Package org.azd.build
Class BuildApi
- All Implemented Interfaces:
BuildDetails
Build class to manage build API
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddBuildTag
(int buildId, String tag) Adds a tag to a build.addBuildTags
(int buildId, List<String> tags) Adds tags to a build.addDefinitionTag
(int definitionId, String tag) Adds a tag to a definition.addDefinitionTags
(int definitionId, List<String> tags) Adds multiple tags to a definition.cloneBuildDefinition
(String definitionName, String definitionCloneName) Clone an existing definition/pipelinecreateArtifact
(int buildId, BuildArtifact artifact) Associates an artifact with a build.createBuildDefinition
(String buildDefinitionParameters) Creates a new definition.createBuildDefinition
(BuildDefinition buildDefinition, Number definitionToCloneId, Number definitionToCloneRevision) Creates a new definition.createFolder
(String path, Folder folder) Creates a new folder.deleteBuild
(int buildId) Deletes a build.deleteBuildDefinition
(int definitionId) Deletes a definition and all associated builds.deleteBuildTag
(int buildId, String tag) Removes a tag from a build.deleteDefinitionTag
(int definitionId, String tag) Removes a tag from a definition.deleteFolder
(String path) Deletes a definition folder.Removes a tag from builds, definitions, and from the tag storegetArtifact
(int buildId, String artifactName) Gets a specific artifact for a build.getArtifactAsZip
(int buildId, String artifactName) Gets a specific artifact for a build as a zip file.getArtifactFile
(int buildId, String artifactName, String fileId, String fileName) Gets a file from the build.getArtifacts
(int buildId) Gets all artifacts for a build.getAttachments
(int buildId, String type) Gets the list of attachments of a specific type that are associated with a build.getBranches
(String providerName, String serviceEndpointId, String repositoryName) Gets a list of branches for the given source code repository.getBranches
(String providerName, String serviceEndpointId, String repositoryName, String branchName) Gets a list of branches for the given source code repository.getBuild
(int buildId) Gets a buildgetBuildChanges
(int buildId) Gets the changes associated with a buildgetBuildChanges
(int buildId, int top, String continuationToken, boolean includeSourceChange) Gets the changes associated with a buildgetBuildController
(int controllerId) Gets a controllerGets controllersgetBuildControllers
(String name) Gets controller, optionally filtered by namegetBuildDefinition
(int definitionId) Gets a definitiongetBuildDefinition
(int definitionId, boolean includeLatestBuilds, String minMetricsTime, int revision) Gets a definition, optionally at a specific revision.getBuildDefinitionRevisions
(int definitionId) Gets all revisions of a definition.Gets a list of definitions.getBuildDefinitions
(boolean includeAllProperties, boolean includeLatestBuilds) Gets a list of definitions.getBuildDefinitions
(int top) Gets a list of definitions.getBuildDefinitions
(int[] definitionIds) Gets a list of definitions.getBuildDefinitions
(String name) Gets a list of definitions.getBuildDefinitions
(String builtAfter, String continuationToken, boolean includeAllProperties, boolean includeLatestBuilds, String minMetricsTime, String notBuiltAfter, String path, int processType, DefinitionQueryOrder queryOrder, String repositoryId, String repositoryType, String taskIdFilter, String yamlFilename) Gets a list of definitions.getBuildLog
(int buildId, int logId) Gets an individual log file for a build.getBuildLog
(int buildId, int logId, long startLine, long endLine) Gets an individual log file for a build.getBuildLogs
(int buildId) Gets the logs for a build.Gets a list of builds.getBuilds
(int top) Gets a list of builds.getBuilds
(int[] buildIds) Gets a list of builds.getBuilds
(int top, String branchName, String buildNumber, String continuationToken, int[] definitions, QueryDeletedOption deletedFilter, int maxBuildsPerDefinition, String maxTime, String minTime, String[] properties, BuildQueryOrder queryOrder, int[] queues, BuildReason reasonFilter, String repositoryId, String repositoryType, String requestedFor, BuildResult resultFilter, BuildStatus statusFilter, String tagFilters) Gets a list of builds.getBuildTags
(int buildId) Gets the tags for a build.getBuildWorkItems
(int buildId) Gets the work items associated with a build.getBuildWorkItems
(int buildId, int top) Gets the work items associated with a build.getChangesBetweenBuilds
(int fromBuildId, int toBuildId, int top) Gets the changes made to the repository between two given builds.getDefinitionTags
(int definitionId) Gets the tags for a definition.getDefinitionTags
(int definitionId, int revision) Gets the tags for a definition.getFileContents
(String providerName, String serviceEndpointId, String repositoryName, String branchName, String path) Gets the contents of a file in the given source code repository.Gets a list of build definition folders.getFolders
(String path, FolderQueryOrder queryOrder) Gets a list of build definition folders.getPathContents
(String providerName, String serviceEndpointId, String repositoryName, String branchName, String path) Gets the contents of a directory in the given source code repository.getPullRequest
(String providerName, String pullRequestId, String repositoryName, String serviceEndpointId) Gets a pull request object from source provider.getRepositories
(String providerName, String serviceEndpointId) Gets a list of source code repositories.getRepositories
(String providerName, String serviceEndpointId, String repositoryName) Gets a list of source code repositories.getRepositories
(String providerName, String serviceEndpointId, String repositoryName, String continuationToken, boolean pageResults, SourceProviderResultSet resultSet) Gets a list of source code repositories.Get a list of source providers and their capabilities.getTags()
Gets a list of all build tags in the project.getTimeline
(int buildId) Gets details for a build.getTimeline
(int buildId, String timelineId) Gets details for a build.getTimeline
(int buildId, String timelineId, int changeId, String planId) Gets details for a build.getWebHooks
(String providerName, String serviceEndpointId, String repositoryName) Gets a list of webhooks installed in the given source code repository.getWorkItemsBetweenBuilds
(int fromBuildId, int toBuildId, int top) Gets all the work items between two builds.getYaml
(int definitionId) Converts a definition to YAML.getYaml
(int definitionId, boolean includeLatestBuilds, String minMetricsTime, String[] propertyFilters, Number revision) Converts a definition to YAML, optionally at a specific revision.queueBuild
(int definitionId) Queues a buildqueueBuild
(Build buildParameters) Queues a buildrestoreBuildDefinition
(int definitionId, boolean deleted) Restores a deleted definitionrestoreWebHooks
(String providerName, String serviceEndpointId, String repositoryName, List<String> triggerTypes) Recreates the webhooks for the specified triggers in the given source code repository.updateBuild
(Build build, int buildId, boolean retry) Updates a build.updateBuildDefinition
(BuildDefinition definition) Updates an existing build definition.updateBuildDefinition
(BuildDefinition definition, Number secretsSourceDefinitionId, Number secretsSourceDefinitionRevision) Updates an existing build definition.updateBuilds
(Builds builds) Updates multiple builds.updateBuildStage
(int buildId, String stageReferenceName, boolean forceRetryAllJobs, StageUpdateType state) Update a build stage.updateBuildTags
(int buildId, List<String> tags, boolean toRemove) Adds/Removes tags from a build.updateDefinitionTags
(int definitionId, List<String> tags, boolean toRemove) Adds/Removes tags from a build.updateFolder
(String path, Folder folder) Updates an existing folder at given existing pathMethods inherited from class org.azd.utils.AzDAsyncApi
createAsync
-
Constructor Details
-
BuildApi
Pass the connection object- Parameters:
connection
- Connection object
-
-
Method Details
-
deleteBuild
Deletes a build.- Specified by:
deleteBuild
in interfaceBuildDetails
- Parameters:
buildId
- pass the build id to delete- Throws:
AzDException
- Default Api Exception handler.
-
getBuild
Gets a build- Specified by:
getBuild
in interfaceBuildDetails
- Parameters:
buildId
- pass the build id- Returns:
- a build object
Build
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildChanges
Gets the changes associated with a build- Specified by:
getBuildChanges
in interfaceBuildDetails
- Parameters:
buildId
- pass the build id- Returns:
- the object of build changes
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildChanges
public BuildChanges getBuildChanges(int buildId, int top, String continuationToken, boolean includeSourceChange) throws AzDException Gets the changes associated with a build- Specified by:
getBuildChanges
in interfaceBuildDetails
- Parameters:
buildId
- pass the build idtop
- The maximum number of changes to returncontinuationToken
- pass the continuation tokenincludeSourceChange
- if set to true gets the source changes- Returns:
- the object of build changes
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildLog
Gets an individual log file for a build.- Specified by:
getBuildLog
in interfaceBuildDetails
- Parameters:
buildId
- pass the build idlogId
- pass the log id- Returns:
- logs associated with the build for given id
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildLog
Gets an individual log file for a build.- Specified by:
getBuildLog
in interfaceBuildDetails
- Parameters:
buildId
- pass the build idlogId
- pass the log idstartLine
- pass the line number from log which you need to fetchendLine
- pass till which line number you need to fetch from the log- Returns:
- logs associated with the build for given id
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildLogs
Gets the logs for a build.- Specified by:
getBuildLogs
in interfaceBuildDetails
- Parameters:
buildId
- pass the build id- Returns:
- the object of build logs with id. This can be used to fetch the particular log with id
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildWorkItems
Gets the work items associated with a build.- Specified by:
getBuildWorkItems
in interfaceBuildDetails
- Parameters:
buildId
- The ID of the build.- Returns:
- an array of work items associated with the build
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildWorkItems
Gets the work items associated with a build.- Specified by:
getBuildWorkItems
in interfaceBuildDetails
- Parameters:
buildId
- id of the buildtop
- specify how many top work items to return- Returns:
- an array of work items associated with the build
- Throws:
AzDException
- Default Api Exception handler.
-
getChangesBetweenBuilds
public BuildChanges getChangesBetweenBuilds(int fromBuildId, int toBuildId, int top) throws AzDException Gets the changes made to the repository between two given builds.- Specified by:
getChangesBetweenBuilds
in interfaceBuildDetails
- Parameters:
fromBuildId
- The ID of the first build.toBuildId
- The ID of the last build.top
- The maximum number of changes to return.- Returns:
- an array of changes between the builds
- Throws:
AzDException
- Default Api Exception handler.
-
getWorkItemsBetweenBuilds
public BuildWorkItems getWorkItemsBetweenBuilds(int fromBuildId, int toBuildId, int top) throws AzDException Gets all the work items between two builds.- Specified by:
getWorkItemsBetweenBuilds
in interfaceBuildDetails
- Parameters:
fromBuildId
- The ID of the first build.toBuildId
- The ID of the last build.top
- The maximum number of changes to return.- Returns:
- an array of workitems between the builds
- Throws:
AzDException
- Default Api Exception handler.
-
getBuilds
Gets a list of builds.- Specified by:
getBuilds
in interfaceBuildDetails
- Returns:
- a build array
Builds
- Throws:
AzDException
- Default Api Exception handler.
-
getBuilds
Gets a list of builds.- Specified by:
getBuilds
in interfaceBuildDetails
- Parameters:
buildIds
- array of build ids- Returns:
- an array of build
- Throws:
AzDException
- Default Api Exception handler.
-
getBuilds
Gets a list of builds.- Specified by:
getBuilds
in interfaceBuildDetails
- Parameters:
top
- specify how many builds to retrieve- Returns:
- an array of build
- Throws:
AzDException
- Default Api Exception handler.
-
getBuilds
public Builds getBuilds(int top, String branchName, String buildNumber, String continuationToken, int[] definitions, QueryDeletedOption deletedFilter, int maxBuildsPerDefinition, String maxTime, String minTime, String[] properties, BuildQueryOrder queryOrder, int[] queues, BuildReason reasonFilter, String repositoryId, String repositoryType, String requestedFor, BuildResult resultFilter, BuildStatus statusFilter, String tagFilters) throws AzDException Gets a list of builds.- Specified by:
getBuilds
in interfaceBuildDetails
- Parameters:
top
- specify how many builds to retrievebranchName
- If specified, filters to builds that built branches that built this branch.buildNumber
- If specified, filters to builds that match this build number. Append * to do a prefix search.continuationToken
- A continuation token, returned by a previous call to this method, that can be used to return the next set of builds.definitions
- A comma-delimited list of definition IDs. If specified, filters to builds for these definitions.deletedFilter
- Indicates whether to exclude, include, or only return deleted builds.maxBuildsPerDefinition
- The maximum number of builds to return per definition.maxTime
- If specified, filters to builds that finished/started/queued before this date based on the queryOrder specified.minTime
- If specified, filters to builds that finished/started/queued after this date based on the queryOrder specified.properties
- A comma-delimited list of properties to retrieve.queryOrder
- The order in which builds should be returned.queues
- A comma-delimited list of queue IDs. If specified, filters to builds that ran against these queues.reasonFilter
- If specified, filters to builds that match this reason.repositoryId
- If specified, filters to builds that built from this repository.repositoryType
- If specified, filters to builds that built from repositories of this type.requestedFor
- If specified, filters to builds requested for the specified user.resultFilter
- If specified, filters to builds that match this result.statusFilter
- If specified, filters to builds that match this status.tagFilters
- A comma-delimited list of tags. If specified, filters to builds that have the specified tags.- Returns:
- an array of build
- Throws:
AzDException
- Default Api Exception handler.
-
queueBuild
Queues a build- Specified by:
queueBuild
in interfaceBuildDetails
- Parameters:
definitionId
- pass the pipeline id to queue the build- Returns:
- a build object
Build
- Throws:
AzDException
- Default Api Exception handler.
-
queueBuild
Queues a build- Specified by:
queueBuild
in interfaceBuildDetails
- Parameters:
buildParameters
- dictionary of parameters to queue the build.- Returns:
- a build object
Build
- Throws:
AzDException
- Default Api Exception handler.
-
updateBuild
Updates a build.- Specified by:
updateBuild
in interfaceBuildDetails
- Parameters:
build
- pass the Build object to update.Build
buildId
- The ID of the build.retry
- None- Returns:
- Build Object
Build
- Throws:
AzDException
- Default Api Exception handler.
-
updateBuilds
Updates multiple builds.- Specified by:
updateBuilds
in interfaceBuildDetails
- Parameters:
builds
- List of build to update.Builds
- Returns:
- Build Object
Build
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildControllers
Gets controllers- Specified by:
getBuildControllers
in interfaceBuildDetails
- Returns:
- array of build controller
BuildControllers
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildControllers
Gets controller, optionally filtered by name- Specified by:
getBuildControllers
in interfaceBuildDetails
- Parameters:
name
- pass the controller name- Returns:
- array of build controller
BuildControllers
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildController
Gets a controller- Specified by:
getBuildController
in interfaceBuildDetails
- Parameters:
controllerId
- pass the controller id- Returns:
- build controller
BuildController
- Throws:
AzDException
- Default Api Exception handler.
-
createBuildDefinition
Creates a new definition.- Specified by:
createBuildDefinition
in interfaceBuildDetails
- Parameters:
buildDefinitionParameters
- json string of the build pipeline. Export the build definition from existing pipeline and edit it. Or get the existing build definition using getBuildDefinition(definitionId) method and call toString() method on it to convert the value to string and create the definition. Easiest way is to use cloneBuildDefinition() method to create a clone of build definition and later edit it to suit the needs.- Returns:
- build definition
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
createBuildDefinition
public BuildDefinition createBuildDefinition(BuildDefinition buildDefinition, Number definitionToCloneId, Number definitionToCloneRevision) throws AzDException Creates a new definition.- Specified by:
createBuildDefinition
in interfaceBuildDetails
- Parameters:
buildDefinition
- Build definition object. Export the build definition from existing pipeline and edit it. Or get the existing build definition using getBuildDefinition(definitionId).- Returns:
- build definition
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
cloneBuildDefinition
public BuildDefinition cloneBuildDefinition(String definitionName, String definitionCloneName) throws AzDException Clone an existing definition/pipeline- Specified by:
cloneBuildDefinition
in interfaceBuildDetails
- Parameters:
definitionName
- Name of the build definition/pipeline. E.g., WebApp-Deployment-CIdefinitionCloneName
- Name of the pipeline/definition to be created or cloned. E.g., WebApp-Deployment-CI-Copy- Returns:
- build definition
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
deleteBuildDefinition
Deletes a definition and all associated builds.- Specified by:
deleteBuildDefinition
in interfaceBuildDetails
- Parameters:
definitionId
- pass the definition id- Throws:
AzDException
- Default Api Exception handler.
-
getBuildDefinition
Gets a definition- Specified by:
getBuildDefinition
in interfaceBuildDetails
- Parameters:
definitionId
- pass the definition id- Returns:
- build definition
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildDefinition
public BuildDefinition getBuildDefinition(int definitionId, boolean includeLatestBuilds, String minMetricsTime, int revision) throws AzDException Gets a definition, optionally at a specific revision.- Specified by:
getBuildDefinition
in interfaceBuildDetails
- Parameters:
definitionId
- The ID of the definition.includeLatestBuilds
- if specified gets the details of latest buildminMetricsTime
- If specified, indicates the date from which metrics should be included.revision
- The revision number to retrieve. If this is not specified, the latest version will be returned.- Returns:
- Build definition object
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildDefinitionRevisions
Gets all revisions of a definition.- Specified by:
getBuildDefinitionRevisions
in interfaceBuildDetails
- Parameters:
definitionId
- The ID of the definition.- Returns:
- array of build definition revisions
BuildDefinitionRevision
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildDefinitions
Gets a list of definitions.- Specified by:
getBuildDefinitions
in interfaceBuildDetails
- Returns:
- build definitions
BuildDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildDefinitions
Gets a list of definitions.- Specified by:
getBuildDefinitions
in interfaceBuildDetails
- Parameters:
definitionIds
- array of definition ids- Returns:
- build definitions
BuildDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildDefinitions
Gets a list of definitions.- Specified by:
getBuildDefinitions
in interfaceBuildDetails
- Parameters:
top
- definitions to retrieve- Returns:
- build definitions
BuildDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildDefinitions
Gets a list of definitions.- Specified by:
getBuildDefinitions
in interfaceBuildDetails
- Parameters:
name
- Name of the build definition- Returns:
- build definitions
BuildDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildDefinitions
public BuildDefinitions getBuildDefinitions(boolean includeAllProperties, boolean includeLatestBuilds) throws AzDException Gets a list of definitions.- Specified by:
getBuildDefinitions
in interfaceBuildDetails
- Parameters:
includeAllProperties
- Indicates whether the full definitions should be returned. By default, shallow representations of the definitions are returned.includeLatestBuilds
- Indicates whether to return the latest and latest completed builds for this definition.- Returns:
- build definitions
BuildDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildDefinitions
public BuildDefinitions getBuildDefinitions(String builtAfter, String continuationToken, boolean includeAllProperties, boolean includeLatestBuilds, String minMetricsTime, String notBuiltAfter, String path, int processType, DefinitionQueryOrder queryOrder, String repositoryId, String repositoryType, String taskIdFilter, String yamlFilename) throws AzDException Gets a list of definitions.- Specified by:
getBuildDefinitions
in interfaceBuildDetails
- Parameters:
builtAfter
- If specified, filters to definitions that have builds after this date.continuationToken
- A continuation token, returned by a previous call to this method, that can be used to return the next set of definitions.includeAllProperties
- Indicates whether the full definitions should be returned. By default, shallow representations of the definitions are returned.includeLatestBuilds
- Indicates whether to return the latest and latest completed builds for this definition.minMetricsTime
- If specified, indicates the date from which metrics should be included.notBuiltAfter
- If specified, filters to definitions that do not have builds after this date.path
- If specified, filters to definitions under this folder.processType
- If specified, filters to definitions with the given process type.queryOrder
- Indicates the order in which definitions should be returned.repositoryId
- A repository ID. If specified, filters to definitions that use this repository.repositoryType
- If specified, filters to definitions that have a repository of this type.taskIdFilter
- If specified, filters to definitions that use the specified task.yamlFilename
- If specified, filters to YAML definitions that match the given filename.- Returns:
- build definitions
BuildDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
restoreBuildDefinition
public BuildDefinition restoreBuildDefinition(int definitionId, boolean deleted) throws AzDException Restores a deleted definition- Specified by:
restoreBuildDefinition
in interfaceBuildDetails
- Parameters:
definitionId
- pass the build definition iddeleted
- When false, restores a deleted definition.- Returns:
- a
BuildDefinition
object - Throws:
AzDException
- Default Api Exception handler.
-
updateBuildDefinition
Updates an existing build definition. In order for this operation to succeed, the value of the "Revision" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT.- Specified by:
updateBuildDefinition
in interfaceBuildDetails
- Parameters:
definition
- Build definition object.- Returns:
- BuildDefinition Object
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
updateBuildDefinition
public BuildDefinition updateBuildDefinition(BuildDefinition definition, Number secretsSourceDefinitionId, Number secretsSourceDefinitionRevision) throws AzDException Updates an existing build definition. In order for this operation to succeed, the value of the "Revision" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT.- Specified by:
updateBuildDefinition
in interfaceBuildDetails
- Parameters:
definition
- Build definition object.secretsSourceDefinitionId
- NonesecretsSourceDefinitionRevision
- None- Returns:
- BuildDefinition Object
BuildDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
createFolder
Creates a new folder.- Specified by:
createFolder
in interfaceBuildDetails
- Parameters:
path
- The full path of the folder.folder
- Folder object with mandatory details.- Returns:
- Folder Object
Folder
- Throws:
AzDException
- Default Api Exception handler.
-
deleteFolder
Deletes a definition folder. Definitions and their corresponding builds will also be deleted.- Specified by:
deleteFolder
in interfaceBuildDetails
- Parameters:
path
- The full path to the folder.- Throws:
AzDException
- Default Api Exception handler.
-
getFolders
Gets a list of build definition folders.- Specified by:
getFolders
in interfaceBuildDetails
- Returns:
- List of folder Object
Folders
- Throws:
AzDException
- Default Api Exception handler.
-
getFolders
Gets a list of build definition folders.- Specified by:
getFolders
in interfaceBuildDetails
- Returns:
- List of folder Object
Folders
- Throws:
AzDException
- Default Api Exception handler.
-
updateFolder
Updates an existing folder at given existing path- Specified by:
updateFolder
in interfaceBuildDetails
- Parameters:
path
- The full path to the folder.- Returns:
- Folder Object
Folder
- Throws:
AzDException
- Default Api Exception handler.
-
addBuildTag
Adds a tag to a build.- Specified by:
addBuildTag
in interfaceBuildDetails
- Parameters:
buildId
- The ID of the build.tag
- The tag to add.- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
addBuildTags
Adds tags to a build.- Specified by:
addBuildTags
in interfaceBuildDetails
- Parameters:
buildId
- The ID of the build.tags
- The tags to add.- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
addDefinitionTag
Adds a tag to a definition.- Specified by:
addDefinitionTag
in interfaceBuildDetails
- Parameters:
definitionId
- Id of build definition.tag
- The tag to add.- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
addDefinitionTags
Adds multiple tags to a definition.- Specified by:
addDefinitionTags
in interfaceBuildDetails
- Parameters:
definitionId
- Id of build definition.tags
- The tags to add.- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
deleteBuildTag
Removes a tag from a build. NOTE: This method will not work for tags with special characters. To remove tags with special characters, use the updateBuildTags method instead.- Specified by:
deleteBuildTag
in interfaceBuildDetails
- Parameters:
buildId
- Id of the build.tag
- The tag to delete.- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
deleteDefinitionTag
Removes a tag from a definition. NOTE: This method will not work for tags with special characters. To remove tags with special characters, use the updateDefinitionTags method instead.- Specified by:
deleteDefinitionTag
in interfaceBuildDetails
- Parameters:
definitionId
- Id of the build definition.tag
- The tag to delete- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
deleteTag
Removes a tag from builds, definitions, and from the tag store- Specified by:
deleteTag
in interfaceBuildDetails
- Parameters:
tag
- The tag to delete.- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
getBuildTags
Gets the tags for a build.- Specified by:
getBuildTags
in interfaceBuildDetails
- Parameters:
buildId
- The ID of the build.- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
getDefinitionTags
Gets the tags for a definition.- Specified by:
getDefinitionTags
in interfaceBuildDetails
- Parameters:
definitionId
- Id of build definition.- Returns:
- Sting array of tags
- Throws:
AzDException
- Default Api Exception handler.
-
getDefinitionTags
Gets the tags for a definition.- Specified by:
getDefinitionTags
in interfaceBuildDetails
- Parameters:
definitionId
- Id of build definition.revision
- The definition revision number. If not specified, uses the latest revision of the definition.- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
getTags
Gets a list of all build tags in the project.- Specified by:
getTags
in interfaceBuildDetails
- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
updateBuildTags
public BuildTags updateBuildTags(int buildId, List<String> tags, boolean toRemove) throws AzDException Adds/Removes tags from a build.- Specified by:
updateBuildTags
in interfaceBuildDetails
- Parameters:
buildId
- The ID of the build.tags
- The tags to update.toRemove
- If true removes the tags. Use this to remove tags that has special characters.- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
updateDefinitionTags
public BuildTags updateDefinitionTags(int definitionId, List<String> tags, boolean toRemove) throws AzDException Adds/Removes tags from a build.- Specified by:
updateDefinitionTags
in interfaceBuildDetails
- Parameters:
definitionId
- The Id of the build definition.tags
- The tags to update.toRemove
- If true removes the tags. Use this to remove tags that has special characters.- Returns:
- Sting array of tags
BuildTags
- Throws:
AzDException
- Default Api Exception handler.
-
getYaml
Converts a definition to YAML.- Specified by:
getYaml
in interfaceBuildDetails
- Parameters:
definitionId
- The ID of the definition.- Returns:
- Yaml build object
YamlBuild
- Throws:
AzDException
- Default Api Exception handler.
-
getYaml
public YamlBuild getYaml(int definitionId, boolean includeLatestBuilds, String minMetricsTime, String[] propertyFilters, Number revision) throws AzDException Converts a definition to YAML, optionally at a specific revision.- Specified by:
getYaml
in interfaceBuildDetails
- Parameters:
definitionId
- The ID of the definition.includeLatestBuilds
- if true includes latest buildsminMetricsTime
- If specified, indicates the date from which metrics should be included.propertyFilters
- A comma-delimited list of properties to include in the results.revision
- The revision number to retrieve. If this is not specified, the latest version will be returned.- Returns:
- Yaml build object
YamlBuild
- Throws:
AzDException
- Default Api Exception handler.
-
updateBuildStage
public Void updateBuildStage(int buildId, String stageReferenceName, boolean forceRetryAllJobs, StageUpdateType state) throws AzDException Update a build stage.- Specified by:
updateBuildStage
in interfaceBuildDetails
- Parameters:
buildId
- Id of the build to update the stage.stageReferenceName
- Name of the stage to update.forceRetryAllJobs
- if true forcefully retries all jobs.state
- state to update.- Throws:
AzDException
- Default Api Exception handler.
-
getFileContents
public String getFileContents(String providerName, String serviceEndpointId, String repositoryName, String branchName, String path) throws AzDException Gets the contents of a file in the given source code repository.- Specified by:
getFileContents
in interfaceBuildDetails
- Parameters:
providerName
- The name of the source provider. E.g., GithubserviceEndpointId
- If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.repositoryName
- If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories.branchName
- The identifier of the commit or branch from which a file's contents are retrieved.path
- The path to the file to retrieve, relative to the root of the repository.- Returns:
- Contents of the file given String.
String
- Throws:
AzDException
- Default Api Exception handler.
-
getPathContents
public SourceRepositoryItems getPathContents(String providerName, String serviceEndpointId, String repositoryName, String branchName, String path) throws AzDException Gets the contents of a directory in the given source code repository.- Specified by:
getPathContents
in interfaceBuildDetails
- Parameters:
providerName
- The name of the source provider. E.g., GithubserviceEndpointId
- If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.repositoryName
- If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories.branchName
- The identifier of the commit or branch from which a file's contents are retrieved.path
- The path to the file to retrieve, relative to the root of the repository.- Returns:
- SourceRepositoryItems
SourceRepositoryItems
- Throws:
AzDException
- Default Api Exception handler.
-
getPullRequest
public SourceProviderPullRequest getPullRequest(String providerName, String pullRequestId, String repositoryName, String serviceEndpointId) throws AzDException Gets a pull request object from source provider.- Specified by:
getPullRequest
in interfaceBuildDetails
- Parameters:
providerName
- The name of the source provider.pullRequestId
- Vendor-specific id of the pull request.repositoryName
- Vendor-specific identifier or the name of the repository that contains the pull request.serviceEndpointId
- If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.- Returns:
- SourceProviderPullRequest
SourceProviderPullRequest
- Throws:
AzDException
- Default Api Exception handler.
-
getSourceProviders
Get a list of source providers and their capabilities.- Specified by:
getSourceProviders
in interfaceBuildDetails
- Returns:
- SourceProviderAttributes
SourceProviderAttributes
- Throws:
AzDException
- Default Api Exception handler.
-
getBranches
public SourceProviderBranches getBranches(String providerName, String serviceEndpointId, String repositoryName) throws AzDException Gets a list of branches for the given source code repository.- Specified by:
getBranches
in interfaceBuildDetails
- Parameters:
providerName
- The name of the source provider.serviceEndpointId
- If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.repositoryName
- The vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories.- Returns:
- SourceProvideBranches
SourceProviderBranches
- Throws:
AzDException
- Default Api Exception handler.
-
getBranches
public SourceProviderBranches getBranches(String providerName, String serviceEndpointId, String repositoryName, String branchName) throws AzDException Gets a list of branches for the given source code repository.- Specified by:
getBranches
in interfaceBuildDetails
- Parameters:
providerName
- The name of the source provider.serviceEndpointId
- If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.repositoryName
- The vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories.branchName
- If supplied, the name of the branch to check for specifically.- Returns:
- SourceProvideBranches
SourceProviderBranches
- Throws:
AzDException
- Default Api Exception handler.
-
getRepositories
public SourceRepositories getRepositories(String providerName, String serviceEndpointId) throws AzDException Gets a list of source code repositories.- Specified by:
getRepositories
in interfaceBuildDetails
- Parameters:
providerName
- The name of the source provider.serviceEndpointId
- If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.- Returns:
- SourceRepositories
SourceRepositories
- Throws:
AzDException
- Default Api Exception handler.
-
getRepositories
public SourceRepositories getRepositories(String providerName, String serviceEndpointId, String repositoryName) throws AzDException Gets a list of source code repositories.- Specified by:
getRepositories
in interfaceBuildDetails
- Parameters:
providerName
- The name of the source provider.serviceEndpointId
- If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.repositoryName
- If specified, the vendor-specific identifier or the name of a single repository to get.- Returns:
- SourceRepositories
SourceRepositories
- Throws:
AzDException
- Default Api Exception handler.
-
getRepositories
public SourceRepositories getRepositories(String providerName, String serviceEndpointId, String repositoryName, String continuationToken, boolean pageResults, SourceProviderResultSet resultSet) throws AzDException Gets a list of source code repositories.- Specified by:
getRepositories
in interfaceBuildDetails
- Parameters:
providerName
- The name of the source provider.serviceEndpointId
- If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.repositoryName
- If specified, the vendor-specific identifier or the name of a single repository to get.continuationToken
- When paging results, this is a continuation token, returned by a previous call to this method, that can be used to return the next set of repositories.pageResults
- If set to true, this will limit the set of results and will return a continuation token to continue the query.resultSet
- 'top' for the repositories most relevant for the endpoint. If not set, all repositories are returned. Ignored if 'repository' is set.- Returns:
- SourceRepositories
SourceRepositories
- Throws:
AzDException
- Default Api Exception handler.
-
getWebHooks
public RepositoryWebhooks getWebHooks(String providerName, String serviceEndpointId, String repositoryName) throws AzDException Gets a list of webhooks installed in the given source code repository.- Specified by:
getWebHooks
in interfaceBuildDetails
- Parameters:
providerName
- The name of the source provider.serviceEndpointId
- If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.repositoryName
- If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories.- Returns:
- RepositoryWebhooks
RepositoryWebhooks
- Throws:
AzDException
- Default Api Exception handler.
-
restoreWebHooks
public Void restoreWebHooks(String providerName, String serviceEndpointId, String repositoryName, List<String> triggerTypes) throws AzDException Recreates the webhooks for the specified triggers in the given source code repository.- Specified by:
restoreWebHooks
in interfaceBuildDetails
- Parameters:
providerName
- The name of the source provider.serviceEndpointId
- If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit.repositoryName
- If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories.triggerTypes
- The types of triggers to restore webhooks for.- Returns:
- Void; successful operation
- Throws:
AzDException
- Default Api Exception handler.
-
getTimeline
Gets details for a build.- Specified by:
getTimeline
in interfaceBuildDetails
- Parameters:
buildId
- Id of the build. use getBuilds() to list all the builds.- Returns:
- a timeline object.
Timeline
- Throws:
AzDException
- Default Api Exception handler.
-
getTimeline
Gets details for a build.- Specified by:
getTimeline
in interfaceBuildDetails
- Parameters:
buildId
- Id of the build. use getBuilds() to list all the builds.timelineId
- Id of the build timeline.- Returns:
- a timeline object.
Timeline
- Throws:
AzDException
- Default Api Exception handler.
-
getTimeline
public Timeline getTimeline(int buildId, String timelineId, int changeId, String planId) throws AzDException Gets details for a build.- Specified by:
getTimeline
in interfaceBuildDetails
- Parameters:
buildId
- Id of the build. use getBuilds() to list all the builds.timelineId
- Id of the build timeline.changeId
- Timeline change id.planId
- Timeline plan id. This value can be null if unknown.- Returns:
- a timeline object.
Timeline
- Throws:
AzDException
- Default Api Exception handler.
-
createArtifact
Associates an artifact with a build.- Specified by:
createArtifact
in interfaceBuildDetails
- Parameters:
buildId
- The ID of the build.artifact
- Build artifact to associate.- Returns:
- BuildArtifact Object
BuildArtifact
- Throws:
AzDException
- Default Api Exception handler.
-
getArtifact
Gets a specific artifact for a build.- Specified by:
getArtifact
in interfaceBuildDetails
- Parameters:
buildId
- The ID of the build.artifactName
- The name of the artifact.- Returns:
- BuildArtifact Object
BuildArtifact
- Throws:
AzDException
- Default Api Exception handler.
-
getArtifactAsZip
Gets a specific artifact for a build as a zip file.- Specified by:
getArtifactAsZip
in interfaceBuildDetails
- Parameters:
buildId
- The ID of the build.artifactName
- The name of the artifact.- Returns:
- Input stream response of artifact
- Throws:
AzDException
- Default Api Exception handler.
-
getArtifactFile
public InputStream getArtifactFile(int buildId, String artifactName, String fileId, String fileName) throws AzDException Gets a file from the build. Returns the file contents as InputStream andStreamHelper
can be used to download the file.- Specified by:
getArtifactFile
in interfaceBuildDetails
- Parameters:
buildId
- The ID of the build.artifactName
- The name of the artifact.- Returns:
- Input stream response of artifact
- Throws:
AzDException
- Default Api Exception handler.
-
getArtifacts
Gets all artifacts for a build.- Specified by:
getArtifacts
in interfaceBuildDetails
- Parameters:
buildId
- The ID of the build.- Returns:
- BuildArtifact Object
BuildArtifact
- Throws:
AzDException
- Default Api Exception handler.
-
getAttachments
Gets the list of attachments of a specific type that are associated with a build.- Specified by:
getAttachments
in interfaceBuildDetails
- Parameters:
buildId
- The ID of the build.type
- The type of attachment.- Returns:
- Attachment Object
Attachment
- Throws:
AzDException
- Default Api Exception handler.
-