startDeployment method
Starts a deployment.
May throw BadRequestException. May throw ResourceNotFoundException. May throw ConflictException. May throw InternalServerException.
Parameter applicationId
:
The application ID.
Parameter configurationProfileId
:
The configuration profile ID.
Parameter configurationVersion
:
The configuration version to deploy.
Parameter deploymentStrategyId
:
The deployment strategy ID.
Parameter environmentId
:
The environment ID.
Parameter description
:
A description of the deployment.
Parameter tags
:
Metadata to assign to the deployment. Tags help organize and categorize
your AppConfig resources. Each tag consists of a key and an optional
value, both of which you define.
Implementation
Future<Deployment> startDeployment({
required String applicationId,
required String configurationProfileId,
required String configurationVersion,
required String deploymentStrategyId,
required String environmentId,
String? description,
Map<String, String>? tags,
}) async {
ArgumentError.checkNotNull(applicationId, 'applicationId');
ArgumentError.checkNotNull(
configurationProfileId, 'configurationProfileId');
ArgumentError.checkNotNull(configurationVersion, 'configurationVersion');
_s.validateStringLength(
'configurationVersion',
configurationVersion,
1,
1024,
isRequired: true,
);
ArgumentError.checkNotNull(deploymentStrategyId, 'deploymentStrategyId');
ArgumentError.checkNotNull(environmentId, 'environmentId');
_s.validateStringLength(
'description',
description,
0,
1024,
);
final $payload = <String, dynamic>{
'ConfigurationProfileId': configurationProfileId,
'ConfigurationVersion': configurationVersion,
'DeploymentStrategyId': deploymentStrategyId,
if (description != null) 'Description': description,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/applications/${Uri.encodeComponent(applicationId)}/environments/${Uri.encodeComponent(environmentId)}/deployments',
exceptionFnMap: _exceptionFns,
);
return Deployment.fromJson(response);
}