-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexamples.http
More file actions
90 lines (66 loc) · 1.9 KB
/
Copy pathexamples.http
File metadata and controls
90 lines (66 loc) · 1.9 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
### status (Canonical Envelope-First)
# 响应包含 code, message, data。data 中包含 status, ip, sets。
GET http://192.168.2.1:1444/api/status
### health (Canonical Health)
GET http://192.168.2.1:1444/api/health
### rules: list (Canonical Rules)
GET http://192.168.2.1:1444/api/rules
### rules: add (Canonical Rules)
POST http://192.168.2.1:1444/api/rules/add
Content-Type: application/json
{
"ip": "1.2.3.4",
"set": "proxy_src"
}
### rules: remove (Canonical Rules)
POST http://192.168.2.1:1444/api/rules/remove
Content-Type: application/json
{
"ip": "1.2.3.4/31",
"set": "direct_src"
}
### rules: sync (Canonical Rules)
POST http://192.168.2.1:1444/api/rules/sync
### Retained Compatibility Endpoints (保留兼容性端点)
### ip (Compatibility)
GET http://192.168.2.1:1444/api/ip
### refresh-route (Compatibility)
POST http://192.168.2.1:1444/api/refresh-route
### configs: list
GET http://192.168.2.1:1444/api/configs
### configs: get by name
GET http://192.168.2.1:1444/api/configs/main
### configs: update by name
PUT http://192.168.2.1:1444/api/configs/main
Content-Type: application/json
{
"format": "yaml",
"content": "checker: {}\nnft:\n sets:\n - proxy_src\n"
}
### configs: validate by name(无效请求返回 4xx envelope)
POST http://192.168.2.1:1444/api/configs/main/validate
Content-Type: application/json
{
"format": "yaml",
"content": "checker: {}\nnft:\n sets:\n - proxy_src\n"
}
### apply: preview
POST http://192.168.2.1:1444/api/apply/preview
Content-Type: application/json
{}
### apply: execute
POST http://192.168.2.1:1444/api/apply/execute
Content-Type: application/json
{}
### audit
GET http://192.168.2.1:1444/api/audit
### rollback
POST http://192.168.2.1:1444/api/rollback
Content-Type: application/json
{}
### 统一响应 envelope 示例
# {
# "code": "ok|invalid_request|internal_error|not_implemented",
# "message": "...",
# "data": { ... }
# }