createService method
Create an Proton service. An Proton service is an instantiation of a service template and often includes several service instances and pipeline. For more information, see Services in the Proton User Guide.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter name :
The service name.
Parameter spec :
A link to a spec file that provides inputs as defined in the service
template bundle schema file. The spec file is in YAML format. Don’t
include pipeline inputs in the spec if your service template
doesn’t include a service pipeline. For more information, see Create
a service in the Proton User Guide.
Parameter templateMajorVersion :
The major version of the service template that was used to create the
service.
Parameter templateName :
The name of the service template that's used to create the service.
Parameter branchName :
The name of the code repository branch that holds the code that's deployed
in Proton. Don't include this parameter if your service template
doesn't include a service pipeline.
Parameter description :
A description of the Proton service.
Parameter repositoryConnectionArn :
The Amazon Resource Name (ARN) of the repository connection. For more
information, see Setting
up an AWS CodeStar connection in the Proton User Guide.
Don't include this parameter if your service template
doesn't include a service pipeline.
Parameter repositoryId :
The ID of the code repository. Don't include this parameter if your
service template doesn't include a service pipeline.
Parameter tags :
An optional list of metadata items that you can associate with the Proton
service. A tag is a key-value pair.
For more information, see Proton resources and tagging in the Proton User Guide.
Parameter templateMinorVersion :
The minor version of the service template that was used to create the
service.
Implementation
Future<CreateServiceOutput> createService({
required String name,
required String spec,
required String templateMajorVersion,
required String templateName,
String? branchName,
String? description,
String? repositoryConnectionArn,
String? repositoryId,
List<Tag>? tags,
String? templateMinorVersion,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AwsProton20200720.CreateService'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'name': name,
'spec': spec,
'templateMajorVersion': templateMajorVersion,
'templateName': templateName,
if (branchName != null) 'branchName': branchName,
if (description != null) 'description': description,
if (repositoryConnectionArn != null)
'repositoryConnectionArn': repositoryConnectionArn,
if (repositoryId != null) 'repositoryId': repositoryId,
if (tags != null) 'tags': tags,
if (templateMinorVersion != null)
'templateMinorVersion': templateMinorVersion,
},
);
return CreateServiceOutput.fromJson(jsonResponse.body);
}