Service to manage Cloud SQL instances. v1
Package
@google-cloud/sql
Constructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of SqlInstancesServiceClient.
Parameters |
Name |
Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of google-gax . Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new SqlInstancesServiceClient({fallback: true}, gax); ```
|
Properties
apiEndpoint
get apiEndpoint(): string;
The DNS address for this API service.
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath.
auth
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
locationsClient
locationsClient: LocationsClient;
port
static get port(): number;
The port for this API service.
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
sqlInstancesServiceStub
sqlInstancesServiceStub?: Promise<{
[name: string]: Function;
}>;
universeDomain
get universeDomain(): string;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
addServerCa(request, options)
addServerCa(request?: protos.google.cloud.sql.v1.ISqlInstancesAddServerCaRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesAddServerCaRequest | undefined,
{} | undefined
]>;
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.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callAddServerCa() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.addServerCa(request);
console.log(response);
}
callAddServerCa();
addServerCa(request, options, callback)
addServerCa(request: protos.google.cloud.sql.v1.ISqlInstancesAddServerCaRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesAddServerCaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
addServerCa(request, callback)
addServerCa(request: protos.google.cloud.sql.v1.ISqlInstancesAddServerCaRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesAddServerCaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
clone(request, options)
clone(request?: protos.google.cloud.sql.v1.ISqlInstancesCloneRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesCloneRequest | undefined,
{} | undefined
]>;
Creates a Cloud SQL instance as a clone of the source instance. Using this operation might cause your instance to restart.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* The ID of the Cloud SQL instance to be cloned (source). This does not
* include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the source as well as the clone Cloud SQL instance.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callClone() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.clone(request);
console.log(response);
}
callClone();
clone(request, options, callback)
clone(request: protos.google.cloud.sql.v1.ISqlInstancesCloneRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesCloneRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
clone(request, callback)
clone(request: protos.google.cloud.sql.v1.ISqlInstancesCloneRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesCloneRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
close()
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns |
Type |
Description |
Promise<void> |
{Promise} A promise that resolves when the client is closed.
|
createEphemeral(request, options)
createEphemeral(request?: protos.google.cloud.sql.v1.ISqlInstancesCreateEphemeralCertRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.ISslCert,
(protos.google.cloud.sql.v1.ISqlInstancesCreateEphemeralCertRequest | undefined),
{} | undefined
]>;
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.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the Cloud SQL project.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callCreateEphemeral() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.createEphemeral(request);
console.log(response);
}
callCreateEphemeral();
createEphemeral(request, options, callback)
createEphemeral(request: protos.google.cloud.sql.v1.ISqlInstancesCreateEphemeralCertRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.ISslCert, protos.google.cloud.sql.v1.ISqlInstancesCreateEphemeralCertRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
createEphemeral(request, callback)
createEphemeral(request: protos.google.cloud.sql.v1.ISqlInstancesCreateEphemeralCertRequest, callback: Callback<protos.google.cloud.sql.v1.ISslCert, protos.google.cloud.sql.v1.ISqlInstancesCreateEphemeralCertRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
delete(request, options)
delete(request?: protos.google.cloud.sql.v1.ISqlInstancesDeleteRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesDeleteRequest | undefined,
{} | undefined
]>;
Deletes a Cloud SQL instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance to be deleted.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callDelete() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.delete(request);
console.log(response);
}
callDelete();
delete(request, options, callback)
delete(request: protos.google.cloud.sql.v1.ISqlInstancesDeleteRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesDeleteRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
delete(request, callback)
delete(request: protos.google.cloud.sql.v1.ISqlInstancesDeleteRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesDeleteRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
demote(request, options)
demote(request?: protos.google.cloud.sql.v1.ISqlInstancesDemoteRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesDemoteRequest | undefined,
{} | undefined
]>;
Demotes an existing standalone instance to be a Cloud SQL read replica for an external database server.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Cloud SQL instance name.
*/
// const instance = 'abc123'
/**
* Required. ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
* Required. The request body.
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callDemote() {
// Construct request
const request = {
instance,
project,
body,
};
// Run request
const response = await sqlClient.demote(request);
console.log(response);
}
callDemote();
demote(request, options, callback)
demote(request: protos.google.cloud.sql.v1.ISqlInstancesDemoteRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesDemoteRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
demote(request, callback)
demote(request: protos.google.cloud.sql.v1.ISqlInstancesDemoteRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesDemoteRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
demoteMaster(request, options)
demoteMaster(request?: protos.google.cloud.sql.v1.ISqlInstancesDemoteMasterRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesDemoteMasterRequest | undefined,
{} | undefined
]>;
Demotes the stand-alone instance to be a Cloud SQL read replica for an external database server.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance name.
*/
// const instance = 'abc123'
/**
* ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callDemoteMaster() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.demoteMaster(request);
console.log(response);
}
callDemoteMaster();
demoteMaster(request, options, callback)
demoteMaster(request: protos.google.cloud.sql.v1.ISqlInstancesDemoteMasterRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesDemoteMasterRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
demoteMaster(request, callback)
demoteMaster(request: protos.google.cloud.sql.v1.ISqlInstancesDemoteMasterRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesDemoteMasterRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
export(request, options)
export(request?: protos.google.cloud.sql.v1.ISqlInstancesExportRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesExportRequest | undefined,
{} | undefined
]>;
Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL dump or CSV file.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance to be exported.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callExport() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.export(request);
console.log(response);
}
callExport();
export(request, options, callback)
export(request: protos.google.cloud.sql.v1.ISqlInstancesExportRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesExportRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
export(request, callback)
export(request: protos.google.cloud.sql.v1.ISqlInstancesExportRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesExportRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
failover(request, options)
failover(request?: protos.google.cloud.sql.v1.ISqlInstancesFailoverRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesFailoverRequest | undefined,
{} | undefined
]>;
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](https://cloud.google.com/sql/docs/mysql/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.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* ID of the project that contains the read replica.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callFailover() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.failover(request);
console.log(response);
}
callFailover();
failover(request, options, callback)
failover(request: protos.google.cloud.sql.v1.ISqlInstancesFailoverRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesFailoverRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
failover(request, callback)
failover(request: protos.google.cloud.sql.v1.ISqlInstancesFailoverRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesFailoverRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
get(request, options)
get(request?: protos.google.cloud.sql.v1.ISqlInstancesGetRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IDatabaseInstance,
protos.google.cloud.sql.v1.ISqlInstancesGetRequest | undefined,
{} | undefined
]>;
Retrieves a resource containing information about a Cloud SQL instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Database instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callGet() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.get(request);
console.log(response);
}
callGet();
get(request, options, callback)
get(request: protos.google.cloud.sql.v1.ISqlInstancesGetRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IDatabaseInstance, protos.google.cloud.sql.v1.ISqlInstancesGetRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
get(request, callback)
get(request: protos.google.cloud.sql.v1.ISqlInstancesGetRequest, callback: Callback<protos.google.cloud.sql.v1.IDatabaseInstance, protos.google.cloud.sql.v1.ISqlInstancesGetRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
getDiskShrinkConfig(request, options)
getDiskShrinkConfig(request?: protos.google.cloud.sql.v1.ISqlInstancesGetDiskShrinkConfigRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.ISqlInstancesGetDiskShrinkConfigResponse,
(protos.google.cloud.sql.v1.ISqlInstancesGetDiskShrinkConfigRequest | undefined),
{} | undefined
]>;
Get Disk Shrink Config for a given instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callGetDiskShrinkConfig() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.getDiskShrinkConfig(request);
console.log(response);
}
callGetDiskShrinkConfig();
getDiskShrinkConfig(request, options, callback)
getDiskShrinkConfig(request: protos.google.cloud.sql.v1.ISqlInstancesGetDiskShrinkConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.ISqlInstancesGetDiskShrinkConfigResponse, protos.google.cloud.sql.v1.ISqlInstancesGetDiskShrinkConfigRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
getDiskShrinkConfig(request, callback)
getDiskShrinkConfig(request: protos.google.cloud.sql.v1.ISqlInstancesGetDiskShrinkConfigRequest, callback: Callback<protos.google.cloud.sql.v1.ISqlInstancesGetDiskShrinkConfigResponse, protos.google.cloud.sql.v1.ISqlInstancesGetDiskShrinkConfigRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
getLatestRecoveryTime(request, options)
getLatestRecoveryTime(request?: protos.google.cloud.sql.v1.ISqlInstancesGetLatestRecoveryTimeRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.ISqlInstancesGetLatestRecoveryTimeResponse,
(protos.google.cloud.sql.v1.ISqlInstancesGetLatestRecoveryTimeRequest | undefined),
{} | undefined
]>;
Get Latest Recovery Time for a given instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callGetLatestRecoveryTime() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.getLatestRecoveryTime(request);
console.log(response);
}
callGetLatestRecoveryTime();
getLatestRecoveryTime(request, options, callback)
getLatestRecoveryTime(request: protos.google.cloud.sql.v1.ISqlInstancesGetLatestRecoveryTimeRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.ISqlInstancesGetLatestRecoveryTimeResponse, protos.google.cloud.sql.v1.ISqlInstancesGetLatestRecoveryTimeRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
getLatestRecoveryTime(request, callback)
getLatestRecoveryTime(request: protos.google.cloud.sql.v1.ISqlInstancesGetLatestRecoveryTimeRequest, callback: Callback<protos.google.cloud.sql.v1.ISqlInstancesGetLatestRecoveryTimeResponse, protos.google.cloud.sql.v1.ISqlInstancesGetLatestRecoveryTimeRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
getLocation(request, options, callback)
getLocation(request: LocationProtos.google.cloud.location.IGetLocationRequest, options?: gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>, callback?: Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>): Promise<LocationProtos.google.cloud.location.ILocation>;
Gets information about a location.
Parameters |
Name |
Description |
request |
LocationProtos.google.cloud.location.IGetLocationRequest
The request object that will be sent.
|
options |
CallOptions | Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Call options. See CallOptions for more details.
|
callback |
Callback<google.cloud.location.ILocation, google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
|
Returns |
Type |
Description |
Promise<google.cloud.location.ILocation> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the documentation for more details and examples.
|
Example
const [response] = await client.getLocation(request);
getProjectId()
getProjectId(): Promise<string>;
Returns |
Type |
Description |
Promise<string> |
|
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter |
Name |
Description |
callback |
Callback<string, undefined, undefined>
|
Returns |
Type |
Description |
void |
|
import(request, options)
import(request?: protos.google.cloud.sql.v1.ISqlInstancesImportRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesImportRequest | undefined,
{} | undefined
]>;
Imports data into a Cloud SQL instance from a SQL dump or CSV file in Cloud Storage.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callImport() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.import(request);
console.log(response);
}
callImport();
import(request, options, callback)
import(request: protos.google.cloud.sql.v1.ISqlInstancesImportRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesImportRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
import(request, callback)
import(request: protos.google.cloud.sql.v1.ISqlInstancesImportRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesImportRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns |
Type |
Description |
Promise<{
[name: string]: Function;
}> |
{Promise} A promise that resolves to an authenticated service stub.
|
insert(request, options)
insert(request?: protos.google.cloud.sql.v1.ISqlInstancesInsertRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesInsertRequest | undefined,
{} | undefined
]>;
Creates a new Cloud SQL instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Project ID of the project to which the newly created Cloud SQL instances
* should belong.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callInsert() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.insert(request);
console.log(response);
}
callInsert();
insert(request, options, callback)
insert(request: protos.google.cloud.sql.v1.ISqlInstancesInsertRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesInsertRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
insert(request, callback)
insert(request: protos.google.cloud.sql.v1.ISqlInstancesInsertRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesInsertRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
list(request, options)
list(request?: protos.google.cloud.sql.v1.ISqlInstancesListRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IInstancesListResponse,
protos.google.cloud.sql.v1.ISqlInstancesListRequest | undefined,
{} | undefined
]>;
Lists instances under a given project.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* A filter expression that filters resources listed in the response.
* The expression is in the form of field:value. For example,
* 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
* their JSON representation, such as 'settings.userLabels.auto_start:true'.
* Multiple filter queries are space-separated. For example.
* 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
* expression is an AND expression. However, you can include AND and OR
* expressions explicitly.
*/
// const filter = 'abc123'
/**
* The maximum number of instances to return. The service may return fewer
* than this value.
* If unspecified, at most 500 instances are returned.
* The maximum value is 1000; values above 1000 are coerced to 1000.
*/
// const maxResults = 1234
/**
* A previously-returned page token representing part of the larger set of
* results to view.
*/
// const pageToken = 'abc123'
/**
* Project ID of the project for which to list Cloud SQL instances.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callList() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.list(request);
console.log(response);
}
callList();
list(request, options, callback)
list(request: protos.google.cloud.sql.v1.ISqlInstancesListRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IInstancesListResponse, protos.google.cloud.sql.v1.ISqlInstancesListRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
list(request, callback)
list(request: protos.google.cloud.sql.v1.ISqlInstancesListRequest, callback: Callback<protos.google.cloud.sql.v1.IInstancesListResponse, protos.google.cloud.sql.v1.ISqlInstancesListRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
listLocationsAsync(request, options)
listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;
Lists information about the supported locations for this service. Returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters |
Name |
Description |
request |
LocationProtos.google.cloud.location.IListLocationsRequest
The request object that will be sent.
|
options |
CallOptions
Call options. See CallOptions for more details.
|
Returns |
Type |
Description |
AsyncIterable<google.cloud.location.ILocation> |
{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.
|
Example
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
listServerCas(request, options)
listServerCas(request?: protos.google.cloud.sql.v1.ISqlInstancesListServerCasRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IInstancesListServerCasResponse,
protos.google.cloud.sql.v1.ISqlInstancesListServerCasRequest | undefined,
{} | undefined
]>;
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.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callListServerCas() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.listServerCas(request);
console.log(response);
}
callListServerCas();
listServerCas(request, options, callback)
listServerCas(request: protos.google.cloud.sql.v1.ISqlInstancesListServerCasRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IInstancesListServerCasResponse, protos.google.cloud.sql.v1.ISqlInstancesListServerCasRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
listServerCas(request, callback)
listServerCas(request: protos.google.cloud.sql.v1.ISqlInstancesListServerCasRequest, callback: Callback<protos.google.cloud.sql.v1.IInstancesListServerCasResponse, protos.google.cloud.sql.v1.ISqlInstancesListServerCasRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
patch(request, options)
patch(request?: protos.google.cloud.sql.v1.ISqlInstancesPatchRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesPatchRequest | undefined,
{} | undefined
]>;
Partially updates settings of a Cloud SQL instance by merging the request with the current configuration. This method supports patch semantics.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callPatch() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.patch(request);
console.log(response);
}
callPatch();
patch(request, options, callback)
patch(request: protos.google.cloud.sql.v1.ISqlInstancesPatchRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesPatchRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
patch(request, callback)
patch(request: protos.google.cloud.sql.v1.ISqlInstancesPatchRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesPatchRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
performDiskShrink(request?: protos.google.cloud.sql.v1.ISqlInstancesPerformDiskShrinkRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
(protos.google.cloud.sql.v1.ISqlInstancesPerformDiskShrinkRequest | undefined),
{} | undefined
]>;
Perform Disk Shrink on primary instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
* Perform disk shrink context.
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callPerformDiskShrink() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.performDiskShrink(request);
console.log(response);
}
callPerformDiskShrink();
performDiskShrink(request: protos.google.cloud.sql.v1.ISqlInstancesPerformDiskShrinkRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesPerformDiskShrinkRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
performDiskShrink(request: protos.google.cloud.sql.v1.ISqlInstancesPerformDiskShrinkRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesPerformDiskShrinkRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
promoteReplica(request?: protos.google.cloud.sql.v1.ISqlInstancesPromoteReplicaRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesPromoteReplicaRequest | undefined,
{} | undefined
]>;
Promotes the read replica instance to be a stand-alone Cloud SQL instance. Using this operation might cause your instance to restart.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL read replica instance name.
*/
// const instance = 'abc123'
/**
* ID of the project that contains the read replica.
*/
// const project = 'my-project'
/**
* Set to true if the promote operation should attempt to re-add the original
* primary as a replica when it comes back online. Otherwise, if this value is
* false or not set, the original primary will be a standalone instance.
*/
// const failover = true
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callPromoteReplica() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.promoteReplica(request);
console.log(response);
}
callPromoteReplica();
promoteReplica(request: protos.google.cloud.sql.v1.ISqlInstancesPromoteReplicaRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesPromoteReplicaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
promoteReplica(request: protos.google.cloud.sql.v1.ISqlInstancesPromoteReplicaRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesPromoteReplicaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
reencrypt(request, options)
reencrypt(request?: protos.google.cloud.sql.v1.ISqlInstancesReencryptRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesReencryptRequest | undefined,
{} | undefined
]>;
Reencrypt CMEK instance with latest key version.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
* Reencrypt body that users request
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callReencrypt() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.reencrypt(request);
console.log(response);
}
callReencrypt();
reencrypt(request, options, callback)
reencrypt(request: protos.google.cloud.sql.v1.ISqlInstancesReencryptRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesReencryptRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
reencrypt(request, callback)
reencrypt(request: protos.google.cloud.sql.v1.ISqlInstancesReencryptRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesReencryptRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
rescheduleMaintenance(request, options)
rescheduleMaintenance(request?: protos.google.cloud.sql.v1.ISqlInstancesRescheduleMaintenanceRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
(protos.google.cloud.sql.v1.ISqlInstancesRescheduleMaintenanceRequest | undefined),
{} | undefined
]>;
Reschedules the maintenance on the given instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callRescheduleMaintenance() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.rescheduleMaintenance(request);
console.log(response);
}
callRescheduleMaintenance();
rescheduleMaintenance(request, options, callback)
rescheduleMaintenance(request: protos.google.cloud.sql.v1.ISqlInstancesRescheduleMaintenanceRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesRescheduleMaintenanceRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
rescheduleMaintenance(request, callback)
rescheduleMaintenance(request: protos.google.cloud.sql.v1.ISqlInstancesRescheduleMaintenanceRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesRescheduleMaintenanceRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
resetReplicaSize(request, options)
resetReplicaSize(request?: protos.google.cloud.sql.v1.ISqlInstancesResetReplicaSizeRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
(protos.google.cloud.sql.v1.ISqlInstancesResetReplicaSizeRequest | undefined),
{} | undefined
]>;
Reset Replica Size to primary instance disk size.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL read replica instance name.
*/
// const instance = 'abc123'
/**
* ID of the project that contains the read replica.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callResetReplicaSize() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.resetReplicaSize(request);
console.log(response);
}
callResetReplicaSize();
resetReplicaSize(request, options, callback)
resetReplicaSize(request: protos.google.cloud.sql.v1.ISqlInstancesResetReplicaSizeRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesResetReplicaSizeRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
resetReplicaSize(request, callback)
resetReplicaSize(request: protos.google.cloud.sql.v1.ISqlInstancesResetReplicaSizeRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesResetReplicaSizeRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
resetSslConfig(request, options)
resetSslConfig(request?: protos.google.cloud.sql.v1.ISqlInstancesResetSslConfigRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesResetSslConfigRequest | undefined,
{} | undefined
]>;
Deletes all client certificates and generates a new server SSL certificate for the instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callResetSslConfig() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.resetSslConfig(request);
console.log(response);
}
callResetSslConfig();
resetSslConfig(request, options, callback)
resetSslConfig(request: protos.google.cloud.sql.v1.ISqlInstancesResetSslConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesResetSslConfigRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
resetSslConfig(request, callback)
resetSslConfig(request: protos.google.cloud.sql.v1.ISqlInstancesResetSslConfigRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesResetSslConfigRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
restart(request, options)
restart(request?: protos.google.cloud.sql.v1.ISqlInstancesRestartRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesRestartRequest | undefined,
{} | undefined
]>;
Restarts a Cloud SQL instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance to be restarted.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callRestart() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.restart(request);
console.log(response);
}
callRestart();
restart(request, options, callback)
restart(request: protos.google.cloud.sql.v1.ISqlInstancesRestartRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesRestartRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
restart(request, callback)
restart(request: protos.google.cloud.sql.v1.ISqlInstancesRestartRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesRestartRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
restoreBackup(request, options)
restoreBackup(request?: protos.google.cloud.sql.v1.ISqlInstancesRestoreBackupRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesRestoreBackupRequest | undefined,
{} | undefined
]>;
Restores a backup of a Cloud SQL instance. Using this operation might cause your instance to restart.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callRestoreBackup() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.restoreBackup(request);
console.log(response);
}
callRestoreBackup();
restoreBackup(request, options, callback)
restoreBackup(request: protos.google.cloud.sql.v1.ISqlInstancesRestoreBackupRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesRestoreBackupRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
restoreBackup(request, callback)
restoreBackup(request: protos.google.cloud.sql.v1.ISqlInstancesRestoreBackupRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesRestoreBackupRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
rotateServerCa(request, options)
rotateServerCa(request?: protos.google.cloud.sql.v1.ISqlInstancesRotateServerCaRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesRotateServerCaRequest | undefined,
{} | undefined
]>;
Rotates the server certificate to one signed by the Certificate Authority (CA) version previously added with the addServerCA method.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callRotateServerCa() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.rotateServerCa(request);
console.log(response);
}
callRotateServerCa();
rotateServerCa(request, options, callback)
rotateServerCa(request: protos.google.cloud.sql.v1.ISqlInstancesRotateServerCaRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesRotateServerCaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
rotateServerCa(request, callback)
rotateServerCa(request: protos.google.cloud.sql.v1.ISqlInstancesRotateServerCaRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesRotateServerCaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
startExternalSync(request, options)
startExternalSync(request?: protos.google.cloud.sql.v1.ISqlInstancesStartExternalSyncRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
(protos.google.cloud.sql.v1.ISqlInstancesStartExternalSyncRequest | undefined),
{} | undefined
]>;
Start External primary instance migration.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
* External sync mode.
*/
// const syncMode = {}
/**
* Whether to skip the verification step (VESS).
*/
// const skipVerification = true
/**
* MySQL-specific settings for start external sync.
*/
// const mysqlSyncConfig = {}
/**
* Optional. Parallel level for initial data sync. Currently only applicable
* for MySQL.
*/
// const syncParallelLevel = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callStartExternalSync() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.startExternalSync(request);
console.log(response);
}
callStartExternalSync();
startExternalSync(request, options, callback)
startExternalSync(request: protos.google.cloud.sql.v1.ISqlInstancesStartExternalSyncRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesStartExternalSyncRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
startExternalSync(request, callback)
startExternalSync(request: protos.google.cloud.sql.v1.ISqlInstancesStartExternalSyncRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesStartExternalSyncRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
startReplica(request, options)
startReplica(request?: protos.google.cloud.sql.v1.ISqlInstancesStartReplicaRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesStartReplicaRequest | undefined,
{} | undefined
]>;
Starts the replication in the read replica instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL read replica instance name.
*/
// const instance = 'abc123'
/**
* ID of the project that contains the read replica.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callStartReplica() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.startReplica(request);
console.log(response);
}
callStartReplica();
startReplica(request, options, callback)
startReplica(request: protos.google.cloud.sql.v1.ISqlInstancesStartReplicaRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesStartReplicaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
startReplica(request, callback)
startReplica(request: protos.google.cloud.sql.v1.ISqlInstancesStartReplicaRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesStartReplicaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
stopReplica(request, options)
stopReplica(request?: protos.google.cloud.sql.v1.ISqlInstancesStopReplicaRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesStopReplicaRequest | undefined,
{} | undefined
]>;
Stops the replication in the read replica instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL read replica instance name.
*/
// const instance = 'abc123'
/**
* ID of the project that contains the read replica.
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callStopReplica() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.stopReplica(request);
console.log(response);
}
callStopReplica();
stopReplica(request, options, callback)
stopReplica(request: protos.google.cloud.sql.v1.ISqlInstancesStopReplicaRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesStopReplicaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
stopReplica(request, callback)
stopReplica(request: protos.google.cloud.sql.v1.ISqlInstancesStopReplicaRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesStopReplicaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
switchover(request, options)
switchover(request?: protos.google.cloud.sql.v1.ISqlInstancesSwitchoverRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesSwitchoverRequest | undefined,
{} | undefined
]>;
Switches over from the primary instance to the replica instance.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL read replica instance name.
*/
// const instance = 'abc123'
/**
* ID of the project that contains the replica.
*/
// const project = 'my-project'
/**
* Optional. (MySQL only) Cloud SQL instance operations timeout, which is a
* sum of all database operations. Default value is 10 minutes and can be
* modified to a maximum value of 24 hours.
*/
// const dbTimeout = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callSwitchover() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.switchover(request);
console.log(response);
}
callSwitchover();
switchover(request, options, callback)
switchover(request: protos.google.cloud.sql.v1.ISqlInstancesSwitchoverRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesSwitchoverRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
switchover(request, callback)
switchover(request: protos.google.cloud.sql.v1.ISqlInstancesSwitchoverRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesSwitchoverRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
truncateLog(request, options)
truncateLog(request?: protos.google.cloud.sql.v1.ISqlInstancesTruncateLogRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesTruncateLogRequest | undefined,
{} | undefined
]>;
Truncate MySQL general and slow query log tables MySQL only.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the Cloud SQL project.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callTruncateLog() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.truncateLog(request);
console.log(response);
}
callTruncateLog();
truncateLog(request, options, callback)
truncateLog(request: protos.google.cloud.sql.v1.ISqlInstancesTruncateLogRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesTruncateLogRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
truncateLog(request, callback)
truncateLog(request: protos.google.cloud.sql.v1.ISqlInstancesTruncateLogRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesTruncateLogRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
update(request, options)
update(request?: protos.google.cloud.sql.v1.ISqlInstancesUpdateRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.IOperation,
protos.google.cloud.sql.v1.ISqlInstancesUpdateRequest | undefined,
{} | undefined
]>;
Updates settings of a Cloud SQL instance. Using this operation might cause your instance to restart.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callUpdate() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.update(request);
console.log(response);
}
callUpdate();
update(request, options, callback)
update(request: protos.google.cloud.sql.v1.ISqlInstancesUpdateRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesUpdateRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
update(request, callback)
update(request: protos.google.cloud.sql.v1.ISqlInstancesUpdateRequest, callback: Callback<protos.google.cloud.sql.v1.IOperation, protos.google.cloud.sql.v1.ISqlInstancesUpdateRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
verifyExternalSyncSettings(request, options)
verifyExternalSyncSettings(request?: protos.google.cloud.sql.v1.ISqlInstancesVerifyExternalSyncSettingsRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1.ISqlInstancesVerifyExternalSyncSettingsResponse,
(protos.google.cloud.sql.v1.ISqlInstancesVerifyExternalSyncSettingsRequest | undefined),
{} | undefined
]>;
Verify External primary instance external sync settings.
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Cloud SQL instance ID. This does not include the project ID.
*/
// const instance = 'abc123'
/**
* Project ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
* Flag to enable verifying connection only
*/
// const verifyConnectionOnly = true
/**
* External sync mode
*/
// const syncMode = {}
/**
* Optional. Flag to verify settings required by replication setup only
*/
// const verifyReplicationOnly = true
/**
* Optional. MySQL-specific settings for start external sync.
*/
// const mysqlSyncConfig = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callVerifyExternalSyncSettings() {
// Construct request
const request = {
};
// Run request
const response = await sqlClient.verifyExternalSyncSettings(request);
console.log(response);
}
callVerifyExternalSyncSettings();
verifyExternalSyncSettings(request, options, callback)
verifyExternalSyncSettings(request: protos.google.cloud.sql.v1.ISqlInstancesVerifyExternalSyncSettingsRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1.ISqlInstancesVerifyExternalSyncSettingsResponse, protos.google.cloud.sql.v1.ISqlInstancesVerifyExternalSyncSettingsRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
verifyExternalSyncSettings(request, callback)
verifyExternalSyncSettings(request: protos.google.cloud.sql.v1.ISqlInstancesVerifyExternalSyncSettingsRequest, callback: Callback<protos.google.cloud.sql.v1.ISqlInstancesVerifyExternalSyncSettingsResponse, protos.google.cloud.sql.v1.ISqlInstancesVerifyExternalSyncSettingsRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|