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.cloud.aiplatform.v1beta1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/aiplatform/v1beta1/model_monitor.proto"; 24import "google/cloud/aiplatform/v1beta1/model_monitoring_alert.proto"; 25import "google/cloud/aiplatform/v1beta1/model_monitoring_job.proto"; 26import "google/cloud/aiplatform/v1beta1/model_monitoring_stats.proto"; 27import "google/cloud/aiplatform/v1beta1/operation.proto"; 28import "google/longrunning/operations.proto"; 29import "google/protobuf/empty.proto"; 30import "google/protobuf/field_mask.proto"; 31import "google/type/interval.proto"; 32 33option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; 34option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; 35option java_multiple_files = true; 36option java_outer_classname = "ModelMonitoringServiceProto"; 37option java_package = "com.google.cloud.aiplatform.v1beta1"; 38option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; 39option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; 40 41// A service for creating and managing Vertex AI Model moitoring. This includes 42// `ModelMonitor` resources, `ModelMonitoringJob` resources. 43service ModelMonitoringService { 44 option (google.api.default_host) = "aiplatform.googleapis.com"; 45 option (google.api.oauth_scopes) = 46 "https://www.googleapis.com/auth/cloud-platform"; 47 48 // Creates a ModelMonitor. 49 rpc CreateModelMonitor(CreateModelMonitorRequest) 50 returns (google.longrunning.Operation) { 51 option (google.api.http) = { 52 post: "/v1beta1/{parent=projects/*/locations/*}/modelMonitors" 53 body: "model_monitor" 54 }; 55 option (google.api.method_signature) = "parent,model_monitor"; 56 option (google.longrunning.operation_info) = { 57 response_type: "ModelMonitor" 58 metadata_type: "CreateModelMonitorOperationMetadata" 59 }; 60 } 61 62 // Updates a ModelMonitor. 63 rpc UpdateModelMonitor(UpdateModelMonitorRequest) 64 returns (google.longrunning.Operation) { 65 option (google.api.http) = { 66 patch: "/v1beta1/{model_monitor.name=projects/*/locations/*/modelMonitors/*}" 67 body: "model_monitor" 68 }; 69 option (google.api.method_signature) = "model_monitor,update_mask"; 70 option (google.longrunning.operation_info) = { 71 response_type: "ModelMonitor" 72 metadata_type: "UpdateModelMonitorOperationMetadata" 73 }; 74 } 75 76 // Gets a ModelMonitor. 77 rpc GetModelMonitor(GetModelMonitorRequest) returns (ModelMonitor) { 78 option (google.api.http) = { 79 get: "/v1beta1/{name=projects/*/locations/*/modelMonitors/*}" 80 }; 81 option (google.api.method_signature) = "name"; 82 } 83 84 // Lists ModelMonitors in a Location. 85 rpc ListModelMonitors(ListModelMonitorsRequest) 86 returns (ListModelMonitorsResponse) { 87 option (google.api.http) = { 88 get: "/v1beta1/{parent=projects/*/locations/*}/modelMonitors" 89 }; 90 option (google.api.method_signature) = "parent"; 91 } 92 93 // Deletes a ModelMonitor. 94 rpc DeleteModelMonitor(DeleteModelMonitorRequest) 95 returns (google.longrunning.Operation) { 96 option (google.api.http) = { 97 delete: "/v1beta1/{name=projects/*/locations/*/modelMonitors/*}" 98 }; 99 option (google.api.method_signature) = "name"; 100 option (google.longrunning.operation_info) = { 101 response_type: "google.protobuf.Empty" 102 metadata_type: "DeleteOperationMetadata" 103 }; 104 } 105 106 // Creates a ModelMonitoringJob. 107 rpc CreateModelMonitoringJob(CreateModelMonitoringJobRequest) 108 returns (ModelMonitoringJob) { 109 option (google.api.http) = { 110 post: "/v1beta1/{parent=projects/*/locations/*/modelMonitors/*}/modelMonitoringJobs" 111 body: "model_monitoring_job" 112 }; 113 option (google.api.method_signature) = "parent,model_monitoring_job"; 114 } 115 116 // Gets a ModelMonitoringJob. 117 rpc GetModelMonitoringJob(GetModelMonitoringJobRequest) 118 returns (ModelMonitoringJob) { 119 option (google.api.http) = { 120 get: "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/modelMonitoringJobs/*}" 121 }; 122 option (google.api.method_signature) = "name"; 123 } 124 125 // Lists ModelMonitoringJobs. 126 // Callers may choose to read across multiple Monitors as per 127 // [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash 128 // character) as a wildcard character instead of modelMonitor id in the 129 // parent. Format 130 // `projects/{project_id}/locations/{location}/moodelMonitors/-/modelMonitoringJobs` 131 rpc ListModelMonitoringJobs(ListModelMonitoringJobsRequest) 132 returns (ListModelMonitoringJobsResponse) { 133 option (google.api.http) = { 134 get: "/v1beta1/{parent=projects/*/locations/*/modelMonitors/*}/modelMonitoringJobs" 135 }; 136 option (google.api.method_signature) = "parent"; 137 } 138 139 // Deletes a ModelMonitoringJob. 140 rpc DeleteModelMonitoringJob(DeleteModelMonitoringJobRequest) 141 returns (google.longrunning.Operation) { 142 option (google.api.http) = { 143 delete: "/v1beta1/{name=projects/*/locations/*/modelMonitors/*/modelMonitoringJobs/*}" 144 }; 145 option (google.api.method_signature) = "name"; 146 option (google.longrunning.operation_info) = { 147 response_type: "google.protobuf.Empty" 148 metadata_type: "DeleteOperationMetadata" 149 }; 150 } 151 152 // Searches Model Monitoring Stats generated within a given time window. 153 rpc SearchModelMonitoringStats(SearchModelMonitoringStatsRequest) 154 returns (SearchModelMonitoringStatsResponse) { 155 option (google.api.http) = { 156 post: "/v1beta1/{model_monitor=projects/*/locations/*/modelMonitors/*}:searchModelMonitoringStats" 157 body: "*" 158 }; 159 option (google.api.method_signature) = "model_monitor"; 160 } 161 162 // Returns the Model Monitoring alerts. 163 rpc SearchModelMonitoringAlerts(SearchModelMonitoringAlertsRequest) 164 returns (SearchModelMonitoringAlertsResponse) { 165 option (google.api.http) = { 166 post: "/v1beta1/{model_monitor=projects/*/locations/*/modelMonitors/*}:searchModelMonitoringAlerts" 167 body: "*" 168 }; 169 option (google.api.method_signature) = "model_monitor"; 170 } 171} 172 173// Request message for 174// [ModelMonitoringService.CreateModelMonitor][google.cloud.aiplatform.v1beta1.ModelMonitoringService.CreateModelMonitor]. 175message CreateModelMonitorRequest { 176 // Required. The resource name of the Location to create the ModelMonitor in. 177 // Format: `projects/{project}/locations/{location}` 178 string parent = 1 [ 179 (google.api.field_behavior) = REQUIRED, 180 (google.api.resource_reference) = { 181 type: "locations.googleapis.com/Location" 182 } 183 ]; 184 185 // Required. The ModelMonitor to create. 186 ModelMonitor model_monitor = 2 [(google.api.field_behavior) = REQUIRED]; 187 188 // Optional. The ID to use for the Model Monitor, which will become the final 189 // component of the model monitor resource name. 190 // 191 // The maximum length is 63 characters, and valid characters are 192 // `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. 193 string model_monitor_id = 3 [(google.api.field_behavior) = OPTIONAL]; 194} 195 196// Runtime operation information for 197// [ModelMonitoringService.CreateModelMonitor][google.cloud.aiplatform.v1beta1.ModelMonitoringService.CreateModelMonitor]. 198message CreateModelMonitorOperationMetadata { 199 // The operation generic information. 200 GenericOperationMetadata generic_metadata = 1; 201} 202 203// Request message for 204// [ModelMonitoringService.UpdateModelMonitor][google.cloud.aiplatform.v1beta1.ModelMonitoringService.UpdateModelMonitor]. 205message UpdateModelMonitorRequest { 206 // Required. The model monitoring configuration which replaces the resource on 207 // the server. 208 ModelMonitor model_monitor = 1 [(google.api.field_behavior) = REQUIRED]; 209 210 // Required. Mask specifying which fields to update. 211 google.protobuf.FieldMask update_mask = 2 212 [(google.api.field_behavior) = REQUIRED]; 213} 214 215// Runtime operation information for 216// [ModelMonitoringService.UpdateModelMonitor][google.cloud.aiplatform.v1beta1.ModelMonitoringService.UpdateModelMonitor]. 217message UpdateModelMonitorOperationMetadata { 218 // The operation generic information. 219 GenericOperationMetadata generic_metadata = 1; 220} 221 222// Request message for 223// [ModelMonitoringService.GetModelMonitor][google.cloud.aiplatform.v1beta1.ModelMonitoringService.GetModelMonitor]. 224message GetModelMonitorRequest { 225 // Required. The name of the ModelMonitor resource. 226 // Format: 227 // `projects/{project}/locations/{location}/modelMonitors/{model_monitor}` 228 string name = 1 [ 229 (google.api.field_behavior) = REQUIRED, 230 (google.api.resource_reference) = { 231 type: "aiplatform.googleapis.com/ModelMonitor" 232 } 233 ]; 234} 235 236// Request message for 237// [ModelMonitoringService.ListModelMonitors][google.cloud.aiplatform.v1beta1.ModelMonitoringService.ListModelMonitors]. 238message ListModelMonitorsRequest { 239 // Required. The resource name of the Location to list the ModelMonitors from. 240 // Format: `projects/{project}/locations/{location}` 241 string parent = 1 [ 242 (google.api.field_behavior) = REQUIRED, 243 (google.api.resource_reference) = { 244 type: "locations.googleapis.com/Location" 245 } 246 ]; 247 248 // The standard list filter. 249 // More detail in [AIP-160](https://google.aip.dev/160). 250 string filter = 2; 251 252 // The standard list page size. 253 int32 page_size = 3; 254 255 // The standard list page token. 256 string page_token = 4; 257 258 // Mask specifying which fields to read. 259 google.protobuf.FieldMask read_mask = 5; 260} 261 262// Response message for 263// [ModelMonitoringService.ListModelMonitors][google.cloud.aiplatform.v1beta1.ModelMonitoringService.ListModelMonitors] 264message ListModelMonitorsResponse { 265 // List of ModelMonitor in the requested page. 266 repeated ModelMonitor model_monitors = 1; 267 268 // A token to retrieve the next page of results. 269 // Pass to 270 // [ListModelMonitorsRequest.page_token][google.cloud.aiplatform.v1beta1.ListModelMonitorsRequest.page_token] 271 // to obtain that page. 272 string next_page_token = 2; 273} 274 275// Request message for 276// [ModelMonitoringService.DeleteModelMonitor][google.cloud.aiplatform.v1beta1.ModelMonitoringService.DeleteModelMonitor]. 277message DeleteModelMonitorRequest { 278 // Required. The name of the ModelMonitor resource to be deleted. 279 // Format: 280 // `projects/{project}/locations/{location}/modelMonitords/{model_monitor}` 281 string name = 1 [ 282 (google.api.field_behavior) = REQUIRED, 283 (google.api.resource_reference) = { 284 type: "aiplatform.googleapis.com/ModelMonitor" 285 } 286 ]; 287 288 // Optional. Force delete the model monitor with schedules. 289 bool force = 2 [(google.api.field_behavior) = OPTIONAL]; 290} 291 292// Request message for 293// [ModelMonitoringService.CreateModelMonitoringJob][google.cloud.aiplatform.v1beta1.ModelMonitoringService.CreateModelMonitoringJob]. 294message CreateModelMonitoringJobRequest { 295 // Required. The parent of the ModelMonitoringJob. 296 // Format: 297 // `projects/{project}/locations/{location}/modelMoniitors/{model_monitor}` 298 string parent = 1 [ 299 (google.api.field_behavior) = REQUIRED, 300 (google.api.resource_reference) = { 301 type: "aiplatform.googleapis.com/ModelMonitor" 302 } 303 ]; 304 305 // Required. The ModelMonitoringJob to create 306 ModelMonitoringJob model_monitoring_job = 2 307 [(google.api.field_behavior) = REQUIRED]; 308 309 // Optional. The ID to use for the Model Monitoring Job, which will become the 310 // final component of the model monitoring job resource name. 311 // 312 // The maximum length is 63 characters, and valid characters are 313 // `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. 314 string model_monitoring_job_id = 3 [(google.api.field_behavior) = OPTIONAL]; 315} 316 317// Request message for 318// [ModelMonitoringService.GetModelMonitoringJob][google.cloud.aiplatform.v1beta1.ModelMonitoringService.GetModelMonitoringJob]. 319message GetModelMonitoringJobRequest { 320 // Required. The resource name of the ModelMonitoringJob. 321 // Format: 322 // `projects/{project}/locations/{location}/modelMonitors/{model_monitor}/modelMonitoringJobs/{model_monitoring_job}` 323 string name = 1 [ 324 (google.api.field_behavior) = REQUIRED, 325 (google.api.resource_reference) = { 326 type: "aiplatform.googleapis.com/ModelMonitoringJob" 327 } 328 ]; 329} 330 331// Request message for 332// [ModelMonitoringService.ListModelMonitoringJobs][google.cloud.aiplatform.v1beta1.ModelMonitoringService.ListModelMonitoringJobs]. 333message ListModelMonitoringJobsRequest { 334 // Required. The parent of the ModelMonitoringJob. 335 // Format: 336 // `projects/{project}/locations/{location}/modelMonitors/{model_monitor}` 337 string parent = 1 [ 338 (google.api.field_behavior) = REQUIRED, 339 (google.api.resource_reference) = { 340 type: "aiplatform.googleapis.com/ModelMonitor" 341 } 342 ]; 343 344 // The standard list filter. 345 // More detail in [AIP-160](https://google.aip.dev/160). 346 string filter = 2; 347 348 // The standard list page size. 349 int32 page_size = 3; 350 351 // The standard list page token. 352 string page_token = 4; 353 354 // Mask specifying which fields to read 355 google.protobuf.FieldMask read_mask = 5; 356} 357 358// Response message for 359// [ModelMonitoringService.ListModelMonitoringJobs][google.cloud.aiplatform.v1beta1.ModelMonitoringService.ListModelMonitoringJobs]. 360message ListModelMonitoringJobsResponse { 361 // A list of ModelMonitoringJobs that matches the specified filter 362 // in the request. 363 repeated ModelMonitoringJob model_monitoring_jobs = 1; 364 365 // The standard List next-page token. 366 string next_page_token = 2; 367} 368 369// Request message for 370// [ModelMonitoringService.DeleteModelMonitoringJob][google.cloud.aiplatform.v1beta1.ModelMonitoringService.DeleteModelMonitoringJob]. 371message DeleteModelMonitoringJobRequest { 372 // Required. The resource name of the model monitoring job to delete. 373 // Format: 374 // `projects/{project}/locations/{location}/modelMonitors/{model_monitor}/modelMonitoringJobs/{model_monitoring_job}` 375 string name = 1 [ 376 (google.api.field_behavior) = REQUIRED, 377 (google.api.resource_reference) = { 378 type: "aiplatform.googleapis.com/ModelMonitoringJob" 379 } 380 ]; 381} 382 383// Request message for 384// [ModelMonitoringService.SearchModelMonitoringStats][google.cloud.aiplatform.v1beta1.ModelMonitoringService.SearchModelMonitoringStats]. 385message SearchModelMonitoringStatsRequest { 386 // Required. ModelMonitor resource name. 387 // Format: 388 // `projects/{project}/locations/{location}/modelMonitors/{model_monitor}` 389 string model_monitor = 1 [ 390 (google.api.field_behavior) = REQUIRED, 391 (google.api.resource_reference) = { 392 type: "aiplatform.googleapis.com/ModelMonitor" 393 } 394 ]; 395 396 // Filter for search different stats. 397 SearchModelMonitoringStatsFilter stats_filter = 2; 398 399 // The time interval for which results should be returned. 400 google.type.Interval time_interval = 3; 401 402 // The standard list page size. 403 int32 page_size = 4; 404 405 // A page token received from a previous 406 // [ModelMonitoringService.SearchModelMonitoringStats][google.cloud.aiplatform.v1beta1.ModelMonitoringService.SearchModelMonitoringStats] 407 // call. 408 string page_token = 5; 409} 410 411// Response message for 412// [ModelMonitoringService.SearchModelMonitoringStats][google.cloud.aiplatform.v1beta1.ModelMonitoringService.SearchModelMonitoringStats]. 413message SearchModelMonitoringStatsResponse { 414 // Stats retrieved for requested objectives. 415 repeated ModelMonitoringStats monitoring_stats = 1; 416 417 // The page token that can be used by the next 418 // [ModelMonitoringService.SearchModelMonitoringStats][google.cloud.aiplatform.v1beta1.ModelMonitoringService.SearchModelMonitoringStats] 419 // call. 420 string next_page_token = 2; 421} 422 423// Request message for 424// [ModelMonitoringService.SearchModelMonitoringAlerts][google.cloud.aiplatform.v1beta1.ModelMonitoringService.SearchModelMonitoringAlerts]. 425message SearchModelMonitoringAlertsRequest { 426 // Required. ModelMonitor resource name. 427 // Format: 428 // `projects/{project}/locations/{location}/modelMonitors/{model_monitor}` 429 string model_monitor = 1 [ 430 (google.api.field_behavior) = REQUIRED, 431 (google.api.resource_reference) = { 432 type: "aiplatform.googleapis.com/ModelMonitor" 433 } 434 ]; 435 436 // If non-empty, returns the alerts of this model monitoring job. 437 string model_monitoring_job = 2; 438 439 // If non-empty, returns the alerts in this time interval. 440 google.type.Interval alert_time_interval = 3; 441 442 // If non-empty, returns the alerts of this stats_name. 443 string stats_name = 4; 444 445 // If non-empty, returns the alerts of this objective type. 446 // Supported monitoring objectives: 447 // `raw-feature-drift` 448 // `prediction-output-drift` 449 // `feature-attribution` 450 string objective_type = 5; 451 452 // The standard list page size. 453 int32 page_size = 6; 454 455 // A page token received from a previous 456 // [ModelMonitoringService.SearchModelMonitoringAlerts][google.cloud.aiplatform.v1beta1.ModelMonitoringService.SearchModelMonitoringAlerts] 457 // call. 458 string page_token = 7; 459} 460 461// Response message for 462// [ModelMonitoringService.SearchModelMonitoringAlerts][google.cloud.aiplatform.v1beta1.ModelMonitoringService.SearchModelMonitoringAlerts]. 463message SearchModelMonitoringAlertsResponse { 464 // Alerts retrieved for the requested objectives. Sorted by alert time 465 // descendingly. 466 repeated ModelMonitoringAlert model_monitoring_alerts = 1; 467 468 // The total number of alerts retrieved by the requested objectives. 469 int64 total_number_alerts = 2; 470 471 // The page token that can be used by the next 472 // [ModelMonitoringService.SearchModelMonitoringAlerts][google.cloud.aiplatform.v1beta1.ModelMonitoringService.SearchModelMonitoringAlerts] 473 // call. 474 string next_page_token = 3; 475} 476