Skip to content

Commit

Permalink
doc: update gremlin config in graphs.md (apache#282)
Browse files Browse the repository at this point in the history
line126:
gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy

* enhance a string of style problem & fix package name

---------

Co-authored-by: imbajin <[email protected]>
  • Loading branch information
badagou333 and imbajin authored Sep 18, 2023
1 parent 66cf8ef commit 3baae60
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 118 deletions.
85 changes: 42 additions & 43 deletions content/cn/docs/clients/restful-api/graphs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ GET http://localhost:8080/graphs

##### Response Status

```json
```javascript
200
```

##### Response Body

```json
```javascript
{
"graphs": [
"hugegraph",
Expand All @@ -41,24 +41,24 @@ GET http://localhost:8080/graphs/hugegraph

##### Response Status

```json
```javascript
200
```

##### Response Body

```json
```javascript
{
"name": "hugegraph",
"backend": "cassandra"
}
```

#### 6.1.3 清空某个图的全部数据,包括schema、vertex、edge和index等**该操作需要管理员权限**
#### 6.1.3 清空某个图的全部数据,包括 schema、vertex、edge 和 index 等**该操作需要管理员权限**

##### Params

由于清空图是一个比较危险的操作,为避免用户误调用,我们给API添加了用于确认的参数
由于清空图是一个比较危险的操作,为避免用户误调用,我们给 API 添加了用于确认的参数

- confirm_message: 默认为`I'm sure to delete all data`

Expand All @@ -70,7 +70,7 @@ DELETE http://localhost:8080/graphs/hugegraph/clear?confirm_message=I%27m+sure+t

##### Response Status

```json
```javascript
204
```

Expand All @@ -86,10 +86,10 @@ DELETE http://localhost:8080/graphs/hugegraph/clear?confirm_message=I%27m+sure+t
POST http://localhost:8080/graphs/hugegraph_clone?clone_graph_name=hugegraph
```

##### Request Body 【可选】
##### Request Body【可选】

```
gremlin.graph=com.baidu.hugegraph.auth.HugeFactoryAuthProxy
gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy
backend=rocksdb
serializer=binary
store=hugegraph_clone
Expand All @@ -99,13 +99,13 @@ rocksdb.wal_path=./hg2

##### Response Status

```json
```javascript
200
```

##### Response Body

```json
```javascript
{
"name": "hugegraph_clone",
"backend": "rocksdb"
Expand All @@ -123,7 +123,7 @@ POST http://localhost:8080/graphs/hugegraph2
##### Request Body

```
gremlin.graph=com.baidu.hugegraph.auth.HugeFactoryAuthProxy
gremlin.graph=org.apache.hugegraph.auth.HugeFactoryAuthProxy
backend=rocksdb
serializer=binary
store=hugegraph2
Expand All @@ -133,13 +133,13 @@ rocksdb.wal_path=./hg2

##### Response Status

```json
```javascript
200
```

##### Response Body

```json
```javascript
{
"name": "hugegraph2",
"backend": "rocksdb"
Expand All @@ -150,7 +150,7 @@ rocksdb.wal_path=./hg2

##### Params

由于删除图是一个比较危险的操作,为避免用户误调用,我们给API添加了用于确认的参数
由于删除图是一个比较危险的操作,为避免用户误调用,我们给 API 添加了用于确认的参数

- confirm_message: 默认为`I'm sure to drop the graph`

Expand All @@ -162,7 +162,7 @@ DELETE http://localhost:8080/graphs/hugegraph_clone?confirm_message=I%27m%20sure

##### Response Status

```json
```javascript
204
```

Expand All @@ -178,16 +178,15 @@ GET http://localhost:8080/graphs/hugegraph/conf

##### Response Status

```json
```javascript
200
```

##### Response Body

```properties
# gremlin entrence to create graph
gremlin.graph=com.baidu.hugegraph.HugeFactory

gremlin.graph=org.apache.hugegraph.HugeFactory
# cache config
#schema.cache_capacity=1048576
#graph.cache_capacity=10485760
Expand All @@ -202,20 +201,20 @@ backend=cassandra
serializer=cassandra

store=hugegraph
...
...=
```

### 6.3 Mode

合法的图模式包括:NONE,RESTORING,MERGING,LOADING

- None 模式(默认),元数据和图数据的写入属于正常状态。特别的:
- 元数据(schema)创建时不允许指定 ID
- 图数据(vertex)在 id strategy 为 Automatic 时,不允许指定 ID
- LOADING:批量导入数据时自动启用,特别的:
- 添加顶点/边时,不会检查必填属性是否传入

Restore 时存在两种不同的模式: Restoring 和 Merging
Restore 时存在两种不同的模式:Restoring 和 Merging

- Restoring 模式,恢复到一个新图中,特别的:
- 元数据(schema)创建时允许指定 ID
Expand All @@ -224,10 +223,10 @@ Restore 时存在两种不同的模式: Restoring 和 Merging
- 元数据(schema)创建时不允许指定 ID
- 图数据(vertex)在 id strategy 为 Automatic 时,允许指定 ID

正常情况下,图模式为 None,当需要 Restore 图时,需要根据需要临时修改图模式为 Restoring 模式或者 Merging 模式,并在完成 Restore 时,恢复图模式为 None。
正常情况下,图模式为 None,当需要 Restore 图时,需要根据需要临时修改图模式为 Restoring 模式或者 Merging
模式,并在完成 Restore 时,恢复图模式为 None。


#### 6.3.1 查看某个图的模式.
#### 6.3.1 查看某个图的模式。

##### Method & Url

Expand All @@ -237,21 +236,21 @@ GET http://localhost:8080/graphs/hugegraph/mode

##### Response Status

```json
```javascript
200
```

##### Response Body

```json
```javascript
{
"mode": "NONE"
}
```

> 合法的图模式包括:NONE,RESTORING,MERGING
#### 6.3.2 设置某个图的模式. **该操作需要管理员权限**
#### 6.3.2 设置某个图的模式**该操作需要管理员权限**

##### Method & Url

Expand All @@ -269,19 +268,19 @@ PUT http://localhost:8080/graphs/hugegraph/mode
##### Response Status

```json
```javascript
200
```

##### Response Body

```json
```javascript
{
"mode": "RESTORING"
}
```

#### 6.3.3 查看某个图的读模式.
#### 6.3.3 查看某个图的读模式

##### Params

Expand All @@ -295,19 +294,19 @@ GET http://localhost:8080/graphs/hugegraph/graph_read_mode

##### Response Status

```json
```javascript
200
```

##### Response Body

```json
```javascript
{
"graph_read_mode": "ALL"
}
```

#### 6.3.4 设置某个图的读模式. **该操作需要管理员权限**
#### 6.3.4 设置某个图的读模式**该操作需要管理员权限**

##### Params

Expand All @@ -329,13 +328,13 @@ PUT http://localhost:8080/graphs/hugegraph/graph_read_mode
##### Response Status

```json
```javascript
200
```

##### Response Body

```json
```javascript
{
"graph_read_mode": "OLTP_ONLY"
}
Expand All @@ -357,13 +356,13 @@ PUT http://localhost:8080/graphs/hugegraph/snapshot_create

##### Response Status

```json
```javascript
200
```

##### Response Body

```json
```javascript
{
"hugegraph": "snapshot_created"
}
Expand All @@ -383,13 +382,13 @@ PUT http://localhost:8080/graphs/hugegraph/snapshot_resume

##### Response Status

```json
```javascript
200
```

##### Response Body

```json
```javascript
{
"hugegraph": "snapshot_resumed"
}
Expand All @@ -411,18 +410,18 @@ PUT http://localhost:8080/graphs/hugegraph/compact

##### Response Status

```json
```javascript
200
```

##### Response Body

```json
```javascript
{
"nodes": 1,
"cluster_id": "local",
"servers": {
"local": "OK"
}
}
```
```
Loading

0 comments on commit 3baae60

Please sign in to comment.