endpoint_service.proto 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.cloud.aiplatform.v1beta1;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/cloud/aiplatform/v1beta1/endpoint.proto";
  21. import "google/cloud/aiplatform/v1beta1/operation.proto";
  22. import "google/longrunning/operations.proto";
  23. import "google/protobuf/field_mask.proto";
  24. option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "EndpointServiceProto";
  28. option java_package = "com.google.cloud.aiplatform.v1beta1";
  29. option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
  30. option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
  31. // A service for managing Vertex AI's Endpoints.
  32. service EndpointService {
  33. option (google.api.default_host) = "aiplatform.googleapis.com";
  34. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  35. // Creates an Endpoint.
  36. rpc CreateEndpoint(CreateEndpointRequest) returns (google.longrunning.Operation) {
  37. option (google.api.http) = {
  38. post: "/v1beta1/{parent=projects/*/locations/*}/endpoints"
  39. body: "endpoint"
  40. };
  41. option (google.api.method_signature) = "parent,endpoint";
  42. option (google.api.method_signature) = "parent,endpoint,endpoint_id";
  43. option (google.longrunning.operation_info) = {
  44. response_type: "Endpoint"
  45. metadata_type: "CreateEndpointOperationMetadata"
  46. };
  47. }
  48. // Gets an Endpoint.
  49. rpc GetEndpoint(GetEndpointRequest) returns (Endpoint) {
  50. option (google.api.http) = {
  51. get: "/v1beta1/{name=projects/*/locations/*/endpoints/*}"
  52. };
  53. option (google.api.method_signature) = "name";
  54. }
  55. // Lists Endpoints in a Location.
  56. rpc ListEndpoints(ListEndpointsRequest) returns (ListEndpointsResponse) {
  57. option (google.api.http) = {
  58. get: "/v1beta1/{parent=projects/*/locations/*}/endpoints"
  59. };
  60. option (google.api.method_signature) = "parent";
  61. }
  62. // Updates an Endpoint.
  63. rpc UpdateEndpoint(UpdateEndpointRequest) returns (Endpoint) {
  64. option (google.api.http) = {
  65. patch: "/v1beta1/{endpoint.name=projects/*/locations/*/endpoints/*}"
  66. body: "endpoint"
  67. };
  68. option (google.api.method_signature) = "endpoint,update_mask";
  69. }
  70. // Deletes an Endpoint.
  71. rpc DeleteEndpoint(DeleteEndpointRequest) returns (google.longrunning.Operation) {
  72. option (google.api.http) = {
  73. delete: "/v1beta1/{name=projects/*/locations/*/endpoints/*}"
  74. };
  75. option (google.api.method_signature) = "name";
  76. option (google.longrunning.operation_info) = {
  77. response_type: "google.protobuf.Empty"
  78. metadata_type: "DeleteOperationMetadata"
  79. };
  80. }
  81. // Deploys a Model into this Endpoint, creating a DeployedModel within it.
  82. rpc DeployModel(DeployModelRequest) returns (google.longrunning.Operation) {
  83. option (google.api.http) = {
  84. post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:deployModel"
  85. body: "*"
  86. };
  87. option (google.api.method_signature) = "endpoint,deployed_model,traffic_split";
  88. option (google.longrunning.operation_info) = {
  89. response_type: "DeployModelResponse"
  90. metadata_type: "DeployModelOperationMetadata"
  91. };
  92. }
  93. // Undeploys a Model from an Endpoint, removing a DeployedModel from it, and
  94. // freeing all resources it's using.
  95. rpc UndeployModel(UndeployModelRequest) returns (google.longrunning.Operation) {
  96. option (google.api.http) = {
  97. post: "/v1beta1/{endpoint=projects/*/locations/*/endpoints/*}:undeployModel"
  98. body: "*"
  99. };
  100. option (google.api.method_signature) = "endpoint,deployed_model_id,traffic_split";
  101. option (google.longrunning.operation_info) = {
  102. response_type: "UndeployModelResponse"
  103. metadata_type: "UndeployModelOperationMetadata"
  104. };
  105. }
  106. }
  107. // Request message for [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.CreateEndpoint].
  108. message CreateEndpointRequest {
  109. // Required. The resource name of the Location to create the Endpoint in.
  110. // Format: `projects/{project}/locations/{location}`
  111. string parent = 1 [
  112. (google.api.field_behavior) = REQUIRED,
  113. (google.api.resource_reference) = {
  114. type: "locations.googleapis.com/Location"
  115. }
  116. ];
  117. // Required. The Endpoint to create.
  118. Endpoint endpoint = 2 [(google.api.field_behavior) = REQUIRED];
  119. // Immutable. The ID to use for endpoint, which will become the final
  120. // component of the endpoint resource name.
  121. // If not provided, Vertex AI will generate a value for this ID.
  122. //
  123. // This value should be 1-10 characters, and valid characters are /[0-9]/.
  124. // When using HTTP/JSON, this field is populated based on a query string
  125. // argument, such as `?endpoint_id=12345`. This is the fallback for fields
  126. // that are not included in either the URI or the body.
  127. string endpoint_id = 4 [(google.api.field_behavior) = IMMUTABLE];
  128. }
  129. // Runtime operation information for [EndpointService.CreateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.CreateEndpoint].
  130. message CreateEndpointOperationMetadata {
  131. // The operation generic information.
  132. GenericOperationMetadata generic_metadata = 1;
  133. }
  134. // Request message for [EndpointService.GetEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.GetEndpoint]
  135. message GetEndpointRequest {
  136. // Required. The name of the Endpoint resource.
  137. // Format:
  138. // `projects/{project}/locations/{location}/endpoints/{endpoint}`
  139. string name = 1 [
  140. (google.api.field_behavior) = REQUIRED,
  141. (google.api.resource_reference) = {
  142. type: "aiplatform.googleapis.com/Endpoint"
  143. }
  144. ];
  145. }
  146. // Request message for [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints].
  147. message ListEndpointsRequest {
  148. // Required. The resource name of the Location from which to list the Endpoints.
  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. // Optional. An expression for filtering the results of the request. For field names
  157. // both snake_case and camelCase are supported.
  158. //
  159. // * `endpoint` supports = and !=. `endpoint` represents the Endpoint ID,
  160. // i.e. the last segment of the Endpoint's [resource name][google.cloud.aiplatform.v1beta1.Endpoint.name].
  161. // * `display_name` supports = and, !=
  162. // * `labels` supports general map functions that is:
  163. // * `labels.key=value` - key:value equality
  164. // * `labels.key:* or labels:key - key existence
  165. // * A key including a space must be quoted. `labels."a key"`.
  166. //
  167. // Some examples:
  168. // * `endpoint=1`
  169. // * `displayName="myDisplayName"`
  170. // * `labels.myKey="myValue"`
  171. string filter = 2 [(google.api.field_behavior) = OPTIONAL];
  172. // Optional. The standard list page size.
  173. int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL];
  174. // Optional. The standard list page token.
  175. // Typically obtained via
  176. // [ListEndpointsResponse.next_page_token][google.cloud.aiplatform.v1beta1.ListEndpointsResponse.next_page_token] of the previous
  177. // [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints] call.
  178. string page_token = 4 [(google.api.field_behavior) = OPTIONAL];
  179. // Optional. Mask specifying which fields to read.
  180. google.protobuf.FieldMask read_mask = 5 [(google.api.field_behavior) = OPTIONAL];
  181. }
  182. // Response message for [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints].
  183. message ListEndpointsResponse {
  184. // List of Endpoints in the requested page.
  185. repeated Endpoint endpoints = 1;
  186. // A token to retrieve the next page of results.
  187. // Pass to [ListEndpointsRequest.page_token][google.cloud.aiplatform.v1beta1.ListEndpointsRequest.page_token] to obtain that page.
  188. string next_page_token = 2;
  189. }
  190. // Request message for [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint].
  191. message UpdateEndpointRequest {
  192. // Required. The Endpoint which replaces the resource on the server.
  193. Endpoint endpoint = 1 [(google.api.field_behavior) = REQUIRED];
  194. // Required. The update mask applies to the resource. See [google.protobuf.FieldMask][google.protobuf.FieldMask].
  195. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  196. }
  197. // Request message for [EndpointService.DeleteEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeleteEndpoint].
  198. message DeleteEndpointRequest {
  199. // Required. The name of the Endpoint resource to be deleted.
  200. // Format:
  201. // `projects/{project}/locations/{location}/endpoints/{endpoint}`
  202. string name = 1 [
  203. (google.api.field_behavior) = REQUIRED,
  204. (google.api.resource_reference) = {
  205. type: "aiplatform.googleapis.com/Endpoint"
  206. }
  207. ];
  208. }
  209. // Request message for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel].
  210. message DeployModelRequest {
  211. // Required. The name of the Endpoint resource into which to deploy a Model.
  212. // Format:
  213. // `projects/{project}/locations/{location}/endpoints/{endpoint}`
  214. string endpoint = 1 [
  215. (google.api.field_behavior) = REQUIRED,
  216. (google.api.resource_reference) = {
  217. type: "aiplatform.googleapis.com/Endpoint"
  218. }
  219. ];
  220. // Required. The DeployedModel to be created within the Endpoint. Note that
  221. // [Endpoint.traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] must be updated for the DeployedModel to start
  222. // receiving traffic, either as part of this call, or via
  223. // [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint].
  224. DeployedModel deployed_model = 2 [(google.api.field_behavior) = REQUIRED];
  225. // A map from a DeployedModel's ID to the percentage of this Endpoint's
  226. // traffic that should be forwarded to that DeployedModel.
  227. //
  228. // If this field is non-empty, then the Endpoint's
  229. // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] will be overwritten with it.
  230. // To refer to the ID of the just being deployed Model, a "0" should be used,
  231. // and the actual ID of the new DeployedModel will be filled in its place by
  232. // this method. The traffic percentage values must add up to 100.
  233. //
  234. // If this field is empty, then the Endpoint's
  235. // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] is not updated.
  236. map<string, int32> traffic_split = 3;
  237. }
  238. // Response message for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel].
  239. message DeployModelResponse {
  240. // The DeployedModel that had been deployed in the Endpoint.
  241. DeployedModel deployed_model = 1;
  242. }
  243. // Runtime operation information for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel].
  244. message DeployModelOperationMetadata {
  245. // The operation generic information.
  246. GenericOperationMetadata generic_metadata = 1;
  247. }
  248. // Request message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel].
  249. message UndeployModelRequest {
  250. // Required. The name of the Endpoint resource from which to undeploy a Model.
  251. // Format:
  252. // `projects/{project}/locations/{location}/endpoints/{endpoint}`
  253. string endpoint = 1 [
  254. (google.api.field_behavior) = REQUIRED,
  255. (google.api.resource_reference) = {
  256. type: "aiplatform.googleapis.com/Endpoint"
  257. }
  258. ];
  259. // Required. The ID of the DeployedModel to be undeployed from the Endpoint.
  260. string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED];
  261. // If this field is provided, then the Endpoint's
  262. // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] will be overwritten with it. If
  263. // last DeployedModel is being undeployed from the Endpoint, the
  264. // [Endpoint.traffic_split] will always end up empty when this call returns.
  265. // A DeployedModel will be successfully undeployed only if it doesn't have
  266. // any traffic assigned to it when this method executes, or if this field
  267. // unassigns any traffic to it.
  268. map<string, int32> traffic_split = 3;
  269. }
  270. // Response message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel].
  271. message UndeployModelResponse {
  272. }
  273. // Runtime operation information for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel].
  274. message UndeployModelOperationMetadata {
  275. // The operation generic information.
  276. GenericOperationMetadata generic_metadata = 1;
  277. }