create method
- CreateInstancePartitionRequest request,
- String parent, {
- String? $fields,
Creates an instance partition and begins preparing it to be used.
The returned long-running operation can be used to track the progress of
preparing the new instance partition. The instance partition name is
assigned by the caller. If the named instance partition already exists,
CreateInstancePartition
returns ALREADY_EXISTS
. Immediately upon
completion of this request: * The instance partition is readable via the
API, with all requested attributes but no allocated resources. Its state
is CREATING
. Until completion of the returned operation: * Cancelling
the operation renders the instance partition immediately unreadable via
the API. * The instance partition can be deleted. * All other attempts to
modify the instance partition are rejected. Upon completion of the
returned operation: * Billing for all successfully-allocated resources
begins (some types may have lower than the requested levels). * Databases
can start using this instance partition. * The instance partition's
allocated resource levels are readable via the API. * The instance
partition's state becomes READY
. The returned long-running operation
will have a name of the format /operations/
and can be used to track
creation of the instance partition. The metadata field type is
CreateInstancePartitionMetadata. The response field type is
InstancePartition, if successful.
request
- The metadata request object.
Request parameters:
parent
- Required. The name of the instance in which to create the
instance partition. Values are of the form projects//instances/
.
Value must have pattern ^projects/\[^/\]+/instances/\[^/\]+$
.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Operation.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<Operation> create(
CreateInstancePartitionRequest request,
core.String parent, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/instancePartitions';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Operation.fromJson(response_ as core.Map<core.String, core.dynamic>);
}