putAttributes method
Create or update an attribute on an Amazon ECS resource. If the attribute doesn't exist, it's created. If the attribute exists, its value is replaced with the specified value. To delete an attribute, use DeleteAttributes. For more information, see Attributes in the Amazon Elastic Container Service Developer Guide.
May throw AccessDeniedException.
May throw AttributeLimitExceededException.
May throw ClientException.
May throw ClusterNotFoundException.
May throw InvalidParameterException.
May throw ServerException.
May throw TargetNotFoundException.
Parameter attributes :
The attributes to apply to your resource. You can specify up to 10 custom
attributes for each resource. You can specify up to 10 attributes in a
single call.
Parameter cluster :
The short name or full Amazon Resource Name (ARN) of the cluster that
contains the resource to apply attributes. If you do not specify a
cluster, the default cluster is assumed.
Implementation
Future<PutAttributesResponse> putAttributes({
required List<Attribute> attributes,
String? cluster,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonEC2ContainerServiceV20141113.PutAttributes'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'attributes': attributes,
if (cluster != null) 'cluster': cluster,
},
);
return PutAttributesResponse.fromJson(jsonResponse.body);
}