Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

SQLAdmin

import { SQLAdmin } from "https://googleapis.deno.dev/v1/sqladmin:v1.ts";

API for Cloud SQL database instance management

class SQLAdmin {
constructor(client?: CredentialsClient, baseUrl?: string);
async backupRunsDelete(
id: bigint,
instance: string,
project: string,
): Promise<Operation>;
async backupRunsGet(
id: bigint,
instance: string,
project: string,
): Promise<BackupRun>;
async backupRunsInsert(
instance: string,
project: string,
req: BackupRun,
): Promise<Operation>;
async backupRunsList(
instance: string,
project: string,
): Promise<BackupRunsListResponse>;
async connectGenerateEphemeralCert(
instance: string,
project: string,
): Promise<GenerateEphemeralCertResponse>;
async connectGet(
instance: string,
project: string,
): Promise<ConnectSettings>;
async databasesDelete(
database: string,
instance: string,
project: string,
): Promise<Operation>;
async databasesGet(
database: string,
instance: string,
project: string,
): Promise<Database>;
async databasesInsert(
instance: string,
project: string,
req: Database,
): Promise<Operation>;
async databasesList(instance: string, project: string): Promise<DatabasesListResponse>;
async databasesPatch(
database: string,
instance: string,
project: string,
req: Database,
): Promise<Operation>;
async databasesUpdate(
database: string,
instance: string,
project: string,
req: Database,
): Promise<Operation>;
async flagsList(opts?: FlagsListOptions): Promise<FlagsListResponse>;
async instancesAcquireSsrsLease(
instance: string,
project: string,
): Promise<SqlInstancesAcquireSsrsLeaseResponse>;
async instancesAddServerCa(instance: string, project: string): Promise<Operation>;
async instancesClone(
instance: string,
project: string,
): Promise<Operation>;
async instancesDelete(instance: string, project: string): Promise<Operation>;
async instancesDemote(
instance: string,
project: string,
): Promise<Operation>;
async instancesDemoteMaster(
instance: string,
project: string,
): Promise<Operation>;
async instancesExport(
instance: string,
project: string,
): Promise<Operation>;
async instancesFailover(
instance: string,
project: string,
): Promise<Operation>;
async instancesGet(instance: string, project: string): Promise<DatabaseInstance>;
async instancesImport(
instance: string,
project: string,
): Promise<Operation>;
async instancesInsert(project: string, req: DatabaseInstance): Promise<Operation>;
async instancesList(project: string, opts?: InstancesListOptions): Promise<InstancesListResponse>;
async instancesListServerCas(instance: string, project: string): Promise<InstancesListServerCasResponse>;
async instancesPatch(
instance: string,
project: string,
): Promise<Operation>;
async instancesPromoteReplica(
instance: string,
project: string,
): Promise<Operation>;
async instancesReencrypt(
instance: string,
project: string,
): Promise<Operation>;
async instancesReleaseSsrsLease(instance: string, project: string): Promise<SqlInstancesReleaseSsrsLeaseResponse>;
async instancesResetSslConfig(instance: string, project: string): Promise<Operation>;
async instancesRestart(instance: string, project: string): Promise<Operation>;
async instancesRestoreBackup(
instance: string,
project: string,
): Promise<Operation>;
async instancesRotateServerCa(
instance: string,
project: string,
): Promise<Operation>;
async instancesStartReplica(instance: string, project: string): Promise<Operation>;
async instancesStopReplica(instance: string, project: string): Promise<Operation>;
async instancesSwitchover(
instance: string,
project: string,
): Promise<Operation>;
async instancesTruncateLog(
instance: string,
project: string,
): Promise<Operation>;
async instancesUpdate(
instance: string,
project: string,
): Promise<Operation>;
async operationsCancel(operation: string, project: string): Promise<Empty>;
async operationsGet(operation: string, project: string): Promise<Operation>;
async operationsList(project: string, opts?: OperationsListOptions): Promise<OperationsListResponse>;
async projectsInstancesGetDiskShrinkConfig(instance: string, project: string): Promise<SqlInstancesGetDiskShrinkConfigResponse>;
async projectsInstancesGetLatestRecoveryTime(instance: string, project: string): Promise<SqlInstancesGetLatestRecoveryTimeResponse>;
async projectsInstancesPerformDiskShrink(
instance: string,
project: string,
): Promise<Operation>;
async projectsInstancesRescheduleMaintenance(
instance: string,
project: string,
): Promise<Operation>;
async projectsInstancesResetReplicaSize(
instance: string,
project: string,
): Promise<Operation>;
async projectsInstancesStartExternalSync(
instance: string,
project: string,
): Promise<Operation>;
async projectsInstancesVerifyExternalSyncSettings(
instance: string,
project: string,
): Promise<SqlInstancesVerifyExternalSyncSettingsResponse>;
async sslCertsCreateEphemeral(
instance: string,
project: string,
): Promise<SslCert>;
async sslCertsDelete(
instance: string,
project: string,
sha1Fingerprint: string,
): Promise<Operation>;
async sslCertsGet(
instance: string,
project: string,
sha1Fingerprint: string,
): Promise<SslCert>;
async sslCertsInsert(
instance: string,
project: string,
): Promise<SslCertsInsertResponse>;
async sslCertsList(instance: string, project: string): Promise<SslCertsListResponse>;
async tiersList(project: string): Promise<TiersListResponse>;
async usersDelete(
instance: string,
project: string,
): Promise<Operation>;
async usersGet(
instance: string,
name: string,
project: string,
): Promise<User>;
async usersInsert(
instance: string,
project: string,
req: User,
): Promise<Operation>;
async usersList(instance: string, project: string): Promise<UsersListResponse>;
async usersUpdate(
instance: string,
project: string,
req: User,
): Promise<Operation>;
}

§Constructors

§
new SQLAdmin(client?: CredentialsClient, baseUrl?: string)
[src]

§Methods

§
backupRunsDelete(id: bigint, instance: string, project: string): Promise<Operation>
[src]

Deletes the backup taken by a backup run.

@param id

The ID of the backup run to delete. To find a backup run ID, use the list method.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
backupRunsGet(id: bigint, instance: string, project: string): Promise<BackupRun>
[src]

Retrieves a resource containing information about a backup run.

@param id

The ID of this backup run.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
backupRunsInsert(instance: string, project: string, req: BackupRun): Promise<Operation>
[src]

Creates a new backup run on demand.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
backupRunsList(instance: string, project: string, opts?: BackupRunsListOptions): Promise<BackupRunsListResponse>
[src]

Lists all backup runs associated with the project or a given instance and configuration in the reverse chronological order of the backup initiation time.

@param instance

Cloud SQL instance ID, or "-" for all instances. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
connectGenerateEphemeralCert(instance: string, project: string, req: GenerateEphemeralCertRequest): Promise<GenerateEphemeralCertResponse>
[src]

Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
connectGet(instance: string, project: string, opts?: ConnectGetOptions): Promise<ConnectSettings>
[src]

Retrieves connect settings about a Cloud SQL instance.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
databasesDelete(database: string, instance: string, project: string): Promise<Operation>
[src]

Deletes a database from a Cloud SQL instance.

@param database

Name of the database to be deleted in the instance.

@param instance

Database instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
databasesGet(database: string, instance: string, project: string): Promise<Database>
[src]

Retrieves a resource containing information about a database inside a Cloud SQL instance.

@param database

Name of the database in the instance.

@param instance

Database instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
databasesInsert(instance: string, project: string, req: Database): Promise<Operation>
[src]

Inserts a resource containing information about a database inside a Cloud SQL instance. Note: You can't modify the default character set and collation.

@param instance

Database instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
databasesList(instance: string, project: string): Promise<DatabasesListResponse>
[src]

Lists databases in the specified Cloud SQL instance.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
databasesPatch(database: string, instance: string, project: string, req: Database): Promise<Operation>
[src]

Partially updates a resource containing information about a database inside a Cloud SQL instance. This method supports patch semantics.

@param database

Name of the database to be updated in the instance.

@param instance

Database instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
databasesUpdate(database: string, instance: string, project: string, req: Database): Promise<Operation>
[src]

Updates a resource containing information about a database inside a Cloud SQL instance.

@param database

Name of the database to be updated in the instance.

@param instance

Database instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
flagsList(opts?: FlagsListOptions): Promise<FlagsListResponse>
[src]

Lists all available database flags for Cloud SQL instances.

§
instancesAcquireSsrsLease(instance: string, project: string, req: InstancesAcquireSsrsLeaseRequest): Promise<SqlInstancesAcquireSsrsLeaseResponse>
[src]

Acquire a lease for the setup of SQL Server Reporting Services (SSRS).

@param instance

Required. Cloud SQL instance ID. This doesn't include the project ID. It's composed of lowercase letters, numbers, and hyphens, and it must start with a letter. The total length must be 98 characters or less (Example: instance-id).

@param project

Required. Project ID of the project that contains the instance (Example: project-id).

§
instancesAddServerCa(instance: string, project: string): Promise<Operation>
[src]

Adds a new trusted Certificate Authority (CA) version for the specified instance. Required to prepare for a certificate rotation. If a CA version was previously added but never used in a certificate rotation, this operation replaces that version. There cannot be more than one CA version waiting to be rotated in.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
instancesClone(instance: string, project: string, req: InstancesCloneRequest): Promise<Operation>
[src]

Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.

@param instance

The ID of the Cloud SQL instance to be cloned (source). This does not include the project ID.

@param project

Project ID of the source as well as the clone Cloud SQL instance.

§
instancesDelete(instance: string, project: string): Promise<Operation>
[src]

Deletes a Cloud SQL instance.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance to be deleted.

§
instancesDemote(instance: string, project: string, req: InstancesDemoteRequest): Promise<Operation>
[src]

Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server.

@param instance

Required. Cloud SQL instance name.

@param project

Required. ID of the project that contains the instance.

§
instancesDemoteMaster(instance: string, project: string, req: InstancesDemoteMasterRequest): Promise<Operation>
[src]

Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.

@param instance

Cloud SQL instance name.

@param project

ID of the project that contains the instance.

§
instancesExport(instance: string, project: string, req: InstancesExportRequest): Promise<Operation>
[src]

Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance to be exported.

§
instancesFailover(instance: string, project: string, req: InstancesFailoverRequest): Promise<Operation>
[src]

Initiates a manual failover of a high availability (HA) primary instance to a standby instance, which becomes the primary instance. Users are then rerouted to the new primary. For more information, see the Overview of high availability page in the Cloud SQL documentation. If using Legacy HA (MySQL only), this causes the instance to failover to its failover replica instance.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

ID of the project that contains the read replica.

§
instancesGet(instance: string, project: string): Promise<DatabaseInstance>
[src]

Retrieves a resource containing information about a Cloud SQL instance.

@param instance

Database instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
instancesImport(instance: string, project: string, req: InstancesImportRequest): Promise<Operation>
[src]

Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
instancesInsert(project: string, req: DatabaseInstance): Promise<Operation>
[src]

Creates a new Cloud SQL instance.

@param project

Project ID of the project to which the newly created Cloud SQL instances should belong.

§
instancesList(project: string, opts?: InstancesListOptions): Promise<InstancesListResponse>
[src]

Lists instances under a given project.

@param project

Project ID of the project for which to list Cloud SQL instances.

§
instancesListServerCas(instance: string, project: string): Promise<InstancesListServerCasResponse>
[src]

Lists all of the trusted Certificate Authorities (CAs) for the specified instance. There can be up to three CAs listed: the CA that was used to sign the certificate that is currently in use, a CA that has been added but not yet used to sign a certificate, and a CA used to sign a certificate that has previously rotated out.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
instancesPatch(instance: string, project: string, req: DatabaseInstance): Promise<Operation>
[src]

Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
instancesPromoteReplica(instance: string, project: string, opts?: InstancesPromoteReplicaOptions): Promise<Operation>
[src]

Promotes the read replica instance to be an independent Cloud SQL primary instance. Using this operation might cause your instance to restart.

@param instance

Cloud SQL read replica instance name.

@param project

ID of the project that contains the read replica.

§
instancesReencrypt(instance: string, project: string, req: InstancesReencryptRequest): Promise<Operation>
[src]

Reencrypt CMEK instance with latest key version.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

ID of the project that contains the instance.

§
instancesReleaseSsrsLease(instance: string, project: string): Promise<SqlInstancesReleaseSsrsLeaseResponse>
[src]

Release a lease for the setup of SQL Server Reporting Services (SSRS).

@param instance

Required. The Cloud SQL instance ID. This doesn't include the project ID. The instance ID contains lowercase letters, numbers, and hyphens, and it must start with a letter. This ID can have a maximum length of 98 characters.

@param project

Required. The project ID that contains the instance.

§
instancesResetSslConfig(instance: string, project: string): Promise<Operation>
[src]

Deletes all client certificates and generates a new server SSL certificate for the instance.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
instancesRestart(instance: string, project: string): Promise<Operation>
[src]

Restarts a Cloud SQL instance.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance to be restarted.

§
instancesRestoreBackup(instance: string, project: string, req: InstancesRestoreBackupRequest): Promise<Operation>
[src]

Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
instancesRotateServerCa(instance: string, project: string, req: InstancesRotateServerCaRequest): Promise<Operation>
[src]

Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
instancesStartReplica(instance: string, project: string): Promise<Operation>
[src]

Starts the replication in the read replica instance.

@param instance

Cloud SQL read replica instance name.

@param project

ID of the project that contains the read replica.

§
instancesStopReplica(instance: string, project: string): Promise<Operation>
[src]

Stops the replication in the read replica instance.

@param instance

Cloud SQL read replica instance name.

@param project

ID of the project that contains the read replica.

§
instancesSwitchover(instance: string, project: string, opts?: InstancesSwitchoverOptions): Promise<Operation>
[src]

Switches over from the primary instance to the designated DR replica instance.

@param instance

Cloud SQL read replica instance name.

@param project

ID of the project that contains the replica.

§
instancesTruncateLog(instance: string, project: string, req: InstancesTruncateLogRequest): Promise<Operation>
[src]

Truncate MySQL general and slow query log tables MySQL only.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the Cloud SQL project.

§
instancesUpdate(instance: string, project: string, req: DatabaseInstance): Promise<Operation>
[src]

Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
operationsCancel(operation: string, project: string): Promise<Empty>
[src]

Cancels an instance operation that has been performed on an instance.

@param operation

Instance operation ID.

@param project

Project ID of the project that contains the instance.

§
operationsGet(operation: string, project: string): Promise<Operation>
[src]

Retrieves an instance operation that has been performed on an instance.

@param operation

Instance operation ID.

@param project

Project ID of the project that contains the instance.

§
operationsList(project: string, opts?: OperationsListOptions): Promise<OperationsListResponse>
[src]

Lists all instance operations that have been performed on the given Cloud SQL instance in the reverse chronological order of the start time.

@param project

Project ID of the project that contains the instance.

§
projectsInstancesGetDiskShrinkConfig(instance: string, project: string): Promise<SqlInstancesGetDiskShrinkConfigResponse>
[src]

Get Disk Shrink Config for a given instance.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
projectsInstancesGetLatestRecoveryTime(instance: string, project: string): Promise<SqlInstancesGetLatestRecoveryTimeResponse>
[src]

Get Latest Recovery Time for a given instance.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
projectsInstancesPerformDiskShrink(instance: string, project: string, req: PerformDiskShrinkContext): Promise<Operation>
[src]

Perform Disk Shrink on primary instance.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
projectsInstancesRescheduleMaintenance(instance: string, project: string, req: SqlInstancesRescheduleMaintenanceRequestBody): Promise<Operation>
[src]

Reschedules the maintenance on the given instance.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

ID of the project that contains the instance.

§
projectsInstancesResetReplicaSize(instance: string, project: string, req: SqlInstancesResetReplicaSizeRequest): Promise<Operation>
[src]

Reset Replica Size to primary instance disk size.

@param instance

Cloud SQL read replica instance name.

@param project

ID of the project that contains the read replica.

§
projectsInstancesStartExternalSync(instance: string, project: string, req: SqlInstancesStartExternalSyncRequest): Promise<Operation>
[src]

Start External primary instance migration.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

ID of the project that contains the instance.

§
projectsInstancesVerifyExternalSyncSettings(instance: string, project: string, req: SqlInstancesVerifyExternalSyncSettingsRequest): Promise<SqlInstancesVerifyExternalSyncSettingsResponse>
[src]

Verify External primary instance external sync settings.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
sslCertsCreateEphemeral(instance: string, project: string, req: SslCertsCreateEphemeralRequest): Promise<SslCert>
[src]

Generates a short-lived X509 certificate containing the provided public key and signed by a private key specific to the target instance. Users may use the certificate to authenticate as themselves when connecting to the database.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the Cloud SQL project.

§
sslCertsDelete(instance: string, project: string, sha1Fingerprint: string): Promise<Operation>
[src]

Deletes the SSL certificate. For First Generation instances, the certificate remains valid until the instance is restarted.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

@param sha1Fingerprint

Sha1 FingerPrint.

§
sslCertsGet(instance: string, project: string, sha1Fingerprint: string): Promise<SslCert>
[src]

Retrieves a particular SSL certificate. Does not include the private key (required for usage). The private key must be saved from the response to initial creation.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

@param sha1Fingerprint

Sha1 FingerPrint.

§
sslCertsInsert(instance: string, project: string, req: SslCertsInsertRequest): Promise<SslCertsInsertResponse>
[src]

Creates an SSL certificate and returns it along with the private key and server certificate authority. The new certificate will not be usable until the instance is restarted.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
sslCertsList(instance: string, project: string): Promise<SslCertsListResponse>
[src]

Lists all of the current SSL certificates for the instance.

@param instance

Cloud SQL instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
tiersList(project: string): Promise<TiersListResponse>
[src]

Lists all available machine types (tiers) for Cloud SQL, for example, db-custom-1-3840. For more information, see https://cloud.google.com/sql/pricing.

@param project

Project ID of the project for which to list tiers.

§
usersDelete(instance: string, project: string, opts?: UsersDeleteOptions): Promise<Operation>
[src]

Deletes a user from a Cloud SQL instance.

@param instance

Database instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
usersGet(instance: string, name: string, project: string, opts?: UsersGetOptions): Promise<User>
[src]

Retrieves a resource containing information about a user.

@param instance

Database instance ID. This does not include the project ID.

@param name

User of the instance.

@param project

Project ID of the project that contains the instance.

§
usersInsert(instance: string, project: string, req: User): Promise<Operation>
[src]

Creates a new user in a Cloud SQL instance.

@param instance

Database instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
usersList(instance: string, project: string): Promise<UsersListResponse>
[src]

Lists users in the specified Cloud SQL instance.

@param instance

Database instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.

§
usersUpdate(instance: string, project: string, req: User, opts?: UsersUpdateOptions): Promise<Operation>
[src]

Updates an existing user in a Cloud SQL instance.

@param instance

Database instance ID. This does not include the project ID.

@param project

Project ID of the project that contains the instance.