tagLogGroup method
Adds or updates the specified tags for the specified log group.
To list the tags for a log group, use ListTagsLogGroup. To remove tags, use UntagLogGroup.
For more information about tags, see Tag Log Groups in Amazon CloudWatch Logs in the Amazon CloudWatch Logs User Guide.
May throw ResourceNotFoundException. May throw InvalidParameterException.
Parameter logGroupName
:
The name of the log group.
Parameter tags
:
The key-value pairs to use for the tags.
Implementation
Future<void> tagLogGroup({
required String logGroupName,
required Map<String, String> tags,
}) async {
ArgumentError.checkNotNull(logGroupName, 'logGroupName');
_s.validateStringLength(
'logGroupName',
logGroupName,
1,
512,
isRequired: true,
);
ArgumentError.checkNotNull(tags, 'tags');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'Logs_20140328.TagLogGroup'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'logGroupName': logGroupName,
'tags': tags,
},
);
}