createWorkspace method
Creates a Prometheus workspace. A workspace is a logical space dedicated to the storage and querying of Prometheus metrics. You can have one or more workspaces in each Region in your account.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter alias :
An alias that you assign to this workspace to help you identify it. It
does not need to be unique.
Blank spaces at the beginning or end of the alias that you specify will be trimmed from the value used.
Parameter clientToken :
A unique identifier that you can provide to ensure the idempotency of the
request. Case-sensitive.
Parameter kmsKeyArn :
(optional) The ARN for a customer managed KMS key to use for encrypting
data within your workspace. For more information about using your own key
in your workspace, see Encryption
at rest in the Amazon Managed Service for Prometheus User
Guide.
Parameter tags :
The list of tag keys and values to associate with the workspace.
Implementation
Future<CreateWorkspaceResponse> createWorkspace({
String? alias,
String? clientToken,
String? kmsKeyArn,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
if (alias != null) 'alias': alias,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (kmsKeyArn != null) 'kmsKeyArn': kmsKeyArn,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/workspaces',
exceptionFnMap: _exceptionFns,
);
return CreateWorkspaceResponse.fromJson(response);
}