createKxVolume method
Creates a new volume with a specific amount of throughput and storage capacity.
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 availabilityZoneIds :
The identifier of the availability zones.
Parameter azMode :
The number of availability zones you want to assign per volume. Currently,
FinSpace only supports SINGLE for volumes. This places
dataview in a single AZ.
Parameter environmentId :
A unique identifier for the kdb environment, whose clusters can attach to
the volume.
Parameter volumeName :
A unique identifier for the volume.
Parameter volumeType :
The type of file system volume. Currently, FinSpace only supports
NAS_1 volume type. When you select NAS_1 volume
type, you must also provide nas1Configuration.
Parameter clientToken :
A token that ensures idempotency. This token expires in 10 minutes.
Parameter description :
A description of the volume.
Parameter nas1Configuration :
Specifies the configuration for the Network attached storage (NAS_1) file
system volume. This parameter is required when you choose
volumeType as NAS_1.
Parameter tags :
A list of key-value pairs to label the volume. You can add up to 50 tags
to a volume.
Implementation
Future<CreateKxVolumeResponse> createKxVolume({
required List<String> availabilityZoneIds,
required KxAzMode azMode,
required String environmentId,
required String volumeName,
required KxVolumeType volumeType,
String? clientToken,
String? description,
KxNAS1Configuration? nas1Configuration,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'availabilityZoneIds': availabilityZoneIds,
'azMode': azMode.value,
'volumeName': volumeName,
'volumeType': volumeType.value,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (nas1Configuration != null) 'nas1Configuration': nas1Configuration,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/kx/environments/${Uri.encodeComponent(environmentId)}/kxvolumes',
exceptionFnMap: _exceptionFns,
);
return CreateKxVolumeResponse.fromJson(response);
}