Service for interactions with CloudSQL. v1beta
Package
@google-cloud/alloydbConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);Construct an instance of AlloyDBCSQLAdminClient.
| Parameters | |
|---|---|
| Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof fallback
: loaded instance of |
Properties
alloyDBCSQLAdminStub
alloyDBCSQLAdminStub?: Promise<{
[name: string]: Function;
}>;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
auth: gax.GoogleAuth;descriptors
descriptors: Descriptors;iamClient
iamClient: IamClient;innerApiCalls
innerApiCalls: {
[name: string]: Function;
};locationsClient
locationsClient: LocationsClient;operationsClient
operationsClient: gax.OperationsClient;pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};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.
universeDomain
get universeDomain(): string;warn
warn: (code: string, message: string, warnType?: string) => void;Methods
backupPath(project, location, backup)
backupPath(project: string, location: string, backup: string): string;Return a fully-qualified backup resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
backup |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
cancelOperation(request, optionsOrCallback, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.
| Parameters | |
|---|---|
| Name | Description |
request |
CancelOperationRequest
The request object that will be sent. |
optionsOrCallback |
CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
|
callback |
Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
| Returns | |
|---|---|
| Type | Description |
Promise<protos.google.protobuf.Empty> |
|
const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});
checkRestoreFromCloudSQLProgress(name)
checkRestoreFromCloudSQLProgress(name: string): Promise<LROperation<protos.google.cloud.alloydb.v1beta.Cluster, protos.google.cloud.alloydb.v1beta.OperationMetadata>>;Check the status of the long running operation returned by restoreFromCloudSQL().
| Parameter | |
|---|---|
| Name | Description |
name |
string
The operation name that will be passed. |
| Returns | |
|---|---|
| Type | Description |
Promise<LROperation<protos.google.cloud.alloydb.v1beta.Cluster, protos.google.cloud.alloydb.v1beta.OperationMetadata>> |
{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples. |
/**
* 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.
*/
/**
* Cluster created from CloudSQL backup run.
*/
// const cloudsqlBackupRunSource = {}
/**
* Required. The location of the new cluster. For the required format, see the
* comment on Cluster.name field.
*/
// const parent = 'abc123'
/**
* Required. ID of the requesting object.
*/
// const clusterId = 'abc123'
/**
* Required. The resource being created
*/
// const cluster = {}
// Imports the Alloydb library
const {AlloyDBCSQLAdminClient} = require('@google-cloud/alloydb').v1beta;
// Instantiates a client
const alloydbClient = new AlloyDBCSQLAdminClient();
async function callRestoreFromCloudSQL() {
// Construct request
const request = {
parent,
clusterId,
cluster,
};
// Run request
const [operation] = await alloydbClient.restoreFromCloudSQL(request);
const [response] = await operation.promise();
console.log(response);
}
callRestoreFromCloudSQL();
close()
close(): Promise<void>;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. |
clusterPath(project, location, cluster)
clusterPath(project: string, location: string, cluster: string): string;Return a fully-qualified cluster resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
cluster |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
connectionInfoPath(project, location, cluster, instance)
connectionInfoPath(project: string, location: string, cluster: string, instance: string): string;Return a fully-qualified connectionInfo resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
cluster |
string
|
instance |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
databasePath(project, location, cluster, database)
databasePath(project: string, location: string, cluster: string, database: string): string;Return a fully-qualified database resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
cluster |
string
|
database |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
deleteOperation(request, optionsOrCallback, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.
| Parameters | |
|---|---|
| Name | Description |
request |
DeleteOperationRequest
The request object that will be sent. |
optionsOrCallback |
CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
|
callback |
Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call. |
| Returns | |
|---|---|
| Type | Description |
Promise<protos.google.protobuf.Empty> |
|
const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});
getIamPolicy(request, options, callback)
getIamPolicy(request: IamProtos.google.iam.v1.GetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
| Parameters | |
|---|---|
| Name | Description |
request |
IamProtos.google.iam.v1.GetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<google.iam.v1.Policy, google.iam.v1.GetIamPolicyRequest | null | undefined, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . |
| Returns | |
|---|---|
| Type | Description |
Promise<[google.iam.v1.Policy]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
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. |
const [response] = await client.getLocation(request);
getOperation(request, optionsOrCallback, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
| Parameters | |
|---|---|
| Name | Description |
request |
GetOperationRequest
The request object that will be sent. |
optionsOrCallback |
CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
|
callback |
Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
| Returns | |
|---|---|
| Type | Description |
Promise<[protos.google.longrunning.Operation]> |
|
const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)
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 |
|
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. |
instancePath(project, location, cluster, instance)
instancePath(project: string, location: string, cluster: string, instance: string): string;Return a fully-qualified instance resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
cluster |
string
|
instance |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
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. |
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
listOperationsAsync(request, options)
listOperationsAsync(request: protos.google.longrunning.ListOperationsRequest, options?: gax.CallOptions): AsyncIterable<protos.google.longrunning.IOperation>;Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
| Parameters | |
|---|---|
| Name | Description |
request |
ListOperationsRequest
The request object that will be sent. |
options |
CallOptions
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
| Returns | |
|---|---|
| Type | Description |
AsyncIterable<protos.google.longrunning.IOperation> |
{Object} An iterable Object that conforms to iteration protocols. |
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
locationPath(project, location)
locationPath(project: string, location: string): string;Return a fully-qualified location resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
matchBackupFromBackupName(backupName)
matchBackupFromBackupName(backupName: string): string | number;Parse the backup from Backup resource.
| Parameter | |
|---|---|
| Name | Description |
backupName |
string
A fully-qualified path representing Backup resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the backup. |
matchClusterFromClusterName(clusterName)
matchClusterFromClusterName(clusterName: string): string | number;Parse the cluster from Cluster resource.
| Parameter | |
|---|---|
| Name | Description |
clusterName |
string
A fully-qualified path representing Cluster resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the cluster. |
matchClusterFromConnectionInfoName(connectionInfoName)
matchClusterFromConnectionInfoName(connectionInfoName: string): string | number;Parse the cluster from ConnectionInfo resource.
| Parameter | |
|---|---|
| Name | Description |
connectionInfoName |
string
A fully-qualified path representing ConnectionInfo resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the cluster. |
matchClusterFromDatabaseName(databaseName)
matchClusterFromDatabaseName(databaseName: string): string | number;Parse the cluster from Database resource.
| Parameter | |
|---|---|
| Name | Description |
databaseName |
string
A fully-qualified path representing Database resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the cluster. |
matchClusterFromInstanceName(instanceName)
matchClusterFromInstanceName(instanceName: string): string | number;Parse the cluster from Instance resource.
| Parameter | |
|---|---|
| Name | Description |
instanceName |
string
A fully-qualified path representing Instance resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the cluster. |
matchClusterFromUserName(userName)
matchClusterFromUserName(userName: string): string | number;Parse the cluster from User resource.
| Parameter | |
|---|---|
| Name | Description |
userName |
string
A fully-qualified path representing User resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the cluster. |
matchDatabaseFromDatabaseName(databaseName)
matchDatabaseFromDatabaseName(databaseName: string): string | number;Parse the database from Database resource.
| Parameter | |
|---|---|
| Name | Description |
databaseName |
string
A fully-qualified path representing Database resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the database. |
matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName)
matchFlagFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string): string | number;Parse the flag from SupportedDatabaseFlag resource.
| Parameter | |
|---|---|
| Name | Description |
supportedDatabaseFlagName |
string
A fully-qualified path representing SupportedDatabaseFlag resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the flag. |
matchInstanceFromConnectionInfoName(connectionInfoName)
matchInstanceFromConnectionInfoName(connectionInfoName: string): string | number;Parse the instance from ConnectionInfo resource.
| Parameter | |
|---|---|
| Name | Description |
connectionInfoName |
string
A fully-qualified path representing ConnectionInfo resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the instance. |
matchInstanceFromInstanceName(instanceName)
matchInstanceFromInstanceName(instanceName: string): string | number;Parse the instance from Instance resource.
| Parameter | |
|---|---|
| Name | Description |
instanceName |
string
A fully-qualified path representing Instance resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the instance. |
matchLocationFromBackupName(backupName)
matchLocationFromBackupName(backupName: string): string | number;Parse the location from Backup resource.
| Parameter | |
|---|---|
| Name | Description |
backupName |
string
A fully-qualified path representing Backup resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromClusterName(clusterName)
matchLocationFromClusterName(clusterName: string): string | number;Parse the location from Cluster resource.
| Parameter | |
|---|---|
| Name | Description |
clusterName |
string
A fully-qualified path representing Cluster resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromConnectionInfoName(connectionInfoName)
matchLocationFromConnectionInfoName(connectionInfoName: string): string | number;Parse the location from ConnectionInfo resource.
| Parameter | |
|---|---|
| Name | Description |
connectionInfoName |
string
A fully-qualified path representing ConnectionInfo resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromDatabaseName(databaseName)
matchLocationFromDatabaseName(databaseName: string): string | number;Parse the location from Database resource.
| Parameter | |
|---|---|
| Name | Description |
databaseName |
string
A fully-qualified path representing Database resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromInstanceName(instanceName)
matchLocationFromInstanceName(instanceName: string): string | number;Parse the location from Instance resource.
| Parameter | |
|---|---|
| Name | Description |
instanceName |
string
A fully-qualified path representing Instance resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromLocationName(locationName)
matchLocationFromLocationName(locationName: string): string | number;Parse the location from Location resource.
| Parameter | |
|---|---|
| Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName)
matchLocationFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string): string | number;Parse the location from SupportedDatabaseFlag resource.
| Parameter | |
|---|---|
| Name | Description |
supportedDatabaseFlagName |
string
A fully-qualified path representing SupportedDatabaseFlag resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchLocationFromUserName(userName)
matchLocationFromUserName(userName: string): string | number;Parse the location from User resource.
| Parameter | |
|---|---|
| Name | Description |
userName |
string
A fully-qualified path representing User resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the location. |
matchProjectFromBackupName(backupName)
matchProjectFromBackupName(backupName: string): string | number;Parse the project from Backup resource.
| Parameter | |
|---|---|
| Name | Description |
backupName |
string
A fully-qualified path representing Backup resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromClusterName(clusterName)
matchProjectFromClusterName(clusterName: string): string | number;Parse the project from Cluster resource.
| Parameter | |
|---|---|
| Name | Description |
clusterName |
string
A fully-qualified path representing Cluster resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromConnectionInfoName(connectionInfoName)
matchProjectFromConnectionInfoName(connectionInfoName: string): string | number;Parse the project from ConnectionInfo resource.
| Parameter | |
|---|---|
| Name | Description |
connectionInfoName |
string
A fully-qualified path representing ConnectionInfo resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromDatabaseName(databaseName)
matchProjectFromDatabaseName(databaseName: string): string | number;Parse the project from Database resource.
| Parameter | |
|---|---|
| Name | Description |
databaseName |
string
A fully-qualified path representing Database resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromInstanceName(instanceName)
matchProjectFromInstanceName(instanceName: string): string | number;Parse the project from Instance resource.
| Parameter | |
|---|---|
| Name | Description |
instanceName |
string
A fully-qualified path representing Instance resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromLocationName(locationName)
matchProjectFromLocationName(locationName: string): string | number;Parse the project from Location resource.
| Parameter | |
|---|---|
| Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;Parse the project from Project resource.
| Parameter | |
|---|---|
| Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName)
matchProjectFromSupportedDatabaseFlagName(supportedDatabaseFlagName: string): string | number;Parse the project from SupportedDatabaseFlag resource.
| Parameter | |
|---|---|
| Name | Description |
supportedDatabaseFlagName |
string
A fully-qualified path representing SupportedDatabaseFlag resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchProjectFromUserName(userName)
matchProjectFromUserName(userName: string): string | number;Parse the project from User resource.
| Parameter | |
|---|---|
| Name | Description |
userName |
string
A fully-qualified path representing User resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the project. |
matchUserFromUserName(userName)
matchUserFromUserName(userName: string): string | number;Parse the user from User resource.
| Parameter | |
|---|---|
| Name | Description |
userName |
string
A fully-qualified path representing User resource. |
| Returns | |
|---|---|
| Type | Description |
string | number |
{string} A string representing the user. |
projectPath(project)
projectPath(project: string): string;Return a fully-qualified project resource name string.
| Parameter | |
|---|---|
| Name | Description |
project |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
restoreFromCloudSQL(request, options)
restoreFromCloudSQL(request?: protos.google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;Restores an AlloyDB cluster from a CloudSQL resource.
| Parameters | |
|---|---|
| Name | Description |
request |
IRestoreFromCloudSQLRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
| Returns | |
|---|---|
| Type | Description |
Promise<[
LROperation<protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its |
/**
* 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.
*/
/**
* Cluster created from CloudSQL backup run.
*/
// const cloudsqlBackupRunSource = {}
/**
* Required. The location of the new cluster. For the required format, see the
* comment on Cluster.name field.
*/
// const parent = 'abc123'
/**
* Required. ID of the requesting object.
*/
// const clusterId = 'abc123'
/**
* Required. The resource being created
*/
// const cluster = {}
// Imports the Alloydb library
const {AlloyDBCSQLAdminClient} = require('@google-cloud/alloydb').v1beta;
// Instantiates a client
const alloydbClient = new AlloyDBCSQLAdminClient();
async function callRestoreFromCloudSQL() {
// Construct request
const request = {
parent,
clusterId,
cluster,
};
// Run request
const [operation] = await alloydbClient.restoreFromCloudSQL(request);
const [response] = await operation.promise();
console.log(response);
}
callRestoreFromCloudSQL();
restoreFromCloudSQL(request, options, callback)
restoreFromCloudSQL(request: protos.google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IRestoreFromCloudSQLRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
restoreFromCloudSQL(request, callback)
restoreFromCloudSQL(request: protos.google.cloud.alloydb.v1beta.IRestoreFromCloudSQLRequest, callback: Callback<LROperation<protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;| Parameters | |
|---|---|
| Name | Description |
request |
IRestoreFromCloudSQLRequest
|
callback |
Callback<LROperation<protos.google.cloud.alloydb.v1beta.ICluster, protos.google.cloud.alloydb.v1beta.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
| Returns | |
|---|---|
| Type | Description |
void |
|
setIamPolicy(request, options, callback)
setIamPolicy(request: IamProtos.google.iam.v1.SetIamPolicyRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.Policy, IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.Policy]>;Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
| Parameters | |
|---|---|
| Name | Description |
request |
IamProtos.google.iam.v1.SetIamPolicyRequest
The request object that will be sent. |
options |
CallOptions | Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<google.iam.v1.Policy, google.iam.v1.SetIamPolicyRequest | null | undefined, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . |
| Returns | |
|---|---|
| Type | Description |
Promise<[google.iam.v1.Policy]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
supportedDatabaseFlagPath(project, location, flag)
supportedDatabaseFlagPath(project: string, location: string, flag: string): string;Return a fully-qualified supportedDatabaseFlag resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
flag |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |
testIamPermissions(request, options, callback)
testIamPermissions(request: IamProtos.google.iam.v1.TestIamPermissionsRequest, options?: gax.CallOptions | Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>, callback?: Callback<IamProtos.google.iam.v1.TestIamPermissionsResponse, IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>): Promise<[IamProtos.google.iam.v1.TestIamPermissionsResponse]>;Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
| Parameters | |
|---|---|
| Name | Description |
request |
IamProtos.google.iam.v1.TestIamPermissionsRequest
The request object that will be sent. |
options |
CallOptions | Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
callback |
Callback<google.iam.v1.TestIamPermissionsResponse, google.iam.v1.TestIamPermissionsRequest | null | undefined, {} | null | undefined>
The function which will be called with the result of the API call. The second parameter to the callback is an object representing . |
| Returns | |
|---|---|
| Type | Description |
Promise<[google.iam.v1.TestIamPermissionsResponse]> |
{Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call. |
userPath(project, location, cluster, user)
userPath(project: string, location: string, cluster: string, user: string): string;Return a fully-qualified user resource name string.
| Parameters | |
|---|---|
| Name | Description |
project |
string
|
location |
string
|
cluster |
string
|
user |
string
|
| Returns | |
|---|---|
| Type | Description |
string |
{string} Resource name string. |