updateComponent method
Update a component.
There are a few modes for updating a component. The
deploymentType field defines the mode.
For more information about components, see Proton
components 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 deploymentType :
The deployment type. It defines the mode for updating a component, as
follows:
-
NONEIn this mode, a deployment doesn't occur. Only the requested metadata parameters are updated. You can only specify
descriptionin this mode. -
CURRENT_VERSIONIn this mode, the component is deployed and updated with the new
serviceSpec,templateSource, and/ortypethat you provide. Only requested parameters are updated.
Parameter name :
The name of the component to update.
Parameter clientToken :
The client token for the updated component.
Parameter description :
An optional customer-provided description of the component.
Parameter serviceInstanceName :
The name of the service instance that you want to attach this component
to. Don't specify to keep the component's current service instance
attachment. Specify an empty string to detach the component from the
service instance it's attached to. Specify non-empty values for both
serviceInstanceName and serviceName or for
neither of them.
Parameter serviceName :
The name of the service that serviceInstanceName is
associated with. Don't specify to keep the component's current service
instance attachment. Specify an empty string to detach the component from
the service instance it's attached to. Specify non-empty values for both
serviceInstanceName and serviceName or for
neither of them.
Parameter serviceSpec :
The service spec that you want the component to use to access service
inputs. Set this only when the component is attached to a service
instance.
Parameter templateFile :
A path to the Infrastructure as Code (IaC) file describing infrastructure
that a custom component provisions.
Implementation
Future<UpdateComponentOutput> updateComponent({
required ComponentDeploymentUpdateType deploymentType,
required String name,
String? clientToken,
String? description,
String? serviceInstanceName,
String? serviceName,
String? serviceSpec,
String? templateFile,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AwsProton20200720.UpdateComponent'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'deploymentType': deploymentType.value,
'name': name,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (serviceInstanceName != null)
'serviceInstanceName': serviceInstanceName,
if (serviceName != null) 'serviceName': serviceName,
if (serviceSpec != null) 'serviceSpec': serviceSpec,
if (templateFile != null) 'templateFile': templateFile,
},
);
return UpdateComponentOutput.fromJson(jsonResponse.body);
}