tagResource method
Adds tags to a resource. A tag is a label you can assign to an AWS resource. In AWS Glue, you can tag only certain resources. For information about what resources you can tag, see AWS Tags in AWS Glue.
May throw InvalidInputException. May throw InternalServiceException. May throw OperationTimeoutException. May throw EntityNotFoundException.
Parameter resourceArn
:
The ARN of the AWS Glue resource to which to add the tags. For more
information about AWS Glue resource ARNs, see the AWS
Glue ARN string pattern.
Parameter tagsToAdd
:
Tags to add to this resource.
Implementation
Future<void> tagResource({
required String resourceArn,
required Map<String, String> tagsToAdd,
}) async {
ArgumentError.checkNotNull(resourceArn, 'resourceArn');
_s.validateStringLength(
'resourceArn',
resourceArn,
1,
10240,
isRequired: true,
);
ArgumentError.checkNotNull(tagsToAdd, 'tagsToAdd');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSGlue.TagResource'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ResourceArn': resourceArn,
'TagsToAdd': tagsToAdd,
},
);
}