Skip to content

Commit d9d6b05

Browse files
docs(lb): add documentation (#2414)
Co-authored-by: Rémy Léone <rleone@scaleway.com>
1 parent 963c835 commit d9d6b05

File tree

3 files changed

+50
-36
lines changed

3 files changed

+50
-36
lines changed

cmd/scw/testdata/test-all-usage-lb-backend-update-usage.golden

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,26 @@
33
Update a backend in a given load balancer.
44

55
USAGE:
6-
scw lb backend update [arg=value ...]
6+
scw lb backend update <backend-id ...> [arg=value ...]
77

88
ARGS:
9-
backend-id
10-
[name]
11-
[forward-protocol] (tcp | http)
12-
[forward-port]
13-
[forward-port-algorithm] (roundrobin | leastconn | first)
14-
[sticky-sessions] (none | cookie | table)
15-
[sticky-sessions-cookie-name]
16-
[timeout-server]
17-
[timeout-connect]
18-
[timeout-tunnel]
19-
[on-marked-down-action] (on_marked_down_action_none | shutdown_sessions)
20-
[proxy-protocol] (proxy_protocol_unknown | proxy_protocol_none | proxy_protocol_v1 | proxy_protocol_v2 | proxy_protocol_v2_ssl | proxy_protocol_v2_ssl_cn)
21-
[failover-host]
9+
backend-id Backend ID to update
10+
name Resource name
11+
forward-protocol Backend protocol. TCP or HTTP (tcp | http)
12+
forward-port User sessions will be forwarded to this port of backend servers
13+
forward-port-algorithm Load balancing algorithm (roundrobin | leastconn | first)
14+
sticky-sessions Enable cookie-based session persistence (none | cookie | table)
15+
[sticky-sessions-cookie-name] Cookie name for for sticky sessions
16+
[timeout-server] Maximum server connection inactivity time
17+
[timeout-connect] Maximum initial server connection establishment time
18+
[timeout-tunnel] Maximum tunnel inactivity time
19+
[on-marked-down-action] Modify what occurs when a backend server is marked down (on_marked_down_action_none | shutdown_sessions)
20+
[proxy-protocol] PROXY protocol, forward client's address (must be supported by backend servers software) (proxy_protocol_unknown | proxy_protocol_none | proxy_protocol_v1 | proxy_protocol_v2 | proxy_protocol_v2_ssl | proxy_protocol_v2_ssl_cn)
21+
[failover-host] Scaleway S3 bucket website to be served in case all backend servers are down
2222
[zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-1)
2323

2424
DEPRECATED ARGS:
25-
[send-proxy-v2]
25+
[send-proxy-v2] Deprecated in favor of proxy_protocol field!
2626

2727
FLAGS:
2828
-h, --help help for update

docs/commands/lb.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -385,28 +385,28 @@ Update a backend in a given load balancer.
385385
**Usage:**
386386

387387
```
388-
scw lb backend update [arg=value ...]
388+
scw lb backend update <backend-id ...> [arg=value ...]
389389
```
390390

391391

392392
**Args:**
393393

394394
| Name | | Description |
395395
|------|---|-------------|
396-
| backend-id | Required | |
397-
| name | | |
398-
| forward-protocol | One of: `tcp`, `http` | |
399-
| forward-port | | |
400-
| forward-port-algorithm | One of: `roundrobin`, `leastconn`, `first` | |
401-
| sticky-sessions | One of: `none`, `cookie`, `table` | |
402-
| sticky-sessions-cookie-name | | |
403-
| ~~send-proxy-v2~~ | Deprecated | |
404-
| timeout-server | | |
405-
| timeout-connect | | |
406-
| timeout-tunnel | | |
407-
| on-marked-down-action | One of: `on_marked_down_action_none`, `shutdown_sessions` | |
408-
| proxy-protocol | One of: `proxy_protocol_unknown`, `proxy_protocol_none`, `proxy_protocol_v1`, `proxy_protocol_v2`, `proxy_protocol_v2_ssl`, `proxy_protocol_v2_ssl_cn` | |
409-
| failover-host | | |
396+
| backend-id | Required | Backend ID to update |
397+
| name | Required | Resource name |
398+
| forward-protocol | Required<br />One of: `tcp`, `http` | Backend protocol. TCP or HTTP |
399+
| forward-port | Required | User sessions will be forwarded to this port of backend servers |
400+
| forward-port-algorithm | Required<br />One of: `roundrobin`, `leastconn`, `first` | Load balancing algorithm |
401+
| sticky-sessions | Required<br />One of: `none`, `cookie`, `table` | Enable cookie-based session persistence |
402+
| sticky-sessions-cookie-name | | Cookie name for for sticky sessions |
403+
| ~~send-proxy-v2~~ | Deprecated | Deprecated in favor of proxy_protocol field! |
404+
| timeout-server | | Maximum server connection inactivity time |
405+
| timeout-connect | | Maximum initial server connection establishment time |
406+
| timeout-tunnel | | Maximum tunnel inactivity time |
407+
| on-marked-down-action | One of: `on_marked_down_action_none`, `shutdown_sessions` | Modify what occurs when a backend server is marked down |
408+
| proxy-protocol | One of: `proxy_protocol_unknown`, `proxy_protocol_none`, `proxy_protocol_v1`, `proxy_protocol_v2`, `proxy_protocol_v2_ssl`, `proxy_protocol_v2_ssl_cn` | PROXY protocol, forward client's address (must be supported by backend servers software) |
409+
| failover-host | | Scaleway S3 bucket website to be served in case all backend servers are down |
410410
| zone | Default: `fr-par-1`<br />One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config |
411411

412412

internal/namespaces/lb/v1/lb_cli.go

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -918,89 +918,103 @@ func lbBackendUpdate() *core.Command {
918918
ArgSpecs: core.ArgSpecs{
919919
{
920920
Name: "backend-id",
921+
Short: `Backend ID to update`,
921922
Required: true,
922923
Deprecated: false,
923-
Positional: false,
924+
Positional: true,
924925
},
925926
{
926927
Name: "name",
927-
Required: false,
928+
Short: `Resource name`,
929+
Required: true,
928930
Deprecated: false,
929931
Positional: false,
930932
},
931933
{
932934
Name: "forward-protocol",
933-
Required: false,
935+
Short: `Backend protocol. TCP or HTTP`,
936+
Required: true,
934937
Deprecated: false,
935938
Positional: false,
936939
EnumValues: []string{"tcp", "http"},
937940
},
938941
{
939942
Name: "forward-port",
940-
Required: false,
943+
Short: `User sessions will be forwarded to this port of backend servers`,
944+
Required: true,
941945
Deprecated: false,
942946
Positional: false,
943947
},
944948
{
945949
Name: "forward-port-algorithm",
946-
Required: false,
950+
Short: `Load balancing algorithm`,
951+
Required: true,
947952
Deprecated: false,
948953
Positional: false,
949954
EnumValues: []string{"roundrobin", "leastconn", "first"},
950955
},
951956
{
952957
Name: "sticky-sessions",
953-
Required: false,
958+
Short: `Enable cookie-based session persistence`,
959+
Required: true,
954960
Deprecated: false,
955961
Positional: false,
956962
EnumValues: []string{"none", "cookie", "table"},
957963
},
958964
{
959965
Name: "sticky-sessions-cookie-name",
966+
Short: `Cookie name for for sticky sessions`,
960967
Required: false,
961968
Deprecated: false,
962969
Positional: false,
963970
},
964971
{
965972
Name: "send-proxy-v2",
973+
Short: `Deprecated in favor of proxy_protocol field!`,
966974
Required: false,
967975
Deprecated: true,
968976
Positional: false,
969977
},
970978
{
971979
Name: "timeout-server",
980+
Short: `Maximum server connection inactivity time`,
972981
Required: false,
973982
Deprecated: false,
974983
Positional: false,
975984
},
976985
{
977986
Name: "timeout-connect",
987+
Short: `Maximum initial server connection establishment time`,
978988
Required: false,
979989
Deprecated: false,
980990
Positional: false,
981991
},
982992
{
983993
Name: "timeout-tunnel",
994+
Short: `Maximum tunnel inactivity time`,
984995
Required: false,
985996
Deprecated: false,
986997
Positional: false,
987998
},
988999
{
9891000
Name: "on-marked-down-action",
1001+
Short: `Modify what occurs when a backend server is marked down`,
9901002
Required: false,
9911003
Deprecated: false,
9921004
Positional: false,
9931005
EnumValues: []string{"on_marked_down_action_none", "shutdown_sessions"},
9941006
},
9951007
{
9961008
Name: "proxy-protocol",
1009+
Short: `PROXY protocol, forward client's address (must be supported by backend servers software)`,
9971010
Required: false,
9981011
Deprecated: false,
9991012
Positional: false,
10001013
EnumValues: []string{"proxy_protocol_unknown", "proxy_protocol_none", "proxy_protocol_v1", "proxy_protocol_v2", "proxy_protocol_v2_ssl", "proxy_protocol_v2_ssl_cn"},
10011014
},
10021015
{
10031016
Name: "failover-host",
1017+
Short: `Scaleway S3 bucket website to be served in case all backend servers are down`,
10041018
Required: false,
10051019
Deprecated: false,
10061020
Positional: false,

0 commit comments

Comments
 (0)