1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.monitoring.v3; 18 19import "google/api/label.proto"; 20import "google/api/launch_stage.proto"; 21import "google/api/resource.proto"; 22import "google/monitoring/v3/common.proto"; 23import "google/monitoring/v3/mutation_record.proto"; 24import "google/protobuf/wrappers.proto"; 25 26option csharp_namespace = "Google.Cloud.Monitoring.V3"; 27option go_package = "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb"; 28option java_multiple_files = true; 29option java_outer_classname = "NotificationProto"; 30option java_package = "com.google.monitoring.v3"; 31option php_namespace = "Google\\Cloud\\Monitoring\\V3"; 32option ruby_package = "Google::Cloud::Monitoring::V3"; 33 34// A description of a notification channel. The descriptor includes 35// the properties of the channel and the set of labels or fields that 36// must be specified to configure channels of a given type. 37message NotificationChannelDescriptor { 38 option (google.api.resource) = { 39 type: "monitoring.googleapis.com/NotificationChannelDescriptor" 40 pattern: "projects/{project}/notificationChannelDescriptors/{channel_descriptor}" 41 pattern: "organizations/{organization}/notificationChannelDescriptors/{channel_descriptor}" 42 pattern: "folders/{folder}/notificationChannelDescriptors/{channel_descriptor}" 43 pattern: "*" 44 }; 45 46 // The full REST resource name for this descriptor. The format is: 47 // 48 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannelDescriptors/[TYPE] 49 // 50 // In the above, `[TYPE]` is the value of the `type` field. 51 string name = 6; 52 53 // The type of notification channel, such as "email" and "sms". To view the 54 // full list of channels, see 55 // [Channel 56 // descriptors](https://cloud.google.com/monitoring/alerts/using-channels-api#ncd). 57 // Notification channel types are globally unique. 58 string type = 1; 59 60 // A human-readable name for the notification channel type. This 61 // form of the name is suitable for a user interface. 62 string display_name = 2; 63 64 // A human-readable description of the notification channel 65 // type. The description may include a description of the properties 66 // of the channel and pointers to external documentation. 67 string description = 3; 68 69 // The set of labels that must be defined to identify a particular 70 // channel of the corresponding type. Each label includes a 71 // description for how that field should be populated. 72 repeated google.api.LabelDescriptor labels = 4; 73 74 // The tiers that support this notification channel; the project service tier 75 // must be one of the supported_tiers. 76 repeated ServiceTier supported_tiers = 5 [deprecated = true]; 77 78 // The product launch stage for channels of this type. 79 google.api.LaunchStage launch_stage = 7; 80} 81 82// A `NotificationChannel` is a medium through which an alert is 83// delivered when a policy violation is detected. Examples of channels 84// include email, SMS, and third-party messaging applications. Fields 85// containing sensitive information like authentication tokens or 86// contact info are only partially populated on retrieval. 87message NotificationChannel { 88 option (google.api.resource) = { 89 type: "monitoring.googleapis.com/NotificationChannel" 90 pattern: "projects/{project}/notificationChannels/{notification_channel}" 91 pattern: "organizations/{organization}/notificationChannels/{notification_channel}" 92 pattern: "folders/{folder}/notificationChannels/{notification_channel}" 93 pattern: "*" 94 }; 95 96 // Indicates whether the channel has been verified or not. It is illegal 97 // to specify this field in a 98 // [`CreateNotificationChannel`][google.monitoring.v3.NotificationChannelService.CreateNotificationChannel] 99 // or an 100 // [`UpdateNotificationChannel`][google.monitoring.v3.NotificationChannelService.UpdateNotificationChannel] 101 // operation. 102 enum VerificationStatus { 103 // Sentinel value used to indicate that the state is unknown, omitted, or 104 // is not applicable (as in the case of channels that neither support 105 // nor require verification in order to function). 106 VERIFICATION_STATUS_UNSPECIFIED = 0; 107 108 // The channel has yet to be verified and requires verification to function. 109 // Note that this state also applies to the case where the verification 110 // process has been initiated by sending a verification code but where 111 // the verification code has not been submitted to complete the process. 112 UNVERIFIED = 1; 113 114 // It has been proven that notifications can be received on this 115 // notification channel and that someone on the project has access 116 // to messages that are delivered to that channel. 117 VERIFIED = 2; 118 } 119 120 // The type of the notification channel. This field matches the 121 // value of the 122 // [NotificationChannelDescriptor.type][google.monitoring.v3.NotificationChannelDescriptor.type] 123 // field. 124 string type = 1; 125 126 // The full REST resource name for this channel. The format is: 127 // 128 // projects/[PROJECT_ID_OR_NUMBER]/notificationChannels/[CHANNEL_ID] 129 // 130 // The `[CHANNEL_ID]` is automatically assigned by the server on creation. 131 string name = 6; 132 133 // An optional human-readable name for this notification channel. It is 134 // recommended that you specify a non-empty and unique name in order to 135 // make it easier to identify the channels in your project, though this is 136 // not enforced. The display name is limited to 512 Unicode characters. 137 string display_name = 3; 138 139 // An optional human-readable description of this notification channel. This 140 // description may provide additional details, beyond the display 141 // name, for the channel. This may not exceed 1024 Unicode characters. 142 string description = 4; 143 144 // Configuration fields that define the channel and its behavior. The 145 // permissible and required labels are specified in the 146 // [NotificationChannelDescriptor.labels][google.monitoring.v3.NotificationChannelDescriptor.labels] 147 // of the `NotificationChannelDescriptor` corresponding to the `type` field. 148 map<string, string> labels = 5; 149 150 // User-supplied key/value data that does not need to conform to 151 // the corresponding `NotificationChannelDescriptor`'s schema, unlike 152 // the `labels` field. This field is intended to be used for organizing 153 // and identifying the `NotificationChannel` objects. 154 // 155 // The field can contain up to 64 entries. Each key and value is limited to 156 // 63 Unicode characters or 128 bytes, whichever is smaller. Labels and 157 // values can contain only lowercase letters, numerals, underscores, and 158 // dashes. Keys must begin with a letter. 159 map<string, string> user_labels = 8; 160 161 // Indicates whether this channel has been verified or not. On a 162 // [`ListNotificationChannels`][google.monitoring.v3.NotificationChannelService.ListNotificationChannels] 163 // or 164 // [`GetNotificationChannel`][google.monitoring.v3.NotificationChannelService.GetNotificationChannel] 165 // operation, this field is expected to be populated. 166 // 167 // If the value is `UNVERIFIED`, then it indicates that the channel is 168 // non-functioning (it both requires verification and lacks verification); 169 // otherwise, it is assumed that the channel works. 170 // 171 // If the channel is neither `VERIFIED` nor `UNVERIFIED`, it implies that 172 // the channel is of a type that does not require verification or that 173 // this specific channel has been exempted from verification because it was 174 // created prior to verification being required for channels of this type. 175 // 176 // This field cannot be modified using a standard 177 // [`UpdateNotificationChannel`][google.monitoring.v3.NotificationChannelService.UpdateNotificationChannel] 178 // operation. To change the value of this field, you must call 179 // [`VerifyNotificationChannel`][google.monitoring.v3.NotificationChannelService.VerifyNotificationChannel]. 180 VerificationStatus verification_status = 9; 181 182 // Whether notifications are forwarded to the described channel. This makes 183 // it possible to disable delivery of notifications to a particular channel 184 // without removing the channel from all alerting policies that reference 185 // the channel. This is a more convenient approach when the change is 186 // temporary and you want to receive notifications from the same set 187 // of alerting policies on the channel at some point in the future. 188 google.protobuf.BoolValue enabled = 11; 189 190 // Record of the creation of this channel. 191 MutationRecord creation_record = 12; 192 193 // Records of the modification of this channel. 194 repeated MutationRecord mutation_records = 13; 195} 196