endpoint_service.proto 13 KB

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