Class v3.NotificationChannelServiceClient (5.2.0)

The Notification Channel API provides access to configuration that controls how messages related to incidents are sent. v3

Package

@google-cloud/monitoring

Constructors

(constructor)(opts, gaxInstance)

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

Construct an instance of NotificationChannelServiceClient.

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

Properties

apiEndpoint

get apiEndpoint(): string;

The DNS address for this API service.

apiEndpoint

static get apiEndpoint(): string;

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

auth

auth: gax.GoogleAuth;

descriptors

descriptors: Descriptors;

innerApiCalls

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

notificationChannelServiceStub

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

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

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.

createNotificationChannel(request, options)

createNotificationChannel(request?: protos.google.monitoring.v3.ICreateNotificationChannelRequest, options?: CallOptions): Promise<[
        protos.google.monitoring.v3.INotificationChannel,
        protos.google.monitoring.v3.ICreateNotificationChannelRequest | undefined,
        {} | undefined
    ]>;

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
Name Description
request ICreateNotificationChannelRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.ICreateNotificationChannelRequest | 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
   *  project (https://cloud.google.com/monitoring/api/v3#project_name) on which
   *  to execute the request. The format is:
   *      projects/[PROJECT_ID_OR_NUMBER]
   *  This names the container into which the channel will be
   *  written, this does not name the newly created channel. The resulting
   *  channel's name will have a normalized version of this field as a prefix,
   *  but will add `/notificationChannels/[CHANNEL_ID]` to identify the channel.
   */
  // const name = 'abc123'
  /**
   *  Required. The definition of the `NotificationChannel` to create.
   */
  // const notificationChannel = {}

  // Imports the Monitoring library
  const {NotificationChannelServiceClient} = require('@google-cloud/monitoring').v3;

  // Instantiates a client
  const monitoringClient = new NotificationChannelServiceClient();

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

    // Run request
    const response = await monitoringClient.createNotificationChannel(request);
    console.log(response);
  }

  callCreateNotificationChannel();

createNotificationChannel(request, options, callback)

createNotificationChannel(request: protos.google.monitoring.v3.ICreateNotificationChannelRequest, options: CallOptions, callback: Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.ICreateNotificationChannelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateNotificationChannelRequest
options CallOptions
callback Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.ICreateNotificationChannelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

createNotificationChannel(request, callback)

createNotificationChannel(request: protos.google.monitoring.v3.ICreateNotificationChannelRequest, callback: Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.ICreateNotificationChannelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ICreateNotificationChannelRequest
callback Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.ICreateNotificationChannelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteNotificationChannel(request, options)

deleteNotificationChannel(request?: protos.google.monitoring.v3.IDeleteNotificationChannelRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        protos.google.monitoring.v3.IDeleteNotificationChannelRequest | undefined,
        {} | undefined
    ]>;

Deletes a notification channel.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
Name Description
request IDeleteNotificationChannelRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteNotificationChannelRequest | undefined, {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. 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 channel for which to execute the request. The format is:
   *      projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
   */
  // const name = 'abc123'
  /**
   *  If true, the notification channel will be deleted regardless of its
   *  use in alert policies (the policies will be updated to remove the
   *  channel). If false, this operation will fail if the notification channel
   *  is referenced by existing alerting policies.
   */
  // const force = true

  // Imports the Monitoring library
  const {NotificationChannelServiceClient} = require('@google-cloud/monitoring').v3;

  // Instantiates a client
  const monitoringClient = new NotificationChannelServiceClient();

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

    // Run request
    const response = await monitoringClient.deleteNotificationChannel(request);
    console.log(response);
  }

  callDeleteNotificationChannel();

deleteNotificationChannel(request, options, callback)

deleteNotificationChannel(request: protos.google.monitoring.v3.IDeleteNotificationChannelRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteNotificationChannelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteNotificationChannelRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteNotificationChannelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

deleteNotificationChannel(request, callback)

deleteNotificationChannel(request: protos.google.monitoring.v3.IDeleteNotificationChannelRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteNotificationChannelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IDeleteNotificationChannelRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.IDeleteNotificationChannelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

folderAlertPolicyConditionPath(folder, alertPolicy, condition)

folderAlertPolicyConditionPath(folder: string, alertPolicy: string, condition: string): string;

Return a fully-qualified folderAlertPolicyCondition resource name string.

Parameters
Name Description
folder string
alertPolicy string
condition string
Returns
Type Description
string

{string} Resource name string.

folderAlertPolicyPath(folder, alertPolicy)

folderAlertPolicyPath(folder: string, alertPolicy: string): string;

Return a fully-qualified folderAlertPolicy resource name string.

Parameters
Name Description
folder string
alertPolicy string
Returns
Type Description
string

{string} Resource name string.

folderChannelDescriptorPath(folder, channelDescriptor)

folderChannelDescriptorPath(folder: string, channelDescriptor: string): string;

Return a fully-qualified folderChannelDescriptor resource name string.

Parameters
Name Description
folder string
channelDescriptor string
Returns
Type Description
string

{string} Resource name string.

folderGroupPath(folder, group)

folderGroupPath(folder: string, group: string): string;

Return a fully-qualified folderGroup resource name string.

Parameters
Name Description
folder string
group string
Returns
Type Description
string

{string} Resource name string.

folderNotificationChannelPath(folder, notificationChannel)

folderNotificationChannelPath(folder: string, notificationChannel: string): string;

Return a fully-qualified folderNotificationChannel resource name string.

Parameters
Name Description
folder string
notificationChannel string
Returns
Type Description
string

{string} Resource name string.

folderServicePath(folder, service)

folderServicePath(folder: string, service: string): string;

Return a fully-qualified folderService resource name string.

Parameters
Name Description
folder string
service string
Returns
Type Description
string

{string} Resource name string.

folderServiceServiceLevelObjectivePath(folder, service, serviceLevelObjective)

folderServiceServiceLevelObjectivePath(folder: string, service: string, serviceLevelObjective: string): string;

Return a fully-qualified folderServiceServiceLevelObjective resource name string.

Parameters
Name Description
folder string
service string
serviceLevelObjective string
Returns
Type Description
string

{string} Resource name string.

folderUptimeCheckConfigPath(folder, uptimeCheckConfig)

folderUptimeCheckConfigPath(folder: string, uptimeCheckConfig: string): string;

Return a fully-qualified folderUptimeCheckConfig resource name string.

Parameters
Name Description
folder string
uptimeCheckConfig string
Returns
Type Description
string

{string} Resource name string.

getNotificationChannel(request, options)

getNotificationChannel(request?: protos.google.monitoring.v3.IGetNotificationChannelRequest, options?: CallOptions): Promise<[
        protos.google.monitoring.v3.INotificationChannel,
        protos.google.monitoring.v3.IGetNotificationChannelRequest | undefined,
        {} | undefined
    ]>;

Gets a single notification channel. The channel includes the relevant configuration details with which the channel was created. However, the response may truncate or omit passwords, API keys, or other private key matter and thus the response may not be 100% identical to the information that was supplied in the call to the create method.

Parameters
Name Description
request IGetNotificationChannelRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IGetNotificationChannelRequest | 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 channel for which to execute the request. The format is:
   *      projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID]
   */
  // const name = 'abc123'

  // Imports the Monitoring library
  const {NotificationChannelServiceClient} = require('@google-cloud/monitoring').v3;

  // Instantiates a client
  const monitoringClient = new NotificationChannelServiceClient();

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

    // Run request
    const response = await monitoringClient.getNotificationChannel(request);
    console.log(response);
  }

  callGetNotificationChannel();

getNotificationChannel(request, options, callback)

getNotificationChannel(request: protos.google.monitoring.v3.IGetNotificationChannelRequest, options: CallOptions, callback: Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IGetNotificationChannelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetNotificationChannelRequest
options CallOptions
callback Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IGetNotificationChannelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getNotificationChannel(request, callback)

getNotificationChannel(request: protos.google.monitoring.v3.IGetNotificationChannelRequest, callback: Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IGetNotificationChannelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetNotificationChannelRequest
callback Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IGetNotificationChannelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getNotificationChannelDescriptor(request, options)

getNotificationChannelDescriptor(request?: protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest, options?: CallOptions): Promise<[
        protos.google.monitoring.v3.INotificationChannelDescriptor,
        (protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest | undefined),
        {} | undefined
    ]>;

Gets a single channel descriptor. The descriptor indicates which fields are expected / permitted for a notification channel of the given type.

Parameters
Name Description
request IGetNotificationChannelDescriptorRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.monitoring.v3.INotificationChannelDescriptor, (protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing NotificationChannelDescriptor. 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 channel type for which to execute the request. The format is:
   *      projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[CHANNEL_TYPE]
   */
  // const name = 'abc123'

  // Imports the Monitoring library
  const {NotificationChannelServiceClient} = require('@google-cloud/monitoring').v3;

  // Instantiates a client
  const monitoringClient = new NotificationChannelServiceClient();

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

    // Run request
    const response = await monitoringClient.getNotificationChannelDescriptor(request);
    console.log(response);
  }

  callGetNotificationChannelDescriptor();

getNotificationChannelDescriptor(request, options, callback)

getNotificationChannelDescriptor(request: protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest, options: CallOptions, callback: Callback<protos.google.monitoring.v3.INotificationChannelDescriptor, protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetNotificationChannelDescriptorRequest
options CallOptions
callback Callback<protos.google.monitoring.v3.INotificationChannelDescriptor, protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getNotificationChannelDescriptor(request, callback)

getNotificationChannelDescriptor(request: protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest, callback: Callback<protos.google.monitoring.v3.INotificationChannelDescriptor, protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetNotificationChannelDescriptorRequest
callback Callback<protos.google.monitoring.v3.INotificationChannelDescriptor, protos.google.monitoring.v3.IGetNotificationChannelDescriptorRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getNotificationChannelVerificationCode(request, options)

getNotificationChannelVerificationCode(request?: protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, options?: CallOptions): Promise<[
        protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse,
        (protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest | undefined),
        {} | undefined
    ]>;

Requests a verification code for an already verified channel that can then be used in a call to VerifyNotificationChannel() on a different channel with an equivalent identity in the same or in a different project. This makes it possible to copy a channel between projects without requiring manual reverification of the channel. If the channel is not in the verified state, this method will fail (in other words, this may only be used if the SendNotificationChannelVerificationCode and VerifyNotificationChannel paths have already been used to put the given channel into the verified state).

There is no guarantee that the verification codes returned by this method will be of a similar structure or form as the ones that are delivered to the channel via SendNotificationChannelVerificationCode; while VerifyNotificationChannel() will recognize both the codes delivered via SendNotificationChannelVerificationCode() and returned from GetNotificationChannelVerificationCode(), it is typically the case that the verification codes delivered via SendNotificationChannelVerificationCode() will be shorter and also have a shorter expiration (e.g. codes such as "G-123456") whereas GetVerificationCode() will typically return a much longer, websafe base 64 encoded string that has a longer expiration time.

Parameters
Name Description
request IGetNotificationChannelVerificationCodeRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, (protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing GetNotificationChannelVerificationCodeResponse. 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 notification channel for which a verification code is to be
   *  generated and retrieved. This must name a channel that is already verified;
   *  if the specified channel is not verified, the request will fail.
   */
  // const name = 'abc123'
  /**
   *  The desired expiration time. If specified, the API will guarantee that
   *  the returned code will not be valid after the specified timestamp;
   *  however, the API cannot guarantee that the returned code will be
   *  valid for at least as long as the requested time (the API puts an upper
   *  bound on the amount of time for which a code may be valid). If omitted,
   *  a default expiration will be used, which may be less than the max
   *  permissible expiration (so specifying an expiration may extend the
   *  code's lifetime over omitting an expiration, even though the API does
   *  impose an upper limit on the maximum expiration that is permitted).
   */
  // const expireTime = {}

  // Imports the Monitoring library
  const {NotificationChannelServiceClient} = require('@google-cloud/monitoring').v3;

  // Instantiates a client
  const monitoringClient = new NotificationChannelServiceClient();

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

    // Run request
    const response = await monitoringClient.getNotificationChannelVerificationCode(request);
    console.log(response);
  }

  callGetNotificationChannelVerificationCode();

getNotificationChannelVerificationCode(request, options, callback)

getNotificationChannelVerificationCode(request: protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, options: CallOptions, callback: Callback<protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetNotificationChannelVerificationCodeRequest
options CallOptions
callback Callback<protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getNotificationChannelVerificationCode(request, callback)

getNotificationChannelVerificationCode(request: protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest, callback: Callback<protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IGetNotificationChannelVerificationCodeRequest
callback Callback<protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeResponse, protos.google.monitoring.v3.IGetNotificationChannelVerificationCodeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

getProjectId()

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

getProjectId(callback)

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

initialize()

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

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

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

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

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

listNotificationChannelDescriptors(request, options)

listNotificationChannelDescriptors(request?: protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, options?: CallOptions): Promise<[
        protos.google.monitoring.v3.INotificationChannelDescriptor[],
        protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest | null,
        protos.google.monitoring.v3.IListNotificationChannelDescriptorsResponse
    ]>;

Lists the descriptors for supported channel types. The use of descriptors makes it possible for new channel types to be dynamically added.

Parameters
Name Description
request IListNotificationChannelDescriptorsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.monitoring.v3.INotificationChannelDescriptor[], protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest | null, protos.google.monitoring.v3.IListNotificationChannelDescriptorsResponse ]>

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

listNotificationChannelDescriptors(request, options, callback)

listNotificationChannelDescriptors(request: protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, options: CallOptions, callback: PaginationCallback<protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, protos.google.monitoring.v3.IListNotificationChannelDescriptorsResponse | null | undefined, protos.google.monitoring.v3.INotificationChannelDescriptor>): void;
Parameters
Name Description
request IListNotificationChannelDescriptorsRequest
options CallOptions
callback PaginationCallback<protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, protos.google.monitoring.v3.IListNotificationChannelDescriptorsResponse | null | undefined, protos.google.monitoring.v3.INotificationChannelDescriptor>
Returns
Type Description
void

listNotificationChannelDescriptors(request, callback)

listNotificationChannelDescriptors(request: protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, callback: PaginationCallback<protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, protos.google.monitoring.v3.IListNotificationChannelDescriptorsResponse | null | undefined, protos.google.monitoring.v3.INotificationChannelDescriptor>): void;
Parameters
Name Description
request IListNotificationChannelDescriptorsRequest
callback PaginationCallback<protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, protos.google.monitoring.v3.IListNotificationChannelDescriptorsResponse | null | undefined, protos.google.monitoring.v3.INotificationChannelDescriptor>
Returns
Type Description
void

listNotificationChannelDescriptorsAsync(request, options)

listNotificationChannelDescriptorsAsync(request?: protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, options?: CallOptions): AsyncIterable<protos.google.monitoring.v3.INotificationChannelDescriptor>;

Equivalent to listNotificationChannelDescriptors, but returns an iterable object.

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

Parameters
Name Description
request IListNotificationChannelDescriptorsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.monitoring.v3.INotificationChannelDescriptor>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing NotificationChannelDescriptor. 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 REST resource name of the parent from which to retrieve
   *  the notification channel descriptors. The expected syntax is:
   *      projects/[PROJECT_ID_OR_NUMBER]
   *  Note that this
   *  names (https://cloud.google.com/monitoring/api/v3#project_name) the parent
   *  container in which to look for the descriptors; to retrieve a single
   *  descriptor by name, use the
   *  GetNotificationChannelDescriptor google.monitoring.v3.NotificationChannelService.GetNotificationChannelDescriptor 
   *  operation, instead.
   */
  // const name = 'abc123'
  /**
   *  The maximum number of results to return in a single response. If
   *  not set to a positive number, a reasonable value will be chosen by the
   *  service.
   */
  // const pageSize = 1234
  /**
   *  If non-empty, `page_token` must contain a value returned as the
   *  `next_page_token` in a previous response to request the next set
   *  of results.
   */
  // const pageToken = 'abc123'

  // Imports the Monitoring library
  const {NotificationChannelServiceClient} = require('@google-cloud/monitoring').v3;

  // Instantiates a client
  const monitoringClient = new NotificationChannelServiceClient();

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

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

  callListNotificationChannelDescriptors();

listNotificationChannelDescriptorsStream(request, options)

listNotificationChannelDescriptorsStream(request?: protos.google.monitoring.v3.IListNotificationChannelDescriptorsRequest, options?: CallOptions): Transform;

Equivalent to listNotificationChannelDescriptors, but returns a NodeJS Stream object.

Parameters
Name Description
request IListNotificationChannelDescriptorsRequest

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

listNotificationChannels(request, options)

listNotificationChannels(request?: protos.google.monitoring.v3.IListNotificationChannelsRequest, options?: CallOptions): Promise<[
        protos.google.monitoring.v3.INotificationChannel[],
        protos.google.monitoring.v3.IListNotificationChannelsRequest | null,
        protos.google.monitoring.v3.IListNotificationChannelsResponse
    ]>;

Lists the notification channels that have been created for the project. To list the types of notification channels that are supported, use the ListNotificationChannelDescriptors method.

Parameters
Name Description
request IListNotificationChannelsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.monitoring.v3.INotificationChannel[], protos.google.monitoring.v3.IListNotificationChannelsRequest | null, protos.google.monitoring.v3.IListNotificationChannelsResponse ]>

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

listNotificationChannels(request, options, callback)

listNotificationChannels(request: protos.google.monitoring.v3.IListNotificationChannelsRequest, options: CallOptions, callback: PaginationCallback<protos.google.monitoring.v3.IListNotificationChannelsRequest, protos.google.monitoring.v3.IListNotificationChannelsResponse | null | undefined, protos.google.monitoring.v3.INotificationChannel>): void;
Parameters
Name Description
request IListNotificationChannelsRequest
options CallOptions
callback PaginationCallback<protos.google.monitoring.v3.IListNotificationChannelsRequest, protos.google.monitoring.v3.IListNotificationChannelsResponse | null | undefined, protos.google.monitoring.v3.INotificationChannel>
Returns
Type Description
void

listNotificationChannels(request, callback)

listNotificationChannels(request: protos.google.monitoring.v3.IListNotificationChannelsRequest, callback: PaginationCallback<protos.google.monitoring.v3.IListNotificationChannelsRequest, protos.google.monitoring.v3.IListNotificationChannelsResponse | null | undefined, protos.google.monitoring.v3.INotificationChannel>): void;
Parameters
Name Description
request IListNotificationChannelsRequest
callback PaginationCallback<protos.google.monitoring.v3.IListNotificationChannelsRequest, protos.google.monitoring.v3.IListNotificationChannelsResponse | null | undefined, protos.google.monitoring.v3.INotificationChannel>
Returns
Type Description
void

listNotificationChannelsAsync(request, options)

listNotificationChannelsAsync(request?: protos.google.monitoring.v3.IListNotificationChannelsRequest, options?: CallOptions): AsyncIterable<protos.google.monitoring.v3.INotificationChannel>;

Equivalent to listNotificationChannels, but returns an iterable object.

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

Parameters
Name Description
request IListNotificationChannelsRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
AsyncIterable<protos.google.monitoring.v3.INotificationChannel>

{Object} An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing . The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples.

Example

  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The
   *  project (https://cloud.google.com/monitoring/api/v3#project_name) on which
   *  to execute the request. The format is:
   *      projects/[PROJECT_ID_OR_NUMBER]
   *  This names the container
   *  in which to look for the notification channels; it does not name a
   *  specific channel. To query a specific channel by REST resource name, use
   *  the
   *  `GetNotificationChannel` google.monitoring.v3.NotificationChannelService.GetNotificationChannel 
   *  operation.
   */
  // const name = 'abc123'
  /**
   *  Optional. If provided, this field specifies the criteria that must be met
   *  by notification channels to be included in the response.
   *  For more details, see sorting and
   *  filtering (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
   */
  // const filter = 'abc123'
  /**
   *  Optional. A comma-separated list of fields by which to sort the result.
   *  Supports the same set of fields as in `filter`. Entries can be prefixed
   *  with a minus sign to sort in descending rather than ascending order.
   *  For more details, see sorting and
   *  filtering (https://cloud.google.com/monitoring/api/v3/sorting-and-filtering).
   */
  // const orderBy = 'abc123'
  /**
   *  Optional. The maximum number of results to return in a single response. If
   *  not set to a positive number, a reasonable value will be chosen by the
   *  service.
   */
  // const pageSize = 1234
  /**
   *  Optional. If non-empty, `page_token` must contain a value returned as the
   *  `next_page_token` in a previous response to request the next set
   *  of results.
   */
  // const pageToken = 'abc123'

  // Imports the Monitoring library
  const {NotificationChannelServiceClient} = require('@google-cloud/monitoring').v3;

  // Instantiates a client
  const monitoringClient = new NotificationChannelServiceClient();

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

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

  callListNotificationChannels();

listNotificationChannelsStream(request, options)

listNotificationChannelsStream(request?: protos.google.monitoring.v3.IListNotificationChannelsRequest, options?: CallOptions): Transform;

Equivalent to listNotificationChannels, but returns a NodeJS Stream object.

Parameters
Name Description
request IListNotificationChannelsRequest

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

matchAlertPolicyFromFolderAlertPolicyConditionName(folderAlertPolicyConditionName)

matchAlertPolicyFromFolderAlertPolicyConditionName(folderAlertPolicyConditionName: string): string | number;

Parse the alert_policy from FolderAlertPolicyCondition resource.

Parameter
Name Description
folderAlertPolicyConditionName string

A fully-qualified path representing folder_alert_policy_condition resource.

Returns
Type Description
string | number

{string} A string representing the alert_policy.

matchAlertPolicyFromFolderAlertPolicyName(folderAlertPolicyName)

matchAlertPolicyFromFolderAlertPolicyName(folderAlertPolicyName: string): string | number;

Parse the alert_policy from FolderAlertPolicy resource.

Parameter
Name Description
folderAlertPolicyName string

A fully-qualified path representing folder_alert_policy resource.

Returns
Type Description
string | number

{string} A string representing the alert_policy.

matchAlertPolicyFromOrganizationAlertPolicyConditionName(organizationAlertPolicyConditionName)

matchAlertPolicyFromOrganizationAlertPolicyConditionName(organizationAlertPolicyConditionName: string): string | number;

Parse the alert_policy from OrganizationAlertPolicyCondition resource.

Parameter
Name Description
organizationAlertPolicyConditionName string

A fully-qualified path representing organization_alert_policy_condition resource.

Returns
Type Description
string | number

{string} A string representing the alert_policy.

matchAlertPolicyFromOrganizationAlertPolicyName(organizationAlertPolicyName)

matchAlertPolicyFromOrganizationAlertPolicyName(organizationAlertPolicyName: string): string | number;

Parse the alert_policy from OrganizationAlertPolicy resource.

Parameter
Name Description
organizationAlertPolicyName string

A fully-qualified path representing organization_alert_policy resource.

Returns
Type Description
string | number

{string} A string representing the alert_policy.

matchAlertPolicyFromProjectAlertPolicyConditionName(projectAlertPolicyConditionName)

matchAlertPolicyFromProjectAlertPolicyConditionName(projectAlertPolicyConditionName: string): string | number;

Parse the alert_policy from ProjectAlertPolicyCondition resource.

Parameter
Name Description
projectAlertPolicyConditionName string

A fully-qualified path representing project_alert_policy_condition resource.

Returns
Type Description
string | number

{string} A string representing the alert_policy.

matchAlertPolicyFromProjectAlertPolicyName(projectAlertPolicyName)

matchAlertPolicyFromProjectAlertPolicyName(projectAlertPolicyName: string): string | number;

Parse the alert_policy from ProjectAlertPolicy resource.

Parameter
Name Description
projectAlertPolicyName string

A fully-qualified path representing project_alert_policy resource.

Returns
Type Description
string | number

{string} A string representing the alert_policy.

matchChannelDescriptorFromFolderChannelDescriptorName(folderChannelDescriptorName)

matchChannelDescriptorFromFolderChannelDescriptorName(folderChannelDescriptorName: string): string | number;

Parse the channel_descriptor from FolderChannelDescriptor resource.

Parameter
Name Description
folderChannelDescriptorName string

A fully-qualified path representing folder_channel_descriptor resource.

Returns
Type Description
string | number

{string} A string representing the channel_descriptor.

matchChannelDescriptorFromOrganizationChannelDescriptorName(organizationChannelDescriptorName)

matchChannelDescriptorFromOrganizationChannelDescriptorName(organizationChannelDescriptorName: string): string | number;

Parse the channel_descriptor from OrganizationChannelDescriptor resource.

Parameter
Name Description
organizationChannelDescriptorName string

A fully-qualified path representing organization_channel_descriptor resource.

Returns
Type Description
string | number

{string} A string representing the channel_descriptor.

matchChannelDescriptorFromProjectChannelDescriptorName(projectChannelDescriptorName)

matchChannelDescriptorFromProjectChannelDescriptorName(projectChannelDescriptorName: string): string | number;

Parse the channel_descriptor from ProjectChannelDescriptor resource.

Parameter
Name Description
projectChannelDescriptorName string

A fully-qualified path representing project_channel_descriptor resource.

Returns
Type Description
string | number

{string} A string representing the channel_descriptor.

matchConditionFromFolderAlertPolicyConditionName(folderAlertPolicyConditionName)

matchConditionFromFolderAlertPolicyConditionName(folderAlertPolicyConditionName: string): string | number;

Parse the condition from FolderAlertPolicyCondition resource.

Parameter
Name Description
folderAlertPolicyConditionName string

A fully-qualified path representing folder_alert_policy_condition resource.

Returns
Type Description
string | number

{string} A string representing the condition.

matchConditionFromOrganizationAlertPolicyConditionName(organizationAlertPolicyConditionName)

matchConditionFromOrganizationAlertPolicyConditionName(organizationAlertPolicyConditionName: string): string | number;

Parse the condition from OrganizationAlertPolicyCondition resource.

Parameter
Name Description
organizationAlertPolicyConditionName string

A fully-qualified path representing organization_alert_policy_condition resource.

Returns
Type Description
string | number

{string} A string representing the condition.

matchConditionFromProjectAlertPolicyConditionName(projectAlertPolicyConditionName)

matchConditionFromProjectAlertPolicyConditionName(projectAlertPolicyConditionName: string): string | number;

Parse the condition from ProjectAlertPolicyCondition resource.

Parameter
Name Description
projectAlertPolicyConditionName string

A fully-qualified path representing project_alert_policy_condition resource.

Returns
Type Description
string | number

{string} A string representing the condition.

matchFolderFromFolderAlertPolicyConditionName(folderAlertPolicyConditionName)

matchFolderFromFolderAlertPolicyConditionName(folderAlertPolicyConditionName: string): string | number;

Parse the folder from FolderAlertPolicyCondition resource.

Parameter
Name Description
folderAlertPolicyConditionName string

A fully-qualified path representing folder_alert_policy_condition resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchFolderFromFolderAlertPolicyName(folderAlertPolicyName)

matchFolderFromFolderAlertPolicyName(folderAlertPolicyName: string): string | number;

Parse the folder from FolderAlertPolicy resource.

Parameter
Name Description
folderAlertPolicyName string

A fully-qualified path representing folder_alert_policy resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchFolderFromFolderChannelDescriptorName(folderChannelDescriptorName)

matchFolderFromFolderChannelDescriptorName(folderChannelDescriptorName: string): string | number;

Parse the folder from FolderChannelDescriptor resource.

Parameter
Name Description
folderChannelDescriptorName string

A fully-qualified path representing folder_channel_descriptor resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchFolderFromFolderGroupName(folderGroupName)

matchFolderFromFolderGroupName(folderGroupName: string): string | number;

Parse the folder from FolderGroup resource.

Parameter
Name Description
folderGroupName string

A fully-qualified path representing folder_group resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchFolderFromFolderNotificationChannelName(folderNotificationChannelName)

matchFolderFromFolderNotificationChannelName(folderNotificationChannelName: string): string | number;

Parse the folder from FolderNotificationChannel resource.

Parameter
Name Description
folderNotificationChannelName string

A fully-qualified path representing folder_notification_channel resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchFolderFromFolderServiceName(folderServiceName)

matchFolderFromFolderServiceName(folderServiceName: string): string | number;

Parse the folder from FolderService resource.

Parameter
Name Description
folderServiceName string

A fully-qualified path representing folder_service resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchFolderFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName)

matchFolderFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string): string | number;

Parse the folder from FolderServiceServiceLevelObjective resource.

Parameter
Name Description
folderServiceServiceLevelObjectiveName string

A fully-qualified path representing folder_service_service_level_objective resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchFolderFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName)

matchFolderFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName: string): string | number;

Parse the folder from FolderUptimeCheckConfig resource.

Parameter
Name Description
folderUptimeCheckConfigName string

A fully-qualified path representing folder_uptime_check_config resource.

Returns
Type Description
string | number

{string} A string representing the folder.

matchGroupFromFolderGroupName(folderGroupName)

matchGroupFromFolderGroupName(folderGroupName: string): string | number;

Parse the group from FolderGroup resource.

Parameter
Name Description
folderGroupName string

A fully-qualified path representing folder_group resource.

Returns
Type Description
string | number

{string} A string representing the group.

matchGroupFromOrganizationGroupName(organizationGroupName)

matchGroupFromOrganizationGroupName(organizationGroupName: string): string | number;

Parse the group from OrganizationGroup resource.

Parameter
Name Description
organizationGroupName string

A fully-qualified path representing organization_group resource.

Returns
Type Description
string | number

{string} A string representing the group.

matchGroupFromProjectGroupName(projectGroupName)

matchGroupFromProjectGroupName(projectGroupName: string): string | number;

Parse the group from ProjectGroup resource.

Parameter
Name Description
projectGroupName string

A fully-qualified path representing project_group resource.

Returns
Type Description
string | number

{string} A string representing the group.

matchNotificationChannelFromFolderNotificationChannelName(folderNotificationChannelName)

matchNotificationChannelFromFolderNotificationChannelName(folderNotificationChannelName: string): string | number;

Parse the notification_channel from FolderNotificationChannel resource.

Parameter
Name Description
folderNotificationChannelName string

A fully-qualified path representing folder_notification_channel resource.

Returns
Type Description
string | number

{string} A string representing the notification_channel.

matchNotificationChannelFromOrganizationNotificationChannelName(organizationNotificationChannelName)

matchNotificationChannelFromOrganizationNotificationChannelName(organizationNotificationChannelName: string): string | number;

Parse the notification_channel from OrganizationNotificationChannel resource.

Parameter
Name Description
organizationNotificationChannelName string

A fully-qualified path representing organization_notification_channel resource.

Returns
Type Description
string | number

{string} A string representing the notification_channel.

matchNotificationChannelFromProjectNotificationChannelName(projectNotificationChannelName)

matchNotificationChannelFromProjectNotificationChannelName(projectNotificationChannelName: string): string | number;

Parse the notification_channel from ProjectNotificationChannel resource.

Parameter
Name Description
projectNotificationChannelName string

A fully-qualified path representing project_notification_channel resource.

Returns
Type Description
string | number

{string} A string representing the notification_channel.

matchOrganizationFromOrganizationAlertPolicyConditionName(organizationAlertPolicyConditionName)

matchOrganizationFromOrganizationAlertPolicyConditionName(organizationAlertPolicyConditionName: string): string | number;

Parse the organization from OrganizationAlertPolicyCondition resource.

Parameter
Name Description
organizationAlertPolicyConditionName string

A fully-qualified path representing organization_alert_policy_condition resource.

Returns
Type Description
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationAlertPolicyName(organizationAlertPolicyName)

matchOrganizationFromOrganizationAlertPolicyName(organizationAlertPolicyName: string): string | number;

Parse the organization from OrganizationAlertPolicy resource.

Parameter
Name Description
organizationAlertPolicyName string

A fully-qualified path representing organization_alert_policy resource.

Returns
Type Description
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationChannelDescriptorName(organizationChannelDescriptorName)

matchOrganizationFromOrganizationChannelDescriptorName(organizationChannelDescriptorName: string): string | number;

Parse the organization from OrganizationChannelDescriptor resource.

Parameter
Name Description
organizationChannelDescriptorName string

A fully-qualified path representing organization_channel_descriptor resource.

Returns
Type Description
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationGroupName(organizationGroupName)

matchOrganizationFromOrganizationGroupName(organizationGroupName: string): string | number;

Parse the organization from OrganizationGroup resource.

Parameter
Name Description
organizationGroupName string

A fully-qualified path representing organization_group resource.

Returns
Type Description
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationNotificationChannelName(organizationNotificationChannelName)

matchOrganizationFromOrganizationNotificationChannelName(organizationNotificationChannelName: string): string | number;

Parse the organization from OrganizationNotificationChannel resource.

Parameter
Name Description
organizationNotificationChannelName string

A fully-qualified path representing organization_notification_channel resource.

Returns
Type Description
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationServiceName(organizationServiceName)

matchOrganizationFromOrganizationServiceName(organizationServiceName: string): string | number;

Parse the organization from OrganizationService resource.

Parameter
Name Description
organizationServiceName string

A fully-qualified path representing organization_service resource.

Returns
Type Description
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationServiceServiceLevelObjectiveName(organizationServiceServiceLevelObjectiveName)

matchOrganizationFromOrganizationServiceServiceLevelObjectiveName(organizationServiceServiceLevelObjectiveName: string): string | number;

Parse the organization from OrganizationServiceServiceLevelObjective resource.

Parameter
Name Description
organizationServiceServiceLevelObjectiveName string

A fully-qualified path representing organization_service_service_level_objective resource.

Returns
Type Description
string | number

{string} A string representing the organization.

matchOrganizationFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName)

matchOrganizationFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName: string): string | number;

Parse the organization from OrganizationUptimeCheckConfig resource.

Parameter
Name Description
organizationUptimeCheckConfigName string

A fully-qualified path representing organization_uptime_check_config resource.

Returns
Type Description
string | number

{string} A string representing the organization.

matchProjectFromProjectAlertPolicyConditionName(projectAlertPolicyConditionName)

matchProjectFromProjectAlertPolicyConditionName(projectAlertPolicyConditionName: string): string | number;

Parse the project from ProjectAlertPolicyCondition resource.

Parameter
Name Description
projectAlertPolicyConditionName string

A fully-qualified path representing project_alert_policy_condition resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectAlertPolicyName(projectAlertPolicyName)

matchProjectFromProjectAlertPolicyName(projectAlertPolicyName: string): string | number;

Parse the project from ProjectAlertPolicy resource.

Parameter
Name Description
projectAlertPolicyName string

A fully-qualified path representing project_alert_policy resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectChannelDescriptorName(projectChannelDescriptorName)

matchProjectFromProjectChannelDescriptorName(projectChannelDescriptorName: string): string | number;

Parse the project from ProjectChannelDescriptor resource.

Parameter
Name Description
projectChannelDescriptorName string

A fully-qualified path representing project_channel_descriptor resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectGroupName(projectGroupName)

matchProjectFromProjectGroupName(projectGroupName: string): string | number;

Parse the project from ProjectGroup resource.

Parameter
Name Description
projectGroupName string

A fully-qualified path representing project_group resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectName(projectName)

matchProjectFromProjectName(projectName: string): string | number;

Parse the project from Project resource.

Parameter
Name Description
projectName string

A fully-qualified path representing Project resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectNotificationChannelName(projectNotificationChannelName)

matchProjectFromProjectNotificationChannelName(projectNotificationChannelName: string): string | number;

Parse the project from ProjectNotificationChannel resource.

Parameter
Name Description
projectNotificationChannelName string

A fully-qualified path representing project_notification_channel resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectServiceName(projectServiceName)

matchProjectFromProjectServiceName(projectServiceName: string): string | number;

Parse the project from ProjectService resource.

Parameter
Name Description
projectServiceName string

A fully-qualified path representing project_service resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName)

matchProjectFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string): string | number;

Parse the project from ProjectServiceServiceLevelObjective resource.

Parameter
Name Description
projectServiceServiceLevelObjectiveName string

A fully-qualified path representing project_service_service_level_objective resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName)

matchProjectFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName: string): string | number;

Parse the project from ProjectUptimeCheckConfig resource.

Parameter
Name Description
projectUptimeCheckConfigName string

A fully-qualified path representing project_uptime_check_config resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchProjectFromSnoozeName(snoozeName)

matchProjectFromSnoozeName(snoozeName: string): string | number;

Parse the project from Snooze resource.

Parameter
Name Description
snoozeName string

A fully-qualified path representing Snooze resource.

Returns
Type Description
string | number

{string} A string representing the project.

matchServiceFromFolderServiceName(folderServiceName)

matchServiceFromFolderServiceName(folderServiceName: string): string | number;

Parse the service from FolderService resource.

Parameter
Name Description
folderServiceName string

A fully-qualified path representing folder_service resource.

Returns
Type Description
string | number

{string} A string representing the service.

matchServiceFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName)

matchServiceFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string): string | number;

Parse the service from FolderServiceServiceLevelObjective resource.

Parameter
Name Description
folderServiceServiceLevelObjectiveName string

A fully-qualified path representing folder_service_service_level_objective resource.

Returns
Type Description
string | number

{string} A string representing the service.

matchServiceFromOrganizationServiceName(organizationServiceName)

matchServiceFromOrganizationServiceName(organizationServiceName: string): string | number;

Parse the service from OrganizationService resource.

Parameter
Name Description
organizationServiceName string

A fully-qualified path representing organization_service resource.

Returns
Type Description
string | number

{string} A string representing the service.

matchServiceFromOrganizationServiceServiceLevelObjectiveName(organizationServiceServiceLevelObjectiveName)

matchServiceFromOrganizationServiceServiceLevelObjectiveName(organizationServiceServiceLevelObjectiveName: string): string | number;

Parse the service from OrganizationServiceServiceLevelObjective resource.

Parameter
Name Description
organizationServiceServiceLevelObjectiveName string

A fully-qualified path representing organization_service_service_level_objective resource.

Returns
Type Description
string | number

{string} A string representing the service.

matchServiceFromProjectServiceName(projectServiceName)

matchServiceFromProjectServiceName(projectServiceName: string): string | number;

Parse the service from ProjectService resource.

Parameter
Name Description
projectServiceName string

A fully-qualified path representing project_service resource.

Returns
Type Description
string | number

{string} A string representing the service.

matchServiceFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName)

matchServiceFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string): string | number;

Parse the service from ProjectServiceServiceLevelObjective resource.

Parameter
Name Description
projectServiceServiceLevelObjectiveName string

A fully-qualified path representing project_service_service_level_objective resource.

Returns
Type Description
string | number

{string} A string representing the service.

matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName)

matchServiceLevelObjectiveFromFolderServiceServiceLevelObjectiveName(folderServiceServiceLevelObjectiveName: string): string | number;

Parse the service_level_objective from FolderServiceServiceLevelObjective resource.

Parameter
Name Description
folderServiceServiceLevelObjectiveName string

A fully-qualified path representing folder_service_service_level_objective resource.

Returns
Type Description
string | number

{string} A string representing the service_level_objective.

matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName(organizationServiceServiceLevelObjectiveName)

matchServiceLevelObjectiveFromOrganizationServiceServiceLevelObjectiveName(organizationServiceServiceLevelObjectiveName: string): string | number;

Parse the service_level_objective from OrganizationServiceServiceLevelObjective resource.

Parameter
Name Description
organizationServiceServiceLevelObjectiveName string

A fully-qualified path representing organization_service_service_level_objective resource.

Returns
Type Description
string | number

{string} A string representing the service_level_objective.

matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName)

matchServiceLevelObjectiveFromProjectServiceServiceLevelObjectiveName(projectServiceServiceLevelObjectiveName: string): string | number;

Parse the service_level_objective from ProjectServiceServiceLevelObjective resource.

Parameter
Name Description
projectServiceServiceLevelObjectiveName string

A fully-qualified path representing project_service_service_level_objective resource.

Returns
Type Description
string | number

{string} A string representing the service_level_objective.

matchSnoozeFromSnoozeName(snoozeName)

matchSnoozeFromSnoozeName(snoozeName: string): string | number;

Parse the snooze from Snooze resource.

Parameter
Name Description
snoozeName string

A fully-qualified path representing Snooze resource.

Returns
Type Description
string | number

{string} A string representing the snooze.

matchUptimeCheckConfigFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName)

matchUptimeCheckConfigFromFolderUptimeCheckConfigName(folderUptimeCheckConfigName: string): string | number;

Parse the uptime_check_config from FolderUptimeCheckConfig resource.

Parameter
Name Description
folderUptimeCheckConfigName string

A fully-qualified path representing folder_uptime_check_config resource.

Returns
Type Description
string | number

{string} A string representing the uptime_check_config.

matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName)

matchUptimeCheckConfigFromOrganizationUptimeCheckConfigName(organizationUptimeCheckConfigName: string): string | number;

Parse the uptime_check_config from OrganizationUptimeCheckConfig resource.

Parameter
Name Description
organizationUptimeCheckConfigName string

A fully-qualified path representing organization_uptime_check_config resource.

Returns
Type Description
string | number

{string} A string representing the uptime_check_config.

matchUptimeCheckConfigFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName)

matchUptimeCheckConfigFromProjectUptimeCheckConfigName(projectUptimeCheckConfigName: string): string | number;

Parse the uptime_check_config from ProjectUptimeCheckConfig resource.

Parameter
Name Description
projectUptimeCheckConfigName string

A fully-qualified path representing project_uptime_check_config resource.

Returns
Type Description
string | number

{string} A string representing the uptime_check_config.

organizationAlertPolicyConditionPath(organization, alertPolicy, condition)

organizationAlertPolicyConditionPath(organization: string, alertPolicy: string, condition: string): string;

Return a fully-qualified organizationAlertPolicyCondition resource name string.

Parameters
Name Description
organization string
alertPolicy string
condition string
Returns
Type Description
string

{string} Resource name string.

organizationAlertPolicyPath(organization, alertPolicy)

organizationAlertPolicyPath(organization: string, alertPolicy: string): string;

Return a fully-qualified organizationAlertPolicy resource name string.

Parameters
Name Description
organization string
alertPolicy string
Returns
Type Description
string

{string} Resource name string.

organizationChannelDescriptorPath(organization, channelDescriptor)

organizationChannelDescriptorPath(organization: string, channelDescriptor: string): string;

Return a fully-qualified organizationChannelDescriptor resource name string.

Parameters
Name Description
organization string
channelDescriptor string
Returns
Type Description
string

{string} Resource name string.

organizationGroupPath(organization, group)

organizationGroupPath(organization: string, group: string): string;

Return a fully-qualified organizationGroup resource name string.

Parameters
Name Description
organization string
group string
Returns
Type Description
string

{string} Resource name string.

organizationNotificationChannelPath(organization, notificationChannel)

organizationNotificationChannelPath(organization: string, notificationChannel: string): string;

Return a fully-qualified organizationNotificationChannel resource name string.

Parameters
Name Description
organization string
notificationChannel string
Returns
Type Description
string

{string} Resource name string.

organizationServicePath(organization, service)

organizationServicePath(organization: string, service: string): string;

Return a fully-qualified organizationService resource name string.

Parameters
Name Description
organization string
service string
Returns
Type Description
string

{string} Resource name string.

organizationServiceServiceLevelObjectivePath(organization, service, serviceLevelObjective)

organizationServiceServiceLevelObjectivePath(organization: string, service: string, serviceLevelObjective: string): string;

Return a fully-qualified organizationServiceServiceLevelObjective resource name string.

Parameters
Name Description
organization string
service string
serviceLevelObjective string
Returns
Type Description
string

{string} Resource name string.

organizationUptimeCheckConfigPath(organization, uptimeCheckConfig)

organizationUptimeCheckConfigPath(organization: string, uptimeCheckConfig: string): string;

Return a fully-qualified organizationUptimeCheckConfig resource name string.

Parameters
Name Description
organization string
uptimeCheckConfig string
Returns
Type Description
string

{string} Resource name string.

projectAlertPolicyConditionPath(project, alertPolicy, condition)

projectAlertPolicyConditionPath(project: string, alertPolicy: string, condition: string): string;

Return a fully-qualified projectAlertPolicyCondition resource name string.

Parameters
Name Description
project string
alertPolicy string
condition string
Returns
Type Description
string

{string} Resource name string.

projectAlertPolicyPath(project, alertPolicy)

projectAlertPolicyPath(project: string, alertPolicy: string): string;

Return a fully-qualified projectAlertPolicy resource name string.

Parameters
Name Description
project string
alertPolicy string
Returns
Type Description
string

{string} Resource name string.

projectChannelDescriptorPath(project, channelDescriptor)

projectChannelDescriptorPath(project: string, channelDescriptor: string): string;

Return a fully-qualified projectChannelDescriptor resource name string.

Parameters
Name Description
project string
channelDescriptor string
Returns
Type Description
string

{string} Resource name string.

projectGroupPath(project, group)

projectGroupPath(project: string, group: string): string;

Return a fully-qualified projectGroup resource name string.

Parameters
Name Description
project string
group string
Returns
Type Description
string

{string} Resource name string.

projectNotificationChannelPath(project, notificationChannel)

projectNotificationChannelPath(project: string, notificationChannel: string): string;

Return a fully-qualified projectNotificationChannel resource name string.

Parameters
Name Description
project string
notificationChannel string
Returns
Type Description
string

{string} Resource name string.

projectPath(project)

projectPath(project: string): string;

Return a fully-qualified project resource name string.

Parameter
Name Description
project string
Returns
Type Description
string

{string} Resource name string.

projectServicePath(project, service)

projectServicePath(project: string, service: string): string;

Return a fully-qualified projectService resource name string.

Parameters
Name Description
project string
service string
Returns
Type Description
string

{string} Resource name string.

projectServiceServiceLevelObjectivePath(project, service, serviceLevelObjective)

projectServiceServiceLevelObjectivePath(project: string, service: string, serviceLevelObjective: string): string;

Return a fully-qualified projectServiceServiceLevelObjective resource name string.

Parameters
Name Description
project string
service string
serviceLevelObjective string
Returns
Type Description
string

{string} Resource name string.

projectUptimeCheckConfigPath(project, uptimeCheckConfig)

projectUptimeCheckConfigPath(project: string, uptimeCheckConfig: string): string;

Return a fully-qualified projectUptimeCheckConfig resource name string.

Parameters
Name Description
project string
uptimeCheckConfig string
Returns
Type Description
string

{string} Resource name string.

sendNotificationChannelVerificationCode(request, options)

sendNotificationChannelVerificationCode(request?: protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, options?: CallOptions): Promise<[
        protos.google.protobuf.IEmpty,
        (protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest | undefined),
        {} | undefined
    ]>;

Causes a verification code to be delivered to the channel. The code can then be supplied in VerifyNotificationChannel to verify the channel.

Parameters
Name Description
request ISendNotificationChannelVerificationCodeRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.protobuf.IEmpty, (protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest | undefined), {} | undefined ]>

{Promise} - The promise which resolves to an array. The first element of the array is an object representing Empty. 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 notification channel to which to send a verification code.
   */
  // const name = 'abc123'

  // Imports the Monitoring library
  const {NotificationChannelServiceClient} = require('@google-cloud/monitoring').v3;

  // Instantiates a client
  const monitoringClient = new NotificationChannelServiceClient();

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

    // Run request
    const response = await monitoringClient.sendNotificationChannelVerificationCode(request);
    console.log(response);
  }

  callSendNotificationChannelVerificationCode();

sendNotificationChannelVerificationCode(request, options, callback)

sendNotificationChannelVerificationCode(request: protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ISendNotificationChannelVerificationCodeRequest
options CallOptions
callback Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

sendNotificationChannelVerificationCode(request, callback)

sendNotificationChannelVerificationCode(request: protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request ISendNotificationChannelVerificationCodeRequest
callback Callback<protos.google.protobuf.IEmpty, protos.google.monitoring.v3.ISendNotificationChannelVerificationCodeRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

snoozePath(project, snooze)

snoozePath(project: string, snooze: string): string;

Return a fully-qualified snooze resource name string.

Parameters
Name Description
project string
snooze string
Returns
Type Description
string

{string} Resource name string.

updateNotificationChannel(request, options)

updateNotificationChannel(request?: protos.google.monitoring.v3.IUpdateNotificationChannelRequest, options?: CallOptions): Promise<[
        protos.google.monitoring.v3.INotificationChannel,
        protos.google.monitoring.v3.IUpdateNotificationChannelRequest | undefined,
        {} | undefined
    ]>;

Updates a notification channel. Fields not specified in the field mask remain unchanged.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
Name Description
request IUpdateNotificationChannelRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IUpdateNotificationChannelRequest | 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.
   */
  /**
   *  Optional. The fields to update.
   */
  // const updateMask = {}
  /**
   *  Required. A description of the changes to be applied to the specified
   *  notification channel. The description must provide a definition for
   *  fields to be updated; the names of these fields should also be
   *  included in the `update_mask`.
   */
  // const notificationChannel = {}

  // Imports the Monitoring library
  const {NotificationChannelServiceClient} = require('@google-cloud/monitoring').v3;

  // Instantiates a client
  const monitoringClient = new NotificationChannelServiceClient();

  async function callUpdateNotificationChannel() {
    // Construct request
    const request = {
      notificationChannel,
    };

    // Run request
    const response = await monitoringClient.updateNotificationChannel(request);
    console.log(response);
  }

  callUpdateNotificationChannel();

updateNotificationChannel(request, options, callback)

updateNotificationChannel(request: protos.google.monitoring.v3.IUpdateNotificationChannelRequest, options: CallOptions, callback: Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IUpdateNotificationChannelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateNotificationChannelRequest
options CallOptions
callback Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IUpdateNotificationChannelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

updateNotificationChannel(request, callback)

updateNotificationChannel(request: protos.google.monitoring.v3.IUpdateNotificationChannelRequest, callback: Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IUpdateNotificationChannelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IUpdateNotificationChannelRequest
callback Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IUpdateNotificationChannelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

verifyNotificationChannel(request, options)

verifyNotificationChannel(request?: protos.google.monitoring.v3.IVerifyNotificationChannelRequest, options?: CallOptions): Promise<[
        protos.google.monitoring.v3.INotificationChannel,
        protos.google.monitoring.v3.IVerifyNotificationChannelRequest | undefined,
        {} | undefined
    ]>;

Verifies a NotificationChannel by proving receipt of the code delivered to the channel as a result of calling SendNotificationChannelVerificationCode.

Parameters
Name Description
request IVerifyNotificationChannelRequest

The request object that will be sent.

options CallOptions

Call options. See CallOptions for more details.

Returns
Type Description
Promise<[ protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IVerifyNotificationChannelRequest | 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 notification channel to verify.
   */
  // const name = 'abc123'
  /**
   *  Required. The verification code that was delivered to the channel as
   *  a result of invoking the `SendNotificationChannelVerificationCode` API
   *  method or that was retrieved from a verified channel via
   *  `GetNotificationChannelVerificationCode`. For example, one might have
   *  "G-123456" or "TKNZGhhd2EyN3I1MnRnMjRv" (in general, one is only
   *  guaranteed that the code is valid UTF-8; one should not
   *  make any assumptions regarding the structure or format of the code).
   */
  // const code = 'abc123'

  // Imports the Monitoring library
  const {NotificationChannelServiceClient} = require('@google-cloud/monitoring').v3;

  // Instantiates a client
  const monitoringClient = new NotificationChannelServiceClient();

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

    // Run request
    const response = await monitoringClient.verifyNotificationChannel(request);
    console.log(response);
  }

  callVerifyNotificationChannel();

verifyNotificationChannel(request, options, callback)

verifyNotificationChannel(request: protos.google.monitoring.v3.IVerifyNotificationChannelRequest, options: CallOptions, callback: Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IVerifyNotificationChannelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IVerifyNotificationChannelRequest
options CallOptions
callback Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IVerifyNotificationChannelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void

verifyNotificationChannel(request, callback)

verifyNotificationChannel(request: protos.google.monitoring.v3.IVerifyNotificationChannelRequest, callback: Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IVerifyNotificationChannelRequest | null | undefined, {} | null | undefined>): void;
Parameters
Name Description
request IVerifyNotificationChannelRequest
callback Callback<protos.google.monitoring.v3.INotificationChannel, protos.google.monitoring.v3.IVerifyNotificationChannelRequest | null | undefined, {} | null | undefined>
Returns
Type Description
void