createWorkspaceBundle method
Creates the specified WorkSpace bundle. For more information about creating WorkSpace bundles, see Create a Custom WorkSpaces Image and Bundle.
May throw AccessDeniedException.
May throw InvalidParameterValuesException.
May throw ResourceAlreadyExistsException.
May throw ResourceLimitExceededException.
May throw ResourceNotFoundException.
May throw ResourceUnavailableException.
Parameter bundleDescription :
The description of the bundle.
Parameter bundleName :
The name of the bundle.
Parameter imageId :
The identifier of the image that is used to create the bundle.
Parameter tags :
The tags associated with the bundle.
Implementation
Future<CreateWorkspaceBundleResult> createWorkspaceBundle({
required String bundleDescription,
required String bundleName,
required ComputeType computeType,
required String imageId,
required UserStorage userStorage,
RootStorage? rootStorage,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'WorkspacesService.CreateWorkspaceBundle'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'BundleDescription': bundleDescription,
'BundleName': bundleName,
'ComputeType': computeType,
'ImageId': imageId,
'UserStorage': userStorage,
if (rootStorage != null) 'RootStorage': rootStorage,
if (tags != null) 'Tags': tags,
},
);
return CreateWorkspaceBundleResult.fromJson(jsonResponse.body);
}