ProjectsInstances
class ProjectsInstances extends Resource (View source)
The "instances" collection of methods.
Typical usage is:
$spannerService = new Google\Service\Spanner(...);
$instances = $spannerService->projects_instances;
Methods
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
.
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.
Gets information about a particular instance. (instances.get)
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.
Lists all instances in the given project. (instances.listProjectsInstances)
Moves the instance to the target instance config. The returned long-running operation can be used to track the progress of moving the instance.
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 /operations/
and can be used to
track the instance modification. The metadata field type is
UpdateInstanceMetadata. The response field type is Instance, if successful.
Sets the access control policy on an instance resource. Replaces any existing
policy. Authorization requires spanner.instances.setIamPolicy
on resource.
Returns permissions that the caller has on the specified instance resource.
Details
Operation
create(string $parent, CreateInstanceRequest $postBody, array $optParams = [])
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 /operations/
and can be used to track creation of the instance. The
metadata field type is CreateInstanceMetadata. The response field type is
Instance, if successful. (instances.create)
SpannerEmpty
delete(string $name, array $optParams = [])
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.
(instances.delete)
Instance
get(string $name, array $optParams = [])
Gets information about a particular instance. (instances.get)
Policy
getIamPolicy(string $resource, GetIamPolicyRequest $postBody, array $optParams = [])
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.
(instances.getIamPolicy)
ListInstancesResponse
listProjectsInstances(string $parent, array $optParams = [])
Lists all instances in the given project. (instances.listProjectsInstances)
Operation
move(string $name, MoveInstanceRequest $postBody, array $optParams = [])
Moves the instance to the target instance config. The returned long-running operation can be used to track the progress of moving the instance.
MoveInstance
returns FAILED_PRECONDITION
if the instance meets any of the
following criteria: Has an ongoing move to a different instance config
Has backups Has an ongoing update Is under free trial Contains any
CMEK-enabled databases 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 may
experience higher read-write latencies and a higher transaction abort rate.
However, moving an instance does not cause any downtime. The returned long-
running operation will have a name of the format
/operations/
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 since it involves moving any data previously moved to target instance configuration back to the original instance config. The same operation can be used to track the progress of the cancellation. Upon successful completion of the cancellation, the operation terminates withCANCELLED
status. Upon completion(if not cancelled) of the returned operation: Instance would be successfully moved to the target instance config. You are billed for compute and storage in target instance config. Authorization requiresspanner.instances.update
permission on the resource instance. For more details, please see documentation. (instances.move)
Operation
patch(string $name, UpdateInstanceRequest $postBody, array $optParams = [])
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 /operations/
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. (instances.patch)
Policy
setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])
Sets the access control policy on an instance resource. Replaces any existing
policy. Authorization requires spanner.instances.setIamPolicy
on resource.
(instances.setIamPolicy)
TestIamPermissionsResponse
testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])
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. (instances.testIamPermissions)