listTagsForResource method

Future<ListTagsForResourceResponse> listTagsForResource({
  1. required String resourceArn,
})

List the tags for an Amazon ECS resource.

May throw ServerException. May throw ClientException. May throw ClusterNotFoundException. May throw InvalidParameterException.

Parameter resourceArn : The Amazon Resource Name (ARN) that identifies the resource for which to list the tags. Currently, the supported resources are Amazon ECS tasks, services, task definitions, clusters, and container instances.

Implementation

Future<ListTagsForResourceResponse> listTagsForResource({
  required String resourceArn,
}) async {
  ArgumentError.checkNotNull(resourceArn, 'resourceArn');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonEC2ContainerServiceV20141113.ListTagsForResource'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'resourceArn': resourceArn,
    },
  );

  return ListTagsForResourceResponse.fromJson(jsonResponse.body);
}