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.v1; 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/v1/index_endpoint.proto"; 24import "google/cloud/aiplatform/v1/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.V1"; 30option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; 31option java_multiple_files = true; 32option java_outer_classname = "IndexEndpointServiceProto"; 33option java_package = "com.google.cloud.aiplatform.v1"; 34option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; 35option ruby_package = "Google::Cloud::AIPlatform::V1"; 36 37// A service for managing Vertex AI's IndexEndpoints. 38service IndexEndpointService { 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 IndexEndpoint. 44 rpc CreateIndexEndpoint(CreateIndexEndpointRequest) 45 returns (google.longrunning.Operation) { 46 option (google.api.http) = { 47 post: "/v1/{parent=projects/*/locations/*}/indexEndpoints" 48 body: "index_endpoint" 49 }; 50 option (google.api.method_signature) = "parent,index_endpoint"; 51 option (google.longrunning.operation_info) = { 52 response_type: "IndexEndpoint" 53 metadata_type: "CreateIndexEndpointOperationMetadata" 54 }; 55 } 56 57 // Gets an IndexEndpoint. 58 rpc GetIndexEndpoint(GetIndexEndpointRequest) returns (IndexEndpoint) { 59 option (google.api.http) = { 60 get: "/v1/{name=projects/*/locations/*/indexEndpoints/*}" 61 }; 62 option (google.api.method_signature) = "name"; 63 } 64 65 // Lists IndexEndpoints in a Location. 66 rpc ListIndexEndpoints(ListIndexEndpointsRequest) 67 returns (ListIndexEndpointsResponse) { 68 option (google.api.http) = { 69 get: "/v1/{parent=projects/*/locations/*}/indexEndpoints" 70 }; 71 option (google.api.method_signature) = "parent"; 72 } 73 74 // Updates an IndexEndpoint. 75 rpc UpdateIndexEndpoint(UpdateIndexEndpointRequest) returns (IndexEndpoint) { 76 option (google.api.http) = { 77 patch: "/v1/{index_endpoint.name=projects/*/locations/*/indexEndpoints/*}" 78 body: "index_endpoint" 79 }; 80 option (google.api.method_signature) = "index_endpoint,update_mask"; 81 } 82 83 // Deletes an IndexEndpoint. 84 rpc DeleteIndexEndpoint(DeleteIndexEndpointRequest) 85 returns (google.longrunning.Operation) { 86 option (google.api.http) = { 87 delete: "/v1/{name=projects/*/locations/*/indexEndpoints/*}" 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 an Index into this IndexEndpoint, creating a DeployedIndex within 97 // it. 98 // Only non-empty Indexes can be deployed. 99 rpc DeployIndex(DeployIndexRequest) returns (google.longrunning.Operation) { 100 option (google.api.http) = { 101 post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:deployIndex" 102 body: "*" 103 }; 104 option (google.api.method_signature) = "index_endpoint,deployed_index"; 105 option (google.longrunning.operation_info) = { 106 response_type: "DeployIndexResponse" 107 metadata_type: "DeployIndexOperationMetadata" 108 }; 109 } 110 111 // Undeploys an Index from an IndexEndpoint, removing a DeployedIndex from it, 112 // and freeing all resources it's using. 113 rpc UndeployIndex(UndeployIndexRequest) 114 returns (google.longrunning.Operation) { 115 option (google.api.http) = { 116 post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:undeployIndex" 117 body: "*" 118 }; 119 option (google.api.method_signature) = "index_endpoint,deployed_index_id"; 120 option (google.longrunning.operation_info) = { 121 response_type: "UndeployIndexResponse" 122 metadata_type: "UndeployIndexOperationMetadata" 123 }; 124 } 125 126 // Update an existing DeployedIndex under an IndexEndpoint. 127 rpc MutateDeployedIndex(MutateDeployedIndexRequest) 128 returns (google.longrunning.Operation) { 129 option (google.api.http) = { 130 post: "/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:mutateDeployedIndex" 131 body: "deployed_index" 132 }; 133 option (google.api.method_signature) = "index_endpoint,deployed_index"; 134 option (google.longrunning.operation_info) = { 135 response_type: "MutateDeployedIndexResponse" 136 metadata_type: "MutateDeployedIndexOperationMetadata" 137 }; 138 } 139} 140 141// Request message for 142// [IndexEndpointService.CreateIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.CreateIndexEndpoint]. 143message CreateIndexEndpointRequest { 144 // Required. The resource name of the Location to create the IndexEndpoint in. 145 // Format: `projects/{project}/locations/{location}` 146 string parent = 1 [ 147 (google.api.field_behavior) = REQUIRED, 148 (google.api.resource_reference) = { 149 type: "locations.googleapis.com/Location" 150 } 151 ]; 152 153 // Required. The IndexEndpoint to create. 154 IndexEndpoint index_endpoint = 2 [(google.api.field_behavior) = REQUIRED]; 155} 156 157// Runtime operation information for 158// [IndexEndpointService.CreateIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.CreateIndexEndpoint]. 159message CreateIndexEndpointOperationMetadata { 160 // The operation generic information. 161 GenericOperationMetadata generic_metadata = 1; 162} 163 164// Request message for 165// [IndexEndpointService.GetIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.GetIndexEndpoint] 166message GetIndexEndpointRequest { 167 // Required. The name of the IndexEndpoint resource. 168 // Format: 169 // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` 170 string name = 1 [ 171 (google.api.field_behavior) = REQUIRED, 172 (google.api.resource_reference) = { 173 type: "aiplatform.googleapis.com/IndexEndpoint" 174 } 175 ]; 176} 177 178// Request message for 179// [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints]. 180message ListIndexEndpointsRequest { 181 // Required. The resource name of the Location from which to list the 182 // IndexEndpoints. Format: `projects/{project}/locations/{location}` 183 string parent = 1 [ 184 (google.api.field_behavior) = REQUIRED, 185 (google.api.resource_reference) = { 186 type: "locations.googleapis.com/Location" 187 } 188 ]; 189 190 // Optional. An expression for filtering the results of the request. For field 191 // names both snake_case and camelCase are supported. 192 // 193 // * `index_endpoint` supports = and !=. `index_endpoint` represents the 194 // IndexEndpoint ID, ie. the last segment of the IndexEndpoint's 195 // [resourcename][google.cloud.aiplatform.v1.IndexEndpoint.name]. 196 // * `display_name` supports =, != and regex() 197 // (uses [re2](https://github.com/google/re2/wiki/Syntax) syntax) 198 // * `labels` supports general map functions that is: 199 // `labels.key=value` - key:value equality 200 // `labels.key:* or labels:key - key existence 201 // A key including a space must be quoted. `labels."a key"`. 202 // 203 // Some examples: 204 // * `index_endpoint="1"` 205 // * `display_name="myDisplayName"` 206 // * `regex(display_name, "^A") -> The display name starts with an A. 207 // * `labels.myKey="myValue"` 208 string filter = 2 [(google.api.field_behavior) = OPTIONAL]; 209 210 // Optional. The standard list page size. 211 int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; 212 213 // Optional. The standard list page token. 214 // Typically obtained via 215 // [ListIndexEndpointsResponse.next_page_token][google.cloud.aiplatform.v1.ListIndexEndpointsResponse.next_page_token] 216 // of the previous 217 // [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints] 218 // call. 219 string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; 220 221 // Optional. Mask specifying which fields to read. 222 google.protobuf.FieldMask read_mask = 5 223 [(google.api.field_behavior) = OPTIONAL]; 224} 225 226// Response message for 227// [IndexEndpointService.ListIndexEndpoints][google.cloud.aiplatform.v1.IndexEndpointService.ListIndexEndpoints]. 228message ListIndexEndpointsResponse { 229 // List of IndexEndpoints in the requested page. 230 repeated IndexEndpoint index_endpoints = 1; 231 232 // A token to retrieve next page of results. 233 // Pass to 234 // [ListIndexEndpointsRequest.page_token][google.cloud.aiplatform.v1.ListIndexEndpointsRequest.page_token] 235 // to obtain that page. 236 string next_page_token = 2; 237} 238 239// Request message for 240// [IndexEndpointService.UpdateIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.UpdateIndexEndpoint]. 241message UpdateIndexEndpointRequest { 242 // Required. The IndexEndpoint which replaces the resource on the server. 243 IndexEndpoint index_endpoint = 1 [(google.api.field_behavior) = REQUIRED]; 244 245 // Required. The update mask applies to the resource. See 246 // [google.protobuf.FieldMask][google.protobuf.FieldMask]. 247 google.protobuf.FieldMask update_mask = 2 248 [(google.api.field_behavior) = REQUIRED]; 249} 250 251// Request message for 252// [IndexEndpointService.DeleteIndexEndpoint][google.cloud.aiplatform.v1.IndexEndpointService.DeleteIndexEndpoint]. 253message DeleteIndexEndpointRequest { 254 // Required. The name of the IndexEndpoint resource to be deleted. 255 // Format: 256 // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` 257 string name = 1 [ 258 (google.api.field_behavior) = REQUIRED, 259 (google.api.resource_reference) = { 260 type: "aiplatform.googleapis.com/IndexEndpoint" 261 } 262 ]; 263} 264 265// Request message for 266// [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.DeployIndex]. 267message DeployIndexRequest { 268 // Required. The name of the IndexEndpoint resource into which to deploy an 269 // Index. Format: 270 // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` 271 string index_endpoint = 1 [ 272 (google.api.field_behavior) = REQUIRED, 273 (google.api.resource_reference) = { 274 type: "aiplatform.googleapis.com/IndexEndpoint" 275 } 276 ]; 277 278 // Required. The DeployedIndex to be created within the IndexEndpoint. 279 DeployedIndex deployed_index = 2 [(google.api.field_behavior) = REQUIRED]; 280} 281 282// Response message for 283// [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.DeployIndex]. 284message DeployIndexResponse { 285 // The DeployedIndex that had been deployed in the IndexEndpoint. 286 DeployedIndex deployed_index = 1; 287} 288 289// Runtime operation information for 290// [IndexEndpointService.DeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.DeployIndex]. 291message DeployIndexOperationMetadata { 292 // The operation generic information. 293 GenericOperationMetadata generic_metadata = 1; 294 295 // The unique index id specified by user 296 string deployed_index_id = 2; 297} 298 299// Request message for 300// [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.UndeployIndex]. 301message UndeployIndexRequest { 302 // Required. The name of the IndexEndpoint resource from which to undeploy an 303 // Index. Format: 304 // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` 305 string index_endpoint = 1 [ 306 (google.api.field_behavior) = REQUIRED, 307 (google.api.resource_reference) = { 308 type: "aiplatform.googleapis.com/IndexEndpoint" 309 } 310 ]; 311 312 // Required. The ID of the DeployedIndex to be undeployed from the 313 // IndexEndpoint. 314 string deployed_index_id = 2 [(google.api.field_behavior) = REQUIRED]; 315} 316 317// Response message for 318// [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.UndeployIndex]. 319message UndeployIndexResponse {} 320 321// Runtime operation information for 322// [IndexEndpointService.UndeployIndex][google.cloud.aiplatform.v1.IndexEndpointService.UndeployIndex]. 323message UndeployIndexOperationMetadata { 324 // The operation generic information. 325 GenericOperationMetadata generic_metadata = 1; 326} 327 328// Request message for 329// [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1.IndexEndpointService.MutateDeployedIndex]. 330message MutateDeployedIndexRequest { 331 // Required. The name of the IndexEndpoint resource into which to deploy an 332 // Index. Format: 333 // `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` 334 string index_endpoint = 1 [ 335 (google.api.field_behavior) = REQUIRED, 336 (google.api.resource_reference) = { 337 type: "aiplatform.googleapis.com/IndexEndpoint" 338 } 339 ]; 340 341 // Required. The DeployedIndex to be updated within the IndexEndpoint. 342 // Currently, the updatable fields are [DeployedIndex][automatic_resources] 343 // and [DeployedIndex][dedicated_resources] 344 DeployedIndex deployed_index = 2 [(google.api.field_behavior) = REQUIRED]; 345} 346 347// Response message for 348// [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1.IndexEndpointService.MutateDeployedIndex]. 349message MutateDeployedIndexResponse { 350 // The DeployedIndex that had been updated in the IndexEndpoint. 351 DeployedIndex deployed_index = 1; 352} 353 354// Runtime operation information for 355// [IndexEndpointService.MutateDeployedIndex][google.cloud.aiplatform.v1.IndexEndpointService.MutateDeployedIndex]. 356message MutateDeployedIndexOperationMetadata { 357 // The operation generic information. 358 GenericOperationMetadata generic_metadata = 1; 359 360 // The unique index id specified by user 361 string deployed_index_id = 2; 362} 363