Package org.azd.release.releases
Class ReleasesRequestBuilder
java.lang.Object
org.azd.abstractions.BaseRequestBuilder
org.azd.release.releases.ReleasesRequestBuilder
Provides functionality to work with Release releases Api.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents the query parameters.static class
Represents the query parameters.static class
Request configuration object for the query parameters.static class
Request configuration object for the query parameters.Nested classes/interfaces inherited from class org.azd.abstractions.BaseRequestBuilder
BaseRequestBuilder.ProjectExcludeParameter
-
Field Summary
Fields inherited from class org.azd.abstractions.BaseRequestBuilder
accessTokenCredential, apiVersion, area, locationId, organizationUrl, serializer
-
Constructor Summary
ConstructorDescriptionReleasesRequestBuilder
(String organizationUrl, AccessTokenCredential accessTokenCredential) Instantiates a new RequestBuilder instance and sets the default values. -
Method Summary
Modifier and TypeMethodDescriptioncreate
(ReleaseStartMetadata releaseStartMetadata) Create a release.createAsync
(ReleaseStartMetadata releaseStartMetadata) Create a release.delete
(int releaseId) Delete a ReleasedeleteAsync
(int releaseId) Delete a ReleaseProvides functionality to work with Release environment API.get
(int releaseId) Get a Releaseget
(int releaseId, Consumer<ReleasesRequestBuilder.RequestConfiguration> requestConfiguration) Get a ReleasegetAsync
(int releaseId) Get a ReleasegetAsync
(int releaseId, Consumer<ReleasesRequestBuilder.RequestConfiguration> requestConfiguration) Get a ReleasegetRevision
(int releaseId, int definitionSnapshotRevision) Get release for a given revision number.getRevisionAsync
(int releaseId, int definitionSnapshotRevision) Get release for a given revision number.list()
Get a list of releaseslist
(Consumer<ReleasesRequestBuilder.ListRequestConfiguration> requestConfiguration) Get a list of releasesGet a list of releaseslistAsync
(Consumer<ReleasesRequestBuilder.ListRequestConfiguration> requestConfiguration) Get a list of releaseslogs()
Provides functionality to work with Release logs API.taskLog()
Provides functionality to work with Release Task log API.Update a complete release object.updateAsync
(int releaseId, Release release) Update a complete release object.updateResource
(int releaseId, ReleaseUpdateMetadata releaseUpdateMetadata) Update a complete release object.updateResourceAsync
(int releaseId, ReleaseUpdateMetadata releaseUpdateMetadata) Update a complete release object.Methods inherited from class org.azd.abstractions.BaseRequestBuilder
builder
-
Constructor Details
-
ReleasesRequestBuilder
Instantiates a new RequestBuilder instance and sets the default values.- Parameters:
organizationUrl
- Represents organization location request url.accessTokenCredential
- Access token credential object.
-
-
Method Details
-
environment
Provides functionality to work with Release environment API.- Returns:
- ReleaseEnvironmentRequestBuilder
ReleaseEnvironmentRequestBuilder
-
logs
Provides functionality to work with Release logs API.- Returns:
- ReleaseLogsRequestBuilder
ReleaseLogsRequestBuilder
-
taskLog
Provides functionality to work with Release Task log API.- Returns:
- ReleaseTaskLogRequestBuilder
ReleaseTaskLogRequestBuilder
-
createAsync
public CompletableFuture<Release> createAsync(ReleaseStartMetadata releaseStartMetadata) throws AzDException Create a release.
Example:
var releaseMetadata = new ReleaseStartMetadata(); var artifacts = new ArtifactMetadata(); var buildVersion = new BuildVersion(); buildVersion.setId("1234"); // Build Id buildVersion.setName("Demo-Pipeline-CI"); // Build pipeline name artifacts.setAlias("_Demo-Pipeline-CI"); // Artifact alias name; This can be retrieved from release pipeline. artifacts.setInstanceReference(buildVersion); releaseMetadata.setDefinitionId(2); // Release pipeline Id. releaseMetadata.setDescription("Sample release"); releaseMetadata.setArtifacts(List.of(artifacts)); releaseMetadata.setIsDraft(false); releaseMetadata.setReason(ReleaseReason.NONE);
- Parameters:
releaseStartMetadata
- Release start metadata to create the release.- Returns:
- Release object
Release
- Throws:
AzDException
- Default Api exception handler.
-
deleteAsync
Delete a Release- Parameters:
releaseId
- pass the release id- Throws:
AzDException
- Default Api Exception handler.
-
getAsync
Get a Release- Parameters:
releaseId
- pass the release id- Returns:
- Release
Release
- Throws:
AzDException
- Default Api Exception handler.
-
getAsync
public CompletableFuture<Release> getAsync(int releaseId, Consumer<ReleasesRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException Get a Release- Parameters:
releaseId
- pass the release idrequestConfiguration
- Represents the query parameters.- Returns:
- Release
Release
- Throws:
AzDException
- Default Api Exception handler.
-
getRevisionAsync
public CompletableFuture<String> getRevisionAsync(int releaseId, int definitionSnapshotRevision) throws AzDException Get release for a given revision number.- Parameters:
releaseId
- Id of the release.definitionSnapshotRevision
- Definition snapshot revision number.- Returns:
- Release revision.
- Throws:
AzDException
- Default Api Exception handler.
-
listAsync
Get a list of releases- Returns:
- Releases
Releases
- Throws:
AzDException
- Default Api Exception handler.
-
listAsync
public CompletableFuture<Releases> listAsync(Consumer<ReleasesRequestBuilder.ListRequestConfiguration> requestConfiguration) throws AzDException Get a list of releases- Parameters:
requestConfiguration
- Represents the query parameters- Returns:
- Releases
Releases
- Throws:
AzDException
- Default Api Exception handler.
-
updateAsync
Update a complete release object.- Parameters:
releaseId
- Id of the release to update.release
- Release object to update- Returns:
- a release object
Release
- Throws:
AzDException
- Default Api Exception handler.
-
updateResourceAsync
public CompletableFuture<Release> updateResourceAsync(int releaseId, ReleaseUpdateMetadata releaseUpdateMetadata) throws AzDException Update a complete release object.- Parameters:
releaseId
- Id of the release to update.releaseUpdateMetadata
- Release metadata object to update- Returns:
- a release object
Release
- Throws:
AzDException
- Default Api Exception handler.
-
create
Create a release.
Example:
var releaseMetadata = new ReleaseStartMetadata(); var artifacts = new ArtifactMetadata(); var buildVersion = new BuildVersion(); buildVersion.setId("1234"); // Build Id buildVersion.setName("Demo-Pipeline-CI"); // Build pipeline name artifacts.setAlias("_Demo-Pipeline-CI"); // Artifact alias name; This can be retrieved from release pipeline. artifacts.setInstanceReference(buildVersion); releaseMetadata.setDefinitionId(2); // Release pipeline Id. releaseMetadata.setDescription("Sample release"); releaseMetadata.setArtifacts(List.of(artifacts)); releaseMetadata.setIsDraft(false); releaseMetadata.setReason(ReleaseReason.NONE);
- Parameters:
releaseStartMetadata
- Release start metadata to create the release.- Returns:
- Release object
Release
- Throws:
AzDException
- Default Api exception handler.
-
delete
Delete a Release- Parameters:
releaseId
- pass the release id- Throws:
AzDException
- Default Api Exception handler.
-
get
Get a Release- Parameters:
releaseId
- pass the release id- Returns:
- Release
Release
- Throws:
AzDException
- Default Api Exception handler.
-
get
public Release get(int releaseId, Consumer<ReleasesRequestBuilder.RequestConfiguration> requestConfiguration) throws AzDException Get a Release- Parameters:
releaseId
- pass the release idrequestConfiguration
- Represents the query parameters.- Returns:
- Release
Release
- Throws:
AzDException
- Default Api Exception handler.
-
getRevision
Get release for a given revision number.- Parameters:
releaseId
- Id of the release.definitionSnapshotRevision
- Definition snapshot revision number.- Returns:
- Release revision.
- Throws:
AzDException
- Default Api Exception handler.
-
list
Get a list of releases- Returns:
- Releases
Releases
- Throws:
AzDException
- Default Api Exception handler.
-
list
public Releases list(Consumer<ReleasesRequestBuilder.ListRequestConfiguration> requestConfiguration) throws AzDException Get a list of releases- Parameters:
requestConfiguration
- Represents the query parameters- Returns:
- Releases
Releases
- Throws:
AzDException
- Default Api Exception handler.
-
update
Update a complete release object.- Parameters:
releaseId
- Id of the release to update.release
- Release object to update- Returns:
- a release object
Release
- Throws:
AzDException
- Default Api Exception handler.
-
updateResource
public Release updateResource(int releaseId, ReleaseUpdateMetadata releaseUpdateMetadata) throws AzDException Update a complete release object.- Parameters:
releaseId
- Id of the release to update.releaseUpdateMetadata
- Release metadata object to update- Returns:
- a release object
Release
- Throws:
AzDException
- Default Api Exception handler.
-