Service Interface for the Apigee Connect connection management APIs. v1
Package
@google-cloud/apigee-connectConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of ConnectionServiceClient.
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;
connectionServiceStub
connectionServiceStub?: Promise<{
[name: string]: Function;
}>;
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
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.
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
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. |
endpointPath(project, endpoint)
endpointPath(project: string, endpoint: string): string;
Return a fully-qualified endpoint resource name string.
Parameters | |
---|---|
Name | Description |
project |
string
|
endpoint |
string
|
Returns | |
---|---|
Type | Description |
string | {string} Resource name string. |
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. |
listConnections(request, options)
listConnections(request?: protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest, options?: CallOptions): Promise<[
protos.google.cloud.apigeeconnect.v1.IConnection[],
protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest | null,
protos.google.cloud.apigeeconnect.v1.IListConnectionsResponse
]>;
Lists connections that are currently active for the given Apigee Connect endpoint.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
Promise<[
protos.google.cloud.apigeeconnect.v1.IConnection[],
protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest | null,
protos.google.cloud.apigeeconnect.v1.IListConnectionsResponse
]> | {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 |
listConnections(request, options, callback)
listConnections(request: protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest, protos.google.cloud.apigeeconnect.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.apigeeconnect.v1.IConnection>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest, protos.google.cloud.apigeeconnect.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.apigeeconnect.v1.IConnection>
|
Returns | |
---|---|
Type | Description |
void |
listConnections(request, callback)
listConnections(request: protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest, callback: PaginationCallback<protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest, protos.google.cloud.apigeeconnect.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.apigeeconnect.v1.IConnection>): void;
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest
|
callback |
PaginationCallback<protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest, protos.google.cloud.apigeeconnect.v1.IListConnectionsResponse | null | undefined, protos.google.cloud.apigeeconnect.v1.IConnection>
|
Returns | |
---|---|
Type | Description |
void |
listConnectionsAsync(request, options)
listConnectionsAsync(request?: protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.apigeeconnect.v1.IConnection>;
Equivalent to listConnections
, 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.apigeeconnect.v1.IListConnectionsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Returns | |
---|---|
Type | Description |
AsyncIterable<protos.google.cloud.apigeeconnect.v1.IConnection> | {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. Parent name of the form:
* `projects/{project_number or project_id}/endpoints/{endpoint}`.
*/
// const parent = 'abc123'
/**
* The maximum number of connections to return. The service may return fewer
* than this value. If unspecified, at most 100 connections will be returned.
* The maximum value is 1000; values above 1000 will be coerced to 1000.
*/
// const pageSize = 1234
/**
* A page token, received from a previous `ListConnections` call.
* Provide this to retrieve the subsequent page.
* When paginating, all other parameters provided to `ListConnections` must
* match the call that provided the page token.
*/
// const pageToken = 'abc123'
// Imports the Apigeeconnect library
const {ConnectionServiceClient} = require('@google-cloud/apigee-connect').v1;
// Instantiates a client
const apigeeconnectClient = new ConnectionServiceClient();
async function callListConnections() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await apigeeconnectClient.listConnectionsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListConnections();
listConnectionsStream(request, options)
listConnectionsStream(request?: protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters | |
---|---|
Name | Description |
request |
protos.google.cloud.apigeeconnect.v1.IListConnectionsRequest
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 |
matchEndpointFromEndpointName(endpointName)
matchEndpointFromEndpointName(endpointName: string): string | number;
Parse the endpoint from Endpoint resource.
Parameter | |
---|---|
Name | Description |
endpointName |
string
A fully-qualified path representing Endpoint resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the endpoint. |
matchProjectFromEndpointName(endpointName)
matchProjectFromEndpointName(endpointName: string): string | number;
Parse the project from Endpoint resource.
Parameter | |
---|---|
Name | Description |
endpointName |
string
A fully-qualified path representing Endpoint resource. |
Returns | |
---|---|
Type | Description |
string | number | {string} A string representing the project. |