All Downloads are FREE. Search and download functionalities are using the official Maven repository.

target.apidocs.com.google.api.services.spanner.v1.Spanner.Projects.Instances.Databases.html Maven / Gradle / Ivy

There is a newer version: v1-rev20241119-2.0.0
Show newest version






Spanner.Projects.Instances.Databases (Cloud Spanner API v1-rev20240910-2.0.0)












com.google.api.services.spanner.v1

Class Spanner.Projects.Instances.Databases

  • java.lang.Object
    • com.google.api.services.spanner.v1.Spanner.Projects.Instances.Databases
    • Constructor Detail

      • Databases

        public Databases()
    • Method Detail

      • changequorum

        public Spanner.Projects.Instances.Databases.Changequorum changequorum(String name,
                                                                              ChangeQuorumRequest content)
                                                                       throws IOException
        `ChangeQuorum` is strictly restricted to databases that use dual-region instance configurations. Initiates a background operation to change the quorum of a database from dual-region mode to single-region mode or vice versa. The returned long-running operation has a name of the format `projects//instances//databases//operations/` and can be used to track execution of the `ChangeQuorum`. The metadata field type is ChangeQuorumMetadata. Authorization requires `spanner.databases.changequorum` permission on the resource database. Create a request for the method "databases.changequorum". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        name - Required. Name of the database in which to apply `ChangeQuorum`. Values are of the form `projects//instances//databases/`.
        content - the ChangeQuorumRequest
        Returns:
        the request
        Throws:
        IOException
      • create

        public Spanner.Projects.Instances.Databases.Create create(String parent,
                                                                  CreateDatabaseRequest content)
                                                           throws IOException
        Creates a new Spanner database and starts to prepare it for serving. 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. Create a request for the method "databases.create". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        parent - Required. The name of the instance that will serve the new database. Values are of the form `projects//instances/`.
        content - the CreateDatabaseRequest
        Returns:
        the request
        Throws:
        IOException
      • dropDatabase

        public Spanner.Projects.Instances.Databases.DropDatabase dropDatabase(String database)
                                                                       throws IOException
        Drops (aka deletes) a Cloud Spanner database. Completed backups for the database will be retained according to their `expire_time`. Note: Cloud Spanner might continue to accept requests for a few seconds after the database has been deleted. Create a request for the method "databases.dropDatabase". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        database - Required. The database to be dropped.
        Returns:
        the request
        Throws:
        IOException
      • get

        public Spanner.Projects.Instances.Databases.Get get(String name)
                                                     throws IOException
        Gets the state of a Cloud Spanner database. Create a request for the method "databases.get". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        name - Required. The name of the requested database. Values are of the form `projects//instances//databases/`.
        Returns:
        the request
        Throws:
        IOException
      • getDdl

        public Spanner.Projects.Instances.Databases.GetDdl getDdl(String database)
                                                           throws IOException
        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. Create a request for the method "databases.getDdl". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        database - Required. The database whose schema we wish to get. Values are of the form `projects//instances//databases/`
        Returns:
        the request
        Throws:
        IOException
      • getIamPolicy

        public Spanner.Projects.Instances.Databases.GetIamPolicy getIamPolicy(String resource,
                                                                              GetIamPolicyRequest content)
                                                                       throws IOException
        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. Create a request for the method "databases.getIamPolicy". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        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.
        content - the GetIamPolicyRequest
        Returns:
        the request
        Throws:
        IOException
      • getScans

        public Spanner.Projects.Instances.Databases.GetScans getScans(String name)
                                                               throws IOException
        Request a specific scan with Database-specific data for Cloud Key Visualizer. Create a request for the method "databases.getScans". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        name - Required. The unique name of the scan containing the requested information, specific to the Database service implementing this interface.
        Returns:
        the request
        Throws:
        IOException
      • list

        public Spanner.Projects.Instances.Databases.List list(String parent)
                                                       throws IOException
        Lists Cloud Spanner databases. Create a request for the method "databases.list". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        parent - Required. The instance whose databases should be listed. Values are of the form `projects//instances/`.
        Returns:
        the request
        Throws:
        IOException
      • patch

        public Spanner.Projects.Instances.Databases.Patch patch(String name,
                                                                Database content)
                                                         throws IOException
        Updates a Cloud Spanner database. The returned long-running operation can be used to track the progress of updating the database. If the named database does not exist, returns `NOT_FOUND`. While the operation is pending: * The database's reconciling field is set to true. * Cancelling the operation is best-effort. If the cancellation succeeds, the operation metadata's cancel_time is set, the updates are reverted, and the operation terminates with a `CANCELLED` status. * New UpdateDatabase requests will return a `FAILED_PRECONDITION` error until the pending operation is done (returns successfully or with error). * Reading the database via the API continues to give the pre-request values. Upon completion of the returned operation: * The new values are in effect and readable via the API. * The database's reconciling field becomes false. The returned long- running operation will have a name of the format `projects//instances//databases//operations/` and can be used to track the database modification. The metadata field type is UpdateDatabaseMetadata. The response field type is Database, if successful. Create a request for the method "databases.patch". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        name - Required. The name of the database. Values are of the form `projects//instances//databases/`, where `` is as specified in the `CREATE DATABASE` statement. This name can be passed to other API methods to identify the database.
        content - the Database
        Returns:
        the request
        Throws:
        IOException
      • restore

        public Spanner.Projects.Instances.Databases.Restore restore(String parent,
                                                                    RestoreDatabaseRequest content)
                                                             throws IOException
        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. 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. Create a request for the method "databases.restore". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        parent - 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/`.
        content - the RestoreDatabaseRequest
        Returns:
        the request
        Throws:
        IOException
      • setIamPolicy

        public Spanner.Projects.Instances.Databases.SetIamPolicy setIamPolicy(String resource,
                                                                              SetIamPolicyRequest content)
                                                                       throws IOException
        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. Create a request for the method "databases.setIamPolicy". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        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.
        content - the SetIamPolicyRequest
        Returns:
        the request
        Throws:
        IOException
      • testIamPermissions

        public Spanner.Projects.Instances.Databases.TestIamPermissions testIamPermissions(String resource,
                                                                                          TestIamPermissionsRequest content)
                                                                                   throws IOException
        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. Create a request for the method "databases.testIamPermissions". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        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.
        content - the TestIamPermissionsRequest
        Returns:
        the request
        Throws:
        IOException
      • updateDdl

        public Spanner.Projects.Instances.Databases.UpdateDdl updateDdl(String database,
                                                                        UpdateDatabaseDdlRequest content)
                                                                 throws IOException
        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. Create a request for the method "databases.updateDdl". This request holds the parameters needed by the spanner server. After setting any optional parameters, call the AbstractGoogleClientRequest.execute() method to invoke the remote operation.
        Parameters:
        database - Required. The database to update.
        content - the UpdateDatabaseDdlRequest
        Returns:
        the request
        Throws:
        IOException
      • backupSchedules

        public Spanner.Projects.Instances.Databases.BackupSchedules backupSchedules()
        An accessor for creating requests from the BackupSchedules collection.

        The typical use is:

            Spanner spanner = new Spanner(...);
            Spanner.BackupSchedules.List request = spanner.backupSchedules().list(parameters ...)
         
        Returns:
        the resource collection
      • databaseRoles

        public Spanner.Projects.Instances.Databases.DatabaseRoles databaseRoles()
        An accessor for creating requests from the DatabaseRoles collection.

        The typical use is:

            Spanner spanner = new Spanner(...);
            Spanner.DatabaseRoles.List request = spanner.databaseRoles().list(parameters ...)
         
        Returns:
        the resource collection
      • operations

        public Spanner.Projects.Instances.Databases.Operations operations()
        An accessor for creating requests from the Operations collection.

        The typical use is:

            Spanner spanner = new Spanner(...);
            Spanner.Operations.List request = spanner.operations().list(parameters ...)
         
        Returns:
        the resource collection
      • sessions

        public Spanner.Projects.Instances.Databases.Sessions sessions()
        An accessor for creating requests from the Sessions collection.

        The typical use is:

            Spanner spanner = new Spanner(...);
            Spanner.Sessions.List request = spanner.sessions().list(parameters ...)
         
        Returns:
        the resource collection

Copyright © 2011–2024 Google. All rights reserved.





© 2015 - 2025 Weber Informatics LLC | Privacy Policy