listTagsForResource method

Future<ListTagsForResourceOutput> listTagsForResource({
  1. required String resourceARN,
})

Displays the tags associated with a CloudWatch resource. Currently, alarms and Contributor Insights rules support tagging.

May throw InvalidParameterValueException. May throw ResourceNotFoundException. May throw InternalServiceFault.

Parameter resourceARN : The ARN of the CloudWatch resource that you want to view tags for.

The ARN format of an alarm is arn:aws:cloudwatch:Region:account-id:alarm:alarm-name

The ARN format of a Contributor Insights rule is arn:aws:cloudwatch:Region:account-id:insight-rule:insight-rule-name

For more information about ARN format, see Resource Types Defined by Amazon CloudWatch in the Amazon Web Services General Reference.

Implementation

Future<ListTagsForResourceOutput> listTagsForResource({
  required String resourceARN,
}) async {
  ArgumentError.checkNotNull(resourceARN, 'resourceARN');
  _s.validateStringLength(
    'resourceARN',
    resourceARN,
    1,
    1024,
    isRequired: true,
  );
  final $request = <String, dynamic>{};
  $request['ResourceARN'] = resourceARN;
  final $result = await _protocol.send(
    $request,
    action: 'ListTagsForResource',
    version: '2010-08-01',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ListTagsForResourceInput'],
    shapes: shapes,
    resultWrapper: 'ListTagsForResourceResult',
  );
  return ListTagsForResourceOutput.fromXml($result);
}