Skip to content

Commit e6ce0e1

Browse files
committed
doc: 优化了使用示例
使用示例增加了注释
1 parent a27ab3d commit e6ce0e1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,24 @@ docker run -d --name config-api -p 5000:5000 ztj1993/config-api
2727

2828
## 使用示例
2929
```
30+
$ #获取配置原始数据
3031
$ data=$(cat /etc/docker/daemon.json) && echo ${data}
3132
3233
{
3334
"registry-mirrors": ["http://ef017c13.m.daocloud.io"]
3435
}
3536
37+
$ #初始化配置游标
3638
$ cursor_id=$(curl -sf http://127.0.0.1:5000/init) && echo ${cursor_id}
3739
3840
158853936809905161020585456234816085535
3941
42+
$ #将配置上传到游标
4043
$ curl http://127.0.0.1:5000/${cursor_id}/load/json -d "${data}"
4144
4245
ok
4346
47+
$ #操作配置
4448
$ curl http://127.0.0.1:5000/${cursor_id}/set/bool?key=tlsverify -d "true"
4549
$ curl http://127.0.0.1:5000/${cursor_id}/set/str?key=tlscacert -d "/etc/certs/ca.pem"
4650
$ curl http://127.0.0.1:5000/${cursor_id}/set/str?key=tlscert -d "/etc/certs/server-cert.pem"
@@ -50,6 +54,7 @@ $ curl http://127.0.0.1:5000/${cursor_id}/append/str?key=hosts -d "unix:///var/r
5054
5155
ok
5256
57+
$ #输出配置
5358
$ curl http://127.0.0.1:5000/${cursor_id}/output/json
5459
5560
{

0 commit comments

Comments
 (0)