createKxDatabase method

Future<CreateKxDatabaseResponse> createKxDatabase({
  1. required String databaseName,
  2. required String environmentId,
  3. String? clientToken,
  4. String? description,
  5. Map<String, String>? tags,
})

Creates a new kdb database in the environment.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw LimitExceededException. May throw ResourceAlreadyExistsException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter databaseName : The name of the kdb database.

Parameter environmentId : A unique identifier for the kdb environment.

Parameter clientToken : A token that ensures idempotency. This token expires in 10 minutes.

Parameter description : A description of the database.

Parameter tags : A list of key-value pairs to label the kdb database. You can add up to 50 tags to your kdb database

Implementation

Future<CreateKxDatabaseResponse> createKxDatabase({
  required String databaseName,
  required String environmentId,
  String? clientToken,
  String? description,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'databaseName': databaseName,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (description != null) 'description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/kx/environments/${Uri.encodeComponent(environmentId)}/databases',
    exceptionFnMap: _exceptionFns,
  );
  return CreateKxDatabaseResponse.fromJson(response);
}