model_service.proto 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  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/io.proto";
  21. import "google/cloud/aiplatform/v1/model.proto";
  22. import "google/cloud/aiplatform/v1/model_evaluation.proto";
  23. import "google/cloud/aiplatform/v1/model_evaluation_slice.proto";
  24. import "google/cloud/aiplatform/v1/operation.proto";
  25. import "google/longrunning/operations.proto";
  26. import "google/protobuf/field_mask.proto";
  27. option csharp_namespace = "Google.Cloud.AIPlatform.V1";
  28. option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform";
  29. option java_multiple_files = true;
  30. option java_outer_classname = "ModelServiceProto";
  31. option java_package = "com.google.cloud.aiplatform.v1";
  32. option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
  33. option ruby_package = "Google::Cloud::AIPlatform::V1";
  34. // A service for managing Vertex AI's machine learning Models.
  35. service ModelService {
  36. option (google.api.default_host) = "aiplatform.googleapis.com";
  37. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  38. // Uploads a Model artifact into Vertex AI.
  39. rpc UploadModel(UploadModelRequest) returns (google.longrunning.Operation) {
  40. option (google.api.http) = {
  41. post: "/v1/{parent=projects/*/locations/*}/models:upload"
  42. body: "*"
  43. };
  44. option (google.api.method_signature) = "parent,model";
  45. option (google.longrunning.operation_info) = {
  46. response_type: "UploadModelResponse"
  47. metadata_type: "UploadModelOperationMetadata"
  48. };
  49. }
  50. // Gets a Model.
  51. rpc GetModel(GetModelRequest) returns (Model) {
  52. option (google.api.http) = {
  53. get: "/v1/{name=projects/*/locations/*/models/*}"
  54. };
  55. option (google.api.method_signature) = "name";
  56. }
  57. // Lists Models in a Location.
  58. rpc ListModels(ListModelsRequest) returns (ListModelsResponse) {
  59. option (google.api.http) = {
  60. get: "/v1/{parent=projects/*/locations/*}/models"
  61. };
  62. option (google.api.method_signature) = "parent";
  63. }
  64. // Updates a Model.
  65. rpc UpdateModel(UpdateModelRequest) returns (Model) {
  66. option (google.api.http) = {
  67. patch: "/v1/{model.name=projects/*/locations/*/models/*}"
  68. body: "model"
  69. };
  70. option (google.api.method_signature) = "model,update_mask";
  71. }
  72. // Deletes a Model.
  73. // Note: Model can only be deleted if there are no DeployedModels created
  74. // from it.
  75. rpc DeleteModel(DeleteModelRequest) returns (google.longrunning.Operation) {
  76. option (google.api.http) = {
  77. delete: "/v1/{name=projects/*/locations/*/models/*}"
  78. };
  79. option (google.api.method_signature) = "name";
  80. option (google.longrunning.operation_info) = {
  81. response_type: "google.protobuf.Empty"
  82. metadata_type: "DeleteOperationMetadata"
  83. };
  84. }
  85. // Exports a trained, exportable, Model to a location specified by the
  86. // user. A Model is considered to be exportable if it has at least one
  87. // [supported export format][google.cloud.aiplatform.v1.Model.supported_export_formats].
  88. rpc ExportModel(ExportModelRequest) returns (google.longrunning.Operation) {
  89. option (google.api.http) = {
  90. post: "/v1/{name=projects/*/locations/*/models/*}:export"
  91. body: "*"
  92. };
  93. option (google.api.method_signature) = "name,output_config";
  94. option (google.longrunning.operation_info) = {
  95. response_type: "ExportModelResponse"
  96. metadata_type: "ExportModelOperationMetadata"
  97. };
  98. }
  99. // Gets a ModelEvaluation.
  100. rpc GetModelEvaluation(GetModelEvaluationRequest) returns (ModelEvaluation) {
  101. option (google.api.http) = {
  102. get: "/v1/{name=projects/*/locations/*/models/*/evaluations/*}"
  103. };
  104. option (google.api.method_signature) = "name";
  105. }
  106. // Lists ModelEvaluations in a Model.
  107. rpc ListModelEvaluations(ListModelEvaluationsRequest) returns (ListModelEvaluationsResponse) {
  108. option (google.api.http) = {
  109. get: "/v1/{parent=projects/*/locations/*/models/*}/evaluations"
  110. };
  111. option (google.api.method_signature) = "parent";
  112. }
  113. // Gets a ModelEvaluationSlice.
  114. rpc GetModelEvaluationSlice(GetModelEvaluationSliceRequest) returns (ModelEvaluationSlice) {
  115. option (google.api.http) = {
  116. get: "/v1/{name=projects/*/locations/*/models/*/evaluations/*/slices/*}"
  117. };
  118. option (google.api.method_signature) = "name";
  119. }
  120. // Lists ModelEvaluationSlices in a ModelEvaluation.
  121. rpc ListModelEvaluationSlices(ListModelEvaluationSlicesRequest) returns (ListModelEvaluationSlicesResponse) {
  122. option (google.api.http) = {
  123. get: "/v1/{parent=projects/*/locations/*/models/*/evaluations/*}/slices"
  124. };
  125. option (google.api.method_signature) = "parent";
  126. }
  127. }
  128. // Request message for [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel].
  129. message UploadModelRequest {
  130. // Required. The resource name of the Location into which to upload the Model.
  131. // Format: `projects/{project}/locations/{location}`
  132. string parent = 1 [
  133. (google.api.field_behavior) = REQUIRED,
  134. (google.api.resource_reference) = {
  135. type: "locations.googleapis.com/Location"
  136. }
  137. ];
  138. // Required. The Model to create.
  139. Model model = 2 [(google.api.field_behavior) = REQUIRED];
  140. }
  141. // Details of [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel] operation.
  142. message UploadModelOperationMetadata {
  143. // The common part of the operation metadata.
  144. GenericOperationMetadata generic_metadata = 1;
  145. }
  146. // Response message of [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel] operation.
  147. message UploadModelResponse {
  148. // The name of the uploaded Model resource.
  149. // Format: `projects/{project}/locations/{location}/models/{model}`
  150. string model = 1 [(google.api.resource_reference) = {
  151. type: "aiplatform.googleapis.com/Model"
  152. }];
  153. }
  154. // Request message for [ModelService.GetModel][google.cloud.aiplatform.v1.ModelService.GetModel].
  155. message GetModelRequest {
  156. // Required. The name of the Model resource.
  157. // Format: `projects/{project}/locations/{location}/models/{model}`
  158. string name = 1 [
  159. (google.api.field_behavior) = REQUIRED,
  160. (google.api.resource_reference) = {
  161. type: "aiplatform.googleapis.com/Model"
  162. }
  163. ];
  164. }
  165. // Request message for [ModelService.ListModels][google.cloud.aiplatform.v1.ModelService.ListModels].
  166. message ListModelsRequest {
  167. // Required. The resource name of the Location to list the Models from.
  168. // Format: `projects/{project}/locations/{location}`
  169. string parent = 1 [
  170. (google.api.field_behavior) = REQUIRED,
  171. (google.api.resource_reference) = {
  172. type: "locations.googleapis.com/Location"
  173. }
  174. ];
  175. // An expression for filtering the results of the request. For field names
  176. // both snake_case and camelCase are supported.
  177. //
  178. // * `model` supports = and !=. `model` represents the Model ID,
  179. // i.e. the last segment of the Model's [resource name][google.cloud.aiplatform.v1.Model.name].
  180. // * `display_name` supports = and !=
  181. // * `labels` supports general map functions that is:
  182. // * `labels.key=value` - key:value equality
  183. // * `labels.key:* or labels:key - key existence
  184. // * A key including a space must be quoted. `labels."a key"`.
  185. //
  186. // Some examples:
  187. // * `model=1234`
  188. // * `displayName="myDisplayName"`
  189. // * `labels.myKey="myValue"`
  190. string filter = 2;
  191. // The standard list page size.
  192. int32 page_size = 3;
  193. // The standard list page token.
  194. // Typically obtained via
  195. // [ListModelsResponse.next_page_token][google.cloud.aiplatform.v1.ListModelsResponse.next_page_token] of the previous
  196. // [ModelService.ListModels][google.cloud.aiplatform.v1.ModelService.ListModels] call.
  197. string page_token = 4;
  198. // Mask specifying which fields to read.
  199. google.protobuf.FieldMask read_mask = 5;
  200. // A comma-separated list of fields to order by, sorted in ascending order.
  201. // Use "desc" after a field name for descending.
  202. // Supported fields:
  203. // * `display_name`
  204. // * `create_time`
  205. // * `update_time`
  206. //
  207. // Example: `display_name, create_time desc`.
  208. string order_by = 6;
  209. }
  210. // Response message for [ModelService.ListModels][google.cloud.aiplatform.v1.ModelService.ListModels]
  211. message ListModelsResponse {
  212. // List of Models in the requested page.
  213. repeated Model models = 1;
  214. // A token to retrieve next page of results.
  215. // Pass to [ListModelsRequest.page_token][google.cloud.aiplatform.v1.ListModelsRequest.page_token] to obtain that page.
  216. string next_page_token = 2;
  217. }
  218. // Request message for [ModelService.UpdateModel][google.cloud.aiplatform.v1.ModelService.UpdateModel].
  219. message UpdateModelRequest {
  220. // Required. The Model which replaces the resource on the server.
  221. Model model = 1 [(google.api.field_behavior) = REQUIRED];
  222. // Required. The update mask applies to the resource.
  223. // For the `FieldMask` definition, see [google.protobuf.FieldMask][google.protobuf.FieldMask].
  224. google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
  225. }
  226. // Request message for [ModelService.DeleteModel][google.cloud.aiplatform.v1.ModelService.DeleteModel].
  227. message DeleteModelRequest {
  228. // Required. The name of the Model resource to be deleted.
  229. // Format: `projects/{project}/locations/{location}/models/{model}`
  230. string name = 1 [
  231. (google.api.field_behavior) = REQUIRED,
  232. (google.api.resource_reference) = {
  233. type: "aiplatform.googleapis.com/Model"
  234. }
  235. ];
  236. }
  237. // Request message for [ModelService.ExportModel][google.cloud.aiplatform.v1.ModelService.ExportModel].
  238. message ExportModelRequest {
  239. // Output configuration for the Model export.
  240. message OutputConfig {
  241. // The ID of the format in which the Model must be exported. Each Model
  242. // lists the [export formats it supports][google.cloud.aiplatform.v1.Model.supported_export_formats].
  243. // If no value is provided here, then the first from the list of the Model's
  244. // supported formats is used by default.
  245. string export_format_id = 1;
  246. // The Cloud Storage location where the Model artifact is to be
  247. // written to. Under the directory given as the destination a new one with
  248. // name "`model-export-<model-display-name>-<timestamp-of-export-call>`",
  249. // where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format,
  250. // will be created. Inside, the Model and any of its supporting files
  251. // will be written.
  252. // This field should only be set when the `exportableContent` field of the
  253. // [Model.supported_export_formats] object contains `ARTIFACT`.
  254. GcsDestination artifact_destination = 3;
  255. // The Google Container Registry or Artifact Registry uri where the
  256. // Model container image will be copied to.
  257. // This field should only be set when the `exportableContent` field of the
  258. // [Model.supported_export_formats] object contains `IMAGE`.
  259. ContainerRegistryDestination image_destination = 4;
  260. }
  261. // Required. The resource name of the Model to export.
  262. // Format: `projects/{project}/locations/{location}/models/{model}`
  263. string name = 1 [
  264. (google.api.field_behavior) = REQUIRED,
  265. (google.api.resource_reference) = {
  266. type: "aiplatform.googleapis.com/Model"
  267. }
  268. ];
  269. // Required. The desired output location and configuration.
  270. OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED];
  271. }
  272. // Details of [ModelService.ExportModel][google.cloud.aiplatform.v1.ModelService.ExportModel] operation.
  273. message ExportModelOperationMetadata {
  274. // Further describes the output of the ExportModel. Supplements
  275. // [ExportModelRequest.OutputConfig][google.cloud.aiplatform.v1.ExportModelRequest.OutputConfig].
  276. message OutputInfo {
  277. // Output only. If the Model artifact is being exported to Google Cloud Storage this is
  278. // the full path of the directory created, into which the Model files are
  279. // being written to.
  280. string artifact_output_uri = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  281. // Output only. If the Model image is being exported to Google Container Registry or
  282. // Artifact Registry this is the full path of the image created.
  283. string image_output_uri = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
  284. }
  285. // The common part of the operation metadata.
  286. GenericOperationMetadata generic_metadata = 1;
  287. // Output only. Information further describing the output of this Model export.
  288. OutputInfo output_info = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  289. }
  290. // Response message of [ModelService.ExportModel][google.cloud.aiplatform.v1.ModelService.ExportModel] operation.
  291. message ExportModelResponse {
  292. }
  293. // Request message for [ModelService.GetModelEvaluation][google.cloud.aiplatform.v1.ModelService.GetModelEvaluation].
  294. message GetModelEvaluationRequest {
  295. // Required. The name of the ModelEvaluation resource.
  296. // Format:
  297. // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
  298. string name = 1 [
  299. (google.api.field_behavior) = REQUIRED,
  300. (google.api.resource_reference) = {
  301. type: "aiplatform.googleapis.com/ModelEvaluation"
  302. }
  303. ];
  304. }
  305. // Request message for [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1.ModelService.ListModelEvaluations].
  306. message ListModelEvaluationsRequest {
  307. // Required. The resource name of the Model to list the ModelEvaluations from.
  308. // Format: `projects/{project}/locations/{location}/models/{model}`
  309. string parent = 1 [
  310. (google.api.field_behavior) = REQUIRED,
  311. (google.api.resource_reference) = {
  312. type: "aiplatform.googleapis.com/Model"
  313. }
  314. ];
  315. // The standard list filter.
  316. string filter = 2;
  317. // The standard list page size.
  318. int32 page_size = 3;
  319. // The standard list page token.
  320. // Typically obtained via
  321. // [ListModelEvaluationsResponse.next_page_token][google.cloud.aiplatform.v1.ListModelEvaluationsResponse.next_page_token] of the previous
  322. // [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1.ModelService.ListModelEvaluations] call.
  323. string page_token = 4;
  324. // Mask specifying which fields to read.
  325. google.protobuf.FieldMask read_mask = 5;
  326. }
  327. // Response message for [ModelService.ListModelEvaluations][google.cloud.aiplatform.v1.ModelService.ListModelEvaluations].
  328. message ListModelEvaluationsResponse {
  329. // List of ModelEvaluations in the requested page.
  330. repeated ModelEvaluation model_evaluations = 1;
  331. // A token to retrieve next page of results.
  332. // Pass to [ListModelEvaluationsRequest.page_token][google.cloud.aiplatform.v1.ListModelEvaluationsRequest.page_token] to obtain that page.
  333. string next_page_token = 2;
  334. }
  335. // Request message for [ModelService.GetModelEvaluationSlice][google.cloud.aiplatform.v1.ModelService.GetModelEvaluationSlice].
  336. message GetModelEvaluationSliceRequest {
  337. // Required. The name of the ModelEvaluationSlice resource.
  338. // Format:
  339. // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}/slices/{slice}`
  340. string name = 1 [
  341. (google.api.field_behavior) = REQUIRED,
  342. (google.api.resource_reference) = {
  343. type: "aiplatform.googleapis.com/ModelEvaluationSlice"
  344. }
  345. ];
  346. }
  347. // Request message for [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices].
  348. message ListModelEvaluationSlicesRequest {
  349. // Required. The resource name of the ModelEvaluation to list the ModelEvaluationSlices
  350. // from. Format:
  351. // `projects/{project}/locations/{location}/models/{model}/evaluations/{evaluation}`
  352. string parent = 1 [
  353. (google.api.field_behavior) = REQUIRED,
  354. (google.api.resource_reference) = {
  355. type: "aiplatform.googleapis.com/ModelEvaluation"
  356. }
  357. ];
  358. // The standard list filter.
  359. //
  360. // * `slice.dimension` - for =.
  361. string filter = 2;
  362. // The standard list page size.
  363. int32 page_size = 3;
  364. // The standard list page token.
  365. // Typically obtained via
  366. // [ListModelEvaluationSlicesResponse.next_page_token][google.cloud.aiplatform.v1.ListModelEvaluationSlicesResponse.next_page_token] of the previous
  367. // [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices] call.
  368. string page_token = 4;
  369. // Mask specifying which fields to read.
  370. google.protobuf.FieldMask read_mask = 5;
  371. }
  372. // Response message for [ModelService.ListModelEvaluationSlices][google.cloud.aiplatform.v1.ModelService.ListModelEvaluationSlices].
  373. message ListModelEvaluationSlicesResponse {
  374. // List of ModelEvaluations in the requested page.
  375. repeated ModelEvaluationSlice model_evaluation_slices = 1;
  376. // A token to retrieve next page of results.
  377. // Pass to [ListModelEvaluationSlicesRequest.page_token][google.cloud.aiplatform.v1.ListModelEvaluationSlicesRequest.page_token] to obtain that
  378. // page.
  379. string next_page_token = 2;
  380. }