Skip to content

Commit 8593cbc

Browse files
fix(ns-api): add missing --data option
1 parent 4f49719 commit 8593cbc

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/ns-api/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ Response:
488488

489489
Add a rule:
490490
```
491-
api-cli ns.firewall add-rule '{"name": "r1", "src": "lan", "src_ip": [], "dest": "wan", "dest_ip": ["1.2.3.4"], "proto": [], "dest_port": ", "target": "ACCEPT", "ns_service": "ssh", "enabled": true, "log": false, "ns_tag": [], "add_to_top": false}'
491+
api-cli ns.firewall add-rule --data '{"name": "r1", "src": "lan", "src_ip": [], "dest": "wan", "dest_ip": ["1.2.3.4"], "proto": [], "dest_port": ", "target": "ACCEPT", "ns_service": "ssh", "enabled": true, "log": false, "ns_tag": [], "add_to_top": false}'
492492
```
493493

494494
Response example:
@@ -508,7 +508,7 @@ Possible validation errors:
508508

509509
Edit an existing rule:
510510
```
511-
api-cli ns.firewall edit-rule '{"id": "ns_206325d3", "name": "r1", "src": "lan", "src_ip": [], "dest": "wan", "dest_ip": ["1.2.3.4"], "proto": ["tcp"], "dest_port": "22", "target": "ACCEPT", "ns_service": "ssh", "enabled": true, "log": false, "ns_tag": []}'
511+
api-cli ns.firewall edit-rule --data '{"id": "ns_206325d3", "name": "r1", "src": "lan", "src_ip": [], "dest": "wan", "dest_ip": ["1.2.3.4"], "proto": ["tcp"], "dest_port": "22", "target": "ACCEPT", "ns_service": "ssh", "enabled": true, "log": false, "ns_tag": []}'
512512
```
513513

514514
Response example:
@@ -524,7 +524,7 @@ Possible validation errors:
524524

525525
Order a group of rules:
526526
```
527-
api-cli ns.firewall order-rule '{"type": "forward", "order": ["ns_e6f258a3", "ns_2be3a634", "cfg0f92bd"]}'
527+
api-cli ns.firewall order-rule --data '{"type": "forward", "order": ["ns_e6f258a3", "ns_2be3a634", "cfg0f92bd"]}'
528528
```
529529

530530
This API assumes that the /etc/config/firewall file is ordered using this schema:
@@ -555,7 +555,7 @@ It may rise the following validation errors:
555555

556556
Delete an existing rule:
557557
```
558-
api-cli ns.firewall delete-rule '{"id": "ns_206325d3"}'
558+
api-cli ns.firewall delete-rule --data '{"id": "ns_206325d3"}'
559559
```
560560

561561
Reponse example:
@@ -569,7 +569,7 @@ It may raise `rule_not_found` if the `id` is not found inside the `firewall` con
569569

570570
Enable an existing rule:
571571
```
572-
api-cli ns.firewall enable-rule '{"id": "ns_206325d3"}'
572+
api-cli ns.firewall enable-rule --data '{"id": "ns_206325d3"}'
573573
```
574574

575575
Reponse example:
@@ -583,7 +583,7 @@ It may raise `rule_not_found` if the `id` is not found inside the `firewall` con
583583

584584
Disable an existing rule:
585585
```
586-
api-cli ns.firewall disable-rule '{"id": "ns_206325d3"}'
586+
api-cli ns.firewall disable-rule --data '{"id": "ns_206325d3"}'
587587
```
588588

589589
Reponse example:
@@ -1064,7 +1064,7 @@ Response example:
10641064

10651065
Get tunnel server configuration:
10661066
```
1067-
api-cli ns.ovpntunnel get-tunnel-server '{"id": "ns_502e84af"}'
1067+
api-cli ns.ovpntunnel get-tunnel-server --data '{"id": "ns_502e84af"}'
10681068
```
10691069

10701070
Format returned is the same object passed to the `add-server`, plus the `id` field.
@@ -1132,7 +1132,7 @@ Response example:
11321132

11331133
Disable the given tunnel:
11341134
```
1135-
api-cli ns.ovpntunnel disable-tunnel '{"id": "tun1"}'
1135+
api-cli ns.ovpntunnel disable-tunnel --data '{"id": "tun1"}'
11361136
```
11371137

11381138
It can raise a `tunnel_not_found` validation error.
@@ -1151,7 +1151,7 @@ Error response example:
11511151

11521152
Enable the given tunnel:
11531153
```
1154-
api-cli ns.ovpntunnel enable-tunnel '{"id": "tun1"}'
1154+
api-cli ns.ovpntunnel enable-tunnel --data '{"id": "tun1"}'
11551155
```
11561156

11571157
It can raise a `tunnel_not_found` validation error.
@@ -1170,7 +1170,7 @@ Error response example:
11701170

11711171
Disable the given tunnel:
11721172
```
1173-
api-cli ns.ovpntunnel delete-tunnel '{"id": "tun1"}'
1173+
api-cli ns.ovpntunnel delete-tunnel --data '{"id": "tun1"}'
11741174
```
11751175

11761176
It can raise a `tunnel_not_found` validation error.
@@ -2078,7 +2078,7 @@ List and manage routes
20782078

20792079
List routes from the main table:
20802080
```
2081-
api-cli ns.routes main-table --date '{"protocol": "ipv4"}'
2081+
api-cli ns.routes main-table --data '{"protocol": "ipv4"}'
20822082
```
20832083

20842084
The `protocol` field can be `ipv4 ` or `ipv6`.
@@ -8813,4 +8813,4 @@ Response example:
88138813
```json
88148814
{
88158815
"success": true
8816-
}
8816+
}

0 commit comments

Comments
 (0)