class ProjectsInstancesBackups extends Resource (View source)

The "backups" collection of methods.

Typical usage is:

 $spannerService = new Google\Service\Spanner(...);
 $backups = $spannerService->projects_instances_backups;

Methods

copy(string $parent, CopyBackupRequest $postBody, array $optParams = [])

Starts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format projects//instances//backups//operations/ and can be used to track copying of the backup. The operation is associated with the destination backup. The metadata field type is CopyBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the copying and delete the destination backup. Concurrent CopyBackup requests can run on the same source backup. (backups.copy)

create(string $parent, Backup $postBody, array $optParams = [])

Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format projects//instances//backups//operations/ and can be used to track creation of the backup. The metadata field type is CreateBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the creation and delete the backup. There can be only one pending backup creation per database. Backup creation of different databases can run concurrently. (backups.create)

delete(string $name, array $optParams = [])

Deletes a pending or completed Backup. (backups.delete)

get(string $name, array $optParams = [])

Gets metadata on a pending or completed Backup. (backups.get)

getIamPolicy(string $resource, GetIamPolicyRequest $postBody, array $optParams = [])

Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.

listProjectsInstancesBackups(string $parent, array $optParams = [])

Lists completed and pending backups. Backups returned are ordered by create_time in descending order, starting from the most recent create_time. (backups.listProjectsInstancesBackups)

patch(string $name, Backup $postBody, array $optParams = [])

Updates a pending or completed Backup. (backups.patch)

setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires spanner.databases.setIamPolicy permission on resource. For backups, authorization requires spanner.backups.setIamPolicy permission on resource. (backups.setIamPolicy)

testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])

Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has spanner.databases.list permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has spanner.backups.list permission on the containing instance. (backups.testIamPermissions)

Details

Operation copy(string $parent, CopyBackupRequest $postBody, array $optParams = [])

Starts copying a Cloud Spanner Backup. The returned backup long-running operation will have a name of the format projects//instances//backups//operations/ and can be used to track copying of the backup. The operation is associated with the destination backup. The metadata field type is CopyBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the copying and delete the destination backup. Concurrent CopyBackup requests can run on the same source backup. (backups.copy)

Parameters

string $parent

Required. The name of the destination instance that will contain the backup copy. Values are of the form: projects//instances/.

CopyBackupRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation create(string $parent, Backup $postBody, array $optParams = [])

Starts creating a new Cloud Spanner Backup. The returned backup long-running operation will have a name of the format projects//instances//backups//operations/ and can be used to track creation of the backup. The metadata field type is CreateBackupMetadata. The response field type is Backup, if successful. Cancelling the returned operation will stop the creation and delete the backup. There can be only one pending backup creation per database. Backup creation of different databases can run concurrently. (backups.create)

Parameters

string $parent

Required. The name of the instance in which the backup will be created. This must be the same instance that contains the database the backup will be created from. The backup will be stored in the location(s) specified in the instance configuration of this instance. Values are of the form projects//instances/.

Backup $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

SpannerEmpty delete(string $name, array $optParams = [])

Deletes a pending or completed Backup. (backups.delete)

Parameters

string $name

Required. Name of the backup to delete. Values are of the form projects//instances//backups/.

array $optParams

Optional parameters.

Return Value

SpannerEmpty

Exceptions

Exception

Backup get(string $name, array $optParams = [])

Gets metadata on a pending or completed Backup. (backups.get)

Parameters

string $name

Required. Name of the backup. Values are of the form projects//instances//backups/.

array $optParams

Optional parameters.

Return Value

Backup

Exceptions

Exception

Policy getIamPolicy(string $resource, GetIamPolicyRequest $postBody, array $optParams = [])

Gets the access control policy for a database or backup resource. Returns an empty policy if a database or backup exists but does not have a policy set.

Authorization requires spanner.databases.getIamPolicy permission on resource. For backups, authorization requires spanner.backups.getIamPolicy permission on resource. (backups.getIamPolicy)

Parameters

string $resource

REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is projects//instances/ for instance resources and projects//instances//databases/ for database resources.

GetIamPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

ListBackupsResponse listProjectsInstancesBackups(string $parent, array $optParams = [])

Lists completed and pending backups. Backups returned are ordered by create_time in descending order, starting from the most recent create_time. (backups.listProjectsInstancesBackups)

Parameters

string $parent

Required. The instance to list backups from. Values are of the form projects//instances/.

array $optParams

Optional parameters.

Return Value

ListBackupsResponse

Exceptions

Exception

Backup patch(string $name, Backup $postBody, array $optParams = [])

Updates a pending or completed Backup. (backups.patch)

Parameters

string $name

Output only for the CreateBackup operation. Required for the UpdateBackup operation. A globally unique identifier for the backup which cannot be changed. Values are of the form projects//instances//backups/a-z*[a-z0-9] The final segment of the name must be between 2 and 60 characters in length. The backup is stored in the location(s) specified in the instance configuration of the instance containing the backup, identified by the prefix of the backup name of the form projects//instances/.

Backup $postBody
array $optParams

Optional parameters.

Return Value

Backup

Exceptions

Exception

Policy setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on a database or backup resource. Replaces any existing policy. Authorization requires spanner.databases.setIamPolicy permission on resource. For backups, authorization requires spanner.backups.setIamPolicy permission on resource. (backups.setIamPolicy)

Parameters

string $resource

REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is projects//instances/ for instance resources and projects//instances//databases/ for databases resources.

SetIamPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

TestIamPermissionsResponse testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])

Returns permissions that the caller has on the specified database or backup resource. Attempting this RPC on a non-existent Cloud Spanner database will result in a NOT_FOUND error if the user has spanner.databases.list permission on the containing Cloud Spanner instance. Otherwise returns an empty set of permissions. Calling this method on a backup that does not exist will result in a NOT_FOUND error if the user has spanner.backups.list permission on the containing instance. (backups.testIamPermissions)

Parameters

string $resource

REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is projects//instances/ for instance resources and projects//instances//databases/ for database resources.

TestIamPermissionsRequest $postBody
array $optParams

Optional parameters.

Return Value

TestIamPermissionsResponse

Exceptions

Exception