Cloud Spanner V1 Client - Class InstanceAdminClient (1.85.0)

Reference documentation and code samples for the Cloud Spanner V1 Client class InstanceAdminClient.

Service Description: 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.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.

Namespace

Google \ Cloud \ Spanner \ Admin \ Instance \ V1 \ Client

Methods

__construct

Constructor.

Setting the "SPANNER_EMULATOR_HOST" environment variable will automatically set the API Endpoint to the value specified in the variable, as well as ensure that empty credentials are used in the transport layer.

Parameters
Name Description
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

The address of the API remote host. May optionally include the port, formatted as "

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.

↳ credentialsConfig array

Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .

↳ disableRetries bool

Determines whether or not retries defined by the client configuration should be disabled. Defaults to false.

↳ clientConfig string|array

Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.

↳ transport string|TransportInterface

The transport used for executing network requests. May be either the string rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.

↳ clientCertSource callable

A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.

createInstance

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::createInstanceAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\CreateInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\OperationResponse

createInstanceConfig

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::createInstanceConfigAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\CreateInstanceConfigRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\OperationResponse

createInstancePartition

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::createInstancePartitionAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\CreateInstancePartitionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\OperationResponse

deleteInstance

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::deleteInstanceAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\DeleteInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

deleteInstanceConfig

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::deleteInstanceConfigAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\DeleteInstanceConfigRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

deleteInstancePartition

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::deleteInstancePartitionAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\DeleteInstancePartitionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

getIamPolicy

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::getIamPolicyAsync() .

Parameters
Name Description
request Google\Cloud\Iam\V1\GetIamPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Iam\V1\Policy

getInstance

Gets information about a particular instance.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::getInstanceAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\GetInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Spanner\Admin\Instance\V1\Instance

getInstanceConfig

Gets information about a particular instance configuration.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::getInstanceConfigAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\GetInstanceConfigRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Spanner\Admin\Instance\V1\InstanceConfig

getInstancePartition

Gets information about a particular instance partition.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::getInstancePartitionAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\GetInstancePartitionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Spanner\Admin\Instance\V1\InstancePartition

listInstanceConfigOperations

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::listInstanceConfigOperationsAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\ListInstanceConfigOperationsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse

listInstanceConfigs

Lists the supported instance configurations for a given project.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::listInstanceConfigsAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\ListInstanceConfigsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse

listInstancePartitionOperations

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::listInstancePartitionOperationsAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\ListInstancePartitionOperationsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse

listInstancePartitions

Lists all instance partitions for the given instance.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::listInstancePartitionsAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\ListInstancePartitionsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse

listInstances

Lists all instances in the given project.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::listInstancesAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\ListInstancesRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\PagedListResponse

moveInstance

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::moveInstanceAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\MoveInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\OperationResponse

setIamPolicy

Sets the access control policy on an instance resource. Replaces any existing policy.

Authorization requires spanner.instances.setIamPolicy on resource.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::setIamPolicyAsync() .

Parameters
Name Description
request Google\Cloud\Iam\V1\SetIamPolicyRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Iam\V1\Policy

testIamPermissions

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::testIamPermissionsAsync() .

Parameters
Name Description
request Google\Cloud\Iam\V1\TestIamPermissionsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\Cloud\Iam\V1\TestIamPermissionsResponse

updateInstance

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::updateInstanceAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\UpdateInstanceRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\OperationResponse

updateInstanceConfig

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::updateInstanceConfigAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\UpdateInstanceConfigRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\OperationResponse

updateInstancePartition

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.

The async variant is Google\Cloud\Spanner\Admin\Instance\V1\Client\InstanceAdminClient::updateInstancePartitionAsync() .

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\UpdateInstancePartitionRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
Type Description
Google\ApiCore\OperationResponse

createInstanceAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\CreateInstanceRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createInstanceConfigAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\CreateInstanceConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

createInstancePartitionAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\CreateInstancePartitionRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteInstanceAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\DeleteInstanceRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteInstanceConfigAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\DeleteInstanceConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

deleteInstancePartitionAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\DeleteInstancePartitionRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getIamPolicyAsync

Parameters
Name Description
request Google\Cloud\Iam\V1\GetIamPolicyRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getInstanceAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\GetInstanceRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getInstanceConfigAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\GetInstanceConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getInstancePartitionAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\GetInstancePartitionRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listInstanceConfigOperationsAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\ListInstanceConfigOperationsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listInstanceConfigsAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\ListInstanceConfigsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listInstancePartitionOperationsAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\ListInstancePartitionOperationsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listInstancePartitionsAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\ListInstancePartitionsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

listInstancesAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\ListInstancesRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

moveInstanceAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\MoveInstanceRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

setIamPolicyAsync

Parameters
Name Description
request Google\Cloud\Iam\V1\SetIamPolicyRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

testIamPermissionsAsync

Parameters
Name Description
request Google\Cloud\Iam\V1\TestIamPermissionsRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateInstanceAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\UpdateInstanceRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateInstanceConfigAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\UpdateInstanceConfigRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

updateInstancePartitionAsync

Parameters
Name Description
request Google\Cloud\Spanner\Admin\Instance\V1\UpdateInstancePartitionRequest
optionalArgs = [] array
Returns
Type Description
GuzzleHttp\Promise\PromiseInterface

getOperationsClient

Return an OperationsClient object with the same endpoint as $this.

Returns
Type Description
Google\ApiCore\LongRunning\OperationsClient

resumeOperation

Resume an existing long running operation that was previously started by a long running API method. If $methodName is not provided, or does not match a long running API method, then the operation can still be resumed, but the OperationResponse object will not deserialize the final response.

Parameters
Name Description
operationName string

The name of the long running operation

methodName string

The name of the method used to start the operation

Returns
Type Description
Google\ApiCore\OperationResponse

static::instanceName

Formats a string containing the fully-qualified path to represent a instance resource.

Parameters
Name Description
project string
instance string
Returns
Type Description
string The formatted instance resource.

static::instanceConfigName

Formats a string containing the fully-qualified path to represent a instance_config resource.

Parameters
Name Description
project string
instanceConfig string
Returns
Type Description
string The formatted instance_config resource.

static::instancePartitionName

Formats a string containing the fully-qualified path to represent a instance_partition resource.

Parameters
Name Description
project string
instance string
instancePartition string
Returns
Type Description
string The formatted instance_partition resource.

static::projectName

Formats a string containing the fully-qualified path to represent a project resource.

Parameter
Name Description
project string
Returns
Type Description
string The formatted project resource.

static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported: Template: Pattern

  • instance: projects/{project}/instances/{instance}
  • instanceConfig: projects/{project}/instanceConfigs/{instance_config}
  • instancePartition: projects/{project}/instances/{instance}/instancePartitions/{instance_partition}
  • project: projects/{project}

The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.

Parameters
Name Description
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
Type Description
array An associative array from name component IDs to component values.