addTags method

Future<void> addTags({
  1. required String resourceId,
  2. required List<Tag> tags,
})

Adds tags to an Amazon EMR resource. Tags make it easier to associate clusters in various ways, such as grouping clusters to track your Amazon EMR resource allocation costs. For more information, see Tag Clusters.

May throw InternalServerException. May throw InvalidRequestException.

Parameter resourceId : The Amazon EMR resource identifier to which tags will be added. This value must be a cluster identifier.

Parameter tags : A list of tags to associate with a cluster and propagate to EC2 instances. Tags are user-defined key-value pairs that consist of a required key string with a maximum of 128 characters, and an optional value string with a maximum of 256 characters.

Implementation

Future<void> addTags({
  required String resourceId,
  required List<Tag> tags,
}) async {
  ArgumentError.checkNotNull(resourceId, 'resourceId');
  ArgumentError.checkNotNull(tags, 'tags');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'ElasticMapReduce.AddTags'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceId': resourceId,
      'Tags': tags,
    },
  );
}