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 provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
This class is currently experimental and may be subject to changes. See Google\Cloud\Monitoring\V3\NotificationChannelServiceClient for the stable implementation
Namespace
Google \ Cloud \ Monitoring \ V3 \ ClientMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
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 |
↳ 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 |
↳ 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.
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.
The async variant is Google\Cloud\Monitoring\V3\Client\NotificationChannelServiceClient::createNotificationChannelAsync() .
Parameters | |
---|---|
Name | Description |
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 | |
---|---|
Type | Description |
Google\Cloud\Monitoring\V3\NotificationChannel |
deleteNotificationChannel
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.
The async variant is Google\Cloud\Monitoring\V3\Client\NotificationChannelServiceClient::deleteNotificationChannelAsync() .
Parameters | |
---|---|
Name | Description |
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\NotificationChannelServiceClient::getNotificationChannelAsync() .
Parameters | |
---|---|
Name | Description |
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 | |
---|---|
Type | Description |
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\NotificationChannelServiceClient::getNotificationChannelDescriptorAsync() .
Parameters | |
---|---|
Name | Description |
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 | |
---|---|
Type | Description |
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\NotificationChannelServiceClient::getNotificationChannelVerificationCodeAsync() .
Parameters | |
---|---|
Name | Description |
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 | |
---|---|
Type | Description |
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\NotificationChannelServiceClient::listNotificationChannelDescriptorsAsync() .
Parameters | |
---|---|
Name | Description |
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 | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
listNotificationChannels
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.
The async variant is Google\Cloud\Monitoring\V3\Client\NotificationChannelServiceClient::listNotificationChannelsAsync() .
Parameters | |
---|---|
Name | Description |
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 | |
---|---|
Type | Description |
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\NotificationChannelServiceClient::sendNotificationChannelVerificationCodeAsync() .
Parameters | |
---|---|
Name | Description |
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.
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.
The async variant is Google\Cloud\Monitoring\V3\Client\NotificationChannelServiceClient::updateNotificationChannelAsync() .
Parameters | |
---|---|
Name | Description |
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 | |
---|---|
Type | Description |
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\NotificationChannelServiceClient::verifyNotificationChannelAsync() .
Parameters | |
---|---|
Name | Description |
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 | |
---|---|
Type | Description |
Google\Cloud\Monitoring\V3\NotificationChannel |
createNotificationChannelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Monitoring\V3\CreateNotificationChannelRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
deleteNotificationChannelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Monitoring\V3\DeleteNotificationChannelRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getNotificationChannelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Monitoring\V3\GetNotificationChannelRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getNotificationChannelDescriptorAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Monitoring\V3\GetNotificationChannelDescriptorRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getNotificationChannelVerificationCodeAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Monitoring\V3\GetNotificationChannelVerificationCodeRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listNotificationChannelDescriptorsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Monitoring\V3\ListNotificationChannelDescriptorsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listNotificationChannelsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Monitoring\V3\ListNotificationChannelsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
sendNotificationChannelVerificationCodeAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Monitoring\V3\SendNotificationChannelVerificationCodeRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateNotificationChannelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Monitoring\V3\UpdateNotificationChannelRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
verifyNotificationChannelAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\Monitoring\V3\VerifyNotificationChannelRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
static::folderChannelDescriptorName
Formats a string containing the fully-qualified path to represent a folder_channel_descriptor resource.
Parameters | |
---|---|
Name | Description |
folder |
string
|
channelDescriptor |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted folder_channel_descriptor resource. |
static::folderNotificationChannelName
Formats a string containing the fully-qualified path to represent a folder_notification_channel resource.
Parameters | |
---|---|
Name | Description |
folder |
string
|
notificationChannel |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted folder_notification_channel resource. |
static::notificationChannelName
Formats a string containing the fully-qualified path to represent a notification_channel resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
notificationChannel |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted notification_channel resource. |
static::notificationChannelDescriptorName
Formats a string containing the fully-qualified path to represent a notification_channel_descriptor resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
channelDescriptor |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted notification_channel_descriptor resource. |
static::organizationChannelDescriptorName
Formats a string containing the fully-qualified path to represent a organization_channel_descriptor resource.
Parameters | |
---|---|
Name | Description |
organization |
string
|
channelDescriptor |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted organization_channel_descriptor resource. |
static::organizationNotificationChannelName
Formats a string containing the fully-qualified path to represent a organization_notification_channel resource.
Parameters | |
---|---|
Name | Description |
organization |
string
|
notificationChannel |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted organization_notification_channel resource. |
static::projectChannelDescriptorName
Formats a string containing the fully-qualified path to represent a project_channel_descriptor resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
channelDescriptor |
string
|
Returns | |
---|---|
Type | Description |
string | The formatted project_channel_descriptor resource. |
static::projectNotificationChannelName
Formats a string containing the fully-qualified path to represent a project_notification_channel resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
notificationChannel |
string
|
Returns | |
---|---|
Type | Description |
string | The 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 | |
---|---|
Name | Description |
formattedName |
string
The formatted name string |
template |
string
Optional name of template to match |
Returns | |
---|---|
Type | Description |
array | An associative array from name component IDs to component values. |