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

jiwq 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 a4b8b94  SUBMARINE-601. Notebook API docs
a4b8b94 is described below

commit a4b8b94112ca756038f914fcabe18500d66619a0
Author: Ryan Lo <[email protected]>
AuthorDate: Sat Aug 22 14:50:50 2020 +0800

    SUBMARINE-601. Notebook API docs
    
    ### What is this PR for?
    Write a Notebook API docs into docs/userdocs/k8s/api
    
    ### What type of PR is it?
    [Documentation]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    
[SUBMARINE-601](https://issues.apache.org/jira/projects/SUBMARINE/issues/SUBMARINE-601?)
    
    ### How should this be tested?
    [travis 
CI](https://travis-ci.org/github/lowc1012/submarine/builds/719616898)
    
    ### Screenshots (if appropriate)
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No
    
    Author: Ryan Lo <[email protected]>
    
    Closes #385 from lowc1012/SUBMARINE-601 and squashes the following commits:
    
    536d99a [Ryan Lo] SUBMARINE-601. update notebook api docs
    d0225de [Ryan Lo] SUBMARINE-601. Write a Notebook API docs into 
docs/userdocs/k8s/api
---
 docs/userdocs/k8s/api/notebook.md      | 260 +++++++++++++++++++++++++++++++++
 docs/userdocs/k8s/jupyter-example.yaml |   2 +-
 2 files changed, 261 insertions(+), 1 deletion(-)

diff --git a/docs/userdocs/k8s/api/notebook.md 
b/docs/userdocs/k8s/api/notebook.md
new file mode 100644
index 0000000..02fc131
--- /dev/null
+++ b/docs/userdocs/k8s/api/notebook.md
@@ -0,0 +1,260 @@
+<!--
+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.
+-->
+
+# Notebook API Reference
+
+> Note: The Notebook API is in the alpha stage which is subjected to 
incompatible changes in future releases.
+
+## Create a notebook instance
+`POST /api/v1/notebook`
+
+**Example Request**
+```sh
+curl -X POST -H "Content-Type: application/json" -d '
+{
+  "meta": {
+    "name": "test-nb",
+    "namespace": "default"
+  },
+  "environment": {
+    "name": "my-submarine-env"
+  },
+  "spec": {
+    "envVars": {
+      "TEST_ENV": "test"
+    },
+    "resources": "cpu=1,memory=1.0Gi"
+  }
+}
+' http://127.0.0.1:8080/api/v1/notebook
+```
+
+**Example Response:**
+```json
+{
+  "status":"OK",
+  "code":200,
+  "success":true,
+  "message":"Create a notebook instance",
+  "result":{
+    "notebookId":"notebook_1597931805405_0001",
+    "name":"test-nb",
+    "uid":"5a94c01d-6a92-4222-bc66-c610c277546d",
+    "url":"/notebook/default/test-nb",
+    "status":"Created",
+    "createdTime":"2020-08-20T21:58:27.000+08:00",
+    "deletedTime":null,
+    "spec":{
+      "meta":{
+        "name":"test-nb",
+        "namespace":"default"
+      },
+      "environment":{
+        "name":"my-submarine-env",
+        "dockerImage":"apache/submarine:jupyter-notebook-0.5.0-SNAPSHOT",
+        "kernelSpec":{
+          "name": "team_default_python_3.7",
+          "channels": [
+            "defaults"
+          ],
+          "dependencies": [
+            ""
+          ]
+        },
+        "description":null,
+        "image":null
+      },
+      "spec":{
+        "envVars":{
+          "TEST_ENV":"test"
+        },
+        "resources":"cpu=1,memory=1.0Gi"
+      }
+    }
+  },
+  "attributes":{}
+}
+```
+
+## List notebook instances
+`GET /api/v1/notebook`
+
+**Example Request:**
+```sh
+curl -X GET http://127.0.0.1:8080/api/v1/notebook
+```
+
+**Example Response:**
+```json
+{
+  "status":"OK",
+  "code":200,
+  "success":true,
+  "message":"List all notebook instances",
+  "result":[
+    {
+      "notebookId":"notebook_1597931805405_0001",
+      "name":"test-nb",
+      "uid":"5a94c01d-6a92-4222-bc66-c610c277546d",
+      "url":"/notebook/default/test-nb",
+      "status":"Created",
+      "createdTime":"2020-08-20T21:58:27.000+08:00",
+      "deletedTime":null,
+      "spec":{
+        "meta":{
+          "name":"test-nb",
+          "namespace":"default"
+        },
+        "environment":{
+          "name":"my-submarine-env",
+          "dockerImage":"apache/submarine:jupyter-notebook-0.5.0-SNAPSHOT",
+          "kernelSpec":{
+            "name": "team_default_python_3.7",
+            "channels": [
+              "defaults"
+            ],
+            "dependencies": [
+              ""
+            ]
+          },
+          "description":null,
+          "image":null
+        },
+        "spec":{
+          "envVars":{
+            "TEST_ENV":"test"
+          },
+          "resources":"cpu=1,memory=1.0Gi"
+        }
+      }
+    }
+  ],
+  "attributes":{}
+}
+```
+
+## Get the notebook instance
+`GET /api/v1/notebook/{id}`
+
+**Example Request:**
+```sh
+curl -X GET http://127.0.0.1:8080/api/v1/notebook/{id}
+```
+
+**Example Response:**
+```json
+{
+  "status":"OK",
+  "code":200,
+  "success":true,
+  "message":"Get the notebook instance",
+  "result":{
+    "notebookId":"notebook_1597931805405_0001",
+    "name":"test-nb",
+    "uid":"5a94c01d-6a92-4222-bc66-c610c277546d",
+    "url":"/notebook/default/test-nb",
+    "status":"Created",
+    "createdTime":"2020-08-20T21:58:27.000+08:00",
+    "deletedTime":null,
+    "spec":{
+      "meta":{
+        "name":"test-nb",
+        "namespace":"default"
+      },
+      "environment":{
+        "name":"my-submarine-env",
+        "dockerImage":"apache/submarine:jupyter-notebook-0.5.0-SNAPSHOT",
+        "kernelSpec":{
+          "name": "team_default_python_3.7",
+          "channels": [
+            "defaults"
+          ],
+          "dependencies": [
+            ""
+          ]
+        },
+        "description":null,
+        "image":null
+      },
+      "spec":{
+        "envVars":{
+          "TEST_ENV":"test"
+        },
+        "resources":"cpu=1,memory=1.0Gi"
+      }
+    }
+  },
+  "attributes":{}
+}
+```
+
+## Delete the notebook instance
+`DELETE /api/v1/notebook/{id}`
+
+**Example Request:**
+```sh
+curl -X DELETE http://127.0.0.1:8080/api/v1/notebook/{id}
+```
+
+**Example Response:**
+```json
+{
+  "status": "OK",
+  "code": 200,
+  "success": true,
+  "message": "Delete the notebook instance",
+  "result": {
+    "notebookId": "notebook_1597931805405_0001",
+    "name": "test-nb",
+    "uid": "5a94c01d-6a92-4222-bc66-c610c277546d",
+    "url": "/notebook/null/null",
+    "status": "Deleted",
+    "createdTime": "2020-08-22T14:03:19.000+08:00",
+    "deletedTime": "2020-08-22T14:46:28+0800",
+    "spec": {
+      "meta": {
+        "name": "test-nb",
+        "namespace": "default"
+      },
+      "environment": {
+        "name": "my-submarine-env",
+        "dockerImage": "apache/submarine:jupyter-notebook-0.5.0-SNAPSHOT",
+        "kernelSpec": {
+          "name": "team_default_python_3.7",
+          "channels": [
+            "defaults"
+          ],
+          "dependencies": [
+            ""
+          ]
+        },
+        "description": null,
+        "image": null
+      },
+      "spec": {
+        "envVars": {
+          "TEST_ENV": "test"
+        },
+        "resources": "cpu=1,memory=1.0Gi"
+      }
+    }
+  },
+  "attributes": {}
+}
+```
diff --git a/docs/userdocs/k8s/jupyter-example.yaml 
b/docs/userdocs/k8s/jupyter-example.yaml
index 35c5fac..d5dfcc8 100644
--- a/docs/userdocs/k8s/jupyter-example.yaml
+++ b/docs/userdocs/k8s/jupyter-example.yaml
@@ -27,7 +27,7 @@ spec:
     spec:
       containers:
       - env: []
-        image: apache/submarine:tf2.1.0-jupyter
+        image: apache/submarine:jupyter-notebook-0.5.0-SNAPSHOT
         name: my-nb
         resources:
           limits: {}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to