Class v1.HubServiceClient (4.6.0)

Network Connectivity Center is a hub-and-spoke abstraction for network connectivity management in Google Cloud. It reduces operational complexity through a simple, centralized connectivity management model. v1

Package

@google-cloud/network-connectivity

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of HubServiceClient.

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

hubServiceStub

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

iamClient

iamClient: IamClient;

innerApiCalls

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

locationsClient

locationsClient: LocationsClient;

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

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

port

static get port(): number;

The port for this API service.

scopes

static get scopes(): string[];

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

servicePath

static get servicePath(): string;

The DNS address for this API service.

universeDomain

get universeDomain(): string;

warn

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

Methods

acceptHubSpoke(request, options)

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

Accepts a proposal to attach a Network Connectivity Center spoke to a hub.

Parameters
Name Description
request IAcceptHubSpokeRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, 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 name of the hub into which to accept the spoke.
   */
  // const name = 'abc123'
  /**
   *  Required. The URI of the spoke to accept into the hub.
   */
  // const spokeUri = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

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

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

  callAcceptHubSpoke();

acceptHubSpoke(request, options, callback)

acceptHubSpoke(request: protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IAcceptHubSpokeRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

acceptHubSpoke(request, callback)

acceptHubSpoke(request: protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeRequest, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IAcceptHubSpokeRequest
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IAcceptHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

acceptSpokeUpdate(request, options)

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

Accepts a proposal to update a Network Connectivity Center spoke in a hub.

Parameters
Name Description
request IAcceptSpokeUpdateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.networkconnectivity.v1.IAcceptSpokeUpdateResponse, 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 name of the hub to accept spoke update.
   */
  // const name = 'abc123'
  /**
   *  Required. The URI of the spoke to accept update.
   */
  // const spokeUri = 'abc123'
  /**
   *  Required. The etag of the spoke to accept update.
   */
  // const spokeEtag = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callAcceptSpokeUpdate() {
    // Construct request
    const request = {
      name,
      spokeUri,
      spokeEtag,
    };

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

  callAcceptSpokeUpdate();

acceptSpokeUpdate(request, options, callback)

acceptSpokeUpdate(request: protos.google.cloud.networkconnectivity.v1.IAcceptSpokeUpdateRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IAcceptSpokeUpdateResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IAcceptSpokeUpdateRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IAcceptSpokeUpdateResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

acceptSpokeUpdate(request, callback)

acceptSpokeUpdate(request: protos.google.cloud.networkconnectivity.v1.IAcceptSpokeUpdateRequest, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IAcceptSpokeUpdateResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IAcceptSpokeUpdateRequest
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IAcceptSpokeUpdateResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

cancelOperation(request, optionsOrCallback, callback)

cancelOperation(request: protos.google.longrunning.CancelOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>, callback?: Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>): Promise<protos.google.protobuf.Empty>;

Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED. Clients can use or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an value with a of 1, corresponding to Code.CANCELLED.

Parameters
Name Description
request CancelOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>
callback Callback<protos.google.longrunning.CancelOperationRequest, protos.google.protobuf.Empty, {} | undefined | null>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<protos.google.protobuf.Empty>
Example

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

checkAcceptHubSpokeProgress(name)

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

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.networkconnectivity.v1.AcceptHubSpokeResponse, 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 name of the hub into which to accept the spoke.
   */
  // const name = 'abc123'
  /**
   *  Required. The URI of the spoke to accept into the hub.
   */
  // const spokeUri = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

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

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

  callAcceptHubSpoke();

checkAcceptSpokeUpdateProgress(name)

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

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.networkconnectivity.v1.AcceptSpokeUpdateResponse, 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 name of the hub to accept spoke update.
   */
  // const name = 'abc123'
  /**
   *  Required. The URI of the spoke to accept update.
   */
  // const spokeUri = 'abc123'
  /**
   *  Required. The etag of the spoke to accept update.
   */
  // const spokeEtag = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callAcceptSpokeUpdate() {
    // Construct request
    const request = {
      name,
      spokeUri,
      spokeEtag,
    };

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

  callAcceptSpokeUpdate();

checkCreateHubProgress(name)

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

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.networkconnectivity.v1.Hub, 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.
   */
  // const parent = 'abc123'
  /**
   *  Required. A unique identifier for the hub.
   */
  // const hubId = 'abc123'
  /**
   *  Required. The initial values for a new hub.
   */
  // const hub = {}
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callCreateHub() {
    // Construct request
    const request = {
      parent,
      hubId,
      hub,
    };

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

  callCreateHub();

checkCreateSpokeProgress(name)

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

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.networkconnectivity.v1.Spoke, 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.
   */
  // const parent = 'abc123'
  /**
   *  Required. Unique id for the spoke to create.
   */
  // const spokeId = 'abc123'
  /**
   *  Required. The initial values for a new spoke.
   */
  // const spoke = {}
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callCreateSpoke() {
    // Construct request
    const request = {
      parent,
      spokeId,
      spoke,
    };

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

  callCreateSpoke();

checkDeleteHubProgress(name)

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

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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. The name of the hub to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

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

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

  callDeleteHub();

checkDeleteSpokeProgress(name)

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

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
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. The name of the spoke to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

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

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

  callDeleteSpoke();

checkRejectHubSpokeProgress(name)

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

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.networkconnectivity.v1.RejectHubSpokeResponse, 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 name of the hub from which to reject the spoke.
   */
  // const name = 'abc123'
  /**
   *  Required. The URI of the spoke to reject from the hub.
   */
  // const spokeUri = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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'
  /**
   *  Optional. Additional information provided by the hub administrator.
   */
  // const details = 'abc123'

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

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

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

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

  callRejectHubSpoke();

checkRejectSpokeUpdateProgress(name)

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

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.networkconnectivity.v1.RejectSpokeUpdateResponse, 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 name of the hub to reject spoke update.
   */
  // const name = 'abc123'
  /**
   *  Required. The URI of the spoke to reject update.
   */
  // const spokeUri = 'abc123'
  /**
   *  Required. The etag of the spoke to reject update.
   */
  // const spokeEtag = 'abc123'
  /**
   *  Optional. Additional information provided by the hub administrator.
   */
  // const details = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callRejectSpokeUpdate() {
    // Construct request
    const request = {
      name,
      spokeUri,
      spokeEtag,
    };

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

  callRejectSpokeUpdate();

checkUpdateGroupProgress(name)

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

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.networkconnectivity.v1.Group, 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.
   */
  /**
   *  Optional. In the case of an update to an existing group, field mask is used
   *  to specify the fields to be overwritten. The fields specified in the
   *  update_mask are relative to the resource, not the full request. A field is
   *  overwritten if it is in the mask. If the user does not provide a mask, then
   *  all fields are overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The state that the group should be in after the update.
   */
  // const group = {}
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callUpdateGroup() {
    // Construct request
    const request = {
      group,
    };

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

  callUpdateGroup();

checkUpdateHubProgress(name)

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

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.networkconnectivity.v1.Hub, 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.
   */
  /**
   *  Optional. In the case of an update to an existing hub, field mask is used
   *  to specify the fields to be overwritten. The fields specified in the
   *  update_mask are relative to the resource, not the full request. A field is
   *  overwritten if it is in the mask. If the user does not provide a mask, then
   *  all fields are overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The state that the hub should be in after the update.
   */
  // const hub = {}
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callUpdateHub() {
    // Construct request
    const request = {
      hub,
    };

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

  callUpdateHub();

checkUpdateSpokeProgress(name)

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

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

Parameter
Name Description
name string

The operation name that will be passed.

Returns
Type Description
Promise<LROperation<protos.google.cloud.networkconnectivity.v1.Spoke, 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.
   */
  /**
   *  Optional. In the case of an update to an existing spoke, field mask is used
   *  to specify the fields to be overwritten. The fields specified in the
   *  update_mask are relative to the resource, not the full request. A field is
   *  overwritten if it is in the mask. If the user does not provide a mask, then
   *  all fields are overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The state that the spoke should be in after the update.
   */
  // const spoke = {}
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callUpdateSpoke() {
    // Construct request
    const request = {
      spoke,
    };

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

  callUpdateSpoke();

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.

createHub(request, options)

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

Creates a new Network Connectivity Center hub in the specified project.

Parameters
Name Description
request ICreateHubRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.networkconnectivity.v1.IHub, 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.
   */
  // const parent = 'abc123'
  /**
   *  Required. A unique identifier for the hub.
   */
  // const hubId = 'abc123'
  /**
   *  Required. The initial values for a new hub.
   */
  // const hub = {}
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callCreateHub() {
    // Construct request
    const request = {
      parent,
      hubId,
      hub,
    };

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

  callCreateHub();

createHub(request, options, callback)

createHub(request: protos.google.cloud.networkconnectivity.v1.ICreateHubRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateHubRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createHub(request, callback)

createHub(request: protos.google.cloud.networkconnectivity.v1.ICreateHubRequest, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateHubRequest
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createSpoke(request, options)

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

Creates a Network Connectivity Center spoke.

Parameters
Name Description
request ICreateSpokeRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.networkconnectivity.v1.ISpoke, 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.
   */
  // const parent = 'abc123'
  /**
   *  Required. Unique id for the spoke to create.
   */
  // const spokeId = 'abc123'
  /**
   *  Required. The initial values for a new spoke.
   */
  // const spoke = {}
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callCreateSpoke() {
    // Construct request
    const request = {
      parent,
      spokeId,
      spoke,
    };

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

  callCreateSpoke();

createSpoke(request, options, callback)

createSpoke(request: protos.google.cloud.networkconnectivity.v1.ICreateSpokeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateSpokeRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

createSpoke(request, callback)

createSpoke(request: protos.google.cloud.networkconnectivity.v1.ICreateSpokeRequest, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateSpokeRequest
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteHub(request, options)

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

Deletes a Network Connectivity Center hub.

Parameters
Name Description
request IDeleteHubRequest

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.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 name of the hub to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

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

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

  callDeleteHub();

deleteHub(request, options, callback)

deleteHub(request: protos.google.cloud.networkconnectivity.v1.IDeleteHubRequest, 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
Name Description
request IDeleteHubRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteHub(request, callback)

deleteHub(request: protos.google.cloud.networkconnectivity.v1.IDeleteHubRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteHubRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteOperation(request, optionsOrCallback, callback)

deleteOperation(request: protos.google.longrunning.DeleteOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>): Promise<protos.google.protobuf.Empty>;

Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.

Parameters
Name Description
request DeleteOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>
callback Callback<protos.google.protobuf.Empty, protos.google.longrunning.DeleteOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call. {Promise} - The promise which resolves when API call finishes. The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<protos.google.protobuf.Empty>
Example

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

deleteSpoke(request, options)

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

Deletes a Network Connectivity Center spoke.

Parameters
Name Description
request IDeleteSpokeRequest

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.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 name of the spoke to delete.
   */
  // const name = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

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

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

  callDeleteSpoke();

deleteSpoke(request, options, callback)

deleteSpoke(request: protos.google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, 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
Name Description
request IDeleteSpokeRequest
options CallOptions
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteSpoke(request, callback)

deleteSpoke(request: protos.google.cloud.networkconnectivity.v1.IDeleteSpokeRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteSpokeRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

destinationPath(project, location, multicloudDataTransferConfig, destination)

destinationPath(project: string, location: string, multicloudDataTransferConfig: string, destination: string): string;

Return a fully-qualified destination resource name string.

Parameters
Name Description
project string
location string
multicloudDataTransferConfig string
destination string
Returns
Type Description
string

{string} Resource name string.

getGroup(request, options)

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

Gets details about a Network Connectivity Center group.

Parameters
Name Description
request IGetGroupRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.IGroup, protos.google.cloud.networkconnectivity.v1.IGetGroupRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Group. 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 name of the route table resource.
   */
  // const name = 'abc123'

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

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

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

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

  callGetGroup();

getGroup(request, options, callback)

getGroup(request: protos.google.cloud.networkconnectivity.v1.IGetGroupRequest, options: CallOptions, callback: Callback<protos.google.cloud.networkconnectivity.v1.IGroup, protos.google.cloud.networkconnectivity.v1.IGetGroupRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetGroupRequest
options CallOptions
callback Callback<protos.google.cloud.networkconnectivity.v1.IGroup, protos.google.cloud.networkconnectivity.v1.IGetGroupRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getGroup(request, callback)

getGroup(request: protos.google.cloud.networkconnectivity.v1.IGetGroupRequest, callback: Callback<protos.google.cloud.networkconnectivity.v1.IGroup, protos.google.cloud.networkconnectivity.v1.IGetGroupRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetGroupRequest
callback Callback<protos.google.cloud.networkconnectivity.v1.IGroup, protos.google.cloud.networkconnectivity.v1.IGetGroupRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getHub(request, options)

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

Gets details about a Network Connectivity Center hub.

Parameters
Name Description
request IGetHubRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IGetHubRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Hub. 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 name of the hub resource to get.
   */
  // const name = 'abc123'

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

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

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

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

  callGetHub();

getHub(request, options, callback)

getHub(request: protos.google.cloud.networkconnectivity.v1.IGetHubRequest, options: CallOptions, callback: Callback<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IGetHubRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetHubRequest
options CallOptions
callback Callback<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IGetHubRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getHub(request, callback)

getHub(request: protos.google.cloud.networkconnectivity.v1.IGetHubRequest, callback: Callback<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IGetHubRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetHubRequest
callback Callback<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IGetHubRequest | null | undefined, {} | null | undefined>
Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
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
Type Description
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, optionsOrCallback, callback)

getOperation(request: protos.google.longrunning.GetOperationRequest, optionsOrCallback?: gax.CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>, callback?: Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>): Promise<[protos.google.longrunning.Operation]>;

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters
Name Description
request GetOperationRequest

The request object that will be sent.

optionsOrCallback CallOptions | Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>
callback Callback<protos.google.longrunning.Operation, protos.google.longrunning.GetOperationRequest, {} | null | undefined>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing . {Promise} - The promise which resolves to an array. The first element of the array is an object representing . The promise has a method named "cancel" which cancels the ongoing API call.

Returns
Type Description
Promise<[protos.google.longrunning.Operation]>
Example

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

getProjectId()

getProjectId(): Promise<string>;
Returns
Type Description
Promise<string>

getProjectId(callback)

getProjectId(callback: Callback<string, undefined, undefined>): void;
Parameter
Name Description
callback Callback<string, undefined, undefined>
Returns
Type Description
void

getRoute(request, options)

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

Gets details about the specified route.

Parameters
Name Description
request IGetRouteRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.IRoute, protos.google.cloud.networkconnectivity.v1.IGetRouteRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Route. 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 name of the route resource.
   */
  // const name = 'abc123'

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

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

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

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

  callGetRoute();

getRoute(request, options, callback)

getRoute(request: protos.google.cloud.networkconnectivity.v1.IGetRouteRequest, options: CallOptions, callback: Callback<protos.google.cloud.networkconnectivity.v1.IRoute, protos.google.cloud.networkconnectivity.v1.IGetRouteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetRouteRequest
options CallOptions
callback Callback<protos.google.cloud.networkconnectivity.v1.IRoute, protos.google.cloud.networkconnectivity.v1.IGetRouteRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getRoute(request, callback)

getRoute(request: protos.google.cloud.networkconnectivity.v1.IGetRouteRequest, callback: Callback<protos.google.cloud.networkconnectivity.v1.IRoute, protos.google.cloud.networkconnectivity.v1.IGetRouteRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetRouteRequest
callback Callback<protos.google.cloud.networkconnectivity.v1.IRoute, protos.google.cloud.networkconnectivity.v1.IGetRouteRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getRouteTable(request, options)

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

Gets details about a Network Connectivity Center route table.

Parameters
Name Description
request IGetRouteTableRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.IRouteTable, protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing RouteTable. 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 name of the route table resource.
   */
  // const name = 'abc123'

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

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

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

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

  callGetRouteTable();

getRouteTable(request, options, callback)

getRouteTable(request: protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest, options: CallOptions, callback: Callback<protos.google.cloud.networkconnectivity.v1.IRouteTable, protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetRouteTableRequest
options CallOptions
callback Callback<protos.google.cloud.networkconnectivity.v1.IRouteTable, protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getRouteTable(request, callback)

getRouteTable(request: protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest, callback: Callback<protos.google.cloud.networkconnectivity.v1.IRouteTable, protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetRouteTableRequest
callback Callback<protos.google.cloud.networkconnectivity.v1.IRouteTable, protos.google.cloud.networkconnectivity.v1.IGetRouteTableRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getSpoke(request, options)

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

Gets details about a Network Connectivity Center spoke.

Parameters
Name Description
request IGetSpokeRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IGetSpokeRequest | 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. The name of the spoke resource.
   */
  // const name = 'abc123'

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

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

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

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

  callGetSpoke();

getSpoke(request, options, callback)

getSpoke(request: protos.google.cloud.networkconnectivity.v1.IGetSpokeRequest, options: CallOptions, callback: Callback<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IGetSpokeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetSpokeRequest
options CallOptions
callback Callback<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IGetSpokeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getSpoke(request, callback)

getSpoke(request: protos.google.cloud.networkconnectivity.v1.IGetSpokeRequest, callback: Callback<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IGetSpokeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetSpokeRequest
callback Callback<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IGetSpokeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

groupPath(project, hub, group)

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

Return a fully-qualified group resource name string.

Parameters
Name Description
project string
hub string
group string
Returns
Type Description
string

{string} Resource name string.

hubPath(project, hub)

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

Return a fully-qualified hub resource name string.

Parameters
Name Description
project string
hub string
Returns
Type Description
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
Name Description
project string
hub string
routeTable string
route string
Returns
Type Description
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
Type Description
Promise<{ [name: string]: Function; }>

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

instancePath(project, zone, instance)

instancePath(project: string, zone: string, instance: string): string;

Return a fully-qualified instance resource name string.

Parameters
Name Description
project string
zone string
instance string
Returns
Type Description
string

{string} Resource name string.

interconnectAttachmentPath(project, region, resourceId)

interconnectAttachmentPath(project: string, region: string, resourceId: string): string;

Return a fully-qualified interconnectAttachment resource name string.

Parameters
Name Description
project string
region string
resourceId string
Returns
Type Description
string

{string} Resource name string.

internalRangePath(project, location, internalRange)

internalRangePath(project: string, location: string, internalRange: string): string;

Return a fully-qualified internalRange resource name string.

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

{string} Resource name string.

listGroups(request, options)

listGroups(request?: protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkconnectivity.v1.IGroup[],
        protos.google.cloud.networkconnectivity.v1.IListGroupsRequest | null,
        protos.google.cloud.networkconnectivity.v1.IListGroupsResponse
    ]>;

Lists groups in a given hub.

Parameters
Name Description
request IListGroupsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.IGroup[], protos.google.cloud.networkconnectivity.v1.IListGroupsRequest | null, protos.google.cloud.networkconnectivity.v1.IListGroupsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of Group. 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 listGroupsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listGroups(request, options, callback)

listGroups(request: protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, protos.google.cloud.networkconnectivity.v1.IListGroupsResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IGroup>): void;
Parameters
Name Description
request IListGroupsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, protos.google.cloud.networkconnectivity.v1.IListGroupsResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IGroup>
Returns
Type Description
void

listGroups(request, callback)

listGroups(request: protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, protos.google.cloud.networkconnectivity.v1.IListGroupsResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IGroup>): void;
Parameters
Name Description
request IListGroupsRequest
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, protos.google.cloud.networkconnectivity.v1.IListGroupsResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IGroup>
Returns
Type Description
void

listGroupsAsync(request, options)

listGroupsAsync(request?: protos.google.cloud.networkconnectivity.v1.IListGroupsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.networkconnectivity.v1.IGroup>;

Equivalent to listGroups, but returns an iterable object.

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

Parameters
Name Description
request IListGroupsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.networkconnectivity.v1.IGroup>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Group. 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 to return per page.
   */
  // const pageSize = 1234
  /**
   *  The page token.
   */
  // const pageToken = 'abc123'
  /**
   *  An expression that filters the list of results.
   */
  // const filter = 'abc123'
  /**
   *  Sort the results by a certain order.
   */
  // const orderBy = 'abc123'

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

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

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

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

  callListGroups();

listGroupsStream(request, options)

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

Equivalent to listGroups, but returns a NodeJS Stream object.

Parameters
Name Description
request IListGroupsRequest

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

listHubs(request, options)

listHubs(request?: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkconnectivity.v1.IHub[],
        protos.google.cloud.networkconnectivity.v1.IListHubsRequest | null,
        protos.google.cloud.networkconnectivity.v1.IListHubsResponse
    ]>;

Lists the Network Connectivity Center hubs associated with a given project.

Parameters
Name Description
request IListHubsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.IHub[], protos.google.cloud.networkconnectivity.v1.IListHubsRequest | null, protos.google.cloud.networkconnectivity.v1.IListHubsResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of Hub. 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 listHubsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listHubs(request, options, callback)

listHubs(request: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListHubsRequest, protos.google.cloud.networkconnectivity.v1.IListHubsResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IHub>): void;
Parameters
Name Description
request IListHubsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListHubsRequest, protos.google.cloud.networkconnectivity.v1.IListHubsResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IHub>
Returns
Type Description
void

listHubs(request, callback)

listHubs(request: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListHubsRequest, protos.google.cloud.networkconnectivity.v1.IListHubsResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IHub>): void;
Parameters
Name Description
request IListHubsRequest
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListHubsRequest, protos.google.cloud.networkconnectivity.v1.IListHubsResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IHub>
Returns
Type Description
void

listHubsAsync(request, options)

listHubsAsync(request?: protos.google.cloud.networkconnectivity.v1.IListHubsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.networkconnectivity.v1.IHub>;

Equivalent to listHubs, but returns an iterable object.

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

Parameters
Name Description
request IListHubsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.networkconnectivity.v1.IHub>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Hub. 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 to return.
   */
  // const pageSize = 1234
  /**
   *  The page token.
   */
  // const pageToken = 'abc123'
  /**
   *  An expression that filters the list of results.
   */
  // const filter = 'abc123'
  /**
   *  Sort the results by a certain order.
   */
  // const orderBy = 'abc123'

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

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

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

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

  callListHubs();

listHubSpokes(request, options)

listHubSpokes(request?: protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkconnectivity.v1.ISpoke[],
        protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest | null,
        protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse
    ]>;

Lists the Network Connectivity Center spokes associated with a specified hub and location. The list includes both spokes that are attached to the hub and spokes that have been proposed but not yet accepted.

Parameters
Name Description
request IListHubSpokesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.ISpoke[], protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest | null, protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse ]>

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

listHubSpokes(request, options, callback)

listHubSpokes(request: protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.ISpoke>): void;
Parameters
Name Description
request IListHubSpokesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.ISpoke>
Returns
Type Description
void

listHubSpokes(request, callback)

listHubSpokes(request: protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.ISpoke>): void;
Parameters
Name Description
request IListHubSpokesRequest
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, protos.google.cloud.networkconnectivity.v1.IListHubSpokesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.ISpoke>
Returns
Type Description
void

listHubSpokesAsync(request, options)

listHubSpokesAsync(request?: protos.google.cloud.networkconnectivity.v1.IListHubSpokesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.networkconnectivity.v1.ISpoke>;

Equivalent to listHubSpokes, but returns an iterable object.

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

Parameters
Name Description
request IListHubSpokesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.networkconnectivity.v1.ISpoke>

{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 name of the hub.
   */
  // const name = 'abc123'
  /**
   *  A list of locations.
   *  Specify one of the following: `[global]`, a single region (for
   *  example, `[us-central1]`), or a combination of
   *  values (for example, `[global, us-central1, us-west1]`).
   *  If the spoke_locations field is populated, the list of results
   *  includes only spokes in the specified location.
   *  If the spoke_locations field is not populated, the list of results
   *  includes spokes in all locations.
   */
  // const spokeLocations = ['abc','def']
  /**
   *  The maximum number of results to return per page.
   */
  // const pageSize = 1234
  /**
   *  The page token.
   */
  // const pageToken = 'abc123'
  /**
   *  An expression that filters the list of results.
   */
  // const filter = 'abc123'
  /**
   *  Sort the results by name or create_time.
   */
  // const orderBy = 'abc123'
  /**
   *  The view of the spoke to return.
   *  The view that you use determines which spoke fields are included in the
   *  response.
   */
  // const view = {}

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

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

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

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

  callListHubSpokes();

listHubSpokesStream(request, options)

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

Equivalent to listHubSpokes, but returns a NodeJS Stream object.

Parameters
Name Description
request IListHubSpokesRequest

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

listHubsStream(request, options)

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

Equivalent to listHubs, but returns a NodeJS Stream object.

Parameters
Name Description
request IListHubsRequest

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

listLocationsAsync(request, options)

listLocationsAsync(request: LocationProtos.google.cloud.location.IListLocationsRequest, options?: CallOptions): AsyncIterable<LocationProtos.google.cloud.location.ILocation>;

Lists information about the supported locations for this service. Returns an iterable object.

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

Parameters
Name Description
request LocationProtos.google.cloud.location.IListLocationsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<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.IOperation>;

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. Returns an iterable object.

For-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters
Name Description
request 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
Type Description
AsyncIterable<protos.google.longrunning.IOperation>

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

Example

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

listRoutes(request, options)

listRoutes(request?: protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkconnectivity.v1.IRoute[],
        protos.google.cloud.networkconnectivity.v1.IListRoutesRequest | null,
        protos.google.cloud.networkconnectivity.v1.IListRoutesResponse
    ]>;

Lists routes in a given route table.

Parameters
Name Description
request IListRoutesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.IRoute[], protos.google.cloud.networkconnectivity.v1.IListRoutesRequest | null, protos.google.cloud.networkconnectivity.v1.IListRoutesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of Route. 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 listRoutesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listRoutes(request, options, callback)

listRoutes(request: protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, protos.google.cloud.networkconnectivity.v1.IListRoutesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IRoute>): void;
Parameters
Name Description
request IListRoutesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, protos.google.cloud.networkconnectivity.v1.IListRoutesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IRoute>
Returns
Type Description
void

listRoutes(request, callback)

listRoutes(request: protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, protos.google.cloud.networkconnectivity.v1.IListRoutesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IRoute>): void;
Parameters
Name Description
request IListRoutesRequest
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, protos.google.cloud.networkconnectivity.v1.IListRoutesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IRoute>
Returns
Type Description
void

listRoutesAsync(request, options)

listRoutesAsync(request?: protos.google.cloud.networkconnectivity.v1.IListRoutesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.networkconnectivity.v1.IRoute>;

Equivalent to listRoutes, but returns an iterable object.

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

Parameters
Name Description
request IListRoutesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.networkconnectivity.v1.IRoute>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Route. 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 to return per page.
   */
  // const pageSize = 1234
  /**
   *  The page token.
   */
  // const pageToken = 'abc123'
  /**
   *  An expression that filters the list of results.
   */
  // const filter = 'abc123'
  /**
   *  Sort the results by a certain order.
   */
  // const orderBy = 'abc123'

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

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

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

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

  callListRoutes();

listRoutesStream(request, options)

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

Equivalent to listRoutes, but returns a NodeJS Stream object.

Parameters
Name Description
request IListRoutesRequest

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

listRouteTables(request, options)

listRouteTables(request?: protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkconnectivity.v1.IRouteTable[],
        protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest | null,
        protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse
    ]>;

Lists route tables in a given hub.

Parameters
Name Description
request IListRouteTablesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.IRouteTable[], protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest | null, protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of RouteTable. 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 listRouteTablesAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

listRouteTables(request, options, callback)

listRouteTables(request: protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IRouteTable>): void;
Parameters
Name Description
request IListRouteTablesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IRouteTable>
Returns
Type Description
void

listRouteTables(request, callback)

listRouteTables(request: protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IRouteTable>): void;
Parameters
Name Description
request IListRouteTablesRequest
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, protos.google.cloud.networkconnectivity.v1.IListRouteTablesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IRouteTable>
Returns
Type Description
void

listRouteTablesAsync(request, options)

listRouteTablesAsync(request?: protos.google.cloud.networkconnectivity.v1.IListRouteTablesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.networkconnectivity.v1.IRouteTable>;

Equivalent to listRouteTables, but returns an iterable object.

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

Parameters
Name Description
request IListRouteTablesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.networkconnectivity.v1.IRouteTable>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing RouteTable. 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 to return per page.
   */
  // const pageSize = 1234
  /**
   *  The page token.
   */
  // const pageToken = 'abc123'
  /**
   *  An expression that filters the list of results.
   */
  // const filter = 'abc123'
  /**
   *  Sort the results by a certain order.
   */
  // const orderBy = 'abc123'

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

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

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

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

  callListRouteTables();

listRouteTablesStream(request, options)

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

Equivalent to listRouteTables, but returns a NodeJS Stream object.

Parameters
Name Description
request IListRouteTablesRequest

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

listSpokes(request, options)

listSpokes(request?: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkconnectivity.v1.ISpoke[],
        protos.google.cloud.networkconnectivity.v1.IListSpokesRequest | null,
        protos.google.cloud.networkconnectivity.v1.IListSpokesResponse
    ]>;

Lists the Network Connectivity Center spokes in a specified project and location.

Parameters
Name Description
request IListSpokesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.ISpoke[], protos.google.cloud.networkconnectivity.v1.IListSpokesRequest | null, protos.google.cloud.networkconnectivity.v1.IListSpokesResponse ]>

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

listSpokes(request, options, callback)

listSpokes(request: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, protos.google.cloud.networkconnectivity.v1.IListSpokesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.ISpoke>): void;
Parameters
Name Description
request IListSpokesRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, protos.google.cloud.networkconnectivity.v1.IListSpokesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.ISpoke>
Returns
Type Description
void

listSpokes(request, callback)

listSpokes(request: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, protos.google.cloud.networkconnectivity.v1.IListSpokesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.ISpoke>): void;
Parameters
Name Description
request IListSpokesRequest
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, protos.google.cloud.networkconnectivity.v1.IListSpokesResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.ISpoke>
Returns
Type Description
void

listSpokesAsync(request, options)

listSpokesAsync(request?: protos.google.cloud.networkconnectivity.v1.IListSpokesRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.networkconnectivity.v1.ISpoke>;

Equivalent to listSpokes, but returns an iterable object.

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

Parameters
Name Description
request IListSpokesRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.networkconnectivity.v1.ISpoke>

{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.
   */
  // const parent = 'abc123'
  /**
   *  The maximum number of results to return per page.
   */
  // const pageSize = 1234
  /**
   *  The page token.
   */
  // const pageToken = 'abc123'
  /**
   *  An expression that filters the list of results.
   */
  // const filter = 'abc123'
  /**
   *  Sort the results by a certain order.
   */
  // const orderBy = 'abc123'

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

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

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

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

  callListSpokes();

listSpokesStream(request, options)

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

Equivalent to listSpokes, but returns a NodeJS Stream object.

Parameters
Name Description
request IListSpokesRequest

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 listSpokesAsync() 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
Name Description
project string
location string
Returns
Type Description
string

{string} Resource name string.

matchDestinationFromDestinationName(destinationName)

matchDestinationFromDestinationName(destinationName: string): string | number;

Parse the destination from Destination resource.

Parameter
Name Description
destinationName string

A fully-qualified path representing Destination resource.

Returns
Type Description
string | number

{string} A string representing the destination.

matchGroupFromGroupName(groupName)

matchGroupFromGroupName(groupName: string): string | number;

Parse the group from Group resource.

Parameter
Name Description
groupName string

A fully-qualified path representing Group resource.

Returns
Type Description
string | number

{string} A string representing the group.

matchHubFromGroupName(groupName)

matchHubFromGroupName(groupName: string): string | number;

Parse the hub from Group resource.

Parameter
Name Description
groupName string

A fully-qualified path representing Group resource.

Returns
Type Description
string | number

{string} A string representing the hub.

matchHubFromHubName(hubName)

matchHubFromHubName(hubName: string): string | number;

Parse the hub from Hub resource.

Parameter
Name Description
hubName string

A fully-qualified path representing Hub resource.

Returns
Type Description
string | number

{string} A string representing the hub.

matchHubFromHubRouteName(hubRouteName)

matchHubFromHubRouteName(hubRouteName: string): string | number;

Parse the hub from HubRoute resource.

Parameter
Name Description
hubRouteName string

A fully-qualified path representing HubRoute resource.

Returns
Type Description
string | number

{string} A string representing the hub.

matchHubFromRouteTableName(routeTableName)

matchHubFromRouteTableName(routeTableName: string): string | number;

Parse the hub from RouteTable resource.

Parameter
Name Description
routeTableName string

A fully-qualified path representing RouteTable resource.

Returns
Type Description
string | number

{string} A string representing the hub.

matchInstanceFromInstanceName(instanceName)

matchInstanceFromInstanceName(instanceName: string): string | number;

Parse the instance from Instance resource.

Parameter
Name Description
instanceName string

A fully-qualified path representing Instance resource.

Returns
Type Description
string | number

{string} A string representing the instance.

matchInternalRangeFromInternalRangeName(internalRangeName)

matchInternalRangeFromInternalRangeName(internalRangeName: string): string | number;

Parse the internal_range from InternalRange resource.

Parameter
Name Description
internalRangeName string

A fully-qualified path representing InternalRange resource.

Returns
Type Description
string | number

{string} A string representing the internal_range.

matchLocationFromDestinationName(destinationName)

matchLocationFromDestinationName(destinationName: string): string | number;

Parse the location from Destination resource.

Parameter
Name Description
destinationName string

A fully-qualified path representing Destination resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromInternalRangeName(internalRangeName)

matchLocationFromInternalRangeName(internalRangeName: string): string | number;

Parse the location from InternalRange resource.

Parameter
Name Description
internalRangeName string

A fully-qualified path representing InternalRange resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromLocationName(locationName)

matchLocationFromLocationName(locationName: string): string | number;

Parse the location from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromMulticloudDataTransferConfigName(multicloudDataTransferConfigName)

matchLocationFromMulticloudDataTransferConfigName(multicloudDataTransferConfigName: string): string | number;

Parse the location from MulticloudDataTransferConfig resource.

Parameter
Name Description
multicloudDataTransferConfigName string

A fully-qualified path representing MulticloudDataTransferConfig resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromMulticloudDataTransferSupportedServiceName(multicloudDataTransferSupportedServiceName)

matchLocationFromMulticloudDataTransferSupportedServiceName(multicloudDataTransferSupportedServiceName: string): string | number;

Parse the location from MulticloudDataTransferSupportedService resource.

Parameter
Name Description
multicloudDataTransferSupportedServiceName string

A fully-qualified path representing MulticloudDataTransferSupportedService resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromServiceClassName(serviceClassName)

matchLocationFromServiceClassName(serviceClassName: string): string | number;

Parse the location from ServiceClass resource.

Parameter
Name Description
serviceClassName string

A fully-qualified path representing ServiceClass resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromServiceConnectionMapName(serviceConnectionMapName)

matchLocationFromServiceConnectionMapName(serviceConnectionMapName: string): string | number;

Parse the location from ServiceConnectionMap resource.

Parameter
Name Description
serviceConnectionMapName string

A fully-qualified path representing ServiceConnectionMap resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromServiceConnectionPolicyName(serviceConnectionPolicyName)

matchLocationFromServiceConnectionPolicyName(serviceConnectionPolicyName: string): string | number;

Parse the location from ServiceConnectionPolicy resource.

Parameter
Name Description
serviceConnectionPolicyName string

A fully-qualified path representing ServiceConnectionPolicy resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromServiceConnectionTokenName(serviceConnectionTokenName)

matchLocationFromServiceConnectionTokenName(serviceConnectionTokenName: string): string | number;

Parse the location from ServiceConnectionToken resource.

Parameter
Name Description
serviceConnectionTokenName string

A fully-qualified path representing ServiceConnectionToken resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchLocationFromSpokeName(spokeName)

matchLocationFromSpokeName(spokeName: string): string | number;

Parse the location from Spoke resource.

Parameter
Name Description
spokeName string

A fully-qualified path representing Spoke resource.

Returns
Type Description
string | number

{string} A string representing the location.

matchMulticloudDataTransferConfigFromDestinationName(destinationName)

matchMulticloudDataTransferConfigFromDestinationName(destinationName: string): string | number;

Parse the multicloud_data_transfer_config from Destination resource.

Parameter
Name Description
destinationName string

A fully-qualified path representing Destination resource.

Returns
Type Description
string | number

{string} A string representing the multicloud_data_transfer_config.

matchMulticloudDataTransferConfigFromMulticloudDataTransferConfigName(multicloudDataTransferConfigName)

matchMulticloudDataTransferConfigFromMulticloudDataTransferConfigName(multicloudDataTransferConfigName: string): string | number;

Parse the multicloud_data_transfer_config from MulticloudDataTransferConfig resource.

Parameter
Name Description
multicloudDataTransferConfigName string

A fully-qualified path representing MulticloudDataTransferConfig resource.

Returns
Type Description
string | number

{string} A string representing the multicloud_data_transfer_config.

matchMulticloudDataTransferSupportedServiceFromMulticloudDataTransferSupportedServiceName(multicloudDataTransferSupportedServiceName)

matchMulticloudDataTransferSupportedServiceFromMulticloudDataTransferSupportedServiceName(multicloudDataTransferSupportedServiceName: string): string | number;

Parse the multicloud_data_transfer_supported_service from MulticloudDataTransferSupportedService resource.

Parameter
Name Description
multicloudDataTransferSupportedServiceName string

A fully-qualified path representing MulticloudDataTransferSupportedService resource.

Returns
Type Description
string | number

{string} A string representing the multicloud_data_transfer_supported_service.

matchPolicyBasedRouteFromPolicyBasedRouteName(policyBasedRouteName)

matchPolicyBasedRouteFromPolicyBasedRouteName(policyBasedRouteName: string): string | number;

Parse the policy_based_route from PolicyBasedRoute resource.

Parameter
Name Description
policyBasedRouteName string

A fully-qualified path representing PolicyBasedRoute resource.

Returns
Type Description
string | number

{string} A string representing the policy_based_route.

matchProjectFromDestinationName(destinationName)

matchProjectFromDestinationName(destinationName: string): string | number;

Parse the project from Destination resource.

Parameter
Name Description
destinationName string

A fully-qualified path representing Destination resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromGroupName(groupName)

matchProjectFromGroupName(groupName: string): string | number;

Parse the project from Group resource.

Parameter
Name Description
groupName string

A fully-qualified path representing Group resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromHubName(hubName)

matchProjectFromHubName(hubName: string): string | number;

Parse the project from Hub resource.

Parameter
Name Description
hubName string

A fully-qualified path representing Hub resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromHubRouteName(hubRouteName)

matchProjectFromHubRouteName(hubRouteName: string): string | number;

Parse the project from HubRoute resource.

Parameter
Name Description
hubRouteName string

A fully-qualified path representing HubRoute resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromInstanceName(instanceName)

matchProjectFromInstanceName(instanceName: string): string | number;

Parse the project from Instance resource.

Parameter
Name Description
instanceName string

A fully-qualified path representing Instance resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromInterconnectAttachmentName(interconnectAttachmentName)

matchProjectFromInterconnectAttachmentName(interconnectAttachmentName: string): string | number;

Parse the project from InterconnectAttachment resource.

Parameter
Name Description
interconnectAttachmentName string

A fully-qualified path representing InterconnectAttachment resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromInternalRangeName(internalRangeName)

matchProjectFromInternalRangeName(internalRangeName: string): string | number;

Parse the project from InternalRange resource.

Parameter
Name Description
internalRangeName string

A fully-qualified path representing InternalRange resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromLocationName(locationName)

matchProjectFromLocationName(locationName: string): string | number;

Parse the project from Location resource.

Parameter
Name Description
locationName string

A fully-qualified path representing Location resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromMulticloudDataTransferConfigName(multicloudDataTransferConfigName)

matchProjectFromMulticloudDataTransferConfigName(multicloudDataTransferConfigName: string): string | number;

Parse the project from MulticloudDataTransferConfig resource.

Parameter
Name Description
multicloudDataTransferConfigName string

A fully-qualified path representing MulticloudDataTransferConfig resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromMulticloudDataTransferSupportedServiceName(multicloudDataTransferSupportedServiceName)

matchProjectFromMulticloudDataTransferSupportedServiceName(multicloudDataTransferSupportedServiceName: string): string | number;

Parse the project from MulticloudDataTransferSupportedService resource.

Parameter
Name Description
multicloudDataTransferSupportedServiceName string

A fully-qualified path representing MulticloudDataTransferSupportedService resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromNetworkName(networkName)

matchProjectFromNetworkName(networkName: string): string | number;

Parse the project from Network resource.

Parameter
Name Description
networkName string

A fully-qualified path representing Network resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromPolicyBasedRouteName(policyBasedRouteName)

matchProjectFromPolicyBasedRouteName(policyBasedRouteName: string): string | number;

Parse the project from PolicyBasedRoute resource.

Parameter
Name Description
policyBasedRouteName string

A fully-qualified path representing PolicyBasedRoute resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromRouteTableName(routeTableName)

matchProjectFromRouteTableName(routeTableName: string): string | number;

Parse the project from RouteTable resource.

Parameter
Name Description
routeTableName string

A fully-qualified path representing RouteTable resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromServiceClassName(serviceClassName)

matchProjectFromServiceClassName(serviceClassName: string): string | number;

Parse the project from ServiceClass resource.

Parameter
Name Description
serviceClassName string

A fully-qualified path representing ServiceClass resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromServiceConnectionMapName(serviceConnectionMapName)

matchProjectFromServiceConnectionMapName(serviceConnectionMapName: string): string | number;

Parse the project from ServiceConnectionMap resource.

Parameter
Name Description
serviceConnectionMapName string

A fully-qualified path representing ServiceConnectionMap resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromServiceConnectionPolicyName(serviceConnectionPolicyName)

matchProjectFromServiceConnectionPolicyName(serviceConnectionPolicyName: string): string | number;

Parse the project from ServiceConnectionPolicy resource.

Parameter
Name Description
serviceConnectionPolicyName string

A fully-qualified path representing ServiceConnectionPolicy resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromServiceConnectionTokenName(serviceConnectionTokenName)

matchProjectFromServiceConnectionTokenName(serviceConnectionTokenName: string): string | number;

Parse the project from ServiceConnectionToken resource.

Parameter
Name Description
serviceConnectionTokenName string

A fully-qualified path representing ServiceConnectionToken resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromSpokeName(spokeName)

matchProjectFromSpokeName(spokeName: string): string | number;

Parse the project from Spoke resource.

Parameter
Name Description
spokeName string

A fully-qualified path representing Spoke resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromVpnTunnelName(vpnTunnelName)

matchProjectFromVpnTunnelName(vpnTunnelName: string): string | number;

Parse the project from VpnTunnel resource.

Parameter
Name Description
vpnTunnelName string

A fully-qualified path representing VpnTunnel resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchRegionFromInterconnectAttachmentName(interconnectAttachmentName)

matchRegionFromInterconnectAttachmentName(interconnectAttachmentName: string): string | number;

Parse the region from InterconnectAttachment resource.

Parameter
Name Description
interconnectAttachmentName string

A fully-qualified path representing InterconnectAttachment resource.

Returns
Type Description
string | number

{string} A string representing the region.

matchRegionFromVpnTunnelName(vpnTunnelName)

matchRegionFromVpnTunnelName(vpnTunnelName: string): string | number;

Parse the region from VpnTunnel resource.

Parameter
Name Description
vpnTunnelName string

A fully-qualified path representing VpnTunnel resource.

Returns
Type Description
string | number

{string} A string representing the region.

matchResourceIdFromInterconnectAttachmentName(interconnectAttachmentName)

matchResourceIdFromInterconnectAttachmentName(interconnectAttachmentName: string): string | number;

Parse the resource_id from InterconnectAttachment resource.

Parameter
Name Description
interconnectAttachmentName string

A fully-qualified path representing InterconnectAttachment resource.

Returns
Type Description
string | number

{string} A string representing the resource_id.

matchResourceIdFromNetworkName(networkName)

matchResourceIdFromNetworkName(networkName: string): string | number;

Parse the resource_id from Network resource.

Parameter
Name Description
networkName string

A fully-qualified path representing Network resource.

Returns
Type Description
string | number

{string} A string representing the resource_id.

matchResourceIdFromVpnTunnelName(vpnTunnelName)

matchResourceIdFromVpnTunnelName(vpnTunnelName: string): string | number;

Parse the resource_id from VpnTunnel resource.

Parameter
Name Description
vpnTunnelName string

A fully-qualified path representing VpnTunnel resource.

Returns
Type Description
string | number

{string} A string representing the resource_id.

matchRouteFromHubRouteName(hubRouteName)

matchRouteFromHubRouteName(hubRouteName: string): string | number;

Parse the route from HubRoute resource.

Parameter
Name Description
hubRouteName string

A fully-qualified path representing HubRoute resource.

Returns
Type Description
string | number

{string} A string representing the route.

matchRouteTableFromHubRouteName(hubRouteName)

matchRouteTableFromHubRouteName(hubRouteName: string): string | number;

Parse the route_table from HubRoute resource.

Parameter
Name Description
hubRouteName string

A fully-qualified path representing HubRoute resource.

Returns
Type Description
string | number

{string} A string representing the route_table.

matchRouteTableFromRouteTableName(routeTableName)

matchRouteTableFromRouteTableName(routeTableName: string): string | number;

Parse the route_table from RouteTable resource.

Parameter
Name Description
routeTableName string

A fully-qualified path representing RouteTable resource.

Returns
Type Description
string | number

{string} A string representing the route_table.

matchServiceClassFromServiceClassName(serviceClassName)

matchServiceClassFromServiceClassName(serviceClassName: string): string | number;

Parse the service_class from ServiceClass resource.

Parameter
Name Description
serviceClassName string

A fully-qualified path representing ServiceClass resource.

Returns
Type Description
string | number

{string} A string representing the service_class.

matchServiceConnectionMapFromServiceConnectionMapName(serviceConnectionMapName)

matchServiceConnectionMapFromServiceConnectionMapName(serviceConnectionMapName: string): string | number;

Parse the service_connection_map from ServiceConnectionMap resource.

Parameter
Name Description
serviceConnectionMapName string

A fully-qualified path representing ServiceConnectionMap resource.

Returns
Type Description
string | number

{string} A string representing the service_connection_map.

matchServiceConnectionPolicyFromServiceConnectionPolicyName(serviceConnectionPolicyName)

matchServiceConnectionPolicyFromServiceConnectionPolicyName(serviceConnectionPolicyName: string): string | number;

Parse the service_connection_policy from ServiceConnectionPolicy resource.

Parameter
Name Description
serviceConnectionPolicyName string

A fully-qualified path representing ServiceConnectionPolicy resource.

Returns
Type Description
string | number

{string} A string representing the service_connection_policy.

matchServiceConnectionTokenFromServiceConnectionTokenName(serviceConnectionTokenName)

matchServiceConnectionTokenFromServiceConnectionTokenName(serviceConnectionTokenName: string): string | number;

Parse the service_connection_token from ServiceConnectionToken resource.

Parameter
Name Description
serviceConnectionTokenName string

A fully-qualified path representing ServiceConnectionToken resource.

Returns
Type Description
string | number

{string} A string representing the service_connection_token.

matchSpokeFromSpokeName(spokeName)

matchSpokeFromSpokeName(spokeName: string): string | number;

Parse the spoke from Spoke resource.

Parameter
Name Description
spokeName string

A fully-qualified path representing Spoke resource.

Returns
Type Description
string | number

{string} A string representing the spoke.

matchZoneFromInstanceName(instanceName)

matchZoneFromInstanceName(instanceName: string): string | number;

Parse the zone from Instance resource.

Parameter
Name Description
instanceName string

A fully-qualified path representing Instance resource.

Returns
Type Description
string | number

{string} A string representing the zone.

multicloudDataTransferConfigPath(project, location, multicloudDataTransferConfig)

multicloudDataTransferConfigPath(project: string, location: string, multicloudDataTransferConfig: string): string;

Return a fully-qualified multicloudDataTransferConfig resource name string.

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

{string} Resource name string.

multicloudDataTransferSupportedServicePath(project, location, multicloudDataTransferSupportedService)

multicloudDataTransferSupportedServicePath(project: string, location: string, multicloudDataTransferSupportedService: string): string;

Return a fully-qualified multicloudDataTransferSupportedService resource name string.

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

{string} Resource name string.

networkPath(project, resourceId)

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

Return a fully-qualified network resource name string.

Parameters
Name Description
project string
resourceId string
Returns
Type Description
string

{string} Resource name string.

policyBasedRoutePath(project, policyBasedRoute)

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

Return a fully-qualified policyBasedRoute resource name string.

Parameters
Name Description
project string
policyBasedRoute string
Returns
Type Description
string

{string} Resource name string.

queryHubStatus(request, options)

queryHubStatus(request?: protos.google.cloud.networkconnectivity.v1.IQueryHubStatusRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkconnectivity.v1.IHubStatusEntry[],
        protos.google.cloud.networkconnectivity.v1.IQueryHubStatusRequest | null,
        protos.google.cloud.networkconnectivity.v1.IQueryHubStatusResponse
    ]>;

Query the Private Service Connect propagation status of a Network Connectivity Center hub.

Parameters
Name Description
request IQueryHubStatusRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.cloud.networkconnectivity.v1.IHubStatusEntry[], protos.google.cloud.networkconnectivity.v1.IQueryHubStatusRequest | null, protos.google.cloud.networkconnectivity.v1.IQueryHubStatusResponse ]>

{Promise} - The promise which resolves to an array. The first element of the array is Array of HubStatusEntry. 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 queryHubStatusAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

queryHubStatus(request, options, callback)

queryHubStatus(request: protos.google.cloud.networkconnectivity.v1.IQueryHubStatusRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IQueryHubStatusRequest, protos.google.cloud.networkconnectivity.v1.IQueryHubStatusResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IHubStatusEntry>): void;
Parameters
Name Description
request IQueryHubStatusRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IQueryHubStatusRequest, protos.google.cloud.networkconnectivity.v1.IQueryHubStatusResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IHubStatusEntry>
Returns
Type Description
void

queryHubStatus(request, callback)

queryHubStatus(request: protos.google.cloud.networkconnectivity.v1.IQueryHubStatusRequest, callback: PaginationCallback<protos.google.cloud.networkconnectivity.v1.IQueryHubStatusRequest, protos.google.cloud.networkconnectivity.v1.IQueryHubStatusResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IHubStatusEntry>): void;
Parameters
Name Description
request IQueryHubStatusRequest
callback PaginationCallback<protos.google.cloud.networkconnectivity.v1.IQueryHubStatusRequest, protos.google.cloud.networkconnectivity.v1.IQueryHubStatusResponse | null | undefined, protos.google.cloud.networkconnectivity.v1.IHubStatusEntry>
Returns
Type Description
void

queryHubStatusAsync(request, options)

queryHubStatusAsync(request?: protos.google.cloud.networkconnectivity.v1.IQueryHubStatusRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.networkconnectivity.v1.IHubStatusEntry>;

Equivalent to queryHubStatus, but returns an iterable object.

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

Parameters
Name Description
request IQueryHubStatusRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.cloud.networkconnectivity.v1.IHubStatusEntry>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing HubStatusEntry. 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 name of the hub.
   */
  // const name = 'abc123'
  /**
   *  Optional. The maximum number of results to return per page.
   */
  // const pageSize = 1234
  /**
   *  Optional. The page token.
   */
  // const pageToken = 'abc123'
  /**
   *  Optional. An expression that filters the list of results.
   *  The filter can be used to filter the results by the following fields:
   *    * `psc_propagation_status.source_spoke`
   *    * `psc_propagation_status.source_group`
   *    * `psc_propagation_status.source_forwarding_rule`
   *    * `psc_propagation_status.target_spoke`
   *    * `psc_propagation_status.target_group`
   *    * `psc_propagation_status.code`
   *    * `psc_propagation_status.message`
   */
  // const filter = 'abc123'
  /**
   *  Optional. Sort the results in ascending order by the specified fields.
   *  A comma-separated list of any of these fields:
   *    * `psc_propagation_status.source_spoke`
   *    * `psc_propagation_status.source_group`
   *    * `psc_propagation_status.source_forwarding_rule`
   *    * `psc_propagation_status.target_spoke`
   *    * `psc_propagation_status.target_group`
   *    * `psc_propagation_status.code`
   *  If `group_by` is set, the value of the `order_by` field must be the
   *  same as or a subset of the `group_by` field.
   */
  // const orderBy = 'abc123'
  /**
   *  Optional. Aggregate the results by the specified fields.
   *  A comma-separated list of any of these fields:
   *    * `psc_propagation_status.source_spoke`
   *    * `psc_propagation_status.source_group`
   *    * `psc_propagation_status.source_forwarding_rule`
   *    * `psc_propagation_status.target_spoke`
   *    * `psc_propagation_status.target_group`
   *    * `psc_propagation_status.code`
   */
  // const groupBy = 'abc123'

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

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

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

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

  callQueryHubStatus();

queryHubStatusStream(request, options)

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

Equivalent to queryHubStatus, but returns a NodeJS Stream object.

Parameters
Name Description
request IQueryHubStatusRequest

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

rejectHubSpoke(request, options)

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

Rejects a Network Connectivity Center spoke from being attached to a hub. If the spoke was previously in the ACTIVE state, it transitions to the INACTIVE state and is no longer able to connect to other spokes that are attached to the hub.

Parameters
Name Description
request IRejectHubSpokeRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, 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 name of the hub from which to reject the spoke.
   */
  // const name = 'abc123'
  /**
   *  Required. The URI of the spoke to reject from the hub.
   */
  // const spokeUri = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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'
  /**
   *  Optional. Additional information provided by the hub administrator.
   */
  // const details = 'abc123'

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

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

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

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

  callRejectHubSpoke();

rejectHubSpoke(request, options, callback)

rejectHubSpoke(request: protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRejectHubSpokeRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

rejectHubSpoke(request, callback)

rejectHubSpoke(request: protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeRequest, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRejectHubSpokeRequest
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IRejectHubSpokeResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

rejectSpokeUpdate(request, options)

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

Rejects a proposal to update a Network Connectivity Center spoke in a hub.

Parameters
Name Description
request IRejectSpokeUpdateRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.networkconnectivity.v1.IRejectSpokeUpdateResponse, 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 name of the hub to reject spoke update.
   */
  // const name = 'abc123'
  /**
   *  Required. The URI of the spoke to reject update.
   */
  // const spokeUri = 'abc123'
  /**
   *  Required. The etag of the spoke to reject update.
   */
  // const spokeEtag = 'abc123'
  /**
   *  Optional. Additional information provided by the hub administrator.
   */
  // const details = 'abc123'
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callRejectSpokeUpdate() {
    // Construct request
    const request = {
      name,
      spokeUri,
      spokeEtag,
    };

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

  callRejectSpokeUpdate();

rejectSpokeUpdate(request, options, callback)

rejectSpokeUpdate(request: protos.google.cloud.networkconnectivity.v1.IRejectSpokeUpdateRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IRejectSpokeUpdateResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRejectSpokeUpdateRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IRejectSpokeUpdateResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

rejectSpokeUpdate(request, callback)

rejectSpokeUpdate(request: protos.google.cloud.networkconnectivity.v1.IRejectSpokeUpdateRequest, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IRejectSpokeUpdateResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IRejectSpokeUpdateRequest
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IRejectSpokeUpdateResponse, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

routeTablePath(project, hub, routeTable)

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

Return a fully-qualified routeTable resource name string.

Parameters
Name Description
project string
hub string
routeTable string
Returns
Type Description
string

{string} Resource name string.

serviceClassPath(project, location, serviceClass)

serviceClassPath(project: string, location: string, serviceClass: string): string;

Return a fully-qualified serviceClass resource name string.

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

{string} Resource name string.

serviceConnectionMapPath(project, location, serviceConnectionMap)

serviceConnectionMapPath(project: string, location: string, serviceConnectionMap: string): string;

Return a fully-qualified serviceConnectionMap resource name string.

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

{string} Resource name string.

serviceConnectionPolicyPath(project, location, serviceConnectionPolicy)

serviceConnectionPolicyPath(project: string, location: string, serviceConnectionPolicy: string): string;

Return a fully-qualified serviceConnectionPolicy resource name string.

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

{string} Resource name string.

serviceConnectionTokenPath(project, location, serviceConnectionToken)

serviceConnectionTokenPath(project: string, location: string, serviceConnectionToken: string): string;

Return a fully-qualified serviceConnectionToken resource name string.

Parameters
Name Description
project string
location string
serviceConnectionToken string
Returns
Type Description
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
Name Description
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
Type Description
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
Name Description
project string
location string
spoke string
Returns
Type Description
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
Name Description
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
Type Description
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.

updateGroup(request, options)

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

Updates the parameters of a Network Connectivity Center group.

Parameters
Name Description
request IUpdateGroupRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.networkconnectivity.v1.IGroup, 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.
   */
  /**
   *  Optional. In the case of an update to an existing group, field mask is used
   *  to specify the fields to be overwritten. The fields specified in the
   *  update_mask are relative to the resource, not the full request. A field is
   *  overwritten if it is in the mask. If the user does not provide a mask, then
   *  all fields are overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The state that the group should be in after the update.
   */
  // const group = {}
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callUpdateGroup() {
    // Construct request
    const request = {
      group,
    };

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

  callUpdateGroup();

updateGroup(request, options, callback)

updateGroup(request: protos.google.cloud.networkconnectivity.v1.IUpdateGroupRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IGroup, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateGroupRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IGroup, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateGroup(request, callback)

updateGroup(request: protos.google.cloud.networkconnectivity.v1.IUpdateGroupRequest, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IGroup, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateGroupRequest
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IGroup, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateHub(request, options)

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

Updates the description and/or labels of a Network Connectivity Center hub.

Parameters
Name Description
request IUpdateHubRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.networkconnectivity.v1.IHub, 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.
   */
  /**
   *  Optional. In the case of an update to an existing hub, field mask is used
   *  to specify the fields to be overwritten. The fields specified in the
   *  update_mask are relative to the resource, not the full request. A field is
   *  overwritten if it is in the mask. If the user does not provide a mask, then
   *  all fields are overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The state that the hub should be in after the update.
   */
  // const hub = {}
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callUpdateHub() {
    // Construct request
    const request = {
      hub,
    };

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

  callUpdateHub();

updateHub(request, options, callback)

updateHub(request: protos.google.cloud.networkconnectivity.v1.IUpdateHubRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateHubRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateHub(request, callback)

updateHub(request: protos.google.cloud.networkconnectivity.v1.IUpdateHubRequest, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateHubRequest
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.IHub, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateSpoke(request, options)

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

Updates the parameters of a Network Connectivity Center spoke.

Parameters
Name Description
request IUpdateSpokeRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ LROperation<protos.google.cloud.networkconnectivity.v1.ISpoke, 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.
   */
  /**
   *  Optional. In the case of an update to an existing spoke, field mask is used
   *  to specify the fields to be overwritten. The fields specified in the
   *  update_mask are relative to the resource, not the full request. A field is
   *  overwritten if it is in the mask. If the user does not provide a mask, then
   *  all fields are overwritten.
   */
  // const updateMask = {}
  /**
   *  Required. The state that the spoke should be in after the update.
   */
  // const spoke = {}
  /**
   *  Optional. A request ID to identify requests. Specify a unique request ID so
   *  that if you must retry your request, the server knows to ignore the request
   *  if it has already been completed. The server guarantees that a request
   *  doesn't result in creation of duplicate commitments for at least 60
   *  minutes.
   *  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 to see whether the original operation
   *  was received. If it was, the server ignores the second request. This
   *  behavior prevents clients from mistakenly 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 {HubServiceClient} = require('@google-cloud/network-connectivity').v1;

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

  async function callUpdateSpoke() {
    // Construct request
    const request = {
      spoke,
    };

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

  callUpdateSpoke();

updateSpoke(request, options, callback)

updateSpoke(request: protos.google.cloud.networkconnectivity.v1.IUpdateSpokeRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateSpokeRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateSpoke(request, callback)

updateSpoke(request: protos.google.cloud.networkconnectivity.v1.IUpdateSpokeRequest, callback: Callback<LROperation<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateSpokeRequest
callback Callback<LROperation<protos.google.cloud.networkconnectivity.v1.ISpoke, protos.google.cloud.networkconnectivity.v1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
Type Description
void

vpnTunnelPath(project, region, resourceId)

vpnTunnelPath(project: string, region: string, resourceId: string): string;

Return a fully-qualified vpnTunnel resource name string.

Parameters
Name Description
project string
region string
resourceId string
Returns
Type Description
string

{string} Resource name string.