Google_Service_Spanner_Resource_ProjectsInstancesDatabases
extends Google_Service_Resource
in package
The "databases" collection of methods.
Typical usage is:
$spannerService = new Google_Service_Spanner(...);
$databases = $spannerService->databases;
Table of Contents
- $client : Google_Client
- $methods : array<string|int, mixed>
- $resourceName : string
- $rootUrl : string
- $serviceName : string
- $servicePath : string
- $stackParameters : mixed
- __construct() : mixed
- call() : Google_Http_Request|expectedClass
- TODO: This function needs simplifying.
- create() : Google_Service_Spanner_Operation
- Creates a new Cloud Spanner database and starts to prepare it for serving.
- createRequestUri() : string
- Parse/expand request parameters and create a fully qualified request uri.
- dropDatabase() : Google_Service_Spanner_SpannerEmpty
- Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their `expire_time`.
- get() : Google_Service_Spanner_Database
- Gets the state of a Cloud Spanner database. (databases.get)
- getDdl() : Google_Service_Spanner_GetDatabaseDdlResponse
- Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the Operations API. (databases.getDdl)
- getIamPolicy() : Google_Service_Spanner_Policy
- 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.
- listProjectsInstancesDatabases() : Google_Service_Spanner_ListDatabasesResponse
- Lists Cloud Spanner databases. (databases.listProjectsInstancesDatabases)
- restore() : Google_Service_Spanner_Operation
- Create a new database by restoring from a completed backup. The new database must be in the same project and in an instance with the same instance configuration as the instance containing the backup. The returned database long-running operation has a name of the format `projects//instances//databases//operations/`, and can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreDatabaseMetadata. The response type is Database, if successful.
- setIamPolicy() : Google_Service_Spanner_Policy
- 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.
- testIamPermissions() : Google_Service_Spanner_TestIamPermissionsResponse
- 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. (databases.testIamPermissions)
- updateDdl() : Google_Service_Spanner_Operation
- Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned long-running operation will have a name of the format `/operations/` and can be used to track execution of the schema change(s). The metadata field type is UpdateDatabaseDdlMetadata. The operation has no response. (databases.updateDdl)
- convertToArrayAndStripNulls() : mixed
Properties
$client
private
Google_Client
$client
$methods
private
array<string|int, mixed>
$methods
$resourceName
private
string
$resourceName
$rootUrl
private
string
$rootUrl
$serviceName
private
string
$serviceName
$servicePath
private
string
$servicePath
$stackParameters
private
mixed
$stackParameters
= array('alt' => array('type' => 'string', 'location' => 'query'), 'fields' => array('type' => 'string', 'location' => 'query'), 'trace' => array('type' => 'string', 'location' => 'query'), 'userIp' => array('type' => 'string', 'location' => 'query'), 'quotaUser' => array('type' => 'string', 'location' => 'query'), 'data' => array('type' => 'string', 'location' => 'body'), 'mimeType' => array('type' => 'string', 'location' => 'header'), 'uploadType' => array('type' => 'string', 'location' => 'query'), 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), 'prettyPrint' => array('type' => 'string', 'location' => 'query'))
Methods
__construct()
public
__construct(mixed $service, mixed $serviceName, mixed $resourceName, mixed $resource) : mixed
Parameters
- $service : mixed
- $serviceName : mixed
- $resourceName : mixed
- $resource : mixed
Return values
mixed —call()
TODO: This function needs simplifying.
public
call( $name, $arguments[, $expectedClass = null ]) : Google_Http_Request|expectedClass
Parameters
Tags
Return values
Google_Http_Request|expectedClass —create()
Creates a new Cloud Spanner database and starts to prepare it for serving.
public
create(string $parent, Google_Service_Spanner_CreateDatabaseRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Spanner_Operation
The returned long-running operation will have a name of the format
/operations/ and can be used to track preparation of the database. The
metadata field type is CreateDatabaseMetadata. The response field type is
Database, if successful. (databases.create)
Parameters
- $parent : string
-
Required. The name of the instance that will serve the new database. Values are of the form
projects//instances/. - $postBody : Google_Service_Spanner_CreateDatabaseRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Spanner_Operation —createRequestUri()
Parse/expand request parameters and create a fully qualified request uri.
public
createRequestUri(string $restPath, array<string|int, mixed> $params) : string
Parameters
- $restPath : string
- $params : array<string|int, mixed>
Tags
Return values
string —$requestUrl
dropDatabase()
Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their `expire_time`.
public
dropDatabase(string $database[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Spanner_SpannerEmpty
(databases.dropDatabase)
Parameters
- $database : string
-
Required. The database to be dropped.
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Spanner_SpannerEmpty —get()
Gets the state of a Cloud Spanner database. (databases.get)
public
get(string $name[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Spanner_Database
Parameters
- $name : string
-
Required. The name of the requested database. Values are of the form
projects//instances//databases/. - $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Spanner_Database —getDdl()
Returns the schema of a Cloud Spanner database as a list of formatted DDL statements. This method does not show pending schema updates, those may be queried using the Operations API. (databases.getDdl)
public
getDdl(string $database[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Spanner_GetDatabaseDdlResponse
Parameters
- $database : string
-
Required. The database whose schema we wish to get. Values are of the form
projects//instances//databases/ - $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Spanner_GetDatabaseDdlResponse —getIamPolicy()
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.
public
getIamPolicy(string $resource, Google_Service_Spanner_GetIamPolicyRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Spanner_Policy
Authorization requires spanner.databases.getIamPolicy permission on
resource. For backups, authorization requires spanner.backups.getIamPolicy
permission on resource. (databases.getIamPolicy)
Parameters
- $resource : string
-
REQUIRED: The Cloud Spanner resource for which the policy is being retrieved. The format is
projects//instances/for instance resources andprojects//instances//databases/for database resources. - $postBody : Google_Service_Spanner_GetIamPolicyRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Spanner_Policy —listProjectsInstancesDatabases()
Lists Cloud Spanner databases. (databases.listProjectsInstancesDatabases)
public
listProjectsInstancesDatabases(string $parent[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Spanner_ListDatabasesResponse
Parameters
- $parent : string
-
Required. The instance whose databases should be listed. Values are of the form
projects//instances/. - $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Tags
Return values
Google_Service_Spanner_ListDatabasesResponse —restore()
Create a new database by restoring from a completed backup. The new database must be in the same project and in an instance with the same instance configuration as the instance containing the backup. The returned database long-running operation has a name of the format `projects//instances//databases//operations/`, and can be used to track the progress of the operation, and to cancel it. The metadata field type is RestoreDatabaseMetadata. The response type is Database, if successful.
public
restore(string $parent, Google_Service_Spanner_RestoreDatabaseRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Spanner_Operation
Cancelling the returned operation will stop the restore and delete the database. There can be only one database being restored into an instance at a time. Once the restore operation completes, a new restore operation can be initiated, without waiting for the optimize operation associated with the first restore to complete. (databases.restore)
Parameters
- $parent : string
-
Required. The name of the instance in which to create the restored database. This instance must be in the same project and have the same instance configuration as the instance containing the source backup. Values are of the form
projects//instances/. - $postBody : Google_Service_Spanner_RestoreDatabaseRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Spanner_Operation —setIamPolicy()
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.
public
setIamPolicy(string $resource, Google_Service_Spanner_SetIamPolicyRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Spanner_Policy
(databases.setIamPolicy)
Parameters
- $resource : string
-
REQUIRED: The Cloud Spanner resource for which the policy is being set. The format is
projects//instances/for instance resources andprojects//instances//databases/for databases resources. - $postBody : Google_Service_Spanner_SetIamPolicyRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Spanner_Policy —testIamPermissions()
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. (databases.testIamPermissions)
public
testIamPermissions(string $resource, Google_Service_Spanner_TestIamPermissionsRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Spanner_TestIamPermissionsResponse
Parameters
- $resource : string
-
REQUIRED: The Cloud Spanner resource for which permissions are being tested. The format is
projects//instances/for instance resources andprojects//instances//databases/for database resources. - $postBody : Google_Service_Spanner_TestIamPermissionsRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Spanner_TestIamPermissionsResponse —updateDdl()
Updates the schema of a Cloud Spanner database by creating/altering/dropping tables, columns, indexes, etc. The returned long-running operation will have a name of the format `/operations/` and can be used to track execution of the schema change(s). The metadata field type is UpdateDatabaseDdlMetadata. The operation has no response. (databases.updateDdl)
public
updateDdl(string $database, Google_Service_Spanner_UpdateDatabaseDdlRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_Spanner_Operation
Parameters
- $database : string
-
Required. The database to update.
- $postBody : Google_Service_Spanner_UpdateDatabaseDdlRequest
- $optParams : array<string|int, mixed> = array()
-
Optional parameters.
Return values
Google_Service_Spanner_Operation —convertToArrayAndStripNulls()
protected
convertToArrayAndStripNulls(mixed $o) : mixed
Parameters
- $o : mixed