Class InstanceAdminClient (2.31.0)

Cloud Spanner Instance Admin API.

The Cloud Spanner Instance Admin API can be used to create, delete, modify and list instances. Instances are dedicated Cloud Spanner serving and storage resources to be used by Cloud Spanner databases.

Each instance has a "configuration", which dictates where the serving resources for the Cloud Spanner instance are located (e.g., US-central, Europe). Configurations are created by Google based on resource availability.

Cloud Spanner billing is based on the instances that exist and their sizes. After an instance exists, there are no additional per-database or per-operation charges for use of the instance (though there may be additional network bandwidth charges). Instances offer isolation: problems with databases in one instance will not affect other instances. However, within an instance databases can affect each other. For example, if one database in an instance receives a lot of requests and consumes most of the instance resources, fewer resources are available for other databases in that instance, and their performance may suffer.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

InstanceAdminClient(InstanceAdminClient const &)

Copy and move support

Parameter
Name Description
InstanceAdminClient const &

InstanceAdminClient(InstanceAdminClient &&)

Copy and move support

Parameter
Name Description
InstanceAdminClient &&

InstanceAdminClient(std::shared_ptr< InstanceAdminConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< InstanceAdminConnection >
opts Options

Operators

operator=(InstanceAdminClient const &)

Copy and move support

Parameter
Name Description
InstanceAdminClient const &
Returns
Type Description
InstanceAdminClient &

operator=(InstanceAdminClient &&)

Copy and move support

Parameter
Name Description
InstanceAdminClient &&
Returns
Type Description
InstanceAdminClient &

Functions

ListInstanceConfigs(std::string const &, Options)

Lists the supported instance configurations for a given project.

Parameters
Name Description
parent std::string const &

Required. The name of the project for which a list of supported instance configurations is requested. Values are of the form projects/<project>.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::spanner::admin::instance::v1::InstanceConfig >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.instance.v1.InstanceConfig, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListInstanceConfigs(google::spanner::admin::instance::v1::ListInstanceConfigsRequest, Options)

Lists the supported instance configurations for a given project.

Parameters
Name Description
request google::spanner::admin::instance::v1::ListInstanceConfigsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.ListInstanceConfigsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::spanner::admin::instance::v1::InstanceConfig >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.instance.v1.InstanceConfig, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetInstanceConfig(std::string const &, Options)

Gets information about a particular instance configuration.

Parameters
Name Description
name std::string const &

Required. The name of the requested instance configuration. Values are of the form projects/<project>/instanceConfigs/<config>.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::spanner::admin::instance::v1::InstanceConfig >

the result of the RPC. The response message type (google.spanner.admin.instance.v1.InstanceConfig) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetInstanceConfig(google::spanner::admin::instance::v1::GetInstanceConfigRequest const &, Options)

Gets information about a particular instance configuration.

Parameters
Name Description
request google::spanner::admin::instance::v1::GetInstanceConfigRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.GetInstanceConfigRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::spanner::admin::instance::v1::InstanceConfig >

the result of the RPC. The response message type (google.spanner.admin.instance.v1.InstanceConfig) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateInstanceConfig(std::string const &, google::spanner::admin::instance::v1::InstanceConfig const &, std::string const &, Options)

Creates an instance configuration and begins preparing it to be used.

The returned long-running operation can be used to track the progress of preparing the new instance configuration. The instance configuration name is assigned by the caller. If the named instance configuration already exists, CreateInstanceConfig returns ALREADY_EXISTS.

Immediately after the request returns:

  • The instance configuration is readable via the API, with all requested attributes. The instance configuration's reconciling field is set to true. Its state is CREATING.

While the operation is pending:

  • Cancelling the operation renders the instance configuration immediately unreadable via the API.
  • Except for deleting the creating resource, all other attempts to modify the instance configuration are rejected.

Upon completion of the returned operation:

  • Instances can be created using the instance configuration.
  • The instance configuration's reconciling field becomes false. Its state becomes READY.

The returned long-running operation will have a name of the format <instance_config_name>/operations/<operation_id> and can be used to track creation of the instance configuration. The metadata field type is CreateInstanceConfigMetadata. The response field type is InstanceConfig, if successful.

Authorization requires spanner.instanceConfigs.create permission on the resource parent.

Parameters
Name Description
parent std::string const &

Required. The name of the project in which to create the instance configuration. Values are of the form projects/<project>.

instance_config google::spanner::admin::instance::v1::InstanceConfig const &

Required. The InstanceConfig proto of the configuration to create. instance_config.name must be <parent>/instanceConfigs/<instance_config_id>. instance_config.base_config must be a Google managed configuration name, e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.

instance_config_id std::string const &

Required. The ID of the instance configuration to create. Valid identifiers are of the form custom-[-a-z0-9]*[a-z0-9] and must be between 2 and 64 characters in length. The custom- prefix is required to avoid name conflicts with Google-managed configurations.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.InstanceConfig proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateInstanceConfig(NoAwaitTag, std::string const &, google::spanner::admin::instance::v1::InstanceConfig const &, std::string const &, Options)

Creates an instance configuration and begins preparing it to be used.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
parent std::string const &
instance_config google::spanner::admin::instance::v1::InstanceConfig const &
instance_config_id std::string const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateInstanceConfig(google::spanner::admin::instance::v1::CreateInstanceConfigRequest const &, Options)

Creates an instance configuration and begins preparing it to be used.

The returned long-running operation can be used to track the progress of preparing the new instance configuration. The instance configuration name is assigned by the caller. If the named instance configuration already exists, CreateInstanceConfig returns ALREADY_EXISTS.

Immediately after the request returns:

  • The instance configuration is readable via the API, with all requested attributes. The instance configuration's reconciling field is set to true. Its state is CREATING.

While the operation is pending:

  • Cancelling the operation renders the instance configuration immediately unreadable via the API.
  • Except for deleting the creating resource, all other attempts to modify the instance configuration are rejected.

Upon completion of the returned operation:

  • Instances can be created using the instance configuration.
  • The instance configuration's reconciling field becomes false. Its state becomes READY.

The returned long-running operation will have a name of the format <instance_config_name>/operations/<operation_id> and can be used to track creation of the instance configuration. The metadata field type is CreateInstanceConfigMetadata. The response field type is InstanceConfig, if successful.

Authorization requires spanner.instanceConfigs.create permission on the resource parent.

Parameters
Name Description
request google::spanner::admin::instance::v1::CreateInstanceConfigRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.CreateInstanceConfigRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.InstanceConfig proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateInstanceConfig(NoAwaitTag, google::spanner::admin::instance::v1::CreateInstanceConfigRequest const &, Options)

Creates an instance configuration and begins preparing it to be used.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::spanner::admin::instance::v1::CreateInstanceConfigRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateInstanceConfig(google::longrunning::Operation const &, Options)

Creates an instance configuration and begins preparing it to be used.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > >

UpdateInstanceConfig(google::spanner::admin::instance::v1::InstanceConfig const &, google::protobuf::FieldMask const &, Options)

Updates an instance configuration.

The returned long-running operation can be used to track the progress of updating the instance. If the named instance configuration does not exist, returns NOT_FOUND.

Only user-managed configurations can be updated.

Immediately after the request returns:

  • The instance configuration's reconciling field is set to true.

While the operation is pending:

  • Cancelling the operation sets its metadata's cancel_time. The operation is guaranteed to succeed at undoing all changes, after which point it terminates with a CANCELLED status.
  • All other attempts to modify the instance configuration are rejected.
  • Reading the instance configuration via the API continues to give the pre-request values.

Upon completion of the returned operation:

  • Creating instances using the instance configuration uses the new values.
  • The new values of the instance configuration are readable via the API.
  • The instance configuration's reconciling field becomes false.

The returned long-running operation will have a name of the format <instance_config_name>/operations/<operation_id> and can be used to track the instance configuration modification. The metadata field type is UpdateInstanceConfigMetadata. The response field type is InstanceConfig, if successful.

Authorization requires spanner.instanceConfigs.update permission on the resource name.

Parameters
Name Description
instance_config google::spanner::admin::instance::v1::InstanceConfig const &

Required. The user instance configuration to update, which must always include the instance configuration name. Otherwise, only fields mentioned in update_mask need be included. To prevent conflicts of concurrent updates, etag can be used.

update_mask google::protobuf::FieldMask const &

Required. A mask specifying which fields in InstanceConfig should be updated. The field mask must always be specified; this prevents any future fields in InstanceConfig from being erased accidentally by clients that do not know about them. Only display_name and labels can be updated.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.InstanceConfig proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateInstanceConfig(NoAwaitTag, google::spanner::admin::instance::v1::InstanceConfig const &, google::protobuf::FieldMask const &, Options)

Updates an instance configuration.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
instance_config google::spanner::admin::instance::v1::InstanceConfig const &
update_mask google::protobuf::FieldMask const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

UpdateInstanceConfig(google::spanner::admin::instance::v1::UpdateInstanceConfigRequest const &, Options)

Updates an instance configuration.

The returned long-running operation can be used to track the progress of updating the instance. If the named instance configuration does not exist, returns NOT_FOUND.

Only user-managed configurations can be updated.

Immediately after the request returns:

  • The instance configuration's reconciling field is set to true.

While the operation is pending:

  • Cancelling the operation sets its metadata's cancel_time. The operation is guaranteed to succeed at undoing all changes, after which point it terminates with a CANCELLED status.
  • All other attempts to modify the instance configuration are rejected.
  • Reading the instance configuration via the API continues to give the pre-request values.

Upon completion of the returned operation:

  • Creating instances using the instance configuration uses the new values.
  • The new values of the instance configuration are readable via the API.
  • The instance configuration's reconciling field becomes false.

The returned long-running operation will have a name of the format <instance_config_name>/operations/<operation_id> and can be used to track the instance configuration modification. The metadata field type is UpdateInstanceConfigMetadata. The response field type is InstanceConfig, if successful.

Authorization requires spanner.instanceConfigs.update permission on the resource name.

Parameters
Name Description
request google::spanner::admin::instance::v1::UpdateInstanceConfigRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.UpdateInstanceConfigRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.InstanceConfig proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateInstanceConfig(NoAwaitTag, google::spanner::admin::instance::v1::UpdateInstanceConfigRequest const &, Options)

Updates an instance configuration.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::spanner::admin::instance::v1::UpdateInstanceConfigRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

UpdateInstanceConfig(google::longrunning::Operation const &, Options)

Updates an instance configuration.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstanceConfig > >

DeleteInstanceConfig(std::string const &, Options)

Deletes the instance configuration.

Deletion is only allowed when no instances are using the configuration. If any instances are using the configuration, returns FAILED_PRECONDITION.

Only user-managed configurations can be deleted.

Authorization requires spanner.instanceConfigs.delete permission on the resource name.

Parameters
Name Description
name std::string const &

Required. The name of the instance configuration to be deleted. Values are of the form projects/<project>/instanceConfigs/<instance_config>

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteInstanceConfig(google::spanner::admin::instance::v1::DeleteInstanceConfigRequest const &, Options)

Deletes the instance configuration.

Deletion is only allowed when no instances are using the configuration. If any instances are using the configuration, returns FAILED_PRECONDITION.

Only user-managed configurations can be deleted.

Authorization requires spanner.instanceConfigs.delete permission on the resource name.

Parameters
Name Description
request google::spanner::admin::instance::v1::DeleteInstanceConfigRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.DeleteInstanceConfigRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

ListInstanceConfigOperations(std::string const &, Options)

Lists the user-managed instance configuration long-running operations in the given project.

An instance configuration operation has a name of the form projects/<project>/instanceConfigs/<instance_config>/operations/<operation>. The long-running operation metadata field type metadata.type_url describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by operation.metadata.value.start_time in descending order starting from the most recently started operation.

Parameters
Name Description
parent std::string const &

Required. The project of the instance configuration operations. Values are of the form projects/<project>.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::longrunning::Operation >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.longrunning.Operation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListInstanceConfigOperations(google::spanner::admin::instance::v1::ListInstanceConfigOperationsRequest, Options)

Lists the user-managed instance configuration long-running operations in the given project.

An instance configuration operation has a name of the form projects/<project>/instanceConfigs/<instance_config>/operations/<operation>. The long-running operation metadata field type metadata.type_url describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by operation.metadata.value.start_time in descending order starting from the most recently started operation.

Parameters
Name Description
request google::spanner::admin::instance::v1::ListInstanceConfigOperationsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.ListInstanceConfigOperationsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::longrunning::Operation >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.longrunning.Operation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListInstances(std::string const &, Options)

Lists all instances in the given project.

Parameters
Name Description
parent std::string const &

Required. The name of the project for which a list of instances is requested. Values are of the form projects/<project>.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::spanner::admin::instance::v1::Instance >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.instance.v1.Instance, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListInstances(google::spanner::admin::instance::v1::ListInstancesRequest, Options)

Lists all instances in the given project.

Parameters
Name Description
request google::spanner::admin::instance::v1::ListInstancesRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.ListInstancesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::spanner::admin::instance::v1::Instance >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.instance.v1.Instance, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListInstancePartitions(std::string const &, Options)

Lists all instance partitions for the given instance.

Parameters
Name Description
parent std::string const &

Required. The instance whose instance partitions should be listed. Values are of the form projects/<project>/instances/<instance>.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::spanner::admin::instance::v1::InstancePartition >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.instance.v1.InstancePartition, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListInstancePartitions(google::spanner::admin::instance::v1::ListInstancePartitionsRequest, Options)

Lists all instance partitions for the given instance.

Parameters
Name Description
request google::spanner::admin::instance::v1::ListInstancePartitionsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.ListInstancePartitionsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::spanner::admin::instance::v1::InstancePartition >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.spanner.admin.instance.v1.InstancePartition, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetInstance(std::string const &, Options)

Gets information about a particular instance.

Parameters
Name Description
name std::string const &

Required. The name of the requested instance. Values are of the form projects/<project>/instances/<instance>.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::spanner::admin::instance::v1::Instance >

the result of the RPC. The response message type (google.spanner.admin.instance.v1.Instance) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetInstance(google::spanner::admin::instance::v1::GetInstanceRequest const &, Options)

Gets information about a particular instance.

Parameters
Name Description
request google::spanner::admin::instance::v1::GetInstanceRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.GetInstanceRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::spanner::admin::instance::v1::Instance >

the result of the RPC. The response message type (google.spanner.admin.instance.v1.Instance) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateInstance(std::string const &, std::string const &, google::spanner::admin::instance::v1::Instance const &, Options)

Creates an instance and begins preparing it to begin serving.

The returned long-running operation can be used to track the progress of preparing the new instance. The instance name is assigned by the caller. If the named instance already exists, CreateInstance returns ALREADY_EXISTS.

Immediately upon completion of this request:

  • The instance 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 immediately unreadable via the API.
  • The instance can be deleted.
  • All other attempts to modify the instance 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 be created in the instance.
  • The instance's allocated resource levels are readable via the API.
  • The instance's state becomes READY.

The returned long-running operation will have a name of the format <instance_name>/operations/<operation_id> and can be used to track creation of the instance. The metadata field type is CreateInstanceMetadata. The response field type is Instance, if successful.

Parameters
Name Description
parent std::string const &

Required. The name of the project in which to create the instance. Values are of the form projects/<project>.

instance_id std::string const &

Required. The ID of the instance to create. Valid identifiers are of the form [a-z][-a-z0-9]*[a-z0-9] and must be between 2 and 64 characters in length.

instance google::spanner::admin::instance::v1::Instance const &

Required. The instance to create. The name may be omitted, but if specified must be <parent>/instances/<instance_id>.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::Instance > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.Instance proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateInstance(NoAwaitTag, std::string const &, std::string const &, google::spanner::admin::instance::v1::Instance const &, Options)

Creates an instance and begins preparing it to begin serving.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
parent std::string const &
instance_id std::string const &
instance google::spanner::admin::instance::v1::Instance const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateInstance(google::spanner::admin::instance::v1::CreateInstanceRequest const &, Options)

Creates an instance and begins preparing it to begin serving.

The returned long-running operation can be used to track the progress of preparing the new instance. The instance name is assigned by the caller. If the named instance already exists, CreateInstance returns ALREADY_EXISTS.

Immediately upon completion of this request:

  • The instance 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 immediately unreadable via the API.
  • The instance can be deleted.
  • All other attempts to modify the instance 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 be created in the instance.
  • The instance's allocated resource levels are readable via the API.
  • The instance's state becomes READY.

The returned long-running operation will have a name of the format <instance_name>/operations/<operation_id> and can be used to track creation of the instance. The metadata field type is CreateInstanceMetadata. The response field type is Instance, if successful.

Parameters
Name Description
request google::spanner::admin::instance::v1::CreateInstanceRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.CreateInstanceRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::Instance > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.Instance proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateInstance(NoAwaitTag, google::spanner::admin::instance::v1::CreateInstanceRequest const &, Options)

Creates an instance and begins preparing it to begin serving.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::spanner::admin::instance::v1::CreateInstanceRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateInstance(google::longrunning::Operation const &, Options)

Creates an instance and begins preparing it to begin serving.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::Instance > >

UpdateInstance(google::spanner::admin::instance::v1::Instance const &, google::protobuf::FieldMask const &, Options)

Updates an instance, and begins allocating or releasing resources as requested.

The returned long-running operation can be used to track the progress of updating the instance. If the named instance does not exist, returns NOT_FOUND.

Immediately upon completion of this request:

  • For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level.

Until completion of the returned operation:

  • Cancelling the operation sets its metadata's cancel_time, and begins restoring resources to their pre-request values. The operation is guaranteed to succeed at undoing all resource changes, after which point it terminates with a CANCELLED status.
  • All other attempts to modify the instance are rejected.
  • Reading the instance via the API continues to give the pre-request resource levels.

Upon completion of the returned operation:

  • Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
  • All newly-reserved resources are available for serving the instance's tables.
  • The instance's new resource levels are readable via the API.

The returned long-running operation will have a name of the format <instance_name>/operations/<operation_id> and can be used to track the instance modification. The metadata field type is UpdateInstanceMetadata. The response field type is Instance, if successful.

Authorization requires spanner.instances.update permission on the resource name.

Parameters
Name Description
instance google::spanner::admin::instance::v1::Instance const &

Required. The instance to update, which must always include the instance name. Otherwise, only fields mentioned in field_mask need be included.

field_mask google::protobuf::FieldMask const &

Required. A mask specifying which fields in Instance should be updated. The field mask must always be specified; this prevents any future fields in Instance from being erased accidentally by clients that do not know about them.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::Instance > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.Instance proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateInstance(NoAwaitTag, google::spanner::admin::instance::v1::Instance const &, google::protobuf::FieldMask const &, Options)

Updates an instance, and begins allocating or releasing resources as requested.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
instance google::spanner::admin::instance::v1::Instance const &
field_mask google::protobuf::FieldMask const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

UpdateInstance(google::spanner::admin::instance::v1::UpdateInstanceRequest const &, Options)

Updates an instance, and begins allocating or releasing resources as requested.

The returned long-running operation can be used to track the progress of updating the instance. If the named instance does not exist, returns NOT_FOUND.

Immediately upon completion of this request:

  • For resource types for which a decrease in the instance's allocation has been requested, billing is based on the newly-requested level.

Until completion of the returned operation:

  • Cancelling the operation sets its metadata's cancel_time, and begins restoring resources to their pre-request values. The operation is guaranteed to succeed at undoing all resource changes, after which point it terminates with a CANCELLED status.
  • All other attempts to modify the instance are rejected.
  • Reading the instance via the API continues to give the pre-request resource levels.

Upon completion of the returned operation:

  • Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
  • All newly-reserved resources are available for serving the instance's tables.
  • The instance's new resource levels are readable via the API.

The returned long-running operation will have a name of the format <instance_name>/operations/<operation_id> and can be used to track the instance modification. The metadata field type is UpdateInstanceMetadata. The response field type is Instance, if successful.

Authorization requires spanner.instances.update permission on the resource name.

Parameters
Name Description
request google::spanner::admin::instance::v1::UpdateInstanceRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.UpdateInstanceRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::Instance > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.Instance proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateInstance(NoAwaitTag, google::spanner::admin::instance::v1::UpdateInstanceRequest const &, Options)

Updates an instance, and begins allocating or releasing resources as requested.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::spanner::admin::instance::v1::UpdateInstanceRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

UpdateInstance(google::longrunning::Operation const &, Options)

Updates an instance, and begins allocating or releasing resources as requested.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::Instance > >

DeleteInstance(std::string const &, Options)

Deletes an instance.

Immediately upon completion of the request:

  • Billing ceases for all of the instance's reserved resources.

Soon afterward:

  • The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
Parameters
Name Description
name std::string const &

Required. The name of the instance to be deleted. Values are of the form projects/<project>/instances/<instance>

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteInstance(google::spanner::admin::instance::v1::DeleteInstanceRequest const &, Options)

Deletes an instance.

Immediately upon completion of the request:

  • Billing ceases for all of the instance's reserved resources.

Soon afterward:

  • The instance and all of its databases immediately and irrevocably disappear from the API. All data in the databases is permanently deleted.
Parameters
Name Description
request google::spanner::admin::instance::v1::DeleteInstanceRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.DeleteInstanceRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

SetIamPolicy(std::string const &, google::iam::v1::Policy const &, Options)

Sets the access control policy on an instance resource.

Replaces any existing policy.

Authorization requires spanner.instances.setIamPolicy on resource.

Parameters
Name Description
resource std::string const &

REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

policy google::iam::v1::Policy const &

REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

SetIamPolicy(std::string const &, IamUpdater const &, Options)

Updates the IAM policy for resource using an optimistic concurrency control loop.

The loop fetches the current policy for resource, and passes it to updater, which should return the new policy. This new policy should use the current etag so that the read-modify-write cycle can detect races and rerun the update when there is a mismatch. If the new policy does not have an etag, the existing policy will be blindly overwritten. If updater does not yield a policy, the control loop is terminated and kCancelled is returned.

Parameters
Name Description
resource std::string const &

Required. The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.

updater IamUpdater const &

Required. Functor to map the current policy to a new one.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::Policy >

google::iam::v1::Policy

SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &, Options)

Sets the access control policy on an instance resource.

Replaces any existing policy.

Authorization requires spanner.instances.setIamPolicy on resource.

Parameters
Name Description
request google::iam::v1::SetIamPolicyRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.SetIamPolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetIamPolicy(std::string const &, Options)

Gets the access control policy for an instance resource.

Returns an empty policy if an instance exists but does not have a policy set.

Authorization requires spanner.instances.getIamPolicy on resource.

Parameters
Name Description
resource std::string const &

REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &, Options)

Gets the access control policy for an instance resource.

Returns an empty policy if an instance exists but does not have a policy set.

Authorization requires spanner.instances.getIamPolicy on resource.

Parameters
Name Description
request google::iam::v1::GetIamPolicyRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.GetIamPolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::Policy >

the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

TestIamPermissions(std::string const &, std::vector< std::string > const &, Options)

Returns permissions that the caller has on the specified instance resource.

Attempting this RPC on a non-existent Cloud Spanner instance resource will result in a NOT_FOUND error if the user has spanner.instances.list permission on the containing Google Cloud Project. Otherwise returns an empty set of permissions.

Parameters
Name Description
resource std::string const &

REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.

permissions std::vector< std::string > const &

The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::TestIamPermissionsResponse >

the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &, Options)

Returns permissions that the caller has on the specified instance resource.

Attempting this RPC on a non-existent Cloud Spanner instance resource will result in a NOT_FOUND error if the user has spanner.instances.list permission on the containing Google Cloud Project. Otherwise returns an empty set of permissions.

Parameters
Name Description
request google::iam::v1::TestIamPermissionsRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.iam.v1.TestIamPermissionsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::iam::v1::TestIamPermissionsResponse >

the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetInstancePartition(std::string const &, Options)

Gets information about a particular instance partition.

Parameters
Name Description
name std::string const &

Required. The name of the requested instance partition. Values are of the form projects/{project}/instances/{instance}/instancePartitions/{instance_partition}.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::spanner::admin::instance::v1::InstancePartition >

the result of the RPC. The response message type (google.spanner.admin.instance.v1.InstancePartition) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetInstancePartition(google::spanner::admin::instance::v1::GetInstancePartitionRequest const &, Options)

Gets information about a particular instance partition.

Parameters
Name Description
request google::spanner::admin::instance::v1::GetInstancePartitionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.GetInstancePartitionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::spanner::admin::instance::v1::InstancePartition >

the result of the RPC. The response message type (google.spanner.admin.instance.v1.InstancePartition) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateInstancePartition(std::string const &, google::spanner::admin::instance::v1::InstancePartition const &, std::string const &, Options)

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 <instance_partition_name>/operations/<operation_id> 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.

Parameters
Name Description
parent std::string const &

Required. The name of the instance in which to create the instance partition. Values are of the form projects/<project>/instances/<instance>.

instance_partition google::spanner::admin::instance::v1::InstancePartition const &

Required. The instance partition to create. The instance_partition.name may be omitted, but if specified must be <parent>/instancePartitions/<instance_partition_id>.

instance_partition_id std::string const &

Required. The ID of the instance partition to create. Valid identifiers are of the form [a-z][-a-z0-9]*[a-z0-9] and must be between 2 and 64 characters in length.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstancePartition > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.InstancePartition proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateInstancePartition(NoAwaitTag, std::string const &, google::spanner::admin::instance::v1::InstancePartition const &, std::string const &, Options)

Creates an instance partition and begins preparing it to be used.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
parent std::string const &
instance_partition google::spanner::admin::instance::v1::InstancePartition const &
instance_partition_id std::string const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateInstancePartition(google::spanner::admin::instance::v1::CreateInstancePartitionRequest const &, Options)

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 <instance_partition_name>/operations/<operation_id> 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.

Parameters
Name Description
request google::spanner::admin::instance::v1::CreateInstancePartitionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.CreateInstancePartitionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstancePartition > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.InstancePartition proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateInstancePartition(NoAwaitTag, google::spanner::admin::instance::v1::CreateInstancePartitionRequest const &, Options)

Creates an instance partition and begins preparing it to be used.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::spanner::admin::instance::v1::CreateInstancePartitionRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateInstancePartition(google::longrunning::Operation const &, Options)

Creates an instance partition and begins preparing it to be used.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstancePartition > >

DeleteInstancePartition(std::string const &, Options)

Deletes an existing instance partition.

Requires that the instance partition is not used by any database or backup and is not the default instance partition of an instance.

Authorization requires spanner.instancePartitions.delete permission on the resource name.

Parameters
Name Description
name std::string const &

Required. The name of the instance partition to be deleted. Values are of the form projects/{project}/instances/{instance}/instancePartitions/{instance_partition}

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteInstancePartition(google::spanner::admin::instance::v1::DeleteInstancePartitionRequest const &, Options)

Deletes an existing instance partition.

Requires that the instance partition is not used by any database or backup and is not the default instance partition of an instance.

Authorization requires spanner.instancePartitions.delete permission on the resource name.

Parameters
Name Description
request google::spanner::admin::instance::v1::DeleteInstancePartitionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.DeleteInstancePartitionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
Status

a Status object. If the request failed, the status contains the details of the failure.

UpdateInstancePartition(google::spanner::admin::instance::v1::InstancePartition const &, google::protobuf::FieldMask const &, Options)

Updates an instance partition, and begins allocating or releasing resources as requested.

The returned long-running operation can be used to track the progress of updating the instance partition. If the named instance partition does not exist, returns NOT_FOUND.

Immediately upon completion of this request:

  • For resource types for which a decrease in the instance partition's allocation has been requested, billing is based on the newly-requested level.

Until completion of the returned operation:

  • Cancelling the operation sets its metadata's cancel_time, and begins restoring resources to their pre-request values. The operation is guaranteed to succeed at undoing all resource changes, after which point it terminates with a CANCELLED status.
  • All other attempts to modify the instance partition are rejected.
  • Reading the instance partition via the API continues to give the pre-request resource levels.

Upon completion of the returned operation:

  • Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
  • All newly-reserved resources are available for serving the instance partition's tables.
  • The instance partition's new resource levels are readable via the API.

The returned long-running operation will have a name of the format <instance_partition_name>/operations/<operation_id> and can be used to track the instance partition modification. The metadata field type is UpdateInstancePartitionMetadata. The response field type is InstancePartition, if successful.

Authorization requires spanner.instancePartitions.update permission on the resource name.

Parameters
Name Description
instance_partition google::spanner::admin::instance::v1::InstancePartition const &

Required. The instance partition to update, which must always include the instance partition name. Otherwise, only fields mentioned in field_mask need be included.

field_mask google::protobuf::FieldMask const &

Required. A mask specifying which fields in InstancePartition should be updated. The field mask must always be specified; this prevents any future fields in InstancePartition from being erased accidentally by clients that do not know about them.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstancePartition > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.InstancePartition proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateInstancePartition(NoAwaitTag, google::spanner::admin::instance::v1::InstancePartition const &, google::protobuf::FieldMask const &, Options)

Updates an instance partition, and begins allocating or releasing resources as requested.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
instance_partition google::spanner::admin::instance::v1::InstancePartition const &
field_mask google::protobuf::FieldMask const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

UpdateInstancePartition(google::spanner::admin::instance::v1::UpdateInstancePartitionRequest const &, Options)

Updates an instance partition, and begins allocating or releasing resources as requested.

The returned long-running operation can be used to track the progress of updating the instance partition. If the named instance partition does not exist, returns NOT_FOUND.

Immediately upon completion of this request:

  • For resource types for which a decrease in the instance partition's allocation has been requested, billing is based on the newly-requested level.

Until completion of the returned operation:

  • Cancelling the operation sets its metadata's cancel_time, and begins restoring resources to their pre-request values. The operation is guaranteed to succeed at undoing all resource changes, after which point it terminates with a CANCELLED status.
  • All other attempts to modify the instance partition are rejected.
  • Reading the instance partition via the API continues to give the pre-request resource levels.

Upon completion of the returned operation:

  • Billing begins for all successfully-allocated resources (some types may have lower than the requested levels).
  • All newly-reserved resources are available for serving the instance partition's tables.
  • The instance partition's new resource levels are readable via the API.

The returned long-running operation will have a name of the format <instance_partition_name>/operations/<operation_id> and can be used to track the instance partition modification. The metadata field type is UpdateInstancePartitionMetadata. The response field type is InstancePartition, if successful.

Authorization requires spanner.instancePartitions.update permission on the resource name.

Parameters
Name Description
request google::spanner::admin::instance::v1::UpdateInstancePartitionRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.UpdateInstancePartitionRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstancePartition > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.InstancePartition proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateInstancePartition(NoAwaitTag, google::spanner::admin::instance::v1::UpdateInstancePartitionRequest const &, Options)

Updates an instance partition, and begins allocating or releasing resources as requested.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::spanner::admin::instance::v1::UpdateInstancePartitionRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

UpdateInstancePartition(google::longrunning::Operation const &, Options)

Updates an instance partition, and begins allocating or releasing resources as requested.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::InstancePartition > >

ListInstancePartitionOperations(std::string const &, Options)

Lists instance partition long-running operations in the given instance.

An instance partition operation has a name of the form projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>. The long-running operation metadata field type metadata.type_url describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by operation.metadata.value.start_time in descending order starting from the most recently started operation.

Authorization requires spanner.instancePartitionOperations.list permission on the resource parent.

Parameters
Name Description
parent std::string const &

Required. The parent instance of the instance partition operations. Values are of the form projects/<project>/instances/<instance>.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::longrunning::Operation >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.longrunning.Operation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListInstancePartitionOperations(google::spanner::admin::instance::v1::ListInstancePartitionOperationsRequest, Options)

Lists instance partition long-running operations in the given instance.

An instance partition operation has a name of the form projects/<project>/instances/<instance>/instancePartitions/<instance_partition>/operations/<operation>. The long-running operation metadata field type metadata.type_url describes the type of the metadata. Operations returned include those that have completed/failed/canceled within the last 7 days, and pending operations. Operations returned are ordered by operation.metadata.value.start_time in descending order starting from the most recently started operation.

Authorization requires spanner.instancePartitionOperations.list permission on the resource parent.

Parameters
Name Description
request google::spanner::admin::instance::v1::ListInstancePartitionOperationsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.ListInstancePartitionOperationsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::longrunning::Operation >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.longrunning.Operation, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

MoveInstance(google::spanner::admin::instance::v1::MoveInstanceRequest const &, Options)

Moves an instance to the target instance configuration.

You can use the returned long-running operation to track the progress of moving the instance.

MoveInstance returns FAILED_PRECONDITION if the instance meets any of the following criteria:

  • Is undergoing a move to a different instance configuration
  • Has backups
  • Has an ongoing update
  • Contains any CMEK-enabled databases
  • Is a free trial instance

While the operation is pending:

  • All other attempts to modify the instance, including changes to its compute capacity, are rejected.
  • The following database and backup admin operations are rejected:
    • DatabaseAdmin.CreateDatabase
    • DatabaseAdmin.UpdateDatabaseDdl (disabled if default_leader is specified in the request.)
    • DatabaseAdmin.RestoreDatabase
    • DatabaseAdmin.CreateBackup
    • DatabaseAdmin.CopyBackup
  • Both the source and target instance configurations are subject to hourly compute and storage charges.
  • The instance might experience higher read-write latencies and a higher transaction abort rate. However, moving an instance doesn't cause any downtime.

The returned long-running operation has a name of the format <instance_name>/operations/<operation_id> and can be used to track the move instance operation. The metadata field type is MoveInstanceMetadata. The response field type is Instance, if successful. Cancelling the operation sets its metadata's cancel_time. Cancellation is not immediate because it involves moving any data previously moved to the target instance configuration back to the original instance configuration. You can use this operation to track the progress of the cancellation. Upon successful completion of the cancellation, the operation terminates with CANCELLED status.

If not cancelled, upon completion of the returned operation:

  • The instance successfully moves to the target instance configuration.
  • You are billed for compute and storage in target instance configuration.

Authorization requires the spanner.instances.update permission on the resource instance.

For more details, see Move an instance.

Parameters
Name Description
request google::spanner::admin::instance::v1::MoveInstanceRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.spanner.admin.instance.v1.MoveInstanceRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::MoveInstanceResponse > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.spanner.admin.instance.v1.MoveInstanceResponse proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

MoveInstance(NoAwaitTag, google::spanner::admin::instance::v1::MoveInstanceRequest const &, Options)

Moves an instance to the target instance configuration.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::spanner::admin::instance::v1::MoveInstanceRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

MoveInstance(google::longrunning::Operation const &, Options)

Moves an instance to the target instance configuration.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::spanner::admin::instance::v1::MoveInstanceResponse > >