Stackdriver Monitoring V3 Client - Class NotificationChannelServiceClient (1.5.1)

Reference documentation and code samples for the Stackdriver Monitoring V3 Client class NotificationChannelServiceClient.

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

This class is currently experimental and may be subject to changes.

Namespace

Google \ Cloud \ Monitoring \ V3 \ Client

Methods

__construct

Constructor.

Parameters
NameDescription
options array

Optional. Options for configuring the service API wrapper.

↳ apiEndpoint string

The address of the API remote host. May optionally include the port, formatted as "

↳ credentials string|array|FetchAuthTokenInterface|CredentialsWrapper

The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored.

↳ credentialsConfig array

Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() .

↳ disableRetries bool

Determines whether or not retries defined by the client configuration should be disabled. Defaults to false.

↳ clientConfig string|array

Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder.

↳ transport string|TransportInterface

The transport used for executing network requests. May be either the string rest or grpc. Defaults to grpc if gRPC support is detected on the system. Advanced usage: Additionally, it is possible to pass in an already instantiated Google\ApiCore\Transport\TransportInterface object. Note that when this object is provided, any settings in $transportConfig, and any $apiEndpoint setting, will be ignored.

↳ transportConfig array

Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options.

↳ clientCertSource callable

A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS.

createNotificationChannel

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

The async variant is Google\Cloud\Monitoring\V3\Client\BaseClient\self::createNotificationChannelAsync() .

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Monitoring\V3\NotificationChannel

deleteNotificationChannel

Deletes a notification channel.

The async variant is Google\Cloud\Monitoring\V3\Client\BaseClient\self::deleteNotificationChannelAsync() .

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

getNotificationChannel

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.

The async variant is Google\Cloud\Monitoring\V3\Client\BaseClient\self::getNotificationChannelAsync() .

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\GetNotificationChannelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Monitoring\V3\NotificationChannel

getNotificationChannelDescriptor

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

The async variant is Google\Cloud\Monitoring\V3\Client\BaseClient\self::getNotificationChannelDescriptorAsync() .

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Monitoring\V3\NotificationChannelDescriptor

getNotificationChannelVerificationCode

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.

The async variant is Google\Cloud\Monitoring\V3\Client\BaseClient\self::getNotificationChannelVerificationCodeAsync() .

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeResponse

listNotificationChannelDescriptors

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

The async variant is Google\Cloud\Monitoring\V3\Client\BaseClient\self::listNotificationChannelDescriptorsAsync() .

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

listNotificationChannels

Lists the notification channels that have been created for the project.

The async variant is Google\Cloud\Monitoring\V3\Client\BaseClient\self::listNotificationChannelsAsync() .

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\ApiCore\PagedListResponse

sendNotificationChannelVerificationCode

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

The async variant is Google\Cloud\Monitoring\V3\Client\BaseClient\self::sendNotificationChannelVerificationCodeAsync() .

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

updateNotificationChannel

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

The async variant is Google\Cloud\Monitoring\V3\Client\BaseClient\self::updateNotificationChannelAsync() .

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Monitoring\V3\NotificationChannel

verifyNotificationChannel

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

The async variant is Google\Cloud\Monitoring\V3\Client\BaseClient\self::verifyNotificationChannelAsync() .

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest

A request to house fields associated with the call.

callOptions array

Optional.

↳ retrySettings RetrySettings|array

Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage.

Returns
TypeDescription
Google\Cloud\Monitoring\V3\NotificationChannel

createNotificationChannelAsync

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

deleteNotificationChannelAsync

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getNotificationChannelAsync

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\GetNotificationChannelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getNotificationChannelDescriptorAsync

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

getNotificationChannelVerificationCodeAsync

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listNotificationChannelDescriptorsAsync

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

listNotificationChannelsAsync

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

sendNotificationChannelVerificationCodeAsync

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

updateNotificationChannelAsync

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

verifyNotificationChannelAsync

Parameters
NameDescription
request Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest
optionalArgs = [] array
Returns
TypeDescription
GuzzleHttp\Promise\PromiseInterface

static::folderChannelDescriptorName

Formats a string containing the fully-qualified path to represent a folder_channel_descriptor resource.

Parameters
NameDescription
folder string
channelDescriptor string
Returns
TypeDescription
stringThe formatted folder_channel_descriptor resource.

static::folderNotificationChannelName

Formats a string containing the fully-qualified path to represent a folder_notification_channel resource.

Parameters
NameDescription
folder string
notificationChannel string
Returns
TypeDescription
stringThe formatted folder_notification_channel resource.

static::notificationChannelName

Formats a string containing the fully-qualified path to represent a notification_channel resource.

Parameters
NameDescription
project string
notificationChannel string
Returns
TypeDescription
stringThe formatted notification_channel resource.

static::notificationChannelDescriptorName

Formats a string containing the fully-qualified path to represent a notification_channel_descriptor resource.

Parameters
NameDescription
project string
channelDescriptor string
Returns
TypeDescription
stringThe formatted notification_channel_descriptor resource.

static::organizationChannelDescriptorName

Formats a string containing the fully-qualified path to represent a organization_channel_descriptor resource.

Parameters
NameDescription
organization string
channelDescriptor string
Returns
TypeDescription
stringThe formatted organization_channel_descriptor resource.

static::organizationNotificationChannelName

Formats a string containing the fully-qualified path to represent a organization_notification_channel resource.

Parameters
NameDescription
organization string
notificationChannel string
Returns
TypeDescription
stringThe formatted organization_notification_channel resource.

static::projectChannelDescriptorName

Formats a string containing the fully-qualified path to represent a project_channel_descriptor resource.

Parameters
NameDescription
project string
channelDescriptor string
Returns
TypeDescription
stringThe formatted project_channel_descriptor resource.

static::projectNotificationChannelName

Formats a string containing the fully-qualified path to represent a project_notification_channel resource.

Parameters
NameDescription
project string
notificationChannel string
Returns
TypeDescription
stringThe formatted project_notification_channel resource.

static::parseName

Parses a formatted name string and returns an associative array of the components in the name.

The following name formats are supported: Template: Pattern

  • folderChannelDescriptor: folders/{folder}/notificationChannelDescriptors/{channel_descriptor}
  • folderNotificationChannel: folders/{folder}/notificationChannels/{notification_channel}
  • notificationChannel: projects/{project}/notificationChannels/{notification_channel}
  • notificationChannelDescriptor: projects/{project}/notificationChannelDescriptors/{channel_descriptor}
  • organizationChannelDescriptor: organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}
  • organizationNotificationChannel: organizations/{organization}/notificationChannels/{notification_channel}
  • projectChannelDescriptor: projects/{project}/notificationChannelDescriptors/{channel_descriptor}
  • projectNotificationChannel: projects/{project}/notificationChannels/{notification_channel}

The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.

Parameters
NameDescription
formattedName string

The formatted name string

template string

Optional name of template to match

Returns
TypeDescription
arrayAn associative array from name component IDs to component values.