createLoggingConfiguration method
The CreateLoggingConfiguration operation creates rules and
alerting logging configuration for the workspace. Use this operation to
set the CloudWatch log group to which the logs will be published to.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter logGroupArn :
The ARN of the CloudWatch log group to which the vended log data will be
published. This log group must exist prior to calling this operation.
Parameter workspaceId :
The ID of the workspace to create the logging configuration for.
Parameter clientToken :
A unique identifier that you can provide to ensure the idempotency of the
request. Case-sensitive.
Implementation
Future<CreateLoggingConfigurationResponse> createLoggingConfiguration({
required String logGroupArn,
required String workspaceId,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'logGroupArn': logGroupArn,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/workspaces/${Uri.encodeComponent(workspaceId)}/logging',
exceptionFnMap: _exceptionFns,
);
return CreateLoggingConfigurationResponse.fromJson(response);
}