Package org.azd.release
Class ReleaseApi
- All Implemented Interfaces:
ReleaseDetails
Release Api to manage releases service
-
Constructor Summary
ConstructorDescriptionReleaseApi
(Connection connection) Pass the connection object to work with Release Api -
Method Summary
Modifier and TypeMethodDescriptionabandonRelease
(int releaseId) Abandon a release.createRelease
(int releaseDefinitionId, String description, String artifactAlias, String artifactId, String artifactName, boolean isDraft) Create a release.createReleaseDefinition
(String releaseDefinitionParameters) Create a release definitiondeleteRelease
(int releaseId) Delete a release using release id.deleteReleaseDefinition
(int definitionId) Delete a release definition.deleteReleaseDefinition
(int definitionId, String comment, boolean forceDelete) Delete a release definition.getManualIntervention
(int releaseId, int manualInterventionId) Get manual intervention for a given release and manual intervention id.getManualInterventions
(int releaseId) List all manual interventions for a given release.getRelease
(int releaseId) Get a ReleasegetRelease
(int releaseId, SingleReleaseExpands expand) Gets a ReleasegetRelease
(int releaseId, SingleReleaseExpands expand, ReleaseApprovalFilters approvalFilters, String[] propertyFilters, int topGateRecords) Gets a ReleaseGet a list of approvalsgetReleaseApprovals
(int[] releaseIdsFilter) Get a list of approvalsgetReleaseApprovals
(String assignedToFilter, int continuationToken, boolean includeMyGroupApprovals, ReleaseQueryOrder queryOrder, int[] releaseIdsFilter, ReleaseApprovalStatus statusFilter, int top, ReleaseApprovalType typeFilter) Get a list of approvalsgetReleaseDefinition
(int definitionId) Get a release definition.getReleaseDefinitionHistory
(int definitionId) Get revision history for a release definitionGet a list of release definitions.getReleaseDefinitions
(int top) Get a list of release definitions.getReleaseDefinitions
(int[] definitionIdFilter) Get a list of release definitions.getReleaseDefinitions
(String artifactSourceId) Get a list of release definitions.Get a list of release definitions.getReleaseDefinitions
(ReleaseDefinitionExpands expands, int top, String artifactSourceId, String artifactType, String continuationToken, int[] definitionIdFilter, boolean isDeleted, boolean isExactNameMatch, String path, String[] propertyFilters, ReleaseDefinitionQueryOrder queryOrder, String searchText, boolean searchTextContainsFolderName, String[] tagFilter) Get a list of release definitions.getReleaseEnvironment
(int releaseId, int environmentId) Get a release environment.getReleaseEnvironment
(int releaseId, int environmentId, SingleReleaseExpands expand) Get a release environment.Get a list of releasesgetReleases
(int definitionId) Get a list of releasesgetReleases
(String[] releaseIdFilter) Get a list of releasesgetReleases
(ReleaseExpands expand) Get a list of releasesgetReleases
(ReleaseExpands expand, int top) Get a list of releasesgetReleases
(ReleaseExpands expand, int top, String artifactTypeId, String artifactVersionId, int continuationToken, String createdBy, int definitionEnvironmentId, int definitionId, int environmentStatusFilter, boolean isDeleted, String maxCreatedTime, String minCreatedTime, String path, String[] propertyFilters, ReleaseQueryOrder queryOrder, String[] releaseIdFilter, String searchText, String sourceBranchFilter, String sourceId, ReleaseStatus statusFilter, String[] tagFilter) Get a list of releasesgetReleases
(ReleaseExpands expand, String artifactVersionId) Get a list of releasesqueueRelease
(int releaseId, String environmentName) Queue a release pipeline with release id and environment or stage name.updateApproval
(int approvalId, ReleaseApprovalStatus status, String comments) Update status of an approvalupdateManualIntervention
(int releaseId, int manualInterventionId, String comment, ManualInterventionStatus status) Update manual intervention.updateRelease
(int releaseId, Release release) Update a complete release object.updateReleaseDefinition
(ReleaseDefinition releaseDefinition) Update a release definition.updateReleaseEnvironment
(int releaseId, int environmentId, String comment, String scheduledDeploymentTime, ReleaseEnvironmentStatus status, VariableGroupMap variables) Update the status of a release environment.updateReleaseResource
(int releaseId, String comment, boolean keepForever, String[] manualEnvironments, ReleaseStatus status, String name) Update few properties of a release.Methods inherited from class org.azd.utils.AzDAsyncApi
createAsync
-
Constructor Details
-
ReleaseApi
Pass the connection object to work with Release Api- Parameters:
connection
- Connection object
-
-
Method Details
-
createRelease
public Release createRelease(int releaseDefinitionId, String description, String artifactAlias, String artifactId, String artifactName, boolean isDraft) throws AzDException Create a release.- Specified by:
createRelease
in interfaceReleaseDetails
- Parameters:
releaseDefinitionId
- pass definition Id to create a release.description
- pass description to create a release.artifactAlias
- build pipeline alias name. Run getBuilds() from BuildApi to get the build alias name and build number.artifactId
- pass the build id.artifactName
- pass the build pipeline nameisDraft
- creates the release as draft if set to false- Returns:
- Release
Release
- Throws:
AzDException
- Default Api Exception handler.
-
getRelease
Get a Release- Specified by:
getRelease
in interfaceReleaseDetails
- Parameters:
releaseId
- pass the release id- Returns:
- Release
Release
- Throws:
AzDException
- Default Api Exception handler.
-
getRelease
Gets a Release- Specified by:
getRelease
in interfaceReleaseDetails
- Parameters:
releaseId
- pass the release idexpand
- field to expand in the result.SingleReleaseExpands
- Returns:
- Release
Release
- Throws:
AzDException
- Default Api Exception handler.
-
getRelease
public Release getRelease(int releaseId, SingleReleaseExpands expand, ReleaseApprovalFilters approvalFilters, String[] propertyFilters, int topGateRecords) throws AzDException Gets a Release- Specified by:
getRelease
in interfaceReleaseDetails
- Parameters:
releaseId
- pass the release idexpand
- field to expand in the result.SingleReleaseExpands
approvalFilters
- A filter which would allow fetching approval steps selectively based on whether it is automated, or manual. This would also decide whether we should fetch pre and post approval snapshots. Assumes All by defaultpropertyFilters
- A comma-delimited list of extended properties to be retrieved. If set, the returned Release will contain values for the specified property Ids (if they exist). If not set, properties will not be included.topGateRecords
- Number of release gate records to get. Default is 5.- Returns:
- Release
Release
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseEnvironment
public ReleaseEnvironment getReleaseEnvironment(int releaseId, int environmentId) throws AzDException Get a release environment.- Specified by:
getReleaseEnvironment
in interfaceReleaseDetails
- Parameters:
releaseId
- pass the release idenvironmentId
- Id of the release environment.- Returns:
- Release Environment
ReleaseEnvironment
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseEnvironment
public ReleaseEnvironment getReleaseEnvironment(int releaseId, int environmentId, SingleReleaseExpands expand) throws AzDException Get a release environment.- Specified by:
getReleaseEnvironment
in interfaceReleaseDetails
- Parameters:
releaseId
- pass the release idenvironmentId
- Id of the release environment.expand
- Release expandsSingleReleaseExpands
- Returns:
- Release Environment
ReleaseEnvironment
- Throws:
AzDException
- Default Api Exception handler.
-
getReleases
Get a list of releases- Specified by:
getReleases
in interfaceReleaseDetails
- Returns:
- Releases
Releases
- Throws:
AzDException
- Default Api Exception handler.
-
getReleases
Get a list of releases- Specified by:
getReleases
in interfaceReleaseDetails
- Parameters:
expand
- The property that should be expanded in the list of releases.ReleaseExpands
- Returns:
- Releases
Releases
- Throws:
AzDException
- Default Api Exception handler.
-
getReleases
Get a list of releases- Specified by:
getReleases
in interfaceReleaseDetails
- Parameters:
definitionId
- pass the release definition id- Returns:
- Releases
Releases
- Throws:
AzDException
- Default Api Exception handler.
-
getReleases
Get a list of releases- Specified by:
getReleases
in interfaceReleaseDetails
- Parameters:
expand
- The property that should be expanded in the list of releases.ReleaseExpands
top
- Number of releases to get. Default is 50.- Returns:
- Releases
Releases
- Throws:
AzDException
- Default Api Exception handler.
-
getReleases
Get a list of releases- Specified by:
getReleases
in interfaceReleaseDetails
- Parameters:
releaseIdFilter
- A comma-delimited list of releases Ids. Only releases with these Ids will be returned.- Returns:
- Releases
Releases
- Throws:
AzDException
- Default Api Exception handler.
-
getReleases
Get a list of releases- Specified by:
getReleases
in interfaceReleaseDetails
- Parameters:
expand
- The property that should be expanded in the list of releases.ReleaseExpands
artifactVersionId
- Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId.- Returns:
- Releases
Releases
- Throws:
AzDException
- Default Api Exception handler.
-
getReleases
public Releases getReleases(ReleaseExpands expand, int top, String artifactTypeId, String artifactVersionId, int continuationToken, String createdBy, int definitionEnvironmentId, int definitionId, int environmentStatusFilter, boolean isDeleted, String maxCreatedTime, String minCreatedTime, String path, String[] propertyFilters, ReleaseQueryOrder queryOrder, String[] releaseIdFilter, String searchText, String sourceBranchFilter, String sourceId, ReleaseStatus statusFilter, String[] tagFilter) throws AzDException Get a list of releases- Specified by:
getReleases
in interfaceReleaseDetails
- Parameters:
expand
- The property that should be expanded in the list of releases.ReleaseExpands
top
- Number of releases to get. Default is 50.artifactTypeId
- Releases with given artifactTypeId will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild.artifactVersionId
- Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId.continuationToken
- Gets the releases after the continuation token provided.createdBy
- Releases created by this user.definitionEnvironmentId
- pass the release definition environment iddefinitionId
- Releases from this release definition Id.environmentStatusFilter
- environment status filterisDeleted
- Gets the soft deleted releases, if true.maxCreatedTime
- Releases that were created before this time.minCreatedTime
- Releases that were created after this time.path
- Releases under this folder path will be returnedpropertyFilters
- A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not.queryOrder
- Gets the results in the defined order of created date for releases. Default is descending.releaseIdFilter
- A comma-delimited list of releases Ids. Only releases with these Ids will be returned.searchText
- Releases with names containing searchText.sourceBranchFilter
- Releases with given sourceBranchFilter will be returned.sourceId
- Unique identifier of the artifact used. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions.statusFilter
- Releases that have the status fromReleaseStatus
.tagFilter
- A comma-delimited list of tags. Only releases with these tags will be returned.- Returns:
- Releases
Releases
- Throws:
AzDException
- Default Api Exception handler.
-
createReleaseDefinition
public ReleaseDefinition createReleaseDefinition(String releaseDefinitionParameters) throws AzDException Create a release definition- Specified by:
createReleaseDefinition
in interfaceReleaseDetails
- Parameters:
releaseDefinitionParameters
- Pass the release definition parameter as string. It is easy to export json result from an existing pipeline and edit it.- Returns:
- ReleaseDefinition
ReleaseDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
deleteReleaseDefinition
Delete a release definition.- Specified by:
deleteReleaseDefinition
in interfaceReleaseDetails
- Parameters:
definitionId
- Id of the release definition/pipeline.- Throws:
AzDException
- Default Api Exception handler.
-
deleteReleaseDefinition
public Void deleteReleaseDefinition(int definitionId, String comment, boolean forceDelete) throws AzDException Delete a release definition.- Specified by:
deleteReleaseDefinition
in interfaceReleaseDetails
- Parameters:
definitionId
- Id of the release definition/pipeline.comment
- Comment for deleting a release definition.forceDelete
- 'true' to automatically cancel any in-progress release deployments and proceed with release definition deletion . Default is 'false'.- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseDefinition
Get a release definition.- Specified by:
getReleaseDefinition
in interfaceReleaseDetails
- Parameters:
definitionId
- Id of the release definition/pipeline.- Returns:
- ReleaseDefinition
ReleaseDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseDefinitionHistory
Get revision history for a release definition- Specified by:
getReleaseDefinitionHistory
in interfaceReleaseDetails
- Parameters:
definitionId
- Id of the release definition/pipeline.- Returns:
- ReleaseDefinitionRevisions
ReleaseDefinitionRevisions
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseDefinitions
Get a list of release definitions.- Specified by:
getReleaseDefinitions
in interfaceReleaseDetails
- Returns:
- ReleaseDefinitions
ReleaseDefinitions
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseDefinitions
public ReleaseDefinitions getReleaseDefinitions(ReleaseDefinitionExpands expands) throws AzDException Get a list of release definitions.- Specified by:
getReleaseDefinitions
in interfaceReleaseDetails
- Parameters:
expands
- The properties that should be expanded in the list of Release definitions.ReleaseDefinitionExpands
- Returns:
- ReleaseDefinition Object
ReleaseDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseDefinitions
Get a list of release definitions.- Specified by:
getReleaseDefinitions
in interfaceReleaseDetails
- Parameters:
top
- Number of release definitions to get.- Returns:
- ReleaseDefinition Object
ReleaseDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseDefinitions
Get a list of release definitions.- Specified by:
getReleaseDefinitions
in interfaceReleaseDetails
- Parameters:
artifactSourceId
- Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions.- Returns:
- ReleaseDefinition Object
ReleaseDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseDefinitions
Get a list of release definitions.- Specified by:
getReleaseDefinitions
in interfaceReleaseDetails
- Parameters:
definitionIdFilter
- A comma-delimited list of release definitions to retrieve.- Returns:
- ReleaseDefinition Object
ReleaseDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseDefinitions
public ReleaseDefinitions getReleaseDefinitions(ReleaseDefinitionExpands expands, int top, String artifactSourceId, String artifactType, String continuationToken, int[] definitionIdFilter, boolean isDeleted, boolean isExactNameMatch, String path, String[] propertyFilters, ReleaseDefinitionQueryOrder queryOrder, String searchText, boolean searchTextContainsFolderName, String[] tagFilter) throws AzDException Get a list of release definitions.- Specified by:
getReleaseDefinitions
in interfaceReleaseDetails
- Parameters:
expands
- The properties that should be expanded in the list of Release definitions.top
- Number of release definitions to get.artifactSourceId
- Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions.artifactType
- Release definitions with given artifactType will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild.continuationToken
- Gets the release definitions after the continuation token provided.definitionIdFilter
- A comma-delimited list of release definitions to retrieve.isDeleted
- 'true' to get release definitions that has been deleted. Default is 'false'isExactNameMatch
- 'true'to gets the release definitions with exact match as specified in searchText. Default is 'false'.path
- Gets the release definitions under the specified path.propertyFilters
- A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definitions will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release Definition from results irrespective of whether it has property set or not.queryOrder
- Gets the results in the defined order. Default is 'IdAscending'.searchText
- Get release definitions with names containing searchText.searchTextContainsFolderName
- 'true' to get the release definitions under the folder with name as specified in searchText. Default is 'false'.tagFilter
- A comma-delimited list of tags. Only release definitions with these tags will be returned.- Returns:
- ReleaseDefinition Object
ReleaseDefinition
- Throws:
AzDException
- Default Api Exception handler.
-
updateReleaseDefinition
public ReleaseDefinition updateReleaseDefinition(ReleaseDefinition releaseDefinition) throws AzDException Update a release definition.- Specified by:
updateReleaseDefinition
in interfaceReleaseDetails
- Parameters:
releaseDefinition
- Pass the release definitionReleaseDefinition
object. You can get it by running either getReleaseDefinitions() or getReleaseDefinition(int definitionId)- Returns:
- a ReleaseDefinition
ReleaseDefinition
object. - Throws:
AzDException
- Default Api exception handler.
-
deleteRelease
Delete a release using release id.- Specified by:
deleteRelease
in interfaceReleaseDetails
- Parameters:
releaseId
- Release id to delete- Throws:
AzDException
- Default Api Exception handler.
-
updateRelease
Update a complete release object.- Specified by:
updateRelease
in interfaceReleaseDetails
- Parameters:
releaseId
- Id of the release to update.release
- Release object to update- Returns:
- a release object
Release
- Throws:
AzDException
- Default Api Exception handler.
-
updateReleaseEnvironment
public ReleaseEnvironment updateReleaseEnvironment(int releaseId, int environmentId, String comment, String scheduledDeploymentTime, ReleaseEnvironmentStatus status, VariableGroupMap variables) throws AzDException Update the status of a release environment.- Specified by:
updateReleaseEnvironment
in interfaceReleaseDetails
- Parameters:
releaseId
- Id of the release to update.environmentId
- Id of the stage or environment to update.comment
- Gets or sets comment.scheduledDeploymentTime
- Gets or sets scheduled deployment time.status
- Gets or sets status of environment.variables
- Sets list of environment variables to be overridden at deployment time.- Returns:
- ReleaseEnvironment object
ReleaseEnvironment
- Throws:
AzDException
- Default Api Exception handler.
-
updateReleaseResource
public Release updateReleaseResource(int releaseId, String comment, boolean keepForever, String[] manualEnvironments, ReleaseStatus status, String name) throws AzDException Update few properties of a release.- Specified by:
updateReleaseResource
in interfaceReleaseDetails
- Parameters:
releaseId
- Id of the release to update.comment
- Sets comment for release.keepForever
- Set 'true' to exclude the release from retention policies.manualEnvironments
- Sets list of manual environments.status
- Sets status of the release.name
- Sets name of the release.- Returns:
- A release object
Release
- Throws:
AzDException
- Default Api Exception handler.
-
queueRelease
Queue a release pipeline with release id and environment or stage name.- Specified by:
queueRelease
in interfaceReleaseDetails
- Parameters:
releaseId
- Id of the releaseenvironmentName
- Stage name or environment name- Returns:
- Release Environment object
ReleaseEnvironment
- Throws:
AzDException
- Default Api Exception handler.
-
abandonRelease
Abandon a release.- Specified by:
abandonRelease
in interfaceReleaseDetails
- Parameters:
releaseId
- Id of the release- Returns:
- A release object
Release
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseApprovals
Get a list of approvals- Specified by:
getReleaseApprovals
in interfaceReleaseDetails
- Returns:
- List of release approvals
ReleaseApprovals
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseApprovals
Get a list of approvals- Specified by:
getReleaseApprovals
in interfaceReleaseDetails
- Parameters:
releaseIdsFilter
- array of release ids to filter the approvals- Returns:
- List of release approvals
ReleaseApprovals
- Throws:
AzDException
- Default Api Exception handler.
-
getReleaseApprovals
public ReleaseApprovals getReleaseApprovals(String assignedToFilter, int continuationToken, boolean includeMyGroupApprovals, ReleaseQueryOrder queryOrder, int[] releaseIdsFilter, ReleaseApprovalStatus statusFilter, int top, ReleaseApprovalType typeFilter) throws AzDException Get a list of approvals- Specified by:
getReleaseApprovals
in interfaceReleaseDetails
- Parameters:
assignedToFilter
- Approvals assigned to this user.continuationToken
- Gets the approvals after the continuation token provided.includeMyGroupApprovals
- 'true' to include my group approvals. Default is 'false'.queryOrder
- Gets the results in the defined order of created approvals. Default is 'descending'.releaseIdsFilter
- Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4.statusFilter
- Approvals with this status. Default is 'pending'.top
- Number of approvals to get. Default is 50.typeFilter
- Approval with this type.- Returns:
- List of release approvals
ReleaseApprovals
- Throws:
AzDException
- Default Api Exception handler.
-
updateApproval
public ReleaseApproval updateApproval(int approvalId, ReleaseApprovalStatus status, String comments) throws AzDException Update status of an approval- Specified by:
updateApproval
in interfaceReleaseDetails
- Parameters:
approvalId
- Id of the approval.status
- Gets or sets the status of the approval.comments
- Gets or sets comments for approval.- Returns:
- release approval object
ReleaseApproval
- Throws:
AzDException
- Default Api Exception handler.
-
getManualIntervention
public ManualIntervention getManualIntervention(int releaseId, int manualInterventionId) throws AzDException Get manual intervention for a given release and manual intervention id.- Specified by:
getManualIntervention
in interfaceReleaseDetails
- Parameters:
releaseId
- Id of the manual intervention.manualInterventionId
- Id of the release.- Returns:
- manual intervention object
ManualIntervention
- Throws:
AzDException
- Default Api Exception handler.
-
getManualInterventions
List all manual interventions for a given release.- Specified by:
getManualInterventions
in interfaceReleaseDetails
- Parameters:
releaseId
- Id of the release.- Returns:
- list of manual intervention object
ManualInterventions
- Throws:
AzDException
- Default Api Exception handler.
-
updateManualIntervention
public ManualIntervention updateManualIntervention(int releaseId, int manualInterventionId, String comment, ManualInterventionStatus status) throws AzDException Update manual intervention.- Specified by:
updateManualIntervention
in interfaceReleaseDetails
- Parameters:
releaseId
- Id of the release.manualInterventionId
- Id of the manual intervention.comment
- Sets the comment for manual intervention update.status
- Sets the status of the manual intervention.- Returns:
- manual intervention object
ManualIntervention
- Throws:
AzDException
- Default Api Exception handler.
-