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/endpoint.proto"; 24import "google/cloud/aiplatform/v1beta1/operation.proto"; 25import "google/longrunning/operations.proto"; 26import "google/protobuf/empty.proto"; 27import "google/protobuf/field_mask.proto"; 28 29option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; 30option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb"; 31option java_multiple_files = true; 32option java_outer_classname = "EndpointServiceProto"; 33option java_package = "com.google.cloud.aiplatform.v1beta1"; 34option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; 35option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; 36 37// A service for managing Vertex AI's Endpoints. 38service EndpointService { 39 option (google.api.default_host) = "aiplatform.googleapis.com"; 40 option (google.api.oauth_scopes) = 41 "https://www.googleapis.com/auth/cloud-platform"; 42 43 // Creates an Endpoint. 44 rpc CreateEndpoint(CreateEndpointRequest) 45 returns (google.longrunning.Operation) { 46 option (google.api.http) = { 47 post: "/v1beta1/{parent=projects/*/locations/*}/endpoints" 48 body: "endpoint" 49 }; 50 option (google.api.method_signature) = "parent,endpoint"; 51 option (google.api.method_signature) = "parent,endpoint,endpoint_id"; 52 option (google.longrunning.operation_info) = { 53 response_type: "Endpoint" 54 metadata_type: "CreateEndpointOperationMetadata" 55 }; 56 } 57 58 // Gets an Endpoint. 59 rpc GetEndpoint(GetEndpointRequest) returns (Endpoint) { 60 option (google.api.http) = { 61 get: "/v1beta1/{name=projects/*/locations/*/endpoints/*}" 62 }; 63 option (google.api.method_signature) = "name"; 64 } 65 66 // Lists Endpoints in a Location. 67 rpc ListEndpoints(ListEndpointsRequest) returns (ListEndpointsResponse) { 68 option (google.api.http) = { 69 get: "/v1beta1/{parent=projects/*/locations/*}/endpoints" 70 }; 71 option (google.api.method_signature) = "parent"; 72 } 73 74 // Updates an Endpoint. 75 rpc UpdateEndpoint(UpdateEndpointRequest) returns (Endpoint) { 76 option (google.api.http) = { 77 patch: "/v1beta1/{endpoint.name=projects/*/locations/*/endpoints/*}" 78 body: "endpoint" 79 }; 80 option (google.api.method_signature) = "endpoint,update_mask"; 81 } 82 83 // Deletes an Endpoint. 84 rpc DeleteEndpoint(DeleteEndpointRequest) 85 returns (google.longrunning.Operation) { 86 option (google.api.http) = { 87 delete: "/v1beta1/{name=projects/*/locations/*/endpoints/*}" 88 }; 89 option (google.api.method_signature) = "name"; 90 option (google.longrunning.operation_info) = { 91 response_type: "google.protobuf.Empty" 92 metadata_type: "DeleteOperationMetadata" 93 }; 94 } 95 96 // Deploys a Model into this Endpoint, creating a DeployedModel within it. 97 rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) { 98 option (google.api.http) = { 99 post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:deployModel" 100 body: "*" 101 }; 102 option (google.api.method_signature) = 103 "endpoint,deployed_model,traffic_split"; 104 option (google.longrunning.operation_info) = { 105 response_type: "DeployModelResponse" 106 metadata_type: "DeployModelOperationMetadata" 107 }; 108 } 109 110 // Undeploys a Model from an Endpoint, removing a DeployedModel from it, and 111 // freeing all resources it's using. 112 rpc UndeployModel(UndeployModelRequest) 113 returns (google.longrunning.Operation) { 114 option (google.api.http) = { 115 post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:undeployModel" 116 body: "*" 117 }; 118 option (google.api.method_signature) = 119 "endpoint,deployed_model_id,traffic_split"; 120 option (google.longrunning.operation_info) = { 121 response_type: "UndeployModelResponse" 122 metadata_type: "UndeployModelOperationMetadata" 123 }; 124 } 125 126 // Updates an existing deployed model. Updatable fields include 127 // `min_replica_count`, `max_replica_count`, `autoscaling_metric_specs`, 128 // `disable_container_logging` (v1 only), and `enable_container_logging` 129 // (v1beta1 only). 130 rpc MutateDeployedModel(MutateDeployedModelRequest) 131 returns (google.longrunning.Operation) { 132 option (google.api.http) = { 133 post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:mutateDeployedModel" 134 body: "*" 135 }; 136 option (google.api.method_signature) = 137 "endpoint,deployed_model,update_mask"; 138 option (google.longrunning.operation_info) = { 139 response_type: "MutateDeployedModelResponse" 140 metadata_type: "MutateDeployedModelOperationMetadata" 141 }; 142 } 143} 144 145// Request message for 146// [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.CreateEndpoint]. 147message CreateEndpointRequest { 148 // Required. The resource name of the Location to create the Endpoint in. 149 // Format: `projects/{project}/locations/{location}` 150 string parent = 1 [ 151 (google.api.field_behavior) = REQUIRED, 152 (google.api.resource_reference) = { 153 type: "locations.googleapis.com/Location" 154 } 155 ]; 156 157 // Required. The Endpoint to create. 158 Endpoint endpoint = 2 [(google.api.field_behavior) = REQUIRED]; 159 160 // Immutable. The ID to use for endpoint, which will become the final 161 // component of the endpoint resource name. 162 // If not provided, Vertex AI will generate a value for this ID. 163 // 164 // If the first character is a letter, this value may be up to 63 characters, 165 // and valid characters are `[a-z0-9-]`. The last character must be a letter 166 // or number. 167 // 168 // If the first character is a number, this value may be up to 9 characters, 169 // and valid characters are `[0-9]` with no leading zeros. 170 // 171 // When using HTTP/JSON, this field is populated 172 // based on a query string argument, such as `?endpoint_id=12345`. This is the 173 // fallback for fields that are not included in either the URI or the body. 174 string endpoint_id = 4 [(google.api.field_behavior) = IMMUTABLE]; 175} 176 177// Runtime operation information for 178// [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.CreateEndpoint]. 179message CreateEndpointOperationMetadata { 180 // The operation generic information. 181 GenericOperationMetadata generic_metadata = 1; 182} 183 184// Request message for 185// [EndpointService.GetEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.GetEndpoint] 186message GetEndpointRequest { 187 // Required. The name of the Endpoint resource. 188 // Format: 189 // `projects/{project}/locations/{location}/endpoints/{endpoint}` 190 string name = 1 [ 191 (google.api.field_behavior) = REQUIRED, 192 (google.api.resource_reference) = { 193 type: "aiplatform.googleapis.com/Endpoint" 194 } 195 ]; 196} 197 198// Request message for 199// [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints]. 200message ListEndpointsRequest { 201 // Required. The resource name of the Location from which to list the 202 // Endpoints. Format: `projects/{project}/locations/{location}` 203 string parent = 1 [ 204 (google.api.field_behavior) = REQUIRED, 205 (google.api.resource_reference) = { 206 type: "locations.googleapis.com/Location" 207 } 208 ]; 209 210 // Optional. An expression for filtering the results of the request. For field 211 // names both snake_case and camelCase are supported. 212 // 213 // * `endpoint` supports `=` and `!=`. `endpoint` represents the Endpoint 214 // ID, i.e. the last segment of the Endpoint's 215 // [resource name][google.cloud.aiplatform.v1beta1.Endpoint.name]. 216 // * `display_name` supports `=` and `!=`. 217 // * `labels` supports general map functions that is: 218 // * `labels.key=value` - key:value equality 219 // * `labels.key:*` or `labels:key` - key existence 220 // * A key including a space must be quoted. `labels."a key"`. 221 // * `base_model_name` only supports `=`. 222 // 223 // Some examples: 224 // 225 // * `endpoint=1` 226 // * `displayName="myDisplayName"` 227 // * `labels.myKey="myValue"` 228 // * `baseModelName="text-bison"` 229 string filter = 2 [(google.api.field_behavior) = OPTIONAL]; 230 231 // Optional. The standard list page size. 232 int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; 233 234 // Optional. The standard list page token. 235 // Typically obtained via 236 // [ListEndpointsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListEndpointsResponse.next_page_token] 237 // of the previous 238 // [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints] 239 // call. 240 string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; 241 242 // Optional. Mask specifying which fields to read. 243 google.protobuf.FieldMask read_mask = 5 244 [(google.api.field_behavior) = OPTIONAL]; 245} 246 247// Response message for 248// [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints]. 249message ListEndpointsResponse { 250 // List of Endpoints in the requested page. 251 repeated Endpoint endpoints = 1; 252 253 // A token to retrieve the next page of results. 254 // Pass to 255 // [ListEndpointsRequest.page_token][google.cloud.aiplatform.v1beta1.ListEndpointsRequest.page_token] 256 // to obtain that page. 257 string next_page_token = 2; 258} 259 260// Request message for 261// [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint]. 262message UpdateEndpointRequest { 263 // Required. The Endpoint which replaces the resource on the server. 264 Endpoint endpoint = 1 [(google.api.field_behavior) = REQUIRED]; 265 266 // Required. The update mask applies to the resource. See 267 // [google.protobuf.FieldMask][google.protobuf.FieldMask]. 268 google.protobuf.FieldMask update_mask = 2 269 [(google.api.field_behavior) = REQUIRED]; 270} 271 272// Request message for 273// [EndpointService.DeleteEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeleteEndpoint]. 274message DeleteEndpointRequest { 275 // Required. The name of the Endpoint resource to be deleted. 276 // Format: 277 // `projects/{project}/locations/{location}/endpoints/{endpoint}` 278 string name = 1 [ 279 (google.api.field_behavior) = REQUIRED, 280 (google.api.resource_reference) = { 281 type: "aiplatform.googleapis.com/Endpoint" 282 } 283 ]; 284} 285 286// Request message for 287// [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]. 288message DeployModelRequest { 289 // Required. The name of the Endpoint resource into which to deploy a Model. 290 // Format: 291 // `projects/{project}/locations/{location}/endpoints/{endpoint}` 292 string endpoint = 1 [ 293 (google.api.field_behavior) = REQUIRED, 294 (google.api.resource_reference) = { 295 type: "aiplatform.googleapis.com/Endpoint" 296 } 297 ]; 298 299 // Required. The DeployedModel to be created within the Endpoint. Note that 300 // [Endpoint.traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] 301 // must be updated for the DeployedModel to start receiving traffic, either as 302 // part of this call, or via 303 // [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint]. 304 DeployedModel deployed_model = 2 [(google.api.field_behavior) = REQUIRED]; 305 306 // A map from a DeployedModel's ID to the percentage of this Endpoint's 307 // traffic that should be forwarded to that DeployedModel. 308 // 309 // If this field is non-empty, then the Endpoint's 310 // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] 311 // will be overwritten with it. To refer to the ID of the just being deployed 312 // Model, a "0" should be used, and the actual ID of the new DeployedModel 313 // will be filled in its place by this method. The traffic percentage values 314 // must add up to 100. 315 // 316 // If this field is empty, then the Endpoint's 317 // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] is 318 // not updated. 319 map<string, int32> traffic_split = 3; 320} 321 322// Response message for 323// [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]. 324message DeployModelResponse { 325 // The DeployedModel that had been deployed in the Endpoint. 326 DeployedModel deployed_model = 1; 327} 328 329// Runtime operation information for 330// [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel]. 331message DeployModelOperationMetadata { 332 // The operation generic information. 333 GenericOperationMetadata generic_metadata = 1; 334} 335 336// Request message for 337// [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel]. 338message UndeployModelRequest { 339 // Required. The name of the Endpoint resource from which to undeploy a Model. 340 // Format: 341 // `projects/{project}/locations/{location}/endpoints/{endpoint}` 342 string endpoint = 1 [ 343 (google.api.field_behavior) = REQUIRED, 344 (google.api.resource_reference) = { 345 type: "aiplatform.googleapis.com/Endpoint" 346 } 347 ]; 348 349 // Required. The ID of the DeployedModel to be undeployed from the Endpoint. 350 string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED]; 351 352 // If this field is provided, then the Endpoint's 353 // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] 354 // will be overwritten with it. If last DeployedModel is being undeployed from 355 // the Endpoint, the [Endpoint.traffic_split] will always end up empty when 356 // this call returns. A DeployedModel will be successfully undeployed only if 357 // it doesn't have any traffic assigned to it when this method executes, or if 358 // this field unassigns any traffic to it. 359 map<string, int32> traffic_split = 3; 360} 361 362// Response message for 363// [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel]. 364message UndeployModelResponse {} 365 366// Runtime operation information for 367// [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel]. 368message UndeployModelOperationMetadata { 369 // The operation generic information. 370 GenericOperationMetadata generic_metadata = 1; 371} 372 373// Request message for 374// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. 375message MutateDeployedModelRequest { 376 // Required. The name of the Endpoint resource into which to mutate a 377 // DeployedModel. Format: 378 // `projects/{project}/locations/{location}/endpoints/{endpoint}` 379 string endpoint = 1 [ 380 (google.api.field_behavior) = REQUIRED, 381 (google.api.resource_reference) = { 382 type: "aiplatform.googleapis.com/Endpoint" 383 } 384 ]; 385 386 // Required. The DeployedModel to be mutated within the Endpoint. Only the 387 // following fields can be mutated: 388 // 389 // * `min_replica_count` in either 390 // [DedicatedResources][google.cloud.aiplatform.v1beta1.DedicatedResources] or 391 // [AutomaticResources][google.cloud.aiplatform.v1beta1.AutomaticResources] 392 // * `max_replica_count` in either 393 // [DedicatedResources][google.cloud.aiplatform.v1beta1.DedicatedResources] or 394 // [AutomaticResources][google.cloud.aiplatform.v1beta1.AutomaticResources] 395 // * [autoscaling_metric_specs][google.cloud.aiplatform.v1beta1.DedicatedResources.autoscaling_metric_specs] 396 // * `disable_container_logging` (v1 only) 397 // * `enable_container_logging` (v1beta1 only) 398 DeployedModel deployed_model = 2 [(google.api.field_behavior) = REQUIRED]; 399 400 // Required. The update mask applies to the resource. See 401 // [google.protobuf.FieldMask][google.protobuf.FieldMask]. 402 google.protobuf.FieldMask update_mask = 4 403 [(google.api.field_behavior) = REQUIRED]; 404} 405 406// Response message for 407// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. 408message MutateDeployedModelResponse { 409 // The DeployedModel that's being mutated. 410 DeployedModel deployed_model = 1; 411} 412 413// Runtime operation information for 414// [EndpointService.MutateDeployedModel][google.cloud.aiplatform.v1beta1.EndpointService.MutateDeployedModel]. 415message MutateDeployedModelOperationMetadata { 416 // The operation generic information. 417 GenericOperationMetadata generic_metadata = 1; 418} 419