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
acquireSsrsLease(request, options)
acquireSsrsLease(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesAcquireSsrsLeaseRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.ISqlInstancesAcquireSsrsLeaseResponse,
(protos.google.cloud.sql.v1beta4.ISqlInstancesAcquireSsrsLeaseRequest | undefined),
{} | undefined
]>;
Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
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 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).
*/
// const instance = 'abc123'
/**
* Required. ID of the project that contains the instance (Example:
* project-id).
*/
// const project = 'my-project'
/**
* The body for request to acquire an SSRS lease.
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1beta4;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callAcquireSsrsLease() {
// Construct request
const request = {
instance,
project,
};
// Run request
const response = await sqlClient.acquireSsrsLease(request);
console.log(response);
}
callAcquireSsrsLease();
acquireSsrsLease(request, options, callback)
acquireSsrsLease(request: protos.google.cloud.sql.v1beta4.ISqlInstancesAcquireSsrsLeaseRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.ISqlInstancesAcquireSsrsLeaseResponse, protos.google.cloud.sql.v1beta4.ISqlInstancesAcquireSsrsLeaseRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
acquireSsrsLease(request, callback)
acquireSsrsLease(request: protos.google.cloud.sql.v1beta4.ISqlInstancesAcquireSsrsLeaseRequest, callback: Callback<protos.google.cloud.sql.v1beta4.ISqlInstancesAcquireSsrsLeaseResponse, protos.google.cloud.sql.v1beta4.ISqlInstancesAcquireSsrsLeaseRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
addServerCa(request, options)
addServerCa(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesAddServerCaRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
(protos.google.cloud.sql.v1beta4.ISqlInstancesAddServerCaRequest | undefined),
{} | undefined
]>;
Add 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').v1beta4;
// 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.v1beta4.ISqlInstancesAddServerCaRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesAddServerCaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
addServerCa(request, callback)
addServerCa(request: protos.google.cloud.sql.v1beta4.ISqlInstancesAddServerCaRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesAddServerCaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
clone(request, options)
clone(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesCloneRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesCloneRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesCloneRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
clone(request, callback)
clone(request: protos.google.cloud.sql.v1beta4.ISqlInstancesCloneRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.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.v1beta4.ISqlInstancesCreateEphemeralCertRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.ISslCert,
(protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesCreateEphemeralCertRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.ISslCert, protos.google.cloud.sql.v1beta4.ISqlInstancesCreateEphemeralCertRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
createEphemeral(request, callback)
createEphemeral(request: protos.google.cloud.sql.v1beta4.ISqlInstancesCreateEphemeralCertRequest, callback: Callback<protos.google.cloud.sql.v1beta4.ISslCert, protos.google.cloud.sql.v1beta4.ISqlInstancesCreateEphemeralCertRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
delete(request, options)
delete(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesDeleteRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesDeleteRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesDeleteRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
delete(request, callback)
delete(request: protos.google.cloud.sql.v1beta4.ISqlInstancesDeleteRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesDeleteRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
demote(request, options)
demote(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesDemoteRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
protos.google.cloud.sql.v1beta4.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. The name of the Cloud SQL instance.
*/
// const instance = 'abc123'
/**
* Required. The project ID of the project that contains the instance.
*/
// const project = 'my-project'
/**
* The request body.
*/
// const body = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1beta4;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callDemote() {
// Construct request
const request = {
instance,
project,
};
// Run request
const response = await sqlClient.demote(request);
console.log(response);
}
callDemote();
demote(request, options, callback)
demote(request: protos.google.cloud.sql.v1beta4.ISqlInstancesDemoteRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesDemoteRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
demote(request, callback)
demote(request: protos.google.cloud.sql.v1beta4.ISqlInstancesDemoteRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesDemoteRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
demoteMaster(request, options)
demoteMaster(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesDemoteMasterRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
(protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesDemoteMasterRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesDemoteMasterRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
demoteMaster(request, callback)
demoteMaster(request: protos.google.cloud.sql.v1beta4.ISqlInstancesDemoteMasterRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesDemoteMasterRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
export(request, options)
export(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesExportRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
protos.google.cloud.sql.v1beta4.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.
*/
/**
* The Cloud SQL instance ID. This doesn't 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').v1beta4;
// 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.v1beta4.ISqlInstancesExportRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesExportRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
export(request, callback)
export(request: protos.google.cloud.sql.v1beta4.ISqlInstancesExportRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesExportRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
failover(request, options)
failover(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesFailoverRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesFailoverRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesFailoverRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
failover(request, callback)
failover(request: protos.google.cloud.sql.v1beta4.ISqlInstancesFailoverRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesFailoverRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
get(request, options)
get(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesGetRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IDatabaseInstance,
protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesGetRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IDatabaseInstance, protos.google.cloud.sql.v1beta4.ISqlInstancesGetRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
get(request, callback)
get(request: protos.google.cloud.sql.v1beta4.ISqlInstancesGetRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IDatabaseInstance, protos.google.cloud.sql.v1beta4.ISqlInstancesGetRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
getDiskShrinkConfig(request, options)
getDiskShrinkConfig(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesGetDiskShrinkConfigRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.ISqlInstancesGetDiskShrinkConfigResponse,
(protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesGetDiskShrinkConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.ISqlInstancesGetDiskShrinkConfigResponse, protos.google.cloud.sql.v1beta4.ISqlInstancesGetDiskShrinkConfigRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
getDiskShrinkConfig(request, callback)
getDiskShrinkConfig(request: protos.google.cloud.sql.v1beta4.ISqlInstancesGetDiskShrinkConfigRequest, callback: Callback<protos.google.cloud.sql.v1beta4.ISqlInstancesGetDiskShrinkConfigResponse, protos.google.cloud.sql.v1beta4.ISqlInstancesGetDiskShrinkConfigRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
getLatestRecoveryTime(request, options)
getLatestRecoveryTime(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesGetLatestRecoveryTimeRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.ISqlInstancesGetLatestRecoveryTimeResponse,
(protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesGetLatestRecoveryTimeRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.ISqlInstancesGetLatestRecoveryTimeResponse, protos.google.cloud.sql.v1beta4.ISqlInstancesGetLatestRecoveryTimeRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
getLatestRecoveryTime(request, callback)
getLatestRecoveryTime(request: protos.google.cloud.sql.v1beta4.ISqlInstancesGetLatestRecoveryTimeRequest, callback: Callback<protos.google.cloud.sql.v1beta4.ISqlInstancesGetLatestRecoveryTimeResponse, protos.google.cloud.sql.v1beta4.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.v1beta4.ISqlInstancesImportRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesImportRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesImportRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
import(request, callback)
import(request: protos.google.cloud.sql.v1beta4.ISqlInstancesImportRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.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.v1beta4.ISqlInstancesInsertRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesInsertRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesInsertRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
insert(request, callback)
insert(request: protos.google.cloud.sql.v1beta4.ISqlInstancesInsertRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesInsertRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
list(request, options)
list(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesListRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IInstancesListResponse,
protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesListRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IInstancesListResponse, protos.google.cloud.sql.v1beta4.ISqlInstancesListRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
list(request, callback)
list(request: protos.google.cloud.sql.v1beta4.ISqlInstancesListRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IInstancesListResponse, protos.google.cloud.sql.v1beta4.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.v1beta4.ISqlInstancesListServerCasRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IInstancesListServerCasResponse,
(protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesListServerCasRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IInstancesListServerCasResponse, protos.google.cloud.sql.v1beta4.ISqlInstancesListServerCasRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
listServerCas(request, callback)
listServerCas(request: protos.google.cloud.sql.v1beta4.ISqlInstancesListServerCasRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IInstancesListServerCasResponse, protos.google.cloud.sql.v1beta4.ISqlInstancesListServerCasRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
patch(request, options)
patch(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesPatchRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesPatchRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesPatchRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
patch(request, callback)
patch(request: protos.google.cloud.sql.v1beta4.ISqlInstancesPatchRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesPatchRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
performDiskShrink(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesPerformDiskShrinkRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
(protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesPerformDiskShrinkRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesPerformDiskShrinkRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
performDiskShrink(request: protos.google.cloud.sql.v1beta4.ISqlInstancesPerformDiskShrinkRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesPerformDiskShrinkRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
promoteReplica(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesPromoteReplicaRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
(protos.google.cloud.sql.v1beta4.ISqlInstancesPromoteReplicaRequest | undefined),
{} | undefined
]>;
Promotes the read replica instance to be an independent Cloud SQL primary 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 to invoke a replica failover to the designated DR replica.
* As part of replica failover, the promote operation attempts
* to add the original primary instance as a replica of the promoted
* DR replica when the original primary instance comes back online.
* If set to false or not specified, then the original primary
* instance becomes an independent Cloud SQL primary instance.
* Only applicable to MySQL.
*/
// const failover = true
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1beta4;
// 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.v1beta4.ISqlInstancesPromoteReplicaRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesPromoteReplicaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
promoteReplica(request: protos.google.cloud.sql.v1beta4.ISqlInstancesPromoteReplicaRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesPromoteReplicaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
reencrypt(request, options)
reencrypt(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesReencryptRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesReencryptRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesReencryptRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
reencrypt(request, callback)
reencrypt(request: protos.google.cloud.sql.v1beta4.ISqlInstancesReencryptRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesReencryptRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
releaseSsrsLease(request, options)
releaseSsrsLease(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesReleaseSsrsLeaseRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.ISqlInstancesReleaseSsrsLeaseResponse,
(protos.google.cloud.sql.v1beta4.ISqlInstancesReleaseSsrsLeaseRequest | undefined),
{} | undefined
]>;
Release a lease for the setup of SQL Server Reporting Services (SSRS).
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. The 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).
*/
// const instance = 'abc123'
/**
* Required. The ID of the project that contains the instance (Example:
* project-id).
*/
// const project = 'my-project'
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1beta4;
// Instantiates a client
const sqlClient = new SqlInstancesServiceClient();
async function callReleaseSsrsLease() {
// Construct request
const request = {
instance,
project,
};
// Run request
const response = await sqlClient.releaseSsrsLease(request);
console.log(response);
}
callReleaseSsrsLease();
releaseSsrsLease(request, options, callback)
releaseSsrsLease(request: protos.google.cloud.sql.v1beta4.ISqlInstancesReleaseSsrsLeaseRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.ISqlInstancesReleaseSsrsLeaseResponse, protos.google.cloud.sql.v1beta4.ISqlInstancesReleaseSsrsLeaseRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
releaseSsrsLease(request, callback)
releaseSsrsLease(request: protos.google.cloud.sql.v1beta4.ISqlInstancesReleaseSsrsLeaseRequest, callback: Callback<protos.google.cloud.sql.v1beta4.ISqlInstancesReleaseSsrsLeaseResponse, protos.google.cloud.sql.v1beta4.ISqlInstancesReleaseSsrsLeaseRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
rescheduleMaintenance(request, options)
rescheduleMaintenance(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesRescheduleMaintenanceRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
(protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesRescheduleMaintenanceRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesRescheduleMaintenanceRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
rescheduleMaintenance(request, callback)
rescheduleMaintenance(request: protos.google.cloud.sql.v1beta4.ISqlInstancesRescheduleMaintenanceRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesRescheduleMaintenanceRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
resetReplicaSize(request, options)
resetReplicaSize(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesResetReplicaSizeRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
(protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesResetReplicaSizeRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesResetReplicaSizeRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
resetReplicaSize(request, callback)
resetReplicaSize(request: protos.google.cloud.sql.v1beta4.ISqlInstancesResetReplicaSizeRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesResetReplicaSizeRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
resetSslConfig(request, options)
resetSslConfig(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesResetSslConfigRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
(protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesResetSslConfigRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesResetSslConfigRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
resetSslConfig(request, callback)
resetSslConfig(request: protos.google.cloud.sql.v1beta4.ISqlInstancesResetSslConfigRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesResetSslConfigRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
restart(request, options)
restart(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesRestartRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesRestartRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesRestartRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
restart(request, callback)
restart(request: protos.google.cloud.sql.v1beta4.ISqlInstancesRestartRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesRestartRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
restoreBackup(request, options)
restoreBackup(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesRestoreBackupRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
(protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesRestoreBackupRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesRestoreBackupRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
restoreBackup(request, callback)
restoreBackup(request: protos.google.cloud.sql.v1beta4.ISqlInstancesRestoreBackupRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesRestoreBackupRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
rotateServerCa(request, options)
rotateServerCa(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesRotateServerCaRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
(protos.google.cloud.sql.v1beta4.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').v1beta4;
// 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.v1beta4.ISqlInstancesRotateServerCaRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesRotateServerCaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
rotateServerCa(request, callback)
rotateServerCa(request: protos.google.cloud.sql.v1beta4.ISqlInstancesRotateServerCaRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesRotateServerCaRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
startExternalSync(request, options)
startExternalSync(request?: protos.google.cloud.sql.v1beta4.ISqlInstancesStartExternalSyncRequest, options?: CallOptions): Promise<[
protos.google.cloud.sql.v1beta4.IOperation,
(protos.google.cloud.sql.v1beta4.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 = {}
/**
* Optional. MigrationType configures the migration to use physical files or
* logical dump files. If not set, then the logical dump file configuration is
* used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
*/
// const migrationType = {}
// Imports the Sql library
const {SqlInstancesServiceClient} = require('@google-cloud/sql').v1beta4;
// 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.v1beta4.ISqlInstancesStartExternalSyncRequest, options: CallOptions, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesStartExternalSyncRequest | null | undefined, {} | null | undefined>): void;
Returns |
Type |
Description |
void |
|
startExternalSync(request, callback)
startExternalSync(request: protos.google.cloud.sql.v1beta4.ISqlInstancesStartExternalSyncRequest, callback: Callback<protos.google.cloud.sql.v1beta4.IOperation, protos.google.cloud.sql.v1beta4.ISqlInstancesStartExternalSyncRequest | null | undefined, {} | null | undefined>): void;