endpoint_service.proto 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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.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. 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: "/v1beta1/{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: "/v1beta1/{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: "/v1beta1/{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: "/v1beta1/{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: "/v1beta1/{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: "/v1beta1/{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: "/v1beta1/{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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.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.v1beta1.ListEndpointsResponse.next_page_token] of the previous
  166. // [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.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. }
  171. // Response message for [EndpointService.ListEndpoints][google.cloud.aiplatform.v1beta1.EndpointService.ListEndpoints].
  172. message ListEndpointsResponse {
  173. // List of Endpoints in the requested page.
  174. repeated Endpoint endpoints = 1;
  175. // A token to retrieve the next page of results.
  176. // Pass to [ListEndpointsRequest.page_token][google.cloud.aiplatform.v1beta1.ListEndpointsRequest.page_token] to obtain that page.
  177. string next_page_token = 2;
  178. }
  179. // Request message for [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint].
  180. message UpdateEndpointRequest {
  181. // Required. The Endpoint which replaces the resource on the server.
  182. Endpoint endpoint = 1 [(google.api.field_behavior) = REQUIRED];
  183. // Required. The update mask applies to the resource. See [google.protobuf.FieldMask][google.protobuf.FieldMask].
  184. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  185. }
  186. // Request message for [EndpointService.DeleteEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.DeleteEndpoint].
  187. message DeleteEndpointRequest {
  188. // Required. The name of the Endpoint resource to be deleted.
  189. // Format:
  190. // `projects/{project}/locations/{location}/endpoints/{endpoint}`
  191. string name = 1 [
  192. (google.api.field_behavior) = REQUIRED,
  193. (google.api.resource_reference) = {
  194. type: "aiplatform.googleapis.com/Endpoint"
  195. }
  196. ];
  197. }
  198. // Request message for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel].
  199. message DeployModelRequest {
  200. // Required. The name of the Endpoint resource into which to deploy a Model.
  201. // Format:
  202. // `projects/{project}/locations/{location}/endpoints/{endpoint}`
  203. string endpoint = 1 [
  204. (google.api.field_behavior) = REQUIRED,
  205. (google.api.resource_reference) = {
  206. type: "aiplatform.googleapis.com/Endpoint"
  207. }
  208. ];
  209. // Required. The DeployedModel to be created within the Endpoint. Note that
  210. // [Endpoint.traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] must be updated for the DeployedModel to start
  211. // receiving traffic, either as part of this call, or via
  212. // [EndpointService.UpdateEndpoint][google.cloud.aiplatform.v1beta1.EndpointService.UpdateEndpoint].
  213. DeployedModel deployed_model = 2 [(google.api.field_behavior) = REQUIRED];
  214. // A map from a DeployedModel's ID to the percentage of this Endpoint's
  215. // traffic that should be forwarded to that DeployedModel.
  216. //
  217. // If this field is non-empty, then the Endpoint's
  218. // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] will be overwritten with it.
  219. // To refer to the ID of the just being deployed Model, a "0" should be used,
  220. // and the actual ID of the new DeployedModel will be filled in its place by
  221. // this method. The traffic percentage values must add up to 100.
  222. //
  223. // If this field is empty, then the Endpoint's
  224. // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] is not updated.
  225. map<string, int32> traffic_split = 3;
  226. }
  227. // Response message for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel].
  228. message DeployModelResponse {
  229. // The DeployedModel that had been deployed in the Endpoint.
  230. DeployedModel deployed_model = 1;
  231. }
  232. // Runtime operation information for [EndpointService.DeployModel][google.cloud.aiplatform.v1beta1.EndpointService.DeployModel].
  233. message DeployModelOperationMetadata {
  234. // The operation generic information.
  235. GenericOperationMetadata generic_metadata = 1;
  236. }
  237. // Request message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel].
  238. message UndeployModelRequest {
  239. // Required. The name of the Endpoint resource from which to undeploy a Model.
  240. // Format:
  241. // `projects/{project}/locations/{location}/endpoints/{endpoint}`
  242. string endpoint = 1 [
  243. (google.api.field_behavior) = REQUIRED,
  244. (google.api.resource_reference) = {
  245. type: "aiplatform.googleapis.com/Endpoint"
  246. }
  247. ];
  248. // Required. The ID of the DeployedModel to be undeployed from the Endpoint.
  249. string deployed_model_id = 2 [(google.api.field_behavior) = REQUIRED];
  250. // If this field is provided, then the Endpoint's
  251. // [traffic_split][google.cloud.aiplatform.v1beta1.Endpoint.traffic_split] will be overwritten with it. If
  252. // last DeployedModel is being undeployed from the Endpoint, the
  253. // [Endpoint.traffic_split] will always end up empty when this call returns.
  254. // A DeployedModel will be successfully undeployed only if it doesn't have
  255. // any traffic assigned to it when this method executes, or if this field
  256. // unassigns any traffic to it.
  257. map<string, int32> traffic_split = 3;
  258. }
  259. // Response message for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel].
  260. message UndeployModelResponse {
  261. }
  262. // Runtime operation information for [EndpointService.UndeployModel][google.cloud.aiplatform.v1beta1.EndpointService.UndeployModel].
  263. message UndeployModelOperationMetadata {
  264. // The operation generic information.
  265. GenericOperationMetadata generic_metadata = 1;
  266. }