Class v1.PolicyBasedRoutingServiceClient (3.2.0)

Policy-Based Routing allows GCP customers to specify flexibile routing policies for Layer 4 traffic traversing through the connected service. v1

Package

@google-cloud/network-connectivity

Constructors

(constructor)(opts, gaxInstance)

constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);

Construct an instance of PolicyBasedRoutingServiceClient.

Parameters
NameDescription
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 PolicyBasedRoutingServiceClient({fallback: true}, gax); ```

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;

iamClient

iamClient: IamClient;

innerApiCalls

innerApiCalls: {
        [name: string]: Function;
    };

locationsClient

locationsClient: LocationsClient;

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

pathTemplates: {
        [name: string]: gax.PathTemplate;
    };

policyBasedRoutingServiceStub

policyBasedRoutingServiceStub?: Promise<{
        [name: string]: Function;
    }>;

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

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
NameDescription
request CancelOperationRequest

The request object that will be sent.

options 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
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});

checkCreatePolicyBasedRouteProgress(name)

checkCreatePolicyBasedRouteProgress(name: string): Promise<LROperation<protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute, protos.google.cloud.networkconnectivity.v1.OperationMetadata>>;

Check the status of the long running operation returned by createPolicyBasedRoute().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.networkconnectivity.v1.PolicyBasedRoute, protos.google.cloud.networkconnectivity.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 for more details and examples.

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 parent resource's name of the PolicyBasedRoute.
   */
  // const parent = 'abc123'
  /**
   *  Required. Unique id for the Policy Based Route to create.
   */
  // const policyBasedRouteId = 'abc123'
  /**
   *  Required. Initial values for a new Policy Based Route.
   */
  // const policyBasedRoute = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Networkconnectivity library
  const {PolicyBasedRoutingServiceClient} = require('@google-cloud/network-connectivity').v1;

  // Instantiates a client
  const networkconnectivityClient = new PolicyBasedRoutingServiceClient();

  async function callCreatePolicyBasedRoute() {
    // Construct request
    const request = {
      parent,
      policyBasedRouteId,
      policyBasedRoute,
    };

    // Run request
    const [operation] = await networkconnectivityClient.createPolicyBasedRoute(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreatePolicyBasedRoute();

checkDeletePolicyBasedRouteProgress(name)

checkDeletePolicyBasedRouteProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.networkconnectivity.v1.OperationMetadata>>;

Check the status of the long running operation returned by deletePolicyBasedRoute().

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.networkconnectivity.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 for more details and examples.

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. Name of the PolicyBasedRoute resource to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Networkconnectivity library
  const {PolicyBasedRoutingServiceClient} = require('@google-cloud/network-connectivity').v1;

  // Instantiates a client
  const networkconnectivityClient = new PolicyBasedRoutingServiceClient();

  async function callDeletePolicyBasedRoute() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await networkconnectivityClient.deletePolicyBasedRoute(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeletePolicyBasedRoute();

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
TypeDescription
Promise<void>

{Promise} A promise that resolves when the client is closed.

createPolicyBasedRoute(request, options)

createPolicyBasedRoute(request?: protos.google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new PolicyBasedRoute in a given project and location.

Parameters
NameDescription
request ICreatePolicyBasedRouteRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, protos.google.cloud.networkconnectivity.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 promise() method returns a promise you can await for. Please see the documentation for more details and examples.

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 parent resource's name of the PolicyBasedRoute.
   */
  // const parent = 'abc123'
  /**
   *  Required. Unique id for the Policy Based Route to create.
   */
  // const policyBasedRouteId = 'abc123'
  /**
   *  Required. Initial values for a new Policy Based Route.
   */
  // const policyBasedRoute = {}
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes since the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Networkconnectivity library
  const {PolicyBasedRoutingServiceClient} = require('@google-cloud/network-connectivity').v1;

  // Instantiates a client
  const networkconnectivityClient = new PolicyBasedRoutingServiceClient();

  async function callCreatePolicyBasedRoute() {
    // Construct request
    const request = {
      parent,
      policyBasedRouteId,
      policyBasedRoute,
    };

    // Run request
    const [operation] = await networkconnectivityClient.createPolicyBasedRoute(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callCreatePolicyBasedRoute();

createPolicyBasedRoute(request, options, callback)

createPolicyBasedRoute(request: protos.google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreatePolicyBasedRouteRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createPolicyBasedRoute(request, callback)

createPolicyBasedRoute(request: protos.google.cloud.networkconnectivity.v1.ICreatePolicyBasedRouteRequest, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreatePolicyBasedRouteRequest
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
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
NameDescription
request DeleteOperationRequest

The request object that will be sent.

options 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
TypeDescription
Promise<protos.google.protobuf.Empty>
Example

const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});

deletePolicyBasedRoute(request, options)

deletePolicyBasedRoute(request?: protos.google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a single PolicyBasedRoute.

Parameters
NameDescription
request IDeletePolicyBasedRouteRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.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 promise() method returns a promise you can await for. Please see the documentation for more details and examples.

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. Name of the PolicyBasedRoute resource to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. An optional request ID to identify requests. Specify a unique
   *  request ID so that if you must retry your request, the server will know to
   *  ignore the request if it has already been completed. The server will
   *  guarantee that for at least 60 minutes after the first request.
   *  For example, consider a situation where you make an initial request and
   *  the request times out. If you make the request again with the same request
   *  ID, the server can check if original operation with the same request ID
   *  was received, and if so, will ignore the second request. This prevents
   *  clients from accidentally creating duplicate commitments.
   *  The request ID must be a valid UUID with the exception that zero UUID is
   *  not supported (00000000-0000-0000-0000-000000000000).
   */
  // const requestId = 'abc123'

  // Imports the Networkconnectivity library
  const {PolicyBasedRoutingServiceClient} = require('@google-cloud/network-connectivity').v1;

  // Instantiates a client
  const networkconnectivityClient = new PolicyBasedRoutingServiceClient();

  async function callDeletePolicyBasedRoute() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const [operation] = await networkconnectivityClient.deletePolicyBasedRoute(request);
    const [response] = await operation.promise();
    console.log(response);
  }

  callDeletePolicyBasedRoute();

deletePolicyBasedRoute(request, options, callback)

deletePolicyBasedRoute(request: protos.google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeletePolicyBasedRouteRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deletePolicyBasedRoute(request, callback)

deletePolicyBasedRoute(request: protos.google.cloud.networkconnectivity.v1.IDeletePolicyBasedRouteRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeletePolicyBasedRouteRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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);

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
NameDescription
request GetOperationRequest

The request object that will be sent.

options 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
TypeDescription
Promise<[protos.google.longrunning.Operation]>
Example

const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)

getPolicyBasedRoute(request, options)

getPolicyBasedRoute(request?: protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute,
        (protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest | undefined),
        {} | undefined
    ]>;

Gets details of a single PolicyBasedRoute.

Parameters
NameDescription
request IGetPolicyBasedRouteRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, (protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest | undefined), {} | undefined ]>

{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

  /**
   * 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 the PolicyBasedRoute resource to get.
   */
  // const name = 'abc123'

  // Imports the Networkconnectivity library
  const {PolicyBasedRoutingServiceClient} = require('@google-cloud/network-connectivity').v1;

  // Instantiates a client
  const networkconnectivityClient = new PolicyBasedRoutingServiceClient();

  async function callGetPolicyBasedRoute() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await networkconnectivityClient.getPolicyBasedRoute(request);
    console.log(response);
  }

  callGetPolicyBasedRoute();

getPolicyBasedRoute(request, options, callback)

getPolicyBasedRoute(request: protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest, options: CallOptions, callback: Callback<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetPolicyBasedRouteRequest
options CallOptions
callback Callback<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getPolicyBasedRoute(request, callback)

getPolicyBasedRoute(request: protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest, callback: Callback<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetPolicyBasedRouteRequest
callback Callback<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute, protos.google.cloud.networkconnectivity.v1.IGetPolicyBasedRouteRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

getProjectId(): Promise<string>;
Returns
TypeDescription
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
NameDescription
callback Callback<string, undefined, undefined>
Returns
TypeDescription
void

groupPath(project, hub, group)

groupPath(project: string, hub: string, group: string): string;

Return a fully-qualified group resource name string.

Parameters
NameDescription
project string
hub string
group string
Returns
TypeDescription
string

{string} Resource name string.

hubPath(project, hub)

hubPath(project: string, hub: string): string;

Return a fully-qualified hub resource name string.

Parameters
NameDescription
project string
hub string
Returns
TypeDescription
string

{string} Resource name string.

hubRoutePath(project, hub, routeTable, route)

hubRoutePath(project: string, hub: string, routeTable: string, route: string): string;

Return a fully-qualified hubRoute resource name string.

Parameters
NameDescription
project string
hub string
routeTable string
route string
Returns
TypeDescription
string

{string} Resource name string.

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
TypeDescription
Promise<{ [name: string]: Function; }>

{Promise} A promise that resolves to an authenticated service stub.

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
NameDescription
request LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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
}

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
NameDescription
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
TypeDescription
AsyncIterable<protos.google.longrunning.ListOperationsResponse>

{Object} An iterable Object that conforms to iteration protocols.

Example

const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)

listPolicyBasedRoutes(request, options)

listPolicyBasedRoutes(request?: protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute[],
        protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest | null,
        protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse
    ]>;

Lists PolicyBasedRoutes in a given project and location.

Parameters
NameDescription
request IListPolicyBasedRoutesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute[], protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest | null, protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse ]>

{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 listPolicyBasedRoutesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listPolicyBasedRoutes(request, options, callback)

listPolicyBasedRoutes(request: protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute>): void;
Parameters
NameDescription
request IListPolicyBasedRoutesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute>
Returns
TypeDescription
void

listPolicyBasedRoutes(request, callback)

listPolicyBasedRoutes(request: protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute>): void;
Parameters
NameDescription
request IListPolicyBasedRoutesRequest
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute>
Returns
TypeDescription
void

listPolicyBasedRoutesAsync(request, options)

listPolicyBasedRoutesAsync(request?: protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute>;

Equivalent to listPolicyBasedRoutes, but returns an iterable object.

for-await-of syntax is used with the iterable to get response elements on-demand.

Parameters
NameDescription
request IListPolicyBasedRoutesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.networkconnectivity.v1.IPolicyBasedRoute>

{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

  /**
   * 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 parent resource's name.
   */
  // const parent = 'abc123'
  /**
   *  The maximum number of results per page that should be returned.
   */
  // const pageSize = 1234
  /**
   *  The page token.
   */
  // const pageToken = 'abc123'
  /**
   *  A filter expression that filters the results listed in the response.
   */
  // const filter = 'abc123'
  /**
   *  Sort the results by a certain order.
   */
  // const orderBy = 'abc123'

  // Imports the Networkconnectivity library
  const {PolicyBasedRoutingServiceClient} = require('@google-cloud/network-connectivity').v1;

  // Instantiates a client
  const networkconnectivityClient = new PolicyBasedRoutingServiceClient();

  async function callListPolicyBasedRoutes() {
    // Construct request
    const request = {
      parent,
    };

    // Run request
    const iterable = await networkconnectivityClient.listPolicyBasedRoutesAsync(request);
    for await (const response of iterable) {
        console.log(response);
    }
  }

  callListPolicyBasedRoutes();

listPolicyBasedRoutesStream(request, options)

listPolicyBasedRoutesStream(request?: protos.google.cloud.networkconnectivity.v1.IListPolicyBasedRoutesRequest, options?: CallOptions): Transform;

Equivalent to method.name.toCamelCase(), but returns a NodeJS Stream object.

Parameters
NameDescription
request IListPolicyBasedRoutesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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 listPolicyBasedRoutesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

locationPath(project, location)

locationPath(project: string, location: string): string;

Return a fully-qualified location resource name string.

Parameters
NameDescription
project string
location string
Returns
TypeDescription
string

{string} Resource name string.

matchGroupFromGroupName(groupName)

matchGroupFromGroupName(groupName: string): string | number;

Parse the group from Group resource.

Parameter
NameDescription
groupName string

A fully-qualified path representing Group resource.

Returns
TypeDescription
string | number

{string} A string representing the group.

matchHubFromGroupName(groupName)

matchHubFromGroupName(groupName: string): string | number;

Parse the hub from Group resource.

Parameter
NameDescription
groupName string

A fully-qualified path representing Group resource.

Returns
TypeDescription
string | number

{string} A string representing the hub.

matchHubFromHubName(hubName)

matchHubFromHubName(hubName: string): string | number;

Parse the hub from Hub resource.

Parameter
NameDescription
hubName string

A fully-qualified path representing Hub resource.

Returns
TypeDescription
string | number

{string} A string representing the hub.

matchHubFromHubRouteName(hubRouteName)

matchHubFromHubRouteName(hubRouteName: string): string | number;

Parse the hub from HubRoute resource.

Parameter
NameDescription
hubRouteName string

A fully-qualified path representing HubRoute resource.

Returns
TypeDescription
string | number

{string} A string representing the hub.

matchHubFromRouteTableName(routeTableName)

matchHubFromRouteTableName(routeTableName: string): string | number;

Parse the hub from RouteTable resource.

Parameter
NameDescription
routeTableName string

A fully-qualified path representing RouteTable resource.

Returns
TypeDescription
string | number

{string} A string representing the hub.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromSpokeName(spokeName)

matchLocationFromSpokeName(spokeName: string): string | number;

Parse the location from Spoke resource.

Parameter
NameDescription
spokeName string

A fully-qualified path representing Spoke resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchPolicyBasedRouteFromPolicyBasedRouteName(policyBasedRouteName)

matchPolicyBasedRouteFromPolicyBasedRouteName(policyBasedRouteName: string): string | number;

Parse the policy_based_route from PolicyBasedRoute resource.

Parameter
NameDescription
policyBasedRouteName string

A fully-qualified path representing PolicyBasedRoute resource.

Returns
TypeDescription
string | number

{string} A string representing the policy_based_route.

matchProjectFromGroupName(groupName)

matchProjectFromGroupName(groupName: string): string | number;

Parse the project from Group resource.

Parameter
NameDescription
groupName string

A fully-qualified path representing Group resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromHubName(hubName)

matchProjectFromHubName(hubName: string): string | number;

Parse the project from Hub resource.

Parameter
NameDescription
hubName string

A fully-qualified path representing Hub resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromHubRouteName(hubRouteName)

matchProjectFromHubRouteName(hubRouteName: string): string | number;

Parse the project from HubRoute resource.

Parameter
NameDescription
hubRouteName string

A fully-qualified path representing HubRoute resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
NameDescription
locationName string

A fully-qualified path representing Location resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromNetworkName(networkName)

matchProjectFromNetworkName(networkName: string): string | number;

Parse the project from Network resource.

Parameter
NameDescription
networkName string

A fully-qualified path representing Network resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromPolicyBasedRouteName(policyBasedRouteName)

matchProjectFromPolicyBasedRouteName(policyBasedRouteName: string): string | number;

Parse the project from PolicyBasedRoute resource.

Parameter
NameDescription
policyBasedRouteName string

A fully-qualified path representing PolicyBasedRoute resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromRouteTableName(routeTableName)

matchProjectFromRouteTableName(routeTableName: string): string | number;

Parse the project from RouteTable resource.

Parameter
NameDescription
routeTableName string

A fully-qualified path representing RouteTable resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromSpokeName(spokeName)

matchProjectFromSpokeName(spokeName: string): string | number;

Parse the project from Spoke resource.

Parameter
NameDescription
spokeName string

A fully-qualified path representing Spoke resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchResourceIdFromNetworkName(networkName)

matchResourceIdFromNetworkName(networkName: string): string | number;

Parse the resource_id from Network resource.

Parameter
NameDescription
networkName string

A fully-qualified path representing Network resource.

Returns
TypeDescription
string | number

{string} A string representing the resource_id.

matchRouteFromHubRouteName(hubRouteName)

matchRouteFromHubRouteName(hubRouteName: string): string | number;

Parse the route from HubRoute resource.

Parameter
NameDescription
hubRouteName string

A fully-qualified path representing HubRoute resource.

Returns
TypeDescription
string | number

{string} A string representing the route.

matchRouteTableFromHubRouteName(hubRouteName)

matchRouteTableFromHubRouteName(hubRouteName: string): string | number;

Parse the route_table from HubRoute resource.

Parameter
NameDescription
hubRouteName string

A fully-qualified path representing HubRoute resource.

Returns
TypeDescription
string | number

{string} A string representing the route_table.

matchRouteTableFromRouteTableName(routeTableName)

matchRouteTableFromRouteTableName(routeTableName: string): string | number;

Parse the route_table from RouteTable resource.

Parameter
NameDescription
routeTableName string

A fully-qualified path representing RouteTable resource.

Returns
TypeDescription
string | number

{string} A string representing the route_table.

matchSpokeFromSpokeName(spokeName)

matchSpokeFromSpokeName(spokeName: string): string | number;

Parse the spoke from Spoke resource.

Parameter
NameDescription
spokeName string

A fully-qualified path representing Spoke resource.

Returns
TypeDescription
string | number

{string} A string representing the spoke.

networkPath(project, resourceId)

networkPath(project: string, resourceId: string): string;

Return a fully-qualified network resource name string.

Parameters
NameDescription
project string
resourceId string
Returns
TypeDescription
string

{string} Resource name string.

policyBasedRoutePath(project, policyBasedRoute)

policyBasedRoutePath(project: string, policyBasedRoute: string): string;

Return a fully-qualified policyBasedRoute resource name string.

Parameters
NameDescription
project string
policyBasedRoute string
Returns
TypeDescription
string

{string} Resource name string.

routeTablePath(project, hub, routeTable)

routeTablePath(project: string, hub: string, routeTable: string): string;

Return a fully-qualified routeTable resource name string.

Parameters
NameDescription
project string
hub string
routeTable string
Returns
TypeDescription
string

{string} Resource name string.

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
NameDescription
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
TypeDescription
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.

spokePath(project, location, spoke)

spokePath(project: string, location: string, spoke: string): string;

Return a fully-qualified spoke resource name string.

Parameters
NameDescription
project string
location string
spoke string
Returns
TypeDescription
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
NameDescription
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
TypeDescription
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.