You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by ji...@apache.org on 2022/05/27 03:25:15 UTC

[incubator-hugegraph-doc] branch website updated (d7c5fe5d -> 665739b7)

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

jin pushed a change to branch website
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-doc.git


    from d7c5fe5d add HBase pre-splite config options
     new 1ce3ae34 update:append new api for graphs & translate
     new f79a4b1d add graph-create api desc
     new 665739b7 divide create graph into clone and create

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 content/cn/docs/clients/restful-api/graphs.md | 240 ++++++++++++++++++++-
 content/en/docs/clients/restful-api/graphs.md | 293 +++++++++++++++++++++++---
 2 files changed, 507 insertions(+), 26 deletions(-)


[incubator-hugegraph-doc] 01/03: update:append new api for graphs & translate

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jin pushed a commit to branch website
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-doc.git

commit 1ce3ae3490e4df5724ee8eb91e7335e275b60d50
Author: wangyao <wa...@cmss.chinamobile.com>
AuthorDate: Fri May 13 15:33:47 2022 +0800

    update:append new api for graphs & translate
---
 content/cn/docs/clients/restful-api/graphs.md | 195 +++++++++++++++++++-
 content/en/docs/clients/restful-api/graphs.md | 246 +++++++++++++++++++++++---
 2 files changed, 415 insertions(+), 26 deletions(-)

diff --git a/content/cn/docs/clients/restful-api/graphs.md b/content/cn/docs/clients/restful-api/graphs.md
index 0708cda3..136c89fc 100644
--- a/content/cn/docs/clients/restful-api/graphs.md
+++ b/content/cn/docs/clients/restful-api/graphs.md
@@ -74,6 +74,53 @@ DELETE http://localhost:8080/graphs/hugegraph/clear?confirm_message=I%27m+sure+t
 204
 ```
 
+#### 6.1.4 创建一个图,**该操作需要管理员权限**
+
+##### Params
+
+- clone_graph_name: 已有的一个graph名称
+
+##### Method & Url
+
+```
+POST http://localhost:8080/graphs/hugegraph_clone?clone_graph_name=hugegraph
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "name": "hugegraph_clone",
+    "backend": "rocksdb"
+}
+```
+
+#### 6.1.5 删除某个图及其全部数据
+
+##### Params
+
+由于删除图是一个比较危险的操作,为避免用户误调用,我们给API添加了用于确认的参数:
+
+- confirm_message: 默认为`I'm sure to drop the graph`
+
+##### Method & Url
+
+```
+DELETE http://localhost:8080/graphs/hugegraph_clone?confirm_message=I%27m%20sure%20to%20drop%20the%20graph
+```
+
+##### Response Status
+
+```json
+204
+```
+
 ### 6.2 Conf
 
 #### 6.2.1 查看某个图的配置,**该操作需要管理员权限**
@@ -135,7 +182,7 @@ Restore 时存在两种不同的模式: Restoring 和 Merging
 正常情况下,图模式为 None,当需要 Restore 图时,需要根据需要临时修改图模式为 Restoring 模式或者 Merging 模式,并在完成 Restore 时,恢复图模式为 None。
 
 
-#### 6.3.1 查看某个图的模式. **该操作需要管理员权限**
+#### 6.3.1 查看某个图的模式.
 
 ##### Method & Url
 
@@ -188,3 +235,149 @@ PUT http://localhost:8080/graphs/hugegraph/mode
     "mode": "RESTORING"
 }
 ```
+
+#### 6.3.3 查看某个图的读模式.
+
+##### Params
+
+- name: 图的名称
+
+##### Method & Url
+
+```
+GET http://localhost:8080/graphs/hugegraph/graph_read_mode
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "graph_read_mode": "ALL"
+}
+```
+
+#### 6.3.4 设置某个图的读模式. **该操作需要管理员权限**
+
+##### Params
+
+- name: 图的名称
+
+##### Method & Url
+
+```
+PUT http://localhost:8080/graphs/hugegraph/graph_read_mode
+```
+
+##### Request Body
+
+```
+"OLTP_ONLY"
+```
+
+> 合法的图模式包括:ALL,OLTP_ONLY,OLAP_ONLY
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "graph_read_mode": "OLTP_ONLY"
+}
+```
+
+### 6.4 Snapshot
+
+#### 6.4.1 创建快照
+
+##### Params
+
+- name: 图的名称
+
+##### Method & Url
+
+```
+PUT http://localhost:8080/graphs/hugegraph/snapshot_create
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "hugegraph": "snapshot_created"
+}
+```
+
+#### 6.4.2 快照恢复
+
+##### Params
+
+- name: 图的名称
+
+##### Method & Url
+
+```
+PUT http://localhost:8080/graphs/hugegraph/snapshot_resume
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "hugegraph": "snapshot_resumed"
+}
+```
+
+### 6.5 Compact
+
+#### 6.5.1 手动紧致图,**该操作需要管理员权限**
+
+##### Params
+
+- name: 图的名称
+
+##### Method & Url
+
+```
+PUT http://localhost:8080/graphs/hugegraph/compact
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "nodes": 1,
+    "cluster_id": "local",
+    "servers": {
+        "local": "OK"
+    }
+}
+```
\ No newline at end of file
diff --git a/content/en/docs/clients/restful-api/graphs.md b/content/en/docs/clients/restful-api/graphs.md
index 0708cda3..7c77645e 100644
--- a/content/en/docs/clients/restful-api/graphs.md
+++ b/content/en/docs/clients/restful-api/graphs.md
@@ -6,7 +6,7 @@ weight: 12
 
 ### 6.1 Graphs
 
-#### 6.1.1 列出数据库中全部的图
+#### 6.1.1 List all graphs
 
 ##### Method & Url
 
@@ -31,7 +31,7 @@ GET http://localhost:8080/graphs
 }
 ```
 
-#### 6.1.2 查看某个图的信息
+#### 6.1.2 Get details of the graph
 
 ##### Method & Url
 
@@ -54,13 +54,14 @@ GET http://localhost:8080/graphs/hugegraph
 }
 ```
 
-#### 6.1.3 清空某个图的全部数据,包括schema、vertex、edge和index等,**该操作需要管理员权限**
+#### 6.1.3 Clear all data of a graph,include: schema、vertex、edge and index .etc,**This operation requires administrator privileges**
 
 ##### Params
 
-由于清空图是一个比较危险的操作,为避免用户误调用,我们给API添加了用于确认的参数:
+Since emptying the graph is a dangerous operation, we have added parameters for confirmation to the API to 
+avoid false calls by users:
 
-- confirm_message: 默认为`I'm sure to delete all data`
+- confirm_message: default by `I'm sure to delete all data`
 
 ##### Method & Url
 
@@ -74,9 +75,57 @@ DELETE http://localhost:8080/graphs/hugegraph/clear?confirm_message=I%27m+sure+t
 204
 ```
 
+#### 6.1.4 Create graph,**This operation requires administrator privileges**
+
+##### Params
+
+- clone_graph_name: name of an exist graph
+
+##### Method & Url
+
+```
+POST http://localhost:8080/graphs/hugegraph_clone?clone_graph_name=hugegraph
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "name": "hugegraph_clone",
+    "backend": "rocksdb"
+}
+```
+
+#### 6.1.5 Delete graph and it's data
+
+##### Params
+
+Since deleting a graph is a dangerous operation, we have added parameters for confirmation to the API to 
+avoid false calls by users:
+
+- confirm_message: default by `I'm sure to drop the graph`
+
+##### Method & Url
+
+```
+DELETE http://localhost:8080/graphs/hugegraph_clone?confirm_message=I%27m%20sure%20to%20drop%20the%20graph
+```
+
+##### Response Status
+
+```json
+204
+```
+
 ### 6.2 Conf
 
-#### 6.2.1 查看某个图的配置,**该操作需要管理员权限**
+#### 6.2.1 Get configuration for a graph,**This operation requires administrator privileges**
 
 ##### Method & Url
 
@@ -115,27 +164,28 @@ store=hugegraph
 
 ### 6.3 Mode
 
-合法的图模式包括:NONE,RESTORING,MERGING,LOADING
+Allowed graph mode values are:NONE,RESTORING,MERGING,LOADING
     
-- None 模式(默认),元数据和图数据的写入属于正常状态。特别的:
-    - 元数据(schema)创建时不允许指定 ID
-    - 图数据(vertex)在 id strategy 为 Automatic 时,不允许指定 ID
-- LOADING:批量导入数据时自动启用,特别的:
-    - 添加顶点/边时,不会检查必填属性是否传入
-
-Restore 时存在两种不同的模式: Restoring 和 Merging
+- None mode is regular mode
+    - Not allowed create schema with specified id
+    - Not support create vertex with id for AUTOMATIC id strategy
+- LOADING mode used to load data via hugegraph-loader.
+    - When adding vertices / edges, it is not checked whether the required attributes are passed in
 
-- Restoring 模式,恢复到一个新图中,特别的:
-    - 元数据(schema)创建时允许指定 ID
-    - 图数据(vertex)在 id strategy 为 Automatic 时,允许指定 ID
-- Merging 模式,合并到一个已存在元数据和图数据的图中,特别的:
-    - 元数据(schema)创建时不允许指定 ID
-    - 图数据(vertex)在 id strategy 为 Automatic 时,允许指定 ID
+Restore has two different modes: Restoring and Merging
 
-正常情况下,图模式为 None,当需要 Restore 图时,需要根据需要临时修改图模式为 Restoring 模式或者 Merging 模式,并在完成 Restore 时,恢复图模式为 None。
+- Restoring mode is used to restore schema and graph data to an new graph.
+    - Support create schema with specified id
+    - Support create vertex with id for AUTOMATIC id strategy
+- Merging mode is used to merge schema and graph data to an existing graph.
+    - Not allowed create schema with specified id
+    - Support create vertex with id for AUTOMATIC id strategy
 
+Under normal circumstances, the graph mode is None. When you need to restore the graph, 
+you need to temporarily modify the graph mode to Restoring or Merging as needed. 
+When you complete the restore, change the graph mode to None.
 
-#### 6.3.1 查看某个图的模式. **该操作需要管理员权限**
+#### 6.3.1 Get graph mode.
 
 ##### Method & Url
 
@@ -157,9 +207,9 @@ GET http://localhost:8080/graphs/hugegraph/mode
 }
 ```
 
-> 合法的图模式包括:NONE,RESTORING,MERGING
+> Allowed graph mode values are:NONE,RESTORING,MERGING
 
-#### 6.3.2 设置某个图的模式. **该操作需要管理员权限**
+#### 6.3.2 Modify graph mode. **This operation requires administrator privileges**
 
 ##### Method & Url
 
@@ -173,7 +223,7 @@ PUT http://localhost:8080/graphs/hugegraph/mode
 "RESTORING"
 ```
 
-> 合法的图模式包括:NONE,RESTORING,MERGING
+> Allowed graph mode values are:NONE,RESTORING,MERGING
 
 ##### Response Status
 
@@ -188,3 +238,149 @@ PUT http://localhost:8080/graphs/hugegraph/mode
     "mode": "RESTORING"
 }
 ```
+
+#### 6.3.3 Get graph's read mode.
+
+##### Params
+
+- name: name of a graph
+
+##### Method & Url
+
+```
+GET http://localhost:8080/graphs/hugegraph/graph_read_mode
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "graph_read_mode": "ALL"
+}
+```
+
+#### 6.3.4 Modify graph's read mode. **This operation requires administrator privileges**
+
+##### Params
+
+- name: name of a graph
+
+##### Method & Url
+
+```
+PUT http://localhost:8080/graphs/hugegraph/graph_read_mode
+```
+
+##### Request Body
+
+```
+"OLTP_ONLY"
+```
+
+> Allowed read mode values are:ALL,OLTP_ONLY,OLAP_ONLY
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "graph_read_mode": "OLTP_ONLY"
+}
+```
+
+### 6.4 Snapshot
+
+#### 6.4.1 Create a snapshot
+
+##### Params
+
+- name: name of a graph
+
+##### Method & Url
+
+```
+PUT http://localhost:8080/graphs/hugegraph/snapshot_create
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "hugegraph": "snapshot_created"
+}
+```
+
+#### 6.4.2 Resume a snapshot
+
+##### Params
+
+- name: name of a graph
+
+##### Method & Url
+
+```
+PUT http://localhost:8080/graphs/hugegraph/snapshot_resume
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "hugegraph": "snapshot_resumed"
+}
+```
+
+### 6.5 Compact
+
+#### 6.5.1 Manually compact graph,**This operation requires administrator privileges**
+
+##### Params
+
+- name: name of a graph
+
+##### Method & Url
+
+```
+PUT http://localhost:8080/graphs/hugegraph/compact
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "nodes": 1,
+    "cluster_id": "local",
+    "servers": {
+        "local": "OK"
+    }
+}
+```
\ No newline at end of file


[incubator-hugegraph-doc] 02/03: add graph-create api desc

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jin pushed a commit to branch website
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-doc.git

commit f79a4b1d1cb46887f9c9eb759e3cf4c4b3fc8af3
Author: wangyao <wa...@cmss.chinamobile.com>
AuthorDate: Thu May 26 16:52:28 2022 +0800

    add graph-create api desc
---
 content/cn/docs/clients/restful-api/graphs.md | 15 +++++++++++++--
 content/en/docs/clients/restful-api/graphs.md | 13 ++++++++++++-
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/content/cn/docs/clients/restful-api/graphs.md b/content/cn/docs/clients/restful-api/graphs.md
index 136c89fc..2adb8012 100644
--- a/content/cn/docs/clients/restful-api/graphs.md
+++ b/content/cn/docs/clients/restful-api/graphs.md
@@ -83,7 +83,18 @@ DELETE http://localhost:8080/graphs/hugegraph/clear?confirm_message=I%27m+sure+t
 ##### Method & Url
 
 ```
-POST http://localhost:8080/graphs/hugegraph_clone?clone_graph_name=hugegraph
+POST http://localhost:8080/graphs/hugegraph2?clone_graph_name=hugegraph
+```
+
+##### Request Body
+
+```
+gremlin.graph=com.baidu.hugegraph.auth.HugeFactoryAuthProxy
+backend=rocksdb
+serializer=binary
+store=hugegraph2
+rocksdb.data_path=./hg2
+rocksdb.wal_path=./hg2
 ```
 
 ##### Response Status
@@ -352,7 +363,7 @@ PUT http://localhost:8080/graphs/hugegraph/snapshot_resume
 
 ### 6.5 Compact
 
-#### 6.5.1 手动紧致图,**该操作需要管理员权限**
+#### 6.5.1 手动压缩图,**该操作需要管理员权限**
 
 ##### Params
 
diff --git a/content/en/docs/clients/restful-api/graphs.md b/content/en/docs/clients/restful-api/graphs.md
index 7c77645e..aae24104 100644
--- a/content/en/docs/clients/restful-api/graphs.md
+++ b/content/en/docs/clients/restful-api/graphs.md
@@ -84,7 +84,18 @@ DELETE http://localhost:8080/graphs/hugegraph/clear?confirm_message=I%27m+sure+t
 ##### Method & Url
 
 ```
-POST http://localhost:8080/graphs/hugegraph_clone?clone_graph_name=hugegraph
+POST http://localhost:8080/graphs/hugegraph2?clone_graph_name=hugegraph
+```
+
+##### Request Body
+
+```
+gremlin.graph=com.baidu.hugegraph.auth.HugeFactoryAuthProxy
+backend=rocksdb
+serializer=binary
+store=hugegraph2
+rocksdb.data_path=./hg2
+rocksdb.wal_path=./hg2
 ```
 
 ##### Response Status


[incubator-hugegraph-doc] 03/03: divide create graph into clone and create

Posted by ji...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jin pushed a commit to branch website
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph-doc.git

commit 665739b7bf28c94423cbd8dd9f540fc5c80d77fb
Author: wangyao <wa...@cmss.chinamobile.com>
AuthorDate: Fri May 27 09:27:37 2022 +0800

    divide create graph into clone and create
---
 content/cn/docs/clients/restful-api/graphs.md | 44 ++++++++++++++++++++++---
 content/en/docs/clients/restful-api/graphs.md | 46 ++++++++++++++++++++++++---
 2 files changed, 80 insertions(+), 10 deletions(-)

diff --git a/content/cn/docs/clients/restful-api/graphs.md b/content/cn/docs/clients/restful-api/graphs.md
index 2adb8012..e1d5a0ff 100644
--- a/content/cn/docs/clients/restful-api/graphs.md
+++ b/content/cn/docs/clients/restful-api/graphs.md
@@ -74,16 +74,50 @@ DELETE http://localhost:8080/graphs/hugegraph/clear?confirm_message=I%27m+sure+t
 204
 ```
 
-#### 6.1.4 创建一个图,**该操作需要管理员权限**
+#### 6.1.4 克隆一个图,**该操作需要管理员权限**
 
 ##### Params
 
-- clone_graph_name: 已有的一个graph名称
+- clone_graph_name: 已有图的名称;从已有的图来克隆,用户可选择传递配置文件,传递时将替换已有图中的配置;
 
 ##### Method & Url
 
 ```
-POST http://localhost:8080/graphs/hugegraph2?clone_graph_name=hugegraph
+POST http://localhost:8080/graphs/hugegraph_clone?clone_graph_name=hugegraph
+```
+
+##### Request Body 【可选】
+
+```
+gremlin.graph=com.baidu.hugegraph.auth.HugeFactoryAuthProxy
+backend=rocksdb
+serializer=binary
+store=hugegraph_clone
+rocksdb.data_path=./hg2
+rocksdb.wal_path=./hg2
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "name": "hugegraph_clone",
+    "backend": "rocksdb"
+}
+```
+
+#### 6.1.5 创建一个图,**该操作需要管理员权限**
+
+##### Method & Url
+
+```
+POST http://localhost:8080/graphs/hugegraph2
 ```
 
 ##### Request Body
@@ -107,12 +141,12 @@ rocksdb.wal_path=./hg2
 
 ```json
 {
-    "name": "hugegraph_clone",
+    "name": "hugegraph2",
     "backend": "rocksdb"
 }
 ```
 
-#### 6.1.5 删除某个图及其全部数据
+#### 6.1.6 删除某个图及其全部数据
 
 ##### Params
 
diff --git a/content/en/docs/clients/restful-api/graphs.md b/content/en/docs/clients/restful-api/graphs.md
index aae24104..82ca91d8 100644
--- a/content/en/docs/clients/restful-api/graphs.md
+++ b/content/en/docs/clients/restful-api/graphs.md
@@ -75,16 +75,52 @@ DELETE http://localhost:8080/graphs/hugegraph/clear?confirm_message=I%27m+sure+t
 204
 ```
 
-#### 6.1.4 Create graph,**This operation requires administrator privileges**
+#### 6.1.4 Clone graph,**This operation requires administrator privileges**
 
 ##### Params
 
-- clone_graph_name: name of an exist graph
+- clone_graph_name: name of an exist graph.
+                    To clone from an existing graph, the user can choose to transfer the configuration file, 
+                    which will replace the configuration in the existing graph
 
 ##### Method & Url
 
 ```
-POST http://localhost:8080/graphs/hugegraph2?clone_graph_name=hugegraph
+POST http://localhost:8080/graphs/hugegraph_clone?clone_graph_name=hugegraph
+```
+
+##### Request Body [Optional]
+
+```
+gremlin.graph=com.baidu.hugegraph.auth.HugeFactoryAuthProxy
+backend=rocksdb
+serializer=binary
+store=hugegraph_clone
+rocksdb.data_path=./hg2
+rocksdb.wal_path=./hg2
+```
+
+##### Response Status
+
+```json
+200
+```
+
+##### Response Body
+
+```json
+{
+    "name": "hugegraph_clone",
+    "backend": "rocksdb"
+}
+```
+
+#### 6.1.5 Create graph,**This operation requires administrator privileges**
+
+##### Method & Url
+
+```
+POST http://localhost:8080/graphs/hugegraph2
 ```
 
 ##### Request Body
@@ -108,12 +144,12 @@ rocksdb.wal_path=./hg2
 
 ```json
 {
-    "name": "hugegraph_clone",
+    "name": "hugegraph2",
     "backend": "rocksdb"
 }
 ```
 
-#### 6.1.5 Delete graph and it's data
+#### 6.1.6 Delete graph and it's data
 
 ##### Params