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/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/monitoring/v3/uptime.proto"; 24import "google/protobuf/empty.proto"; 25import "google/protobuf/field_mask.proto"; 26 27option csharp_namespace = "Google.Cloud.Monitoring.V3"; 28option go_package = "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb"; 29option java_multiple_files = true; 30option java_outer_classname = "UptimeServiceProto"; 31option java_package = "com.google.monitoring.v3"; 32option php_namespace = "Google\\Cloud\\Monitoring\\V3"; 33option ruby_package = "Google::Cloud::Monitoring::V3"; 34 35// The UptimeCheckService API is used to manage (list, create, delete, edit) 36// Uptime check configurations in the Cloud Monitoring product. An Uptime 37// check is a piece of configuration that determines which resources and 38// services to monitor for availability. These configurations can also be 39// configured interactively by navigating to the [Cloud console] 40// (https://console.cloud.google.com), selecting the appropriate project, 41// clicking on "Monitoring" on the left-hand side to navigate to Cloud 42// Monitoring, and then clicking on "Uptime". 43service UptimeCheckService { 44 option (google.api.default_host) = "monitoring.googleapis.com"; 45 option (google.api.oauth_scopes) = 46 "https://www.googleapis.com/auth/cloud-platform," 47 "https://www.googleapis.com/auth/monitoring," 48 "https://www.googleapis.com/auth/monitoring.read"; 49 50 // Lists the existing valid Uptime check configurations for the project 51 // (leaving out any invalid configurations). 52 rpc ListUptimeCheckConfigs(ListUptimeCheckConfigsRequest) 53 returns (ListUptimeCheckConfigsResponse) { 54 option (google.api.http) = { 55 get: "/v3/{parent=projects/*}/uptimeCheckConfigs" 56 }; 57 option (google.api.method_signature) = "parent"; 58 } 59 60 // Gets a single Uptime check configuration. 61 rpc GetUptimeCheckConfig(GetUptimeCheckConfigRequest) 62 returns (UptimeCheckConfig) { 63 option (google.api.http) = { 64 get: "/v3/{name=projects/*/uptimeCheckConfigs/*}" 65 }; 66 option (google.api.method_signature) = "name"; 67 } 68 69 // Creates a new Uptime check configuration. 70 rpc CreateUptimeCheckConfig(CreateUptimeCheckConfigRequest) 71 returns (UptimeCheckConfig) { 72 option (google.api.http) = { 73 post: "/v3/{parent=projects/*}/uptimeCheckConfigs" 74 body: "uptime_check_config" 75 }; 76 option (google.api.method_signature) = "parent,uptime_check_config"; 77 } 78 79 // Updates an Uptime check configuration. You can either replace the entire 80 // configuration with a new one or replace only certain fields in the current 81 // configuration by specifying the fields to be updated via `updateMask`. 82 // Returns the updated configuration. 83 rpc UpdateUptimeCheckConfig(UpdateUptimeCheckConfigRequest) 84 returns (UptimeCheckConfig) { 85 option (google.api.http) = { 86 patch: "/v3/{uptime_check_config.name=projects/*/uptimeCheckConfigs/*}" 87 body: "uptime_check_config" 88 }; 89 option (google.api.method_signature) = "uptime_check_config"; 90 } 91 92 // Deletes an Uptime check configuration. Note that this method will fail 93 // if the Uptime check configuration is referenced by an alert policy or 94 // other dependent configs that would be rendered invalid by the deletion. 95 rpc DeleteUptimeCheckConfig(DeleteUptimeCheckConfigRequest) 96 returns (google.protobuf.Empty) { 97 option (google.api.http) = { 98 delete: "/v3/{name=projects/*/uptimeCheckConfigs/*}" 99 }; 100 option (google.api.method_signature) = "name"; 101 } 102 103 // Returns the list of IP addresses that checkers run from 104 rpc ListUptimeCheckIps(ListUptimeCheckIpsRequest) 105 returns (ListUptimeCheckIpsResponse) { 106 option (google.api.http) = { 107 get: "/v3/uptimeCheckIps" 108 }; 109 } 110} 111 112// The protocol for the `ListUptimeCheckConfigs` request. 113message ListUptimeCheckConfigsRequest { 114 // Required. The 115 // [project](https://cloud.google.com/monitoring/api/v3#project_name) whose 116 // Uptime check configurations are listed. The format is: 117 // 118 // projects/[PROJECT_ID_OR_NUMBER] 119 string parent = 1 [ 120 (google.api.field_behavior) = REQUIRED, 121 (google.api.resource_reference) = { 122 child_type: "monitoring.googleapis.com/UptimeCheckConfig" 123 } 124 ]; 125 126 // If provided, this field specifies the criteria that must be met by 127 // uptime checks to be included in the response. 128 // 129 // For more details, see [Filtering 130 // syntax](https://cloud.google.com/monitoring/api/v3/sorting-and-filtering#filter_syntax). 131 string filter = 2; 132 133 // The maximum number of results to return in a single response. The server 134 // may further constrain the maximum number of results returned in a single 135 // page. If the page_size is <=0, the server will decide the number of results 136 // to be returned. 137 int32 page_size = 3; 138 139 // If this field is not empty then it must contain the `nextPageToken` value 140 // returned by a previous call to this method. Using this field causes the 141 // method to return more results from the previous method call. 142 string page_token = 4; 143} 144 145// The protocol for the `ListUptimeCheckConfigs` response. 146message ListUptimeCheckConfigsResponse { 147 // The returned Uptime check configurations. 148 repeated UptimeCheckConfig uptime_check_configs = 1; 149 150 // This field represents the pagination token to retrieve the next page of 151 // results. If the value is empty, it means no further results for the 152 // request. To retrieve the next page of results, the value of the 153 // next_page_token is passed to the subsequent List method call (in the 154 // request message's page_token field). 155 string next_page_token = 2; 156 157 // The total number of Uptime check configurations for the project, 158 // irrespective of any pagination. 159 int32 total_size = 3; 160} 161 162// The protocol for the `GetUptimeCheckConfig` request. 163message GetUptimeCheckConfigRequest { 164 // Required. The Uptime check configuration to retrieve. The format is: 165 // 166 // projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] 167 string name = 1 [ 168 (google.api.field_behavior) = REQUIRED, 169 (google.api.resource_reference) = { 170 type: "monitoring.googleapis.com/UptimeCheckConfig" 171 } 172 ]; 173} 174 175// The protocol for the `CreateUptimeCheckConfig` request. 176message CreateUptimeCheckConfigRequest { 177 // Required. The 178 // [project](https://cloud.google.com/monitoring/api/v3#project_name) in which 179 // to create the Uptime check. The format is: 180 // 181 // projects/[PROJECT_ID_OR_NUMBER] 182 string parent = 1 [ 183 (google.api.field_behavior) = REQUIRED, 184 (google.api.resource_reference) = { 185 child_type: "monitoring.googleapis.com/UptimeCheckConfig" 186 } 187 ]; 188 189 // Required. The new Uptime check configuration. 190 UptimeCheckConfig uptime_check_config = 2 191 [(google.api.field_behavior) = REQUIRED]; 192} 193 194// The protocol for the `UpdateUptimeCheckConfig` request. 195message UpdateUptimeCheckConfigRequest { 196 // Optional. If present, only the listed fields in the current Uptime check 197 // configuration are updated with values from the new configuration. If this 198 // field is empty, then the current configuration is completely replaced with 199 // the new configuration. 200 google.protobuf.FieldMask update_mask = 2; 201 202 // Required. If an `updateMask` has been specified, this field gives 203 // the values for the set of fields mentioned in the `updateMask`. If an 204 // `updateMask` has not been given, this Uptime check configuration replaces 205 // the current configuration. If a field is mentioned in `updateMask` but 206 // the corresponding field is omitted in this partial Uptime check 207 // configuration, it has the effect of deleting/clearing the field from the 208 // configuration on the server. 209 // 210 // The following fields can be updated: `display_name`, 211 // `http_check`, `tcp_check`, `timeout`, `content_matchers`, and 212 // `selected_regions`. 213 UptimeCheckConfig uptime_check_config = 3 214 [(google.api.field_behavior) = REQUIRED]; 215} 216 217// The protocol for the `DeleteUptimeCheckConfig` request. 218message DeleteUptimeCheckConfigRequest { 219 // Required. The Uptime check configuration to delete. The format is: 220 // 221 // projects/[PROJECT_ID_OR_NUMBER]/uptimeCheckConfigs/[UPTIME_CHECK_ID] 222 string name = 1 [ 223 (google.api.field_behavior) = REQUIRED, 224 (google.api.resource_reference) = { 225 type: "monitoring.googleapis.com/UptimeCheckConfig" 226 } 227 ]; 228} 229 230// The protocol for the `ListUptimeCheckIps` request. 231message ListUptimeCheckIpsRequest { 232 // The maximum number of results to return in a single response. The server 233 // may further constrain the maximum number of results returned in a single 234 // page. If the page_size is <=0, the server will decide the number of results 235 // to be returned. 236 // NOTE: this field is not yet implemented 237 int32 page_size = 2; 238 239 // If this field is not empty then it must contain the `nextPageToken` value 240 // returned by a previous call to this method. Using this field causes the 241 // method to return more results from the previous method call. 242 // NOTE: this field is not yet implemented 243 string page_token = 3; 244} 245 246// The protocol for the `ListUptimeCheckIps` response. 247message ListUptimeCheckIpsResponse { 248 // The returned list of IP addresses (including region and location) that the 249 // checkers run from. 250 repeated UptimeCheckIp uptime_check_ips = 1; 251 252 // This field represents the pagination token to retrieve the next page of 253 // results. If the value is empty, it means no further results for the 254 // request. To retrieve the next page of results, the value of the 255 // next_page_token is passed to the subsequent List method call (in the 256 // request message's page_token field). 257 // NOTE: this field is not yet implemented 258 string next_page_token = 2; 259} 260