createAlertManagerDefinition method
The CreateAlertManagerDefinition operation creates the alert
manager definition in a workspace. If a workspace already has an alert
manager definition, don't use this operation to update it. Instead, use
PutAlertManagerDefinition.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter data :
The alert manager definition to add. A base64-encoded version of the YAML
alert manager definition file.
For details about the alert manager definition, see AlertManagedDefinitionData.
Parameter workspaceId :
The ID of the workspace to add the alert manager definition to.
Parameter clientToken :
A unique identifier that you can provide to ensure the idempotency of the
request. Case-sensitive.
Implementation
Future<CreateAlertManagerDefinitionResponse> createAlertManagerDefinition({
required Uint8List data,
required String workspaceId,
String? clientToken,
}) async {
final $payload = <String, dynamic>{
'data': base64Encode(data),
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/workspaces/${Uri.encodeComponent(workspaceId)}/alertmanager/definition',
exceptionFnMap: _exceptionFns,
);
return CreateAlertManagerDefinitionResponse.fromJson(response);
}