@@ -18,37 +18,9 @@ Restore 有两种模式:
1818- Merging 模式,将 Backup 导出的元数据和图数据导入到另一个已经存在元数据或者图数据的图中,过程中元数据的 ID 可能发生改变,顶点和边的 ID 也会发生相应变化。
1919 - 可用于合并图
2020
21- ## API
22-
23- #### Backup
24-
25- Backup 使用元数据和图数据的相应的Get RESTful API 导出,并未增加新的 API。
26-
27- #### Restore
28-
29- Restore 存在两种不同的模式: Restoring 和 Merging。另外,还有非 Restore 模式,区别如下:
30-
31- - None 模式,元数据和图数据的写入属于正常状态,可参见功能说明。特别的:
32- - 元数据(schema)创建时不允许指定 ID
33- - 图数据(vertex)在 id strategy 为 Automatic 时,不允许指定 ID
34- - Restoring 模式,恢复到一个新图中,特别的:
35- - 元数据(schema)创建时允许指定 ID
36- - 图数据(vertex)在 id strategy 为 Automatic 时,允许指定 ID
37- - Merging 模式,合并到一个已存在元数据和图数据的图中,特别的:
38- - 元数据(schema)创建时不允许指定 ID
39- - 图数据(vertex)在 id strategy 为 Automatic 时,允许指定 ID
40-
41- 正常情况下,图模式为 None,当需要 Restore 图时,需要根据需要临时修改图模式为 Restoring 模式或者 Merging 模式,并在完成 Restore 时,恢复图模式为 None。
42-
43- 设置图模式的 RESTful API 如下:
44-
45- ```
46- http://localhost:8080/graphs/hugegraph/mode
47- ```
48-
4921## 使用方法
5022
51- 可以使用hugegraph-tools进行图的备份和恢复 。
23+ 可以使用 [ hugegraph-tools ] ( /quickstart/hugegraph-tools.md ) 进行图的备份和恢复 。
5224
5325#### Backup
5426
@@ -95,3 +67,83 @@ bin/hugegraph graph-mode-set -m NONE
9567#### 帮助
9668
9769备份和恢复命令的详细使用方式可以参考[ hugegraph-tools文档] ( /quickstart/hugegraph-tools.md ) 。
70+
71+ ## Backup/Restore使用和实现的API说明
72+
73+ #### Backup
74+
75+ Backup 使用` 元数据 ` 和` 图数据 ` 的相应的 list(GET) API 导出,并未增加新的 API。
76+
77+ #### Restore
78+
79+ Restore 使用` 元数据 ` 和` 图数据 ` 的相应的 create(POST) API 导入,并未增加新的 API。
80+
81+ Restore 时存在两种不同的模式: Restoring 和 Merging,另外,还有常规模式 NONE(默认),区别如下:
82+
83+ - None 模式,元数据和图数据的写入属于正常状态,可参见功能说明。特别的:
84+ - 元数据(schema)创建时不允许指定 ID
85+ - 图数据(vertex)在 id strategy 为 Automatic 时,不允许指定 ID
86+ - Restoring 模式,恢复到一个新图中,特别的:
87+ - 元数据(schema)创建时允许指定 ID
88+ - 图数据(vertex)在 id strategy 为 Automatic 时,允许指定 ID
89+ - Merging 模式,合并到一个已存在元数据和图数据的图中,特别的:
90+ - 元数据(schema)创建时不允许指定 ID
91+ - 图数据(vertex)在 id strategy 为 Automatic 时,允许指定 ID
92+
93+ 正常情况下,图模式为 None,当需要 Restore 图时,需要根据需要临时修改图模式为 Restoring 模式或者 Merging 模式,并在完成 Restore 时,恢复图模式为 None。
94+
95+ 实现的设置图模式的 RESTful API 如下:
96+
97+ ##### 查看某个图的模式. ** 该操作需要管理员权限**
98+
99+ ###### Method & Url
100+
101+ ```
102+ GET http://localhost:8080/graphs/{graph}/mode
103+ ```
104+
105+ ###### Response Status
106+
107+ ``` json
108+ 200
109+ ```
110+
111+ ###### Response Body
112+
113+ ``` json
114+ {
115+ "mode" : " NONE"
116+ }
117+ ```
118+
119+ > 合法的图模式包括:NONE,RESTORING,MERGING
120+
121+ ##### 设置某个图的模式. ** 该操作需要管理员权限**
122+
123+ ###### Method & Url
124+
125+ ```
126+ PUT http://localhost:8080/graphs/{graph}/mode
127+ ```
128+
129+ ###### Request Body
130+
131+ ```
132+ "RESTORING"
133+ ```
134+
135+ > 合法的图模式包括:NONE,RESTORING,MERGING
136+
137+ ###### Response Status
138+
139+ ``` json
140+ 200
141+ ```
142+
143+ ###### Response Body
144+
145+ ``` json
146+ {
147+ "mode" : " RESTORING"
148+ }
149+ ```
0 commit comments