Class v1beta1.NetworkServicesClient (0.2.1)

v1beta1

Package

@google-cloud/networkservices

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of NetworkServicesClient.

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 NetworkServicesClient({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;

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.

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
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
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
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
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
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
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
TypeDescription
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
NameDescription
request ICreateEndpointPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
request IDeleteEndpointPolicyRequest

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.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
NameDescription
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
TypeDescription
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
NameDescription
request IDeleteEndpointPolicyRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkservices.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

endpointPolicyPath(project, location, endpointPolicy)

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

Return a fully-qualified endpointPolicy resource name string.

Parameters
NameDescription
project string
location string
endpointPolicy string
Returns
TypeDescription
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
NameDescription
request IGetEndpointPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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
NameDescription
request IGetEndpointPolicyRequest
options CallOptions
callback Callback<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
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
NameDescription
request IGetEndpointPolicyRequest
callback Callback<protos.google.cloud.networkservices.v1beta1.IEndpointPolicy, protos.google.cloud.networkservices.v1beta1.IGetEndpointPolicyRequest | 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

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.

lbRouteExtensionPath(project, location, lbRouteExtension)

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

Return a fully-qualified lbRouteExtension resource name string.

Parameters
NameDescription
project string
location string
lbRouteExtension string
Returns
TypeDescription
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
NameDescription
project string
location string
lbTrafficExtension string
Returns
TypeDescription
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
NameDescription
request IListEndpointPoliciesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
request IListEndpointPoliciesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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 = await 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
NameDescription
request IListEndpointPoliciesRequest

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 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
NameDescription
endpointPolicyName string

A fully-qualified path representing EndpointPolicy resource.

Returns
TypeDescription
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
NameDescription
lbRouteExtensionName string

A fully-qualified path representing LbRouteExtension resource.

Returns
TypeDescription
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
NameDescription
lbTrafficExtensionName string

A fully-qualified path representing LbTrafficExtension resource.

Returns
TypeDescription
string | number

{string} A string representing the lb_traffic_extension.

matchLocationFromEndpointPolicyName(endpointPolicyName)

matchLocationFromEndpointPolicyName(endpointPolicyName: string): string | number;

Parse the location from EndpointPolicy resource.

Parameter
NameDescription
endpointPolicyName string

A fully-qualified path representing EndpointPolicy resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromLbRouteExtensionName(lbRouteExtensionName)

matchLocationFromLbRouteExtensionName(lbRouteExtensionName: string): string | number;

Parse the location from LbRouteExtension resource.

Parameter
NameDescription
lbRouteExtensionName string

A fully-qualified path representing LbRouteExtension resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchLocationFromLbTrafficExtensionName(lbTrafficExtensionName)

matchLocationFromLbTrafficExtensionName(lbTrafficExtensionName: string): string | number;

Parse the location from LbTrafficExtension resource.

Parameter
NameDescription
lbTrafficExtensionName string

A fully-qualified path representing LbTrafficExtension resource.

Returns
TypeDescription
string | number

{string} A string representing the location.

matchProjectFromEndpointPolicyName(endpointPolicyName)

matchProjectFromEndpointPolicyName(endpointPolicyName: string): string | number;

Parse the project from EndpointPolicy resource.

Parameter
NameDescription
endpointPolicyName string

A fully-qualified path representing EndpointPolicy resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromLbRouteExtensionName(lbRouteExtensionName)

matchProjectFromLbRouteExtensionName(lbRouteExtensionName: string): string | number;

Parse the project from LbRouteExtension resource.

Parameter
NameDescription
lbRouteExtensionName string

A fully-qualified path representing LbRouteExtension resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchProjectFromLbTrafficExtensionName(lbTrafficExtensionName)

matchProjectFromLbTrafficExtensionName(lbTrafficExtensionName: string): string | number;

Parse the project from LbTrafficExtension resource.

Parameter
NameDescription
lbTrafficExtensionName string

A fully-qualified path representing LbTrafficExtension resource.

Returns
TypeDescription
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
NameDescription
request IUpdateEndpointPolicyRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
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
NameDescription
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
TypeDescription
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
NameDescription
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
TypeDescription
void