// Copyright 2016 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. syntax = "proto3"; package google.cloud.ml.v1beta1; import "google/api/annotations.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/empty.proto"; import "google/protobuf/timestamp.proto"; option java_multiple_files = true; option java_outer_classname = "ModelServiceProto"; option java_package = "com.google.cloud.ml.api.v1beta1"; // Copyright 2016 Google Inc. All Rights Reserved. // // Proto file for the Machine Learning Service // Describes the 'models service' to work with the 'model' and 'version' // resources. // Allows managing the set of machine learning models and model versions // in the project. service ModelService { // Create a model which will later contain a set of model versions. rpc CreateModel(CreateModelRequest) returns (Model) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*}/models" body: "model" }; } // List models in the project. rpc ListModels(ListModelsRequest) returns (ListModelsResponse) { option (google.api.http) = { get: "/v1beta1/{parent=projects/*}/models" }; } // Describe a model and versions in it. rpc GetModel(GetModelRequest) returns (Model) { option (google.api.http) = { get: "/v1beta1/{name=projects/*/models/*}" }; } // Delete the model and all versions in it. rpc DeleteModel(DeleteModelRequest) returns (google.protobuf.Empty) { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/models/*}" }; } // Upload a trained TensorFlow model version. The result of the operation // is a Version. rpc CreateVersion(CreateVersionRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/models/*}/versions" body: "version" }; } // List versions in the model. rpc ListVersions(ListVersionsRequest) returns (ListVersionsResponse) { option (google.api.http) = { get: "/v1beta1/{parent=projects/*/models/*}/versions" }; } // Get version metadata. rpc GetVersion(GetVersionRequest) returns (Version) { option (google.api.http) = { get: "/v1beta1/{name=projects/*/models/*/versions/*}" }; } // Delete a version. rpc DeleteVersion(DeleteVersionRequest) returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/models/*/versions/*}" }; } // Mark the version as default within the model. rpc SetDefaultVersion(SetDefaultVersionRequest) returns (Version) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/models/*/versions/*}:setDefault" body: "*" }; } } // Represents a machine learning model resource that can be used to perform // prediction. message Model { // Required. The user-specified name of the model. string name = 1; // Optional. The description of the model. string description = 2; // Output only. The default version of the model. Version default_version = 3; } // Represents a version of the model. message Version { // Required.The user-specified name of the model version. string name = 1; // Optional. The description of the model version. string description = 2; // Output only. Whether the version is default within the model. bool is_default = 3; // Required. Google Cloud Storage object containing the model graph, weights // and additional metadata at the moment when the version is created. string deployment_uri = 4; // Output only. The creation time of the version. google.protobuf.Timestamp create_time = 5; // Output only. The last usage time of the version. google.protobuf.Timestamp last_use_time = 6; } // Request message for the CreateModel method. message CreateModelRequest { // Required. The project name. // Authorization: requires `Editor` role on the specified project. string parent = 1; // Required. The model to create. Model model = 2; } // Request message for the ListModels method. message ListModelsRequest { // Required. The name of the project whose models are to be listed. // Authorization: requires `Viewer` role on the specified project. string parent = 1; // Optional. Specifies the subset of models to retrieve. string filter = 2; // Optional. Specifies the ordering of the models. string order_by = 3; // Optional. A token for for continuing the enumeration. string page_token = 4; // Optional. The page size. int32 page_size = 5; } // Response message for the ListModels method. message ListModelsResponse { // The list of models. repeated Model models = 1; // Optional pagination token to use for retrieving the next page of results. string next_page_token = 2; } // Request message for the GetModel method. message GetModelRequest { // Required. The name of the model. // Authorization: requires `Viewer` role on the parent project. string name = 1; } // Request message for the DeleteModel method. message DeleteModelRequest { // Required. The name of the model. // Authorization: requires `Editor` role on the parent project. string name = 1; } // Uploads the provided trained model version to Cloud Machine Learning. message CreateVersionRequest { // Required. The name of the model. // Authorization: requires `Editor` role on the parent project. string parent = 1; // Required. The version details. Version version = 2; } // Request message for the ListVersions method. message ListVersionsRequest { // Required. The name of the model whose versions are to be listed. // Authorization: requires `Viewer` role on the parent project. string parent = 1; // Optional. Specifies the subset of versions to retrieve. string filter = 2; // Optional. Specifies the ordering of the versions. string order_by = 3; // Optional. A token for continuing the enumeration. string page_token = 4; // Optional. The page size. int32 page_size = 5; } // Response message for the ListVersions method. message ListVersionsResponse { // The list of versions. repeated Version versions = 1; // Optional pagination token to use for retrieving the next page of results. string next_page_token = 2; } // Request message for the GetVersion method. message GetVersionRequest { // Required. The name of the version. // Authorization: requires `Viewer` role on the parent project. string name = 1; } // Request message for the DeleteVersion method. message DeleteVersionRequest { // Required. The name of the version. string name = 1; } // Request message for the SetDefaultVersion request. message SetDefaultVersionRequest { // Required. The version name which is being made default within the model. // Authorization: requires `Editor` role on the parent project. string name = 1; }