Class v1beta1.NetworkServicesClient (0.7.0)

v1beta1

Package

@google-cloud/networkservices

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of NetworkServicesClient.

Parameters
Name Description
opts ClientOptions
gaxInstance typeof gax | typeof fallback

: loaded instance of google-gax. Useful if you need to avoid loading the default gRPC version and want to use the fallback HTTP implementation. Load only fallback version and pass it to the constructor: ``` const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC const client = new NetworkServicesClient({fallback: true}, gax); ```

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

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

networkServicesStub

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

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

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

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

The scopes needed to make gRPC calls for every method defined in this service.

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

warn: (code: string, message: string, warnType?: string) => void;

Methods

checkCreateEndpointPolicyProgress(name)

checkCreateEndpointPolicyProgress(name: string): Promise<LROperation<protos.google.cloud.networkservices.v1beta1.EndpointPolicy, protos.google.cloud.networkservices.v1beta1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.networkservices.v1beta1.EndpointPolicy, protos.google.cloud.networkservices.v1beta1.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 of the EndpointPolicy. Must be in the
   *  format `projects/* /locations/global`.
   */
  // const parent = 'abc123'
  /**
   *  Required. Short name of the EndpointPolicy resource to be created.
   *  E.g. "CustomECS".
   */
  // const endpointPolicyId = 'abc123'
  /**
   *  Required. EndpointPolicy resource to be created.
   */
  // const endpointPolicy = {}

  // Imports the Networkservices library
  const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1;

  // Instantiates a client
  const networkservicesClient = new NetworkServicesClient();

  async function callCreateEndpointPolicy() {
    // Construct request
    const request = {
      parent,
      endpointPolicyId,
      endpointPolicy,
    };

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

  callCreateEndpointPolicy();

checkDeleteEndpointPolicyProgress(name)

checkDeleteEndpointPolicyProgress(name: string): Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.networkservices.v1beta1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.networkservices.v1beta1.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. A name of the EndpointPolicy to delete. Must be in the format
   *  `projects/* /locations/global/endpointPolicies/*`.
   */
  // const name = 'abc123'

  // Imports the Networkservices library
  const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1;

  // Instantiates a client
  const networkservicesClient = new NetworkServicesClient();

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

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

  callDeleteEndpointPolicy();

checkUpdateEndpointPolicyProgress(name)

checkUpdateEndpointPolicyProgress(name: string): Promise<LROperation<protos.google.cloud.networkservices.v1beta1.EndpointPolicy, protos.google.cloud.networkservices.v1beta1.OperationMetadata>>;

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.networkservices.v1beta1.EndpointPolicy, protos.google.cloud.networkservices.v1beta1.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.
   */
  /**
   *  Optional. Field mask is used to specify the fields to be overwritten in the
   *  EndpointPolicy resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request. A field will be overwritten if it is in the mask. If the
   *  user does not provide a mask then all fields will be overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. Updated EndpointPolicy resource.
   */
  // const endpointPolicy = {}

  // Imports the Networkservices library
  const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1;

  // Instantiates a client
  const networkservicesClient = new NetworkServicesClient();

  async function callUpdateEndpointPolicy() {
    // Construct request
    const request = {
      endpointPolicy,
    };

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

  callUpdateEndpointPolicy();

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.

createEndpointPolicy(request, options)

createEndpointPolicy(request?: protos.google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new EndpointPolicy in a given project and location.

Parameters
Name Description
request ICreateEndpointPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.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 of the EndpointPolicy. Must be in the
   *  format `projects/* /locations/global`.
   */
  // const parent = 'abc123'
  /**
   *  Required. Short name of the EndpointPolicy resource to be created.
   *  E.g. "CustomECS".
   */
  // const endpointPolicyId = 'abc123'
  /**
   *  Required. EndpointPolicy resource to be created.
   */
  // const endpointPolicy = {}

  // Imports the Networkservices library
  const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1;

  // Instantiates a client
  const networkservicesClient = new NetworkServicesClient();

  async function callCreateEndpointPolicy() {
    // Construct request
    const request = {
      parent,
      endpointPolicyId,
      endpointPolicy,
    };

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

  callCreateEndpointPolicy();

createEndpointPolicy(request, options, callback)

createEndpointPolicy(request: protos.google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateEndpointPolicyRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createEndpointPolicy(request, callback)

createEndpointPolicy(request: protos.google.cloud.networkservices.v1beta1.ICreateEndpointPolicyRequest, callback: Callback<LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateEndpointPolicyRequest
callback Callback<LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteEndpointPolicy(request, options)

deleteEndpointPolicy(request?: protos.google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Deletes a single EndpointPolicy.

Parameters
Name Description
request IDeleteEndpointPolicyRequest

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.networkservices.v1beta1.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. A name of the EndpointPolicy to delete. Must be in the format
   *  `projects/* /locations/global/endpointPolicies/*`.
   */
  // const name = 'abc123'

  // Imports the Networkservices library
  const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1;

  // Instantiates a client
  const networkservicesClient = new NetworkServicesClient();

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

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

  callDeleteEndpointPolicy();

deleteEndpointPolicy(request, options, callback)

deleteEndpointPolicy(request: protos.google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest, options: CallOptions, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteEndpointPolicyRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteEndpointPolicy(request, callback)

deleteEndpointPolicy(request: protos.google.cloud.networkservices.v1beta1.IDeleteEndpointPolicyRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteEndpointPolicyRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

endpointPolicyPath(project, location, endpointPolicy)

endpointPolicyPath(project: string, location: string, endpointPolicy: string): string;

Return a fully-qualified endpointPolicy resource name string.

Parameters
Name Description
project string
location string
endpointPolicy string
Returns
Type Description
string

{string} Resource name string.

getEndpointPolicy(request, options)

getEndpointPolicy(request?: protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkservices.v1beta1.IEndpointPolicy,
        (protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest | undefined),
        {} | undefined
    ]>;

Gets details of a single EndpointPolicy.

Parameters
Name Description
request IGetEndpointPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, (protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest | 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. A name of the EndpointPolicy to get. Must be in the format
   *  `projects/* /locations/global/endpointPolicies/*`.
   */
  // const name = 'abc123'

  // Imports the Networkservices library
  const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1;

  // Instantiates a client
  const networkservicesClient = new NetworkServicesClient();

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

    // Run request
    const response = await networkservicesClient.getEndpointPolicy(request);
    console.log(response);
  }

  callGetEndpointPolicy();

getEndpointPolicy(request, options, callback)

getEndpointPolicy(request: protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest, options: CallOptions, callback: Callback<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetEndpointPolicyRequest
options CallOptions
callback Callback<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getEndpointPolicy(request, callback)

getEndpointPolicy(request: protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest, callback: Callback<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetEndpointPolicyRequest
callback Callback<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

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.

lbRouteExtensionPath(project, location, lbRouteExtension)

lbRouteExtensionPath(project: string, location: string, lbRouteExtension: string): string;

Return a fully-qualified lbRouteExtension resource name string.

Parameters
Name Description
project string
location string
lbRouteExtension string
Returns
Type Description
string

{string} Resource name string.

lbTrafficExtensionPath(project, location, lbTrafficExtension)

lbTrafficExtensionPath(project: string, location: string, lbTrafficExtension: string): string;

Return a fully-qualified lbTrafficExtension resource name string.

Parameters
Name Description
project string
location string
lbTrafficExtension string
Returns
Type Description
string

{string} Resource name string.

listEndpointPolicies(request, options)

listEndpointPolicies(request?: protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkservices.v1beta1.IEndpointPolicy[],
        protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest | null,
        protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse
    ]>;

Lists EndpointPolicies in a given project and location.

Parameters
Name Description
request IListEndpointPoliciesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkservices.v1beta1.IEndpointPolicy[], protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest | null, protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse ]>

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

listEndpointPolicies(request, options, callback)

listEndpointPolicies(request: protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse | null | undefined, protos.google.cloud.networkservices.v1beta1.IEndpointPolicy>): void;
Parameters
Name Description
request IListEndpointPoliciesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse | null | undefined, protos.google.cloud.networkservices.v1beta1.IEndpointPolicy>
Returns
Type Description
void

listEndpointPolicies(request, callback)

listEndpointPolicies(request: protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, callback: PaginationCallback<protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse | null | undefined, protos.google.cloud.networkservices.v1beta1.IEndpointPolicy>): void;
Parameters
Name Description
request IListEndpointPoliciesRequest
callback PaginationCallback<protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesResponse | null | undefined, protos.google.cloud.networkservices.v1beta1.IEndpointPolicy>
Returns
Type Description
void

listEndpointPoliciesAsync(request, options)

listEndpointPoliciesAsync(request?: protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy>;

Equivalent to listEndpointPolicies, but returns an iterable object.

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

Parameters
Name Description
request IListEndpointPoliciesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy>

{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 project and location from which the EndpointPolicies should
   *  be listed, specified in the format `projects/* /locations/global`.
   */
  // const parent = 'abc123'
  /**
   *  Maximum number of EndpointPolicies to return per call.
   */
  // const pageSize = 1234
  /**
   *  The value returned by the last `ListEndpointPoliciesResponse`
   *  Indicates that this is a continuation of a prior
   *  `ListEndpointPolicies` call, and that the system should return the
   *  next page of data.
   */
  // const pageToken = 'abc123'

  // Imports the Networkservices library
  const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1;

  // Instantiates a client
  const networkservicesClient = new NetworkServicesClient();

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

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

  callListEndpointPolicies();

listEndpointPoliciesStream(request, options)

listEndpointPoliciesStream(request?: protos.google.cloud.networkservices.v1beta1.IListEndpointPoliciesRequest, options?: CallOptions): Transform;

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

Parameters
Name Description
request IListEndpointPoliciesRequest

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

matchEndpointPolicyFromEndpointPolicyName(endpointPolicyName)

matchEndpointPolicyFromEndpointPolicyName(endpointPolicyName: string): string | number;

Parse the endpoint_policy from EndpointPolicy resource.

Parameter
Name Description
endpointPolicyName string

A fully-qualified path representing EndpointPolicy resource.

Returns
Type Description
string | number

{string} A string representing the endpoint_policy.

matchLbRouteExtensionFromLbRouteExtensionName(lbRouteExtensionName)

matchLbRouteExtensionFromLbRouteExtensionName(lbRouteExtensionName: string): string | number;

Parse the lb_route_extension from LbRouteExtension resource.

Parameter
Name Description
lbRouteExtensionName string

A fully-qualified path representing LbRouteExtension resource.

Returns
Type Description
string | number

{string} A string representing the lb_route_extension.

matchLbTrafficExtensionFromLbTrafficExtensionName(lbTrafficExtensionName)

matchLbTrafficExtensionFromLbTrafficExtensionName(lbTrafficExtensionName: string): string | number;

Parse the lb_traffic_extension from LbTrafficExtension resource.

Parameter
Name Description
lbTrafficExtensionName string

A fully-qualified path representing LbTrafficExtension resource.

Returns
Type Description
string | number

{string} A string representing the lb_traffic_extension.

matchLocationFromEndpointPolicyName(endpointPolicyName)

matchLocationFromEndpointPolicyName(endpointPolicyName: string): string | number;

Parse the location from EndpointPolicy resource.

Parameter
Name Description
endpointPolicyName string

A fully-qualified path representing EndpointPolicy resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromLbRouteExtensionName(lbRouteExtensionName)

matchLocationFromLbRouteExtensionName(lbRouteExtensionName: string): string | number;

Parse the location from LbRouteExtension resource.

Parameter
Name Description
lbRouteExtensionName string

A fully-qualified path representing LbRouteExtension resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromLbTrafficExtensionName(lbTrafficExtensionName)

matchLocationFromLbTrafficExtensionName(lbTrafficExtensionName: string): string | number;

Parse the location from LbTrafficExtension resource.

Parameter
Name Description
lbTrafficExtensionName string

A fully-qualified path representing LbTrafficExtension resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchProjectFromEndpointPolicyName(endpointPolicyName)

matchProjectFromEndpointPolicyName(endpointPolicyName: string): string | number;

Parse the project from EndpointPolicy resource.

Parameter
Name Description
endpointPolicyName string

A fully-qualified path representing EndpointPolicy resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromLbRouteExtensionName(lbRouteExtensionName)

matchProjectFromLbRouteExtensionName(lbRouteExtensionName: string): string | number;

Parse the project from LbRouteExtension resource.

Parameter
Name Description
lbRouteExtensionName string

A fully-qualified path representing LbRouteExtension resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromLbTrafficExtensionName(lbTrafficExtensionName)

matchProjectFromLbTrafficExtensionName(lbTrafficExtensionName: string): string | number;

Parse the project from LbTrafficExtension resource.

Parameter
Name Description
lbTrafficExtensionName string

A fully-qualified path representing LbTrafficExtension resource.

Returns
Type Description
string | number

{string} A string representing the project.

updateEndpointPolicy(request, options)

updateEndpointPolicy(request?: protos.google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates the parameters of a single EndpointPolicy.

Parameters
Name Description
request IUpdateEndpointPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.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.
   */
  /**
   *  Optional. Field mask is used to specify the fields to be overwritten in the
   *  EndpointPolicy resource by the update.
   *  The fields specified in the update_mask are relative to the resource, not
   *  the full request. A field will be overwritten if it is in the mask. If the
   *  user does not provide a mask then all fields will be overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. Updated EndpointPolicy resource.
   */
  // const endpointPolicy = {}

  // Imports the Networkservices library
  const {NetworkServicesClient} = require('@google-cloud/networkservices').v1beta1;

  // Instantiates a client
  const networkservicesClient = new NetworkServicesClient();

  async function callUpdateEndpointPolicy() {
    // Construct request
    const request = {
      endpointPolicy,
    };

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

  callUpdateEndpointPolicy();

updateEndpointPolicy(request, options, callback)

updateEndpointPolicy(request: protos.google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateEndpointPolicyRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateEndpointPolicy(request, callback)

updateEndpointPolicy(request: protos.google.cloud.networkservices.v1beta1.IUpdateEndpointPolicyRequest, callback: Callback<LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateEndpointPolicyRequest
callback Callback<LROperation<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void