Serverless VPC Access API allows users to create and manage connectors for App Engine, Cloud Functions and Cloud Run to have internal connections to Virtual Private Cloud networks. v1
Package
@google-cloud/vpc-accessConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of VpcAccessServiceClient.
Parameters | |
---|---|
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof gax.fallback
: loaded instance of |
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
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.
vpcAccessServiceStub
vpcAccessServiceStub?: Promise<{
[name: string]: Function;
}>;
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
cancelOperation(request, options, callback)
cancelOperation(request: protos.google.longrunning.CancelOperationRequest, options?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | 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 |
protos.google.longrunning.CancelOperationRequest
The request object that will be sent. |
options |
gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.CancelOperationRequest, {} | undefined | null>
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<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: ''});
checkCreateConnectorProgress(name)
checkCreateConnectorProgress(name: string): Promise<LROperation<protos.google.cloud.vpcaccess.v1.Connector, protos.google.cloud.vpcaccess.v1.OperationMetadata>>;
Check the status of the long running operation returned by createConnector()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.cloud.vpcaccess.v1.Connector, protos.google.cloud.vpcaccess.v1.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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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.
*/
/**
* Required. The project and location in which the configuration should be created,
* specified in the format `projects/* /locations/*`.
*/
// const parent = 'abc123'
/**
* Required. The ID to use for this connector.
*/
// const connectorId = 'abc123'
/**
* Required. Resource to create.
*/
// const connector = {}
// Imports the Vpcaccess library
const {VpcAccessServiceClient} = require('@google-cloud/vpc-access').v1;
// Instantiates a client
const vpcaccessClient = new VpcAccessServiceClient();
async function callCreateConnector() {
// Construct request
const request = {
parent,
connectorId,
connector,
};
// Run request
const [operation] = await vpcaccessClient.createConnector(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateConnector();
checkDeleteConnectorProgress(name)
checkDeleteConnectorProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.vpcaccess.v1.OperationMetadata>>;
Check the status of the long running operation returned by deleteConnector()
.
Parameter | |
---|---|
Name | Description |
name |
string
The operation name that will be passed. |
Returns | |
---|---|
Type | Description |
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.vpcaccess.v1.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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) 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.
*/
/**
* Required. Name of a Serverless VPC Access connector to delete.
*/
// const name = 'abc123'
// Imports the Vpcaccess library
const {VpcAccessServiceClient} = require('@google-cloud/vpc-access').v1;
// Instantiates a client
const vpcaccessClient = new VpcAccessServiceClient();
async function callDeleteConnector() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await vpcaccessClient.deleteConnector(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteConnector();
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. |
connectorPath(project, location, connector)
connectorPath(project: string, location: string, connector: string): string;
Return a fully-qualified connector resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
connector |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
createConnector(request, options)
createConnector(request?: protos.google.cloud.vpcaccess.v1.ICreateConnectorRequest, options?: CallOptions): Promise<[
LROperation<protos.google.cloud.vpcaccess.v1.IConnector, protos.google.cloud.vpcaccess.v1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Creates a Serverless VPC Access connector, returns an operation.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.ICreateConnectorRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.cloud.vpcaccess.v1.IConnector, protos.google.cloud.vpcaccess.v1.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.
*/
/**
* Required. The project and location in which the configuration should be created,
* specified in the format `projects/* /locations/*`.
*/
// const parent = 'abc123'
/**
* Required. The ID to use for this connector.
*/
// const connectorId = 'abc123'
/**
* Required. Resource to create.
*/
// const connector = {}
// Imports the Vpcaccess library
const {VpcAccessServiceClient} = require('@google-cloud/vpc-access').v1;
// Instantiates a client
const vpcaccessClient = new VpcAccessServiceClient();
async function callCreateConnector() {
// Construct request
const request = {
parent,
connectorId,
connector,
};
// Run request
const [operation] = await vpcaccessClient.createConnector(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateConnector();
createConnector(request, options, callback)
createConnector(request: protos.google.cloud.vpcaccess.v1.ICreateConnectorRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.vpcaccess.v1.IConnector, protos.google.cloud.vpcaccess.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.ICreateConnectorRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.cloud.vpcaccess.v1.IConnector, protos.google.cloud.vpcaccess.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
createConnector(request, callback)
createConnector(request: protos.google.cloud.vpcaccess.v1.ICreateConnectorRequest, callback: Callback<LROperation<protos.google.cloud.vpcaccess.v1.IConnector, protos.google.cloud.vpcaccess.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.ICreateConnectorRequest
|
callback |
Callback<LROperation<protos.google.cloud.vpcaccess.v1.IConnector, protos.google.cloud.vpcaccess.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteConnector(request, options)
deleteConnector(request?: protos.google.cloud.vpcaccess.v1.IDeleteConnectorRequest, options?: CallOptions): Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vpcaccess.v1.IOperationMetadata>,
protos.google.longrunning.IOperation | undefined,
{} | undefined
]>;
Deletes a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.IDeleteConnectorRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vpcaccess.v1.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.
*/
/**
* Required. Name of a Serverless VPC Access connector to delete.
*/
// const name = 'abc123'
// Imports the Vpcaccess library
const {VpcAccessServiceClient} = require('@google-cloud/vpc-access').v1;
// Instantiates a client
const vpcaccessClient = new VpcAccessServiceClient();
async function callDeleteConnector() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await vpcaccessClient.deleteConnector(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteConnector();
deleteConnector(request, options, callback)
deleteConnector(request: protos.google.cloud.vpcaccess.v1.IDeleteConnectorRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vpcaccess.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.IDeleteConnectorRequest
|
options |
CallOptions
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vpcaccess.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteConnector(request, callback)
deleteConnector(request: protos.google.cloud.vpcaccess.v1.IDeleteConnectorRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vpcaccess.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.IDeleteConnectorRequest
|
callback |
Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.vpcaccess.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
deleteOperation(request, options, callback)
deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, options?: 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 |
protos.google.longrunning.DeleteOperationRequest
The request object that will be sent. |
options |
gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | 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<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: ''});
getConnector(request, options)
getConnector(request?: protos.google.cloud.vpcaccess.v1.IGetConnectorRequest, options?: CallOptions): Promise<[
protos.google.cloud.vpcaccess.v1.IConnector,
protos.google.cloud.vpcaccess.v1.IGetConnectorRequest | undefined,
{} | undefined
]>;
Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.IGetConnectorRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.vpcaccess.v1.IConnector,
protos.google.cloud.vpcaccess.v1.IGetConnectorRequest | undefined,
{} | undefined
]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing . Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) 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.
*/
/**
* Required. Name of a Serverless VPC Access connector to get.
*/
// const name = 'abc123'
// Imports the Vpcaccess library
const {VpcAccessServiceClient} = require('@google-cloud/vpc-access').v1;
// Instantiates a client
const vpcaccessClient = new VpcAccessServiceClient();
async function callGetConnector() {
// Construct request
const request = {
name,
};
// Run request
const response = await vpcaccessClient.getConnector(request);
console.log(response);
}
callGetConnector();
getConnector(request, options, callback)
getConnector(request: protos.google.cloud.vpcaccess.v1.IGetConnectorRequest, options: CallOptions, callback: Callback<protos.google.cloud.vpcaccess.v1.IConnector, protos.google.cloud.vpcaccess.v1.IGetConnectorRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.IGetConnectorRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.vpcaccess.v1.IConnector, protos.google.cloud.vpcaccess.v1.IGetConnectorRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
void |
getConnector(request, callback)
getConnector(request: protos.google.cloud.vpcaccess.v1.IGetConnectorRequest, callback: Callback<protos.google.cloud.vpcaccess.v1.IConnector, protos.google.cloud.vpcaccess.v1.IGetConnectorRequest | null | undefined, {} | null | undefined>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.IGetConnectorRequest
|
callback |
Callback<protos.google.cloud.vpcaccess.v1.IConnector, protos.google.cloud.vpcaccess.v1.IGetConnectorRequest | null | undefined, {} | null | undefined>
|
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 |
gax.CallOptions | Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
Call options. See CallOptions for more details. |
callback |
Callback<LocationProtos.google.cloud.location.ILocation, LocationProtos.google.cloud.location.IGetLocationRequest | null | undefined, {} | null | undefined>
|
Returns | |
---|---|
Type | Description |
Promise<LocationProtos.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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
const [response] = await client.getLocation(request);
getOperation(request, options, callback)
getOperation(request: protos.google.longrunning.GetOperationRequest, options?: 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 |
protos.google.longrunning.GetOperationRequest
The request object that will be sent. |
options |
gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | 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<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. |
listConnectors(request, options)
listConnectors(request?: protos.google.cloud.vpcaccess.v1.IListConnectorsRequest, options?: CallOptions): Promise<[
protos.google.cloud.vpcaccess.v1.IConnector[],
protos.google.cloud.vpcaccess.v1.IListConnectorsRequest | null,
protos.google.cloud.vpcaccess.v1.IListConnectorsResponse
]>;
Lists Serverless VPC Access connectors.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.IListConnectorsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.vpcaccess.v1.IConnector[],
protos.google.cloud.vpcaccess.v1.IListConnectorsRequest | null,
protos.google.cloud.vpcaccess.v1.IListConnectorsResponse
]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of . The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listConnectors(request, options, callback)
listConnectors(request: protos.google.cloud.vpcaccess.v1.IListConnectorsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.vpcaccess.v1.IListConnectorsRequest, protos.google.cloud.vpcaccess.v1.IListConnectorsResponse | null | undefined, protos.google.cloud.vpcaccess.v1.IConnector>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.IListConnectorsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.vpcaccess.v1.IListConnectorsRequest, protos.google.cloud.vpcaccess.v1.IListConnectorsResponse | null | undefined, protos.google.cloud.vpcaccess.v1.IConnector>
|
Returns | |
---|---|
Type | Description |
void |
listConnectors(request, callback)
listConnectors(request: protos.google.cloud.vpcaccess.v1.IListConnectorsRequest, callback: PaginationCallback<protos.google.cloud.vpcaccess.v1.IListConnectorsRequest, protos.google.cloud.vpcaccess.v1.IListConnectorsResponse | null | undefined, protos.google.cloud.vpcaccess.v1.IConnector>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.IListConnectorsRequest
|
callback |
PaginationCallback<protos.google.cloud.vpcaccess.v1.IListConnectorsRequest, protos.google.cloud.vpcaccess.v1.IListConnectorsResponse | null | undefined, protos.google.cloud.vpcaccess.v1.IConnector>
|
Returns | |
---|---|
Type | Description |
void |
listConnectorsAsync(request, options)
listConnectorsAsync(request?: protos.google.cloud.vpcaccess.v1.IListConnectorsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.vpcaccess.v1.IConnector>;
Equivalent to listConnectors
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.IListConnectorsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.vpcaccess.v1.IConnector> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) 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.
*/
/**
* Required. The project and location from which the routes should be listed.
*/
// const parent = 'abc123'
/**
* Maximum number of functions to return per call.
*/
// const pageSize = 1234
/**
* Continuation token.
*/
// const pageToken = 'abc123'
// Imports the Vpcaccess library
const {VpcAccessServiceClient} = require('@google-cloud/vpc-access').v1;
// Instantiates a client
const vpcaccessClient = new VpcAccessServiceClient();
async function callListConnectors() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await vpcaccessClient.listConnectorsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListConnectors();
listConnectorsStream(request, options)
listConnectorsStream(request?: protos.google.cloud.vpcaccess.v1.IListConnectorsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.vpcaccess.v1.IListConnectorsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Transform | {Stream} An object stream which emits an object representing on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
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<LocationProtos.google.cloud.location.ILocation> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). 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](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) 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.ListOperationsResponse>;
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 |
protos.google.longrunning.ListOperationsRequest
The request object that will be sent. |
options |
gax.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.ListOperationsResponse> | {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. |
matchConnectorFromConnectorName(connectorName)
matchConnectorFromConnectorName(connectorName: string): string | number;
Parse the connector from Connector resource.
Parameter | |
---|---|
Name | Description |
connectorName |
string
A fully-qualified path representing Connector resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the connector. |
matchLocationFromConnectorName(connectorName)
matchLocationFromConnectorName(connectorName: string): string | number;
Parse the location from Connector resource.
Parameter | |
---|---|
Name | Description |
connectorName |
string
A fully-qualified path representing Connector 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. |
matchProjectFromConnectorName(connectorName)
matchProjectFromConnectorName(connectorName: string): string | number;
Parse the project from Connector resource.
Parameter | |
---|---|
Name | Description |
connectorName |
string
A fully-qualified path representing Connector 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. |