Class v1beta1.ReachabilityServiceClient (3.0.0)

The Reachability service in the Google Cloud Network Management API provides services that analyze the reachability within a single Google Virtual Private Cloud (VPC) network, between peered VPC networks, between VPC and on-premises networks, or between VPC networks and internet hosts. A reachability analysis is based on Google Cloud network configurations.

You can use the analysis results to verify these configurations and to troubleshoot connectivity issues. v1beta1

Package

@google-cloud/network-management

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of ReachabilityServiceClient.

Parameters
NameDescription
opts ClientOptions
gaxInstance typeof gax | typeof fallback

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

Properties

apiEndpoint

static get apiEndpoint(): string;

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

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

operationsClient

operationsClient: gax.OperationsClient;

pathTemplates

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

port

static get port(): number;

The port for this API service.

reachabilityServiceStub

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

scopes

static get scopes(): string[];

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

servicePath

static get servicePath(): string;

The DNS address for this API service.

warn

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

Methods

checkCreateConnectivityTestProgress(name)

checkCreateConnectivityTestProgress(name: string): Promise<LROperation<protos.google.cloud.networkmanagement.v1beta1.ConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.networkmanagement.v1beta1.ConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource of the Connectivity Test to create:
   *      `projects/{project_id}/locations/global`
   */
  // const parent = 'abc123'
  /**
   *  Required. The logical name of the Connectivity Test in your project
   *  with the following restrictions:
   *  * Must contain only lowercase letters, numbers, and hyphens.
   *  * Must start with a letter.
   *  * Must be between 1-40 characters.
   *  * Must end with a number or a letter.
   *  * Must be unique within the customer project
   */
  // const testId = 'abc123'
  /**
   *  Required. A `ConnectivityTest` resource
   */
  // const resource = {}

  // Imports the Networkmanagement library
  const {ReachabilityServiceClient} = require('@google-cloud/network-management').v1beta1;

  // Instantiates a client
  const networkmanagementClient = new ReachabilityServiceClient();

  async function callCreateConnectivityTest() {
    // Construct request
    const request = {
      parent,
      testId,
      resource,
    };

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

  callCreateConnectivityTest();

checkDeleteConnectivityTestProgress(name)

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

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.protobuf.Empty, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Connectivity Test resource name using the form:
   *      `projects/{project_id}/locations/global/connectivityTests/{test_id}`
   */
  // const name = 'abc123'

  // Imports the Networkmanagement library
  const {ReachabilityServiceClient} = require('@google-cloud/network-management').v1beta1;

  // Instantiates a client
  const networkmanagementClient = new ReachabilityServiceClient();

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

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

  callDeleteConnectivityTest();

checkRerunConnectivityTestProgress(name)

checkRerunConnectivityTestProgress(name: string): Promise<LROperation<protos.google.cloud.networkmanagement.v1beta1.ConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.networkmanagement.v1beta1.ConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Connectivity Test resource name using the form:
   *      `projects/{project_id}/locations/global/connectivityTests/{test_id}`
   */
  // const name = 'abc123'

  // Imports the Networkmanagement library
  const {ReachabilityServiceClient} = require('@google-cloud/network-management').v1beta1;

  // Instantiates a client
  const networkmanagementClient = new ReachabilityServiceClient();

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

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

  callRerunConnectivityTest();

checkUpdateConnectivityTestProgress(name)

checkUpdateConnectivityTestProgress(name: string): Promise<LROperation<protos.google.cloud.networkmanagement.v1beta1.ConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>>;

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

Parameter
NameDescription
name string

The operation name that will be passed.

Returns
TypeDescription
Promise<LROperation<protos.google.cloud.networkmanagement.v1beta1.ConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.OperationMetadata>>

{Promise} - The promise which resolves to an object. The decoded operation object has result and metadata field to get information from. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Mask of fields to update. At least one path must be supplied in
   *  this field.
   */
  // const updateMask = {}
  /**
   *  Required. Only fields specified in update_mask are updated.
   */
  // const resource = {}

  // Imports the Networkmanagement library
  const {ReachabilityServiceClient} = require('@google-cloud/network-management').v1beta1;

  // Instantiates a client
  const networkmanagementClient = new ReachabilityServiceClient();

  async function callUpdateConnectivityTest() {
    // Construct request
    const request = {
      updateMask,
      resource,
    };

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

  callUpdateConnectivityTest();

close()

close(): Promise<void>;

Terminate the gRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

Returns
TypeDescription
Promise<void>

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

connectivityTestPath(project, test)

connectivityTestPath(project: string, test: string): string;

Return a fully-qualified connectivityTest resource name string.

Parameters
NameDescription
project string
test string
Returns
TypeDescription
string

{string} Resource name string.

createConnectivityTest(request, options)

createConnectivityTest(request?: protos.google.cloud.networkmanagement.v1beta1.ICreateConnectivityTestRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Creates a new Connectivity Test. After you create a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes.

If the endpoint specifications in ConnectivityTest are invalid (for example, containing non-existent resources in the network, or you don't have read permissions to the network configurations of listed projects), then the reachability result returns a value of UNKNOWN.

If the endpoint specifications in ConnectivityTest are incomplete, the reachability result returns a value of AMBIGUOUS. For more information, see the Connectivity Test documentation.

Parameters
NameDescription
request ICreateConnectivityTestRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The parent resource of the Connectivity Test to create:
   *      `projects/{project_id}/locations/global`
   */
  // const parent = 'abc123'
  /**
   *  Required. The logical name of the Connectivity Test in your project
   *  with the following restrictions:
   *  * Must contain only lowercase letters, numbers, and hyphens.
   *  * Must start with a letter.
   *  * Must be between 1-40 characters.
   *  * Must end with a number or a letter.
   *  * Must be unique within the customer project
   */
  // const testId = 'abc123'
  /**
   *  Required. A `ConnectivityTest` resource
   */
  // const resource = {}

  // Imports the Networkmanagement library
  const {ReachabilityServiceClient} = require('@google-cloud/network-management').v1beta1;

  // Instantiates a client
  const networkmanagementClient = new ReachabilityServiceClient();

  async function callCreateConnectivityTest() {
    // Construct request
    const request = {
      parent,
      testId,
      resource,
    };

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

  callCreateConnectivityTest();

createConnectivityTest(request, options, callback)

createConnectivityTest(request: protos.google.cloud.networkmanagement.v1beta1.ICreateConnectivityTestRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateConnectivityTestRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

createConnectivityTest(request, callback)

createConnectivityTest(request: protos.google.cloud.networkmanagement.v1beta1.ICreateConnectivityTestRequest, callback: Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request ICreateConnectivityTestRequest
callback Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

deleteConnectivityTest(request, options)

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

Deletes a specific ConnectivityTest.

Parameters
NameDescription
request IDeleteConnectivityTestRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Connectivity Test resource name using the form:
   *      `projects/{project_id}/locations/global/connectivityTests/{test_id}`
   */
  // const name = 'abc123'

  // Imports the Networkmanagement library
  const {ReachabilityServiceClient} = require('@google-cloud/network-management').v1beta1;

  // Instantiates a client
  const networkmanagementClient = new ReachabilityServiceClient();

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

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

  callDeleteConnectivityTest();

deleteConnectivityTest(request, options, callback)

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

deleteConnectivityTest(request, callback)

deleteConnectivityTest(request: protos.google.cloud.networkmanagement.v1beta1.IDeleteConnectivityTestRequest, callback: Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IDeleteConnectivityTestRequest
callback Callback<LROperation<protos.google.protobuf.IEmpty, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getConnectivityTest(request, options)

getConnectivityTest(request?: protos.google.cloud.networkmanagement.v1beta1.IGetConnectivityTestRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest,
        (protos.google.cloud.networkmanagement.v1beta1.IGetConnectivityTestRequest | undefined),
        {} | undefined
    ]>;

Gets the details of a specific Connectivity Test.

Parameters
NameDescription
request IGetConnectivityTestRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, (protos.google.cloud.networkmanagement.v1beta1.IGetConnectivityTestRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing ConnectivityTest. 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. `ConnectivityTest` resource name using the form:
   *      `projects/{project_id}/locations/global/connectivityTests/{test_id}`
   */
  // const name = 'abc123'

  // Imports the Networkmanagement library
  const {ReachabilityServiceClient} = require('@google-cloud/network-management').v1beta1;

  // Instantiates a client
  const networkmanagementClient = new ReachabilityServiceClient();

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

    // Run request
    const response = await networkmanagementClient.getConnectivityTest(request);
    console.log(response);
  }

  callGetConnectivityTest();

getConnectivityTest(request, options, callback)

getConnectivityTest(request: protos.google.cloud.networkmanagement.v1beta1.IGetConnectivityTestRequest, options: CallOptions, callback: Callback<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IGetConnectivityTestRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetConnectivityTestRequest
options CallOptions
callback Callback<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IGetConnectivityTestRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getConnectivityTest(request, callback)

getConnectivityTest(request: protos.google.cloud.networkmanagement.v1beta1.IGetConnectivityTestRequest, callback: Callback<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IGetConnectivityTestRequest | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IGetConnectivityTestRequest
callback Callback<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IGetConnectivityTestRequest | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

getProjectId()

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

getProjectId(callback)

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

initialize()

initialize(): Promise<{
        [name: string]: Function;
    }>;

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

Returns
TypeDescription
Promise<{ [name: string]: Function; }>

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

listConnectivityTests(request, options)

listConnectivityTests(request?: protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsRequest, options?: CallOptions): Promise<[
        protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest[],
        protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsRequest | null,
        protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsResponse
    ]>;

Lists all Connectivity Tests owned by a project.

Parameters
NameDescription
request IListConnectivityTestsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest[], protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsRequest | null, protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsResponse ]>

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

listConnectivityTests(request, options, callback)

listConnectivityTests(request: protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsRequest, protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsResponse | null | undefined, protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest>): void;
Parameters
NameDescription
request IListConnectivityTestsRequest
options CallOptions
callback PaginationCallback<protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsRequest, protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsResponse | null | undefined, protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest>
Returns
TypeDescription
void

listConnectivityTests(request, callback)

listConnectivityTests(request: protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsRequest, callback: PaginationCallback<protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsRequest, protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsResponse | null | undefined, protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest>): void;
Parameters
NameDescription
request IListConnectivityTestsRequest
callback PaginationCallback<protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsRequest, protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsResponse | null | undefined, protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest>
Returns
TypeDescription
void

listConnectivityTestsAsync(request, options)

listConnectivityTestsAsync(request?: protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest>;

Equivalent to listConnectivityTests, but returns an iterable object.

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

Parameters
NameDescription
request IListConnectivityTestsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
AsyncIterable<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing ConnectivityTest. 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 of the Connectivity Tests:
   *      `projects/{project_id}/locations/global`
   */
  // const parent = 'abc123'
  /**
   *  Number of `ConnectivityTests` to return.
   */
  // const pageSize = 1234
  /**
   *  Page token from an earlier query, as returned in `next_page_token`.
   */
  // const pageToken = 'abc123'
  /**
   *  Lists the `ConnectivityTests` that match the filter expression. A filter
   *  expression filters the resources listed in the response. The expression
   *  must be of the form `

listConnectivityTestsStream(request, options)

listConnectivityTestsStream(request?: protos.google.cloud.networkmanagement.v1beta1.IListConnectivityTestsRequest, options?: CallOptions): Transform;

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

Parameters
NameDescription
request IListConnectivityTestsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Transform

{Stream} An object stream which emits an object representing ConnectivityTest 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 listConnectivityTestsAsync() method described below for async iteration which you can stop as needed. Please see the documentation for more details and examples.

matchProjectFromConnectivityTestName(connectivityTestName)

matchProjectFromConnectivityTestName(connectivityTestName: string): string | number;

Parse the project from ConnectivityTest resource.

Parameter
NameDescription
connectivityTestName string

A fully-qualified path representing ConnectivityTest resource.

Returns
TypeDescription
string | number

{string} A string representing the project.

matchTestFromConnectivityTestName(connectivityTestName)

matchTestFromConnectivityTestName(connectivityTestName: string): string | number;

Parse the test from ConnectivityTest resource.

Parameter
NameDescription
connectivityTestName string

A fully-qualified path representing ConnectivityTest resource.

Returns
TypeDescription
string | number

{string} A string representing the test.

rerunConnectivityTest(request, options)

rerunConnectivityTest(request?: protos.google.cloud.networkmanagement.v1beta1.IRerunConnectivityTestRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Rerun an existing ConnectivityTest. After the user triggers the rerun, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes.

Even though the test configuration remains the same, the reachability result may change due to underlying network configuration changes.

If the endpoint specifications in ConnectivityTest become invalid (for example, specified resources are deleted in the network, or you lost read permissions to the network configurations of listed projects), then the reachability result returns a value of UNKNOWN.

Parameters
NameDescription
request IRerunConnectivityTestRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Connectivity Test resource name using the form:
   *      `projects/{project_id}/locations/global/connectivityTests/{test_id}`
   */
  // const name = 'abc123'

  // Imports the Networkmanagement library
  const {ReachabilityServiceClient} = require('@google-cloud/network-management').v1beta1;

  // Instantiates a client
  const networkmanagementClient = new ReachabilityServiceClient();

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

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

  callRerunConnectivityTest();

rerunConnectivityTest(request, options, callback)

rerunConnectivityTest(request: protos.google.cloud.networkmanagement.v1beta1.IRerunConnectivityTestRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IRerunConnectivityTestRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

rerunConnectivityTest(request, callback)

rerunConnectivityTest(request: protos.google.cloud.networkmanagement.v1beta1.IRerunConnectivityTestRequest, callback: Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IRerunConnectivityTestRequest
callback Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateConnectivityTest(request, options)

updateConnectivityTest(request?: protos.google.cloud.networkmanagement.v1beta1.IUpdateConnectivityTestRequest, options?: CallOptions): Promise<[
        LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>,
        protos.google.longrunning.IOperation | undefined,
        {} | undefined
    ]>;

Updates the configuration of an existing ConnectivityTest. After you update a test, the reachability analysis is performed as part of the long running operation, which completes when the analysis completes. The Reachability state in the test resource is updated with the new result.

If the endpoint specifications in ConnectivityTest are invalid (for example, they contain non-existent resources in the network, or the user does not have read permissions to the network configurations of listed projects), then the reachability result returns a value of UNKNOWN.

If the endpoint specifications in ConnectivityTest are incomplete, the reachability result returns a value of AMBIGUOUS. See the documentation in ConnectivityTest for for more details.

Parameters
NameDescription
request IUpdateConnectivityTestRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
TypeDescription
Promise<[ LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing a long running operation. Its promise() method returns a promise you can await for. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. Mask of fields to update. At least one path must be supplied in
   *  this field.
   */
  // const updateMask = {}
  /**
   *  Required. Only fields specified in update_mask are updated.
   */
  // const resource = {}

  // Imports the Networkmanagement library
  const {ReachabilityServiceClient} = require('@google-cloud/network-management').v1beta1;

  // Instantiates a client
  const networkmanagementClient = new ReachabilityServiceClient();

  async function callUpdateConnectivityTest() {
    // Construct request
    const request = {
      updateMask,
      resource,
    };

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

  callUpdateConnectivityTest();

updateConnectivityTest(request, options, callback)

updateConnectivityTest(request: protos.google.cloud.networkmanagement.v1beta1.IUpdateConnectivityTestRequest, options: CallOptions, callback: Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateConnectivityTestRequest
options CallOptions
callback Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void

updateConnectivityTest(request, callback)

updateConnectivityTest(request: protos.google.cloud.networkmanagement.v1beta1.IUpdateConnectivityTestRequest, callback: Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>): void;
Parameters
NameDescription
request IUpdateConnectivityTestRequest
callback Callback<LROperation<protos.google.cloud.networkmanagement.v1beta1.IConnectivityTest, protos.google.cloud.networkmanagement.v1beta1.IOperationMetadata>, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined>
Returns
TypeDescription
void