Skip to content

Commit 66cd8ec

Browse files
zhoneyLinary
authored andcommitted
Improve backup/restore doc (#36)
Change-Id: Ia25a28e93fb1f9ac20dbba9f9370a5b7060ce579
1 parent d5648b3 commit 66cd8ec

File tree

3 files changed

+83
-35
lines changed

3 files changed

+83
-35
lines changed

clients/restful-api/graphs.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,6 @@ GET http://localhost:8080/graphs/hugegraph/mode
135135
136136
#### 5.3.2 设置某个图的模式. **该操作需要管理员权限**
137137

138-
##### Params
139-
140-
- token: 默认为`162f7848-0b6d-4faf-b557-3a0797869c55`
141-
142138
##### Method & Url
143139

144140
```

clients/restful-api/rebuild.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ PUT http://localhost:8080/graphs/hugegraph/jobs/rebuild/indexlabels/personByCity
2626

2727
> 可以通过`GET http://localhost:8080/graphs/hugegraph/tasks/1`(其中"1"是task_id)来查询异步任务的执行状态,更多[异步任务RESTful API](task.md)
2828
29-
#### 6.2.2 重建VertexLabel索引
29+
#### 6.2.2 VertexLabel对应的全部索引重建
3030

3131
##### Method & Url
3232

@@ -52,7 +52,7 @@ PUT http://localhost:8080/graphs/hugegraph/jobs/rebuild/vertexlabels/person
5252

5353
> 可以通过`GET http://localhost:8080/graphs/hugegraph/tasks/2`(其中"2"是task_id)来查询异步任务的执行状态,更多[异步任务RESTful API](task.md)
5454
55-
#### 6.2.3 重建EdgeLabel索引
55+
#### 6.2.3 EdgeLabel对应的全部索引重建
5656

5757
##### Method & Url
5858

guides/backup-restore.md

Lines changed: 81 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)