Package org.azd.build

Class BuildApi

All Implemented Interfaces:
BuildDetails

public class BuildApi extends AzDAsyncApi<BuildApi> implements BuildDetails
Build class to manage build API
  • Constructor Details

    • BuildApi

      public BuildApi(Connection connection)
      Pass the connection object
      Parameters:
      connection - Connection object
  • Method Details

    • deleteBuild

      public Void deleteBuild(int buildId) throws AzDException
      Deletes a build.
      Specified by:
      deleteBuild in interface BuildDetails
      Parameters:
      buildId - pass the build id to delete
      Throws:
      AzDException - Default Api Exception handler.
    • getBuild

      public Build getBuild(int buildId) throws AzDException
      Gets a build
      Specified by:
      getBuild in interface BuildDetails
      Parameters:
      buildId - pass the build id
      Returns:
      a build object Build
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildChanges

      public BuildChanges getBuildChanges(int buildId) throws AzDException
      Gets the changes associated with a build
      Specified by:
      getBuildChanges in interface BuildDetails
      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 interface BuildDetails
      Parameters:
      buildId - pass the build id
      top - The maximum number of changes to return
      continuationToken - pass the continuation token
      includeSourceChange - if set to true gets the source changes
      Returns:
      the object of build changes
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildLog

      public String getBuildLog(int buildId, int logId) throws AzDException
      Gets an individual log file for a build.
      Specified by:
      getBuildLog in interface BuildDetails
      Parameters:
      buildId - pass the build id
      logId - pass the log id
      Returns:
      logs associated with the build for given id
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildLog

      public String getBuildLog(int buildId, int logId, long startLine, long endLine) throws AzDException
      Gets an individual log file for a build.
      Specified by:
      getBuildLog in interface BuildDetails
      Parameters:
      buildId - pass the build id
      logId - pass the log id
      startLine - pass the line number from log which you need to fetch
      endLine - 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

      public BuildLogs getBuildLogs(int buildId) throws AzDException
      Gets the logs for a build.
      Specified by:
      getBuildLogs in interface BuildDetails
      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

      public BuildWorkItems getBuildWorkItems(int buildId) throws AzDException
      Gets the work items associated with a build.
      Specified by:
      getBuildWorkItems in interface BuildDetails
      Parameters:
      buildId - The ID of the build.
      Returns:
      an array of work items associated with the build
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildWorkItems

      public BuildWorkItems getBuildWorkItems(int buildId, int top) throws AzDException
      Gets the work items associated with a build.
      Specified by:
      getBuildWorkItems in interface BuildDetails
      Parameters:
      buildId - id of the build
      top - 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 interface BuildDetails
      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 interface BuildDetails
      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

      public Builds getBuilds() throws AzDException
      Gets a list of builds.
      Specified by:
      getBuilds in interface BuildDetails
      Returns:
      a build array Builds
      Throws:
      AzDException - Default Api Exception handler.
    • getBuilds

      public Builds getBuilds(int[] buildIds) throws AzDException
      Gets a list of builds.
      Specified by:
      getBuilds in interface BuildDetails
      Parameters:
      buildIds - array of build ids
      Returns:
      an array of build
      Throws:
      AzDException - Default Api Exception handler.
    • getBuilds

      public Builds getBuilds(int top) throws AzDException
      Gets a list of builds.
      Specified by:
      getBuilds in interface BuildDetails
      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 interface BuildDetails
      Parameters:
      top - specify how many builds to retrieve
      branchName - 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

      public Build queueBuild(int definitionId) throws AzDException
      Queues a build
      Specified by:
      queueBuild in interface BuildDetails
      Parameters:
      definitionId - pass the pipeline id to queue the build
      Returns:
      a build object Build
      Throws:
      AzDException - Default Api Exception handler.
    • queueBuild

      public Build queueBuild(Build buildParameters) throws AzDException
      Queues a build
      Specified by:
      queueBuild in interface BuildDetails
      Parameters:
      buildParameters - dictionary of parameters to queue the build.
      Returns:
      a build object Build
      Throws:
      AzDException - Default Api Exception handler.
    • updateBuild

      public Build updateBuild(Build build, int buildId, boolean retry) throws AzDException
      Updates a build.
      Specified by:
      updateBuild in interface BuildDetails
      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

      public Builds updateBuilds(Builds builds) throws AzDException
      Updates multiple builds.
      Specified by:
      updateBuilds in interface BuildDetails
      Parameters:
      builds - List of build to update. Builds
      Returns:
      Build Object Build
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildControllers

      public BuildControllers getBuildControllers() throws AzDException
      Gets controllers
      Specified by:
      getBuildControllers in interface BuildDetails
      Returns:
      array of build controller BuildControllers
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildControllers

      public BuildControllers getBuildControllers(String name) throws AzDException
      Gets controller, optionally filtered by name
      Specified by:
      getBuildControllers in interface BuildDetails
      Parameters:
      name - pass the controller name
      Returns:
      array of build controller BuildControllers
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildController

      public BuildController getBuildController(int controllerId) throws AzDException
      Gets a controller
      Specified by:
      getBuildController in interface BuildDetails
      Parameters:
      controllerId - pass the controller id
      Returns:
      build controller BuildController
      Throws:
      AzDException - Default Api Exception handler.
    • createBuildDefinition

      public BuildDefinition createBuildDefinition(String buildDefinitionParameters) throws AzDException
      Creates a new definition.
      Specified by:
      createBuildDefinition in interface BuildDetails
      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 interface BuildDetails
      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 interface BuildDetails
      Parameters:
      definitionName - Name of the build definition/pipeline. E.g., WebApp-Deployment-CI
      definitionCloneName - 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

      public Void deleteBuildDefinition(int definitionId) throws AzDException
      Deletes a definition and all associated builds.
      Specified by:
      deleteBuildDefinition in interface BuildDetails
      Parameters:
      definitionId - pass the definition id
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildDefinition

      public BuildDefinition getBuildDefinition(int definitionId) throws AzDException
      Gets a definition
      Specified by:
      getBuildDefinition in interface BuildDetails
      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 interface BuildDetails
      Parameters:
      definitionId - The ID of the definition.
      includeLatestBuilds - if specified gets the details of latest build
      minMetricsTime - 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

      public BuildDefinitionRevisions getBuildDefinitionRevisions(int definitionId) throws AzDException
      Gets all revisions of a definition.
      Specified by:
      getBuildDefinitionRevisions in interface BuildDetails
      Parameters:
      definitionId - The ID of the definition.
      Returns:
      array of build definition revisions BuildDefinitionRevision
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildDefinitions

      public BuildDefinitions getBuildDefinitions() throws AzDException
      Gets a list of definitions.
      Specified by:
      getBuildDefinitions in interface BuildDetails
      Returns:
      build definitions BuildDefinitions
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildDefinitions

      public BuildDefinitions getBuildDefinitions(int[] definitionIds) throws AzDException
      Gets a list of definitions.
      Specified by:
      getBuildDefinitions in interface BuildDetails
      Parameters:
      definitionIds - array of definition ids
      Returns:
      build definitions BuildDefinitions
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildDefinitions

      public BuildDefinitions getBuildDefinitions(int top) throws AzDException
      Gets a list of definitions.
      Specified by:
      getBuildDefinitions in interface BuildDetails
      Parameters:
      top - definitions to retrieve
      Returns:
      build definitions BuildDefinitions
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildDefinitions

      public BuildDefinitions getBuildDefinitions(String name) throws AzDException
      Gets a list of definitions.
      Specified by:
      getBuildDefinitions in interface BuildDetails
      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 interface BuildDetails
      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 interface BuildDetails
      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 interface BuildDetails
      Parameters:
      definitionId - pass the build definition id
      deleted - When false, restores a deleted definition.
      Returns:
      a BuildDefinition object
      Throws:
      AzDException - Default Api Exception handler.
    • updateBuildDefinition

      public BuildDefinition updateBuildDefinition(BuildDefinition definition) 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 interface BuildDetails
      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 interface BuildDetails
      Parameters:
      definition - Build definition object.
      secretsSourceDefinitionId - None
      secretsSourceDefinitionRevision - None
      Returns:
      BuildDefinition Object BuildDefinition
      Throws:
      AzDException - Default Api Exception handler.
    • createFolder

      public Folder createFolder(String path, Folder folder) throws AzDException
      Creates a new folder.
      Specified by:
      createFolder in interface BuildDetails
      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

      public Void deleteFolder(String path) throws AzDException
      Deletes a definition folder. Definitions and their corresponding builds will also be deleted.
      Specified by:
      deleteFolder in interface BuildDetails
      Parameters:
      path - The full path to the folder.
      Throws:
      AzDException - Default Api Exception handler.
    • getFolders

      public Folders getFolders() throws AzDException
      Gets a list of build definition folders.
      Specified by:
      getFolders in interface BuildDetails
      Returns:
      List of folder Object Folders
      Throws:
      AzDException - Default Api Exception handler.
    • getFolders

      public Folders getFolders(String path, FolderQueryOrder queryOrder) throws AzDException
      Gets a list of build definition folders.
      Specified by:
      getFolders in interface BuildDetails
      Returns:
      List of folder Object Folders
      Throws:
      AzDException - Default Api Exception handler.
    • updateFolder

      public Folder updateFolder(String path, Folder folder) throws AzDException
      Updates an existing folder at given existing path
      Specified by:
      updateFolder in interface BuildDetails
      Parameters:
      path - The full path to the folder.
      Returns:
      Folder Object Folder
      Throws:
      AzDException - Default Api Exception handler.
    • addBuildTag

      public BuildTags addBuildTag(int buildId, String tag) throws AzDException
      Adds a tag to a build.
      Specified by:
      addBuildTag in interface BuildDetails
      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

      public BuildTags addBuildTags(int buildId, List<String> tags) throws AzDException
      Adds tags to a build.
      Specified by:
      addBuildTags in interface BuildDetails
      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

      public BuildTags addDefinitionTag(int definitionId, String tag) throws AzDException
      Adds a tag to a definition.
      Specified by:
      addDefinitionTag in interface BuildDetails
      Parameters:
      definitionId - Id of build definition.
      tag - The tag to add.
      Returns:
      Sting array of tags BuildTags
      Throws:
      AzDException - Default Api Exception handler.
    • addDefinitionTags

      public BuildTags addDefinitionTags(int definitionId, List<String> tags) throws AzDException
      Adds multiple tags to a definition.
      Specified by:
      addDefinitionTags in interface BuildDetails
      Parameters:
      definitionId - Id of build definition.
      tags - The tags to add.
      Returns:
      Sting array of tags BuildTags
      Throws:
      AzDException - Default Api Exception handler.
    • deleteBuildTag

      public BuildTags deleteBuildTag(int buildId, String tag) throws AzDException
      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 interface BuildDetails
      Parameters:
      buildId - Id of the build.
      tag - The tag to delete.
      Returns:
      Sting array of tags BuildTags
      Throws:
      AzDException - Default Api Exception handler.
    • deleteDefinitionTag

      public BuildTags deleteDefinitionTag(int definitionId, String tag) throws AzDException
      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 interface BuildDetails
      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

      public BuildTags deleteTag(String tag) throws AzDException
      Removes a tag from builds, definitions, and from the tag store
      Specified by:
      deleteTag in interface BuildDetails
      Parameters:
      tag - The tag to delete.
      Returns:
      Sting array of tags BuildTags
      Throws:
      AzDException - Default Api Exception handler.
    • getBuildTags

      public BuildTags getBuildTags(int buildId) throws AzDException
      Gets the tags for a build.
      Specified by:
      getBuildTags in interface BuildDetails
      Parameters:
      buildId - The ID of the build.
      Returns:
      Sting array of tags BuildTags
      Throws:
      AzDException - Default Api Exception handler.
    • getDefinitionTags

      public BuildTags getDefinitionTags(int definitionId) throws AzDException
      Gets the tags for a definition.
      Specified by:
      getDefinitionTags in interface BuildDetails
      Parameters:
      definitionId - Id of build definition.
      Returns:
      Sting array of tags
      Throws:
      AzDException - Default Api Exception handler.
    • getDefinitionTags

      public BuildTags getDefinitionTags(int definitionId, int revision) throws AzDException
      Gets the tags for a definition.
      Specified by:
      getDefinitionTags in interface BuildDetails
      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

      public BuildTags getTags() throws AzDException
      Gets a list of all build tags in the project.
      Specified by:
      getTags in interface BuildDetails
      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 interface BuildDetails
      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 interface BuildDetails
      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

      public YamlBuild getYaml(int definitionId) throws AzDException
      Converts a definition to YAML.
      Specified by:
      getYaml in interface BuildDetails
      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 interface BuildDetails
      Parameters:
      definitionId - The ID of the definition.
      includeLatestBuilds - if true includes latest builds
      minMetricsTime - 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 interface BuildDetails
      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 interface BuildDetails
      Parameters:
      providerName - The name of the source provider. E.g., Github
      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 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 interface BuildDetails
      Parameters:
      providerName - The name of the source provider. E.g., Github
      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 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 interface BuildDetails
      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

      public SourceProviderAttributes getSourceProviders() throws AzDException
      Get a list of source providers and their capabilities.
      Specified by:
      getSourceProviders in interface BuildDetails
      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 interface BuildDetails
      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 interface BuildDetails
      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 interface BuildDetails
      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 interface BuildDetails
      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 interface BuildDetails
      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 interface BuildDetails
      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 interface BuildDetails
      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

      public Timeline getTimeline(int buildId) throws AzDException
      Gets details for a build.
      Specified by:
      getTimeline in interface BuildDetails
      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

      public Timeline getTimeline(int buildId, String timelineId) throws AzDException
      Gets details for a build.
      Specified by:
      getTimeline in interface BuildDetails
      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 interface BuildDetails
      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

      public BuildArtifact createArtifact(int buildId, BuildArtifact artifact) throws AzDException
      Associates an artifact with a build.
      Specified by:
      createArtifact in interface BuildDetails
      Parameters:
      buildId - The ID of the build.
      artifact - Build artifact to associate.
      Returns:
      BuildArtifact Object BuildArtifact
      Throws:
      AzDException - Default Api Exception handler.
    • getArtifact

      public BuildArtifact getArtifact(int buildId, String artifactName) throws AzDException
      Gets a specific artifact for a build.
      Specified by:
      getArtifact in interface BuildDetails
      Parameters:
      buildId - The ID of the build.
      artifactName - The name of the artifact.
      Returns:
      BuildArtifact Object BuildArtifact
      Throws:
      AzDException - Default Api Exception handler.
    • getArtifactAsZip

      public InputStream getArtifactAsZip(int buildId, String artifactName) throws AzDException
      Gets a specific artifact for a build as a zip file.
      Specified by:
      getArtifactAsZip in interface BuildDetails
      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 and StreamHelper can be used to download the file.
      Specified by:
      getArtifactFile in interface BuildDetails
      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

      public BuildArtifacts getArtifacts(int buildId) throws AzDException
      Gets all artifacts for a build.
      Specified by:
      getArtifacts in interface BuildDetails
      Parameters:
      buildId - The ID of the build.
      Returns:
      BuildArtifact Object BuildArtifact
      Throws:
      AzDException - Default Api Exception handler.
    • getAttachments

      public Attachments getAttachments(int buildId, String type) throws AzDException
      Gets the list of attachments of a specific type that are associated with a build.
      Specified by:
      getAttachments in interface BuildDetails
      Parameters:
      buildId - The ID of the build.
      type - The type of attachment.
      Returns:
      Attachment Object Attachment
      Throws:
      AzDException - Default Api Exception handler.