You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@submarine.apache.org by ku...@apache.org on 2021/12/17 07:03:42 UTC

[submarine] branch master updated: SUBMARINE-1083. Update model management Api document

This is an automated email from the ASF dual-hosted git repository.

kuanhsun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/submarine.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a7113a  SUBMARINE-1083. Update model management Api document
1a7113a is described below

commit 1a7113adf97a4fa4ec5cfcbb431837ef5906ef9d
Author: jeff-901 <b0...@ntu.edu.tw>
AuthorDate: Fri Dec 17 09:57:12 2021 +0800

    SUBMARINE-1083. Update model management Api document
    
    ### What is this PR for?
    Add model management RESTApi document.
    
    ### What type of PR is it?
    Documentation
    ### Todos
    
    ### What is the Jira issue?
    https://issues.apache.org/jira/browse/SUBMARINE-1083
    
    ### How should this be tested?
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Do the license files need updating? No
    * Are there breaking changes for older versions? No
    * Does this need new documentation? No
    
    Author: jeff-901 <b0...@ntu.edu.tw>
    
    Signed-off-by: kuanhsun <ku...@apache.org>
    
    Closes #837 from jeff-901/SUBMARINE-1083 and squashes the following commits:
    
    11b6b8d7 [jeff-901] delete other file
    d26875a1 [jeff-901] add doc
    2f4f612e [jeff-901] add client
---
 website/docs/api/model-version.md    | 221 +++++++++++++++++++++++++++++++++++
 website/docs/api/registered-model.md | 211 +++++++++++++++++++++++++++++++++
 2 files changed, 432 insertions(+)

diff --git a/website/docs/api/model-version.md b/website/docs/api/model-version.md
new file mode 100644
index 0000000..1addf1e
--- /dev/null
+++ b/website/docs/api/model-version.md
@@ -0,0 +1,221 @@
+---
+title: Serve REST API
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+-->
+
+> Note: The Model Version API is in the alpha stage which is subjected to incompatible changes in future releases.
+
+### List model versions under a registered model
+`GET /api/v1/model-version/{name}`
+
+**Example Request:**
+```sh
+curl -X GET http://127.0.0.1:32080/api/v1/model-version/register
+```
+
+**Example Response:**
+```json
+{
+   "attributes" : {},
+   "code" : 200,
+   "message" : "List all model version instances",
+   "result" : [
+      {
+         "creationTime" : "2021-12-12 02:27:05",
+         "currentStage" : "None",
+         "dataset" : null,
+         "description" : null,
+         "experimentId" : "experiment-1639276018590-0001",
+         "lastUpdatedTime" : "2021-12-12 02:27:05",
+         "modelType" : "tensorflow",
+         "name" : "register",
+         "source" : "s3://submarine/experiment-1639276018590-0001/example/1",
+         "tags" : [],
+         "userId" : "",
+         "version" : 1
+      },
+      {
+         "creationTime" : "2021-12-12 02:27:05",
+         "currentStage" : "None",
+         "dataset" : null,
+         "description" : null,
+         "experimentId" : "experiment-1639276018590-0001",
+         "lastUpdatedTime" : "2021-12-12 02:27:05",
+         "modelType" : "tensorflow",
+         "name" : "register",
+         "source" : "s3://submarine/experiment-1639276018590-0001/example/2",
+         "tags" : [],
+         "userId" : "",
+         "version" : 2
+      },
+      {
+         "creationTime" : "2021-12-12 02:27:05",
+         "currentStage" : "None",
+         "dataset" : null,
+         "description" : null,
+         "experimentId" : "experiment-1639276018590-0001",
+         "lastUpdatedTime" : "2021-12-12 02:27:05",
+         "modelType" : "tensorflow",
+         "name" : "register",
+         "source" : "s3://submarine/experiment-1639276018590-0001/example1/1",
+         "tags" : [],
+         "userId" : "",
+         "version" : 3
+      },
+      {
+         "creationTime" : "2021-12-12 02:27:06",
+         "currentStage" : "None",
+         "dataset" : null,
+         "description" : null,
+         "experimentId" : "experiment-1639276018590-0001",
+         "lastUpdatedTime" : "2021-12-12 02:27:06",
+         "modelType" : "tensorflow",
+         "name" : "register",
+         "source" : "s3://submarine/experiment-1639276018590-0001/example2/1",
+         "tags" : [],
+         "userId" : "",
+         "version" : 4
+      },
+   ],
+   "status" : "OK",
+   "success" : true
+}
+```
+
+### Get a model version
+`GET /api/v1/model-version/{name}/{version}`
+
+**Example Request:**
+```sh
+curl -X GET http://127.0.0.1:32080/api/v1/model-version/register/1
+```
+
+**Example Response:**
+```json
+{
+   "attributes" : {},
+   "code" : 200,
+   "message" : "Get the model version instance",
+   "result" : {
+      "creationTime" : "2021-12-12 02:27:05",
+      "currentStage" : "None",
+      "dataset" : null,
+      "description" : null,
+      "experimentId" : "experiment-1639276018590-0001",
+      "lastUpdatedTime" : "2021-12-12 02:27:05",
+      "modelType" : "tensorflow",
+      "name" : "register",
+      "source" : "s3://submarine/experiment-1639276018590-0001/example/1",
+      "tags" : [],
+      "userId" : "",
+      "version" : 1
+   },
+   "status" : "OK",
+   "success" : true
+}
+```
+
+### Patch a model version
+`PATCH /api/v1/model-version`
+
+**Example Request:**
+```sh
+curl -X PATCH -H "Content-Type: application/json" -d '
+{
+    "name": "register",
+    "version": 1,
+    "description": "new_description",
+    "currentStage": "production",
+    "dataset": "new_dataset"
+}' http://127.0.0.1:32080/api/v1/model-version
+```
+
+**Example Response:**
+```json
+{
+   "attributes" : {},
+   "code" : 200,
+   "message" : "Update the model version instance",
+   "result" : null,
+   "status" : "OK",
+   "success" : true
+}
+```
+
+## Delete a model version
+`DELETE /api/v1/model-version/{name}/{version}`
+
+**Example Request**
+```sh
+curl -X DELETE http://127.0.0.1:32080/api/v1/model-version/register/1
+```
+
+**Example Response:**
+```json
+{
+   "attributes" : {},
+   "code" : 200,
+   "message" : "Delete the model version instance",
+   "result" : null,
+   "status" : "OK",
+   "success" : true
+}
+```
+
+## Create a model version tag
+`POST /api/v1/model-version/tag?name={name}&version={version}&tag={tag}`
+
+**Example Request**
+```sh
+curl -X POST http://127.0.0.1:32080/api/v1/model-version/tag?name=register&version=2&tag=789
+```
+
+**Example Response:**
+```json
+{
+   "attributes" : {},
+   "code" : 200,
+   "message" : "Create a model version tag instance",
+   "result" : null,
+   "status" : "OK",
+   "success" : true
+}
+```
+
+## Delete a model version tag
+`DELETE /api/v1/model-version/tag?name={name}&version={version}&tag={tag}`
+
+**Example Request**
+```sh
+curl -X DELETE http://127.0.0.1:32080/api/v1/model-version/tag?name=register&version=2&tag=789
+```
+
+**Example Response:**
+```json
+{
+    "status":"OK",
+    "code":200,
+    "success":true,
+    "message":"Delete a registered model tag instance",
+    "result":null,
+    "attributes":{}
+}
+```
\ No newline at end of file
diff --git a/website/docs/api/registered-model.md b/website/docs/api/registered-model.md
new file mode 100644
index 0000000..6996c86
--- /dev/null
+++ b/website/docs/api/registered-model.md
@@ -0,0 +1,211 @@
+---
+title: Serve REST API
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+-->
+
+> Note: The Registered Model API is in the alpha stage which is subjected to incompatible changes in future releases.
+
+## Create a registered model
+`POST /api/v1/registered-model`
+
+**Example Request**
+```sh
+curl -X POST -H "Content-Type: application/json" -d '
+{
+   "name": "example_name",
+   "description": "example_description",
+   "tags": ["123", "456"]
+   }
+' http://127.0.0.1:32080/api/v1/registered-model
+```
+
+**Example Response:**
+```json
+{
+    "status":"OK",
+    "code":200,
+    "success":true,
+    "message":"Create a registered model instance",
+    "result":null,
+    "attributes":{}
+}
+```
+
+### List registered models
+`GET /api/v1/registered-model`
+
+**Example Request:**
+```sh
+curl -X GET http://127.0.0.1:32080/api/v1/registered-model
+```
+
+**Example Response:**
+```json
+{
+   "attributes" : {},
+   "code" : 200,
+   "message" : "List all registered model instances",
+   "result" : [
+      {
+         "creationTime" : "2021-12-16 10:14:06",
+         "description" : "example_description",
+         "lastUpdatedTime" : "2021-12-16 10:14:06",
+         "name" : "example_name",
+         "tags" : [
+            "123",
+            "456"
+         ]
+      },
+      {
+         "creationTime" : "2021-12-16 10:16:25",
+         "description" : "example_description",
+         "lastUpdatedTime" : "2021-12-16 10:16:25",
+         "name" : "example_name1",
+         "tags" : [
+            "123",
+            "456"
+         ]
+      },
+      {
+         "creationTime" : "2021-12-12 02:27:05",
+         "description" : null,
+         "lastUpdatedTime" : "2021-12-14 12:49:33",
+         "name" : "register",
+         "tags" : []
+      }
+   ],
+   "status" : "OK",
+   "success" : true
+}
+```
+
+### Get a registered model
+`GET /api/v1/registered-model/{name}`
+
+**Example Request:**
+```sh
+curl -X GET http://127.0.0.1:32080/api/v1/registered-model/example_name
+```
+
+**Example Response:**
+```json
+{
+   "attributes" : {},
+   "code" : 200,
+   "message" : "Get the registered model instance",
+   "result" : {
+      "creationTime" : "2021-12-16 10:14:06",
+      "description" : "example_description",
+      "lastUpdatedTime" : "2021-12-16 10:14:06",
+      "name" : "example_name",
+      "tags" : [
+         "123",
+         "456"
+      ]
+   },
+   "status" : "OK",
+   "success" : true
+}
+```
+
+### Patch a registered model
+`PATCH /api/v1/registered-model/{name}`
+
+**Example Request:**
+```sh
+curl -X PATCH -H "Content-Type: application/json" -d '
+{
+    "name": "new_name",
+    "description": "new_description"
+}' http://127.0.0.1:32080/api/v1/registered-model/example_name
+```
+
+**Example Response:**
+```json
+{
+   "attributes" : {},
+   "code" : 200,
+   "message" : "Update the registered model instance",
+   "result" : null,
+   "status" : "OK",
+   "success" : true
+}
+```
+
+## Delete a registered model
+`DELETE /api/v1/registered-model/{name}`
+
+**Example Request**
+```sh
+curl -X DELETE http://127.0.0.1:32080/api/v1/registered-model/example_name
+```
+
+**Example Response:**
+```json
+{
+   "attributes" : {},
+   "code" : 200,
+   "message" : "Delete the registered model instance",
+   "result" : null,
+   "status" : "OK",
+   "success" : true
+}
+```
+
+## Create a registered model tag
+`POST /api/v1/registered-model/tag?name={name}&tag={tag}`
+
+**Example Request**
+```sh
+curl -X POST http://127.0.0.1:32080/api/v1/registered-model/tag?name=example_name&tag=789
+```
+
+**Example Response:**
+```json
+{
+    "status":"OK",
+    "code":200,
+    "success":true,
+    "message":"Create a registered model tag instance",
+    "result":null,
+    "attributes":{}
+}
+```
+
+## Delete a registered model tag
+`DELETE /api/v1/registered-model/tag?name={name}&tag={tag}`
+
+**Example Request**
+```sh
+curl -X DELETE http://127.0.0.1:32080/api/v1/registered-model/tag?name=example_name&tag=789
+```
+
+**Example Response:**
+```json
+{
+   "attributes" : {},
+   "code" : 200,
+   "message" : "Delete a registered model tag instance",
+   "result" : null,
+   "status" : "OK",
+   "success" : true
+}
+```
\ No newline at end of file

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@submarine.apache.org
For additional commands, e-mail: dev-help@submarine.apache.org