The Notification Channel API provides access to configuration that controls how messages related to incidents are sent.
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
NotificationChannelServiceClient(NotificationChannelServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
NotificationChannelServiceClient const &
|
NotificationChannelServiceClient(NotificationChannelServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
NotificationChannelServiceClient &&
|
NotificationChannelServiceClient(std::shared_ptr< NotificationChannelServiceConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< NotificationChannelServiceConnection >
|
opts |
Options
|
Operators
operator=(NotificationChannelServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
NotificationChannelServiceClient const &
|
Returns | |
---|---|
Type | Description |
NotificationChannelServiceClient & |
operator=(NotificationChannelServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
NotificationChannelServiceClient &&
|
Returns | |
---|---|
Type | Description |
NotificationChannelServiceClient & |
Functions
ListNotificationChannelDescriptors(std::string const &, Options)
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 |
name |
std::string const &
Required. The REST resource name of the parent from which to retrieve the notification channel descriptors. The expected syntax is: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::monitoring::v3::NotificationChannelDescriptor > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListNotificationChannelDescriptors(google::monitoring::v3::ListNotificationChannelDescriptorsRequest, Options)
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 |
google::monitoring::v3::ListNotificationChannelDescriptorsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::monitoring::v3::NotificationChannelDescriptor > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetNotificationChannelDescriptor(std::string const &, Options)
Gets a single channel descriptor.
The descriptor indicates which fields are expected / permitted for a notification channel of the given type.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The channel type for which to execute the request. The format is: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::NotificationChannelDescriptor > |
the result of the RPC. The response message type (google.monitoring.v3.NotificationChannelDescriptor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetNotificationChannelDescriptor(google::monitoring::v3::GetNotificationChannelDescriptorRequest const &, Options)
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 |
google::monitoring::v3::GetNotificationChannelDescriptorRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::NotificationChannelDescriptor > |
the result of the RPC. The response message type (google.monitoring.v3.NotificationChannelDescriptor) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListNotificationChannels(std::string const &, Options)
Lists the notification channels that have been created for the project.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The project on which to execute the request. The format is: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::monitoring::v3::NotificationChannel > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListNotificationChannels(google::monitoring::v3::ListNotificationChannelsRequest, Options)
Lists the notification channels that have been created for the project.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::ListNotificationChannelsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::monitoring::v3::NotificationChannel > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetNotificationChannel(std::string const &, Options)
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 |
name |
std::string const &
Required. The channel for which to execute the request. The format is: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::NotificationChannel > |
the result of the RPC. The response message type (google.monitoring.v3.NotificationChannel) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetNotificationChannel(google::monitoring::v3::GetNotificationChannelRequest const &, Options)
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 |
google::monitoring::v3::GetNotificationChannelRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::NotificationChannel > |
the result of the RPC. The response message type (google.monitoring.v3.NotificationChannel) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateNotificationChannel(std::string const &, google::monitoring::v3::NotificationChannel const &, Options)
Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The project on which to execute the request. The format is: |
notification_channel |
google::monitoring::v3::NotificationChannel const &
Required. The definition of the |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::NotificationChannel > |
the result of the RPC. The response message type (google.monitoring.v3.NotificationChannel) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateNotificationChannel(google::monitoring::v3::CreateNotificationChannelRequest const &, Options)
Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::CreateNotificationChannelRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::NotificationChannel > |
the result of the RPC. The response message type (google.monitoring.v3.NotificationChannel) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateNotificationChannel(google::protobuf::FieldMask const &, google::monitoring::v3::NotificationChannel const &, Options)
Updates a notification channel.
Fields not specified in the field mask remain unchanged.
Parameters | |
---|---|
Name | Description |
update_mask |
google::protobuf::FieldMask const &
The fields to update. |
notification_channel |
google::monitoring::v3::NotificationChannel const &
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 |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::NotificationChannel > |
the result of the RPC. The response message type (google.monitoring.v3.NotificationChannel) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateNotificationChannel(google::monitoring::v3::UpdateNotificationChannelRequest const &, Options)
Updates a notification channel.
Fields not specified in the field mask remain unchanged.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::UpdateNotificationChannelRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::NotificationChannel > |
the result of the RPC. The response message type (google.monitoring.v3.NotificationChannel) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteNotificationChannel(std::string const &, bool, Options)
Deletes a notification channel.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The channel for which to execute the request. The format is: |
force |
bool
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, channels that are still referenced by an existing alerting policy will fail to be deleted in a delete operation. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteNotificationChannel(google::monitoring::v3::DeleteNotificationChannelRequest const &, Options)
Deletes a notification channel.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::DeleteNotificationChannelRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
SendNotificationChannelVerificationCode(std::string const &, Options)
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 |
name |
std::string const &
Required. The notification channel to which to send a verification code. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
SendNotificationChannelVerificationCode(google::monitoring::v3::SendNotificationChannelVerificationCodeRequest const &, Options)
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 |
google::monitoring::v3::SendNotificationChannelVerificationCodeRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
GetNotificationChannelVerificationCode(std::string const &, Options)
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 |
name |
std::string const &
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. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::GetNotificationChannelVerificationCodeResponse > |
the result of the RPC. The response message type (google.monitoring.v3.GetNotificationChannelVerificationCodeResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetNotificationChannelVerificationCode(google::monitoring::v3::GetNotificationChannelVerificationCodeRequest const &, Options)
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 |
google::monitoring::v3::GetNotificationChannelVerificationCodeRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::GetNotificationChannelVerificationCodeResponse > |
the result of the RPC. The response message type (google.monitoring.v3.GetNotificationChannelVerificationCodeResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
VerifyNotificationChannel(std::string const &, std::string const &, Options)
Verifies a NotificationChannel
by proving receipt of the code delivered to the channel as a result of calling SendNotificationChannelVerificationCode
.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The notification channel to verify. |
code |
std::string const &
Required. The verification code that was delivered to the channel as a result of invoking the |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::NotificationChannel > |
the result of the RPC. The response message type (google.monitoring.v3.NotificationChannel) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
VerifyNotificationChannel(google::monitoring::v3::VerifyNotificationChannelRequest const &, Options)
Verifies a NotificationChannel
by proving receipt of the code delivered to the channel as a result of calling SendNotificationChannelVerificationCode
.
Parameters | |
---|---|
Name | Description |
request |
google::monitoring::v3::VerifyNotificationChannelRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::monitoring::v3::NotificationChannel > |
the result of the RPC. The response message type (google.monitoring.v3.NotificationChannel) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |