listTagsForResource method

Future<TagListMessage> listTagsForResource({
  1. required String resourceName,
})

Lists all cost allocation tags currently on the named resource. A cost allocation tag is a key-value pair where the key is case-sensitive and the value is optional. You can use cost allocation tags to categorize and track your AWS costs.

If the cluster is not in the available state, ListTagsForResource returns an error.

You can have a maximum of 50 cost allocation tags on an ElastiCache resource. For more information, see Monitoring Costs with Tags.

May throw CacheClusterNotFoundFault. May throw SnapshotNotFoundFault. May throw InvalidARNFault.

Parameter resourceName : The Amazon Resource Name (ARN) of the resource for which you want the list of tags, for example arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster or arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot.

For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

Implementation

Future<TagListMessage> listTagsForResource({
  required String resourceName,
}) async {
  ArgumentError.checkNotNull(resourceName, 'resourceName');
  final $request = <String, dynamic>{};
  $request['ResourceName'] = resourceName;
  final $result = await _protocol.send(
    $request,
    action: 'ListTagsForResource',
    version: '2015-02-02',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ListTagsForResourceMessage'],
    shapes: shapes,
    resultWrapper: 'ListTagsForResourceResult',
  );
  return TagListMessage.fromXml($result);
}