-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample.http
67 lines (50 loc) · 1.57 KB
/
example.http
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
### 获取客户端IP
GET http://localhost:20080/ip
SECRET: 123456
### 获得所有数据
GET http://localhost:20080/data/
SECRET: 123456
### 将所有数据写入到存储器
PUT http://localhost:20080/data/
SECRET: 123456
### 从存储器中加载所有数据
POST http://localhost:20080/data/
SECRET: 123456
### 添加服务
POST http://localhost:20080/services/
Content-Type: application/x-www-form-urlencoded
SECRET: 123456
id=demo&load_balance=SWRR&meta={"secret":"123456"}
### 重写或创建服务
PUT http://localhost:20080/services/ZGVtbw
Content-Type: application/x-www-form-urlencoded
SECRET: 123456
load_balance=SWRR&meta={"secret":"abcdef"}
### 删除服务
DELETE http://localhost:20080/services/ZGVtbw
SECRET: 123456
### 从服务中获取节点
GET http://127.0.0.1:20080/services/ZGVtbw/select
SECRET: 123456
### 添加节点
POST http://localhost:20080/nodes/
Content-Type: application/x-www-form-urlencoded
SECRET: 123456
service_id=demo&ip=127.0.0.1&port=80&weight=1
### 重写或创建节点
PUT http://localhost:20080/nodes/ZGVtbw/MTI3LjAuMC4xOjIwMTgw
Content-Type: application/x-www-form-urlencoded
SECRET: 123456
weight=1&ttl=0&meta={"os": "linux"}
### 更新节点的属性
PATCH http://localhost:20080/nodes/ZGVtbw/MTI3LjAuMC4xOjIwMTgw/weight,ttl
Content-Type: application/x-www-form-urlencoded
SECRET: 123456
weight=1&ttl=0
### 节点触活
POST http://localhost:20080/nodes/ZGVtbw/MTI3LjAuMC4xOjIwMTgw
Content-Type: application/x-www-form-urlencoded
SECRET: 123456
### 删除节点
DELETE http://localhost:20080/nodes/ZGVtbw/MTI3LjAuMC4xOjIwMTgw
SECRET: 123456