Skip to content

Commit dae1d86

Browse files
authored
feat(cli): use scw.Duration as a flat field (#3510)
1 parent 5c5dc75 commit dae1d86

17 files changed

+117
-213
lines changed

cmd/scw/testdata/test-all-usage-container-container-create-usage.golden

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ ARGS:
1313
[max-scale] Maximum number of instances to scale the container to
1414
[memory-limit] Memory limit of the container in MB
1515
[cpu-limit] CPU limit of the container in mvCPU
16-
[timeout.seconds]
17-
[timeout.nanos]
16+
[timeout] Processing time limit for the container
1817
[privacy] Privacy setting of the container (unknown_privacy | public | private)
1918
[description] Description of the container
2019
[registry-image] Name of the registry image (e.g. "rg.fr-par.scw.cloud/something/image:tag").

cmd/scw/testdata/test-all-usage-container-container-update-usage.golden

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ ARGS:
1212
[max-scale] Maximum number of instances to scale the container to
1313
[memory-limit] Memory limit of the container in MB
1414
[cpu-limit] CPU limit of the container in mvCPU
15-
[timeout.seconds]
16-
[timeout.nanos]
15+
[timeout] Processing time limit for the container
1716
[redeploy] Defines whether to redeploy failed containers
1817
[privacy] Privacy settings of the container (unknown_privacy | public | private)
1918
[description] Description of the container

cmd/scw/testdata/test-all-usage-function-function-create-usage.golden

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ ARGS:
1313
[max-scale] Maximum number of instances to scale the function to
1414
[runtime] Runtime to use with the function (unknown_runtime | golang | python | python3 | node8 | node10 | node14 | node16 | node17 | python37 | python38 | python39 | python310 | go113 | go117 | go118 | node18 | rust165 | go119 | python311 | php82 | node19 | go120 | node20 | go121)
1515
[memory-limit] Memory limit of the function in MB
16-
[timeout.seconds]
17-
[timeout.nanos]
16+
[timeout] Request processing time limit for the function
1817
[handler] Handler to use with the function
1918
[privacy] Privacy setting of the function (unknown_privacy | public | private)
2019
[description] Description of the function

cmd/scw/testdata/test-all-usage-function-function-update-usage.golden

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ ARGS:
1212
[max-scale] Maximum number of instances to scale the function to
1313
[runtime] Runtime to use with the function (unknown_runtime | golang | python | python3 | node8 | node10 | node14 | node16 | node17 | python37 | python38 | python39 | python310 | go113 | go117 | go118 | node18 | rust165 | go119 | python311 | php82 | node19 | go120 | node20 | go121)
1414
[memory-limit] Memory limit of the function in MB
15-
[timeout.seconds]
16-
[timeout.nanos]
15+
[timeout] Processing time limit for the function
1716
[redeploy] Redeploy failed function
1817
[handler] Handler to use with the function
1918
[privacy] Privacy setting of the function (unknown_privacy | public | private)

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

Lines changed: 43 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,49 @@ USAGE:
66
scw lb backend create [arg=value ...]
77

88
ARGS:
9-
name=<generated> Name for the backend
10-
forward-protocol Protocol to be used by the backend when forwarding traffic to backend servers (tcp | http)
11-
forward-port Port to be used by the backend when forwarding traffic to backend servers
12-
forward-port-algorithm=roundrobin Load balancing algorithm to be used when determining which backend server to forward new traffic to (roundrobin | leastconn | first)
13-
sticky-sessions=none Defines whether to activate sticky sessions (binding a particular session to a particular backend server) and the method to use if so. None disables sticky sessions. Cookie-based uses an HTTP cookie TO stick a session to a backend server. Table-based uses the source (client) IP address to stick a session to a backend server (none | cookie | table)
14-
[sticky-sessions-cookie-name] Cookie name for cookie-based sticky sessions
15-
lb-id Load Balancer ID
16-
[health-check.port] Port to use for the backend server health check
17-
[health-check.check-delay=3s] Time to wait between two consecutive health checks
18-
[health-check.check-timeout=1s] Maximum time a backend server has to reply to the health check
19-
[health-check.check-max-retries] Number of consecutive unsuccessful health checks after which the server will be considered dead
20-
[health-check.mysql-config.user] MySQL user to use for the health check
21-
[health-check.pgsql-config.user] PostgreSQL user to use for the health check
22-
[health-check.http-config.uri] HTTP URI used for the health check
23-
[health-check.http-config.method] HTTP method used for the health check
24-
[health-check.http-config.code] HTTP response code expected for a successful health check
25-
[health-check.http-config.host-header] HTTP host header used for the health check
26-
[health-check.https-config.uri] HTTP URI used for the health check
27-
[health-check.https-config.method] HTTP method used for the health check
28-
[health-check.https-config.code] HTTP response code expected for a successful health check
29-
[health-check.https-config.host-header] HTTP host header used for the health check
30-
[health-check.https-config.sni] SNI used for SSL health checks
31-
[health-check.check-send-proxy] Defines whether proxy protocol should be activated for the health check
32-
[health-check.transient-check-delay.seconds]
33-
[health-check.transient-check-delay.nanos]
34-
[instance-server-id.{index}] UIID of the instance server.
35-
[instance-server-tag.{index}] Tag of the instance server.
36-
[use-instance-server-public-ip] Use public IP address of the instance instead of the private one
37-
[baremetal-server-id.{index}] UIID of the baremetal server.
38-
[baremetal-server-tag.{index}] Tag of the baremetal server.
39-
server-ip.{index} List of backend server IP addresses (IPv4 or IPv6) the backend should forward traffic to
40-
[timeout-server=5m] Maximum allowed time for a backend server to process a request
41-
[timeout-connect=5s] Maximum allowed time for establishing a connection to a backend server
42-
[timeout-tunnel=15m] Maximum allowed tunnel inactivity time after Websocket is established (takes precedence over client and server timeout)
43-
[on-marked-down-action] Action to take when a backend server is marked as down (on_marked_down_action_none | shutdown_sessions)
44-
[proxy-protocol] Protocol to use between the Load Balancer and backend servers. Allows the backend servers to be informed of the client's real IP address. The PROXY protocol must be supported by the backend servers' software (proxy_protocol_unknown | proxy_protocol_none | proxy_protocol_v1 | proxy_protocol_v2 | proxy_protocol_v2_ssl | proxy_protocol_v2_ssl_cn)
45-
[failover-host] Scaleway S3 bucket website to be served as failover if all backend servers are down, e.g. failover-website.s3-website.fr-par.scw.cloud
46-
[ssl-bridging] Defines whether to enable SSL bridging between the Load Balancer and backend servers
47-
[ignore-ssl-server-verify] Defines whether the server certificate verification should be ignored
48-
[redispatch-attempt-count] Whether to use another backend server on each attempt
49-
[max-retries] Number of retries when a backend server connection failed
50-
[max-connections] Maximum number of connections allowed per backend server
51-
[timeout-queue.seconds]
52-
[timeout-queue.nanos]
53-
[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 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
9+
name=<generated> Name for the backend
10+
forward-protocol Protocol to be used by the backend when forwarding traffic to backend servers (tcp | http)
11+
forward-port Port to be used by the backend when forwarding traffic to backend servers
12+
forward-port-algorithm=roundrobin Load balancing algorithm to be used when determining which backend server to forward new traffic to (roundrobin | leastconn | first)
13+
sticky-sessions=none Defines whether to activate sticky sessions (binding a particular session to a particular backend server) and the method to use if so. None disables sticky sessions. Cookie-based uses an HTTP cookie TO stick a session to a backend server. Table-based uses the source (client) IP address to stick a session to a backend server (none | cookie | table)
14+
[sticky-sessions-cookie-name] Cookie name for cookie-based sticky sessions
15+
lb-id Load Balancer ID
16+
[health-check.port] Port to use for the backend server health check
17+
[health-check.check-delay=3s] Time to wait between two consecutive health checks
18+
[health-check.check-timeout=1s] Maximum time a backend server has to reply to the health check
19+
[health-check.check-max-retries] Number of consecutive unsuccessful health checks after which the server will be considered dead
20+
[health-check.mysql-config.user] MySQL user to use for the health check
21+
[health-check.pgsql-config.user] PostgreSQL user to use for the health check
22+
[health-check.http-config.uri] HTTP URI used for the health check
23+
[health-check.http-config.method] HTTP method used for the health check
24+
[health-check.http-config.code] HTTP response code expected for a successful health check
25+
[health-check.http-config.host-header] HTTP host header used for the health check
26+
[health-check.https-config.uri] HTTP URI used for the health check
27+
[health-check.https-config.method] HTTP method used for the health check
28+
[health-check.https-config.code] HTTP response code expected for a successful health check
29+
[health-check.https-config.host-header] HTTP host header used for the health check
30+
[health-check.https-config.sni] SNI used for SSL health checks
31+
[health-check.check-send-proxy] Defines whether proxy protocol should be activated for the health check
32+
[health-check.transient-check-delay=0.5s] Time to wait between two consecutive health checks when a backend server is in a transient state (going UP or DOWN)
33+
[instance-server-id.{index}] UIID of the instance server.
34+
[instance-server-tag.{index}] Tag of the instance server.
35+
[use-instance-server-public-ip] Use public IP address of the instance instead of the private one
36+
[baremetal-server-id.{index}] UIID of the baremetal server.
37+
[baremetal-server-tag.{index}] Tag of the baremetal server.
38+
server-ip.{index} List of backend server IP addresses (IPv4 or IPv6) the backend should forward traffic to
39+
[timeout-server=5m] Maximum allowed time for a backend server to process a request
40+
[timeout-connect=5s] Maximum allowed time for establishing a connection to a backend server
41+
[timeout-tunnel=15m] Maximum allowed tunnel inactivity time after Websocket is established (takes precedence over client and server timeout)
42+
[on-marked-down-action] Action to take when a backend server is marked as down (on_marked_down_action_none | shutdown_sessions)
43+
[proxy-protocol] Protocol to use between the Load Balancer and backend servers. Allows the backend servers to be informed of the client's real IP address. The PROXY protocol must be supported by the backend servers' software (proxy_protocol_unknown | proxy_protocol_none | proxy_protocol_v1 | proxy_protocol_v2 | proxy_protocol_v2_ssl | proxy_protocol_v2_ssl_cn)
44+
[failover-host] Scaleway S3 bucket website to be served as failover if all backend servers are down, e.g. failover-website.s3-website.fr-par.scw.cloud
45+
[ssl-bridging] Defines whether to enable SSL bridging between the Load Balancer and backend servers
46+
[ignore-ssl-server-verify] Defines whether the server certificate verification should be ignored
47+
[redispatch-attempt-count] Whether to use another backend server on each attempt
48+
[max-retries] Number of retries when a backend server connection failed
49+
[max-connections] Maximum number of connections allowed per backend server
50+
[timeout-queue] Maximum time for a request to be left pending in queue when `max_connections` is reached
51+
[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 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
5452

5553
DEPRECATED ARGS:
5654
[send-proxy-v2] Deprecated in favor of proxy_protocol field

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

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@ USAGE:
66
scw lb backend update-healthcheck [arg=value ...]
77

88
ARGS:
9-
port Port to use for the backend server health check
10-
check-delay Time to wait between two consecutive health checks
11-
check-timeout Maximum time a backend server has to reply to the health check
12-
check-max-retries Number of consecutive unsuccessful health checks after which the server will be considered dead
13-
backend-id Backend ID
14-
[check-send-proxy] Defines whether proxy protocol should be activated for the health check
15-
[mysql-config.user] MySQL user to use for the health check
16-
[pgsql-config.user] PostgreSQL user to use for the health check
17-
[http-config.uri] HTTP URI used for the health check
18-
[http-config.method] HTTP method used for the health check
19-
[http-config.code] HTTP response code expected for a successful health check
20-
[http-config.host-header] HTTP host header used for the health check
21-
[https-config.uri] HTTP URI used for the health check
22-
[https-config.method] HTTP method used for the health check
23-
[https-config.code] HTTP response code expected for a successful health check
24-
[https-config.host-header] HTTP host header used for the health check
25-
[https-config.sni] SNI used for SSL health checks
26-
[transient-check-delay.seconds]
27-
[transient-check-delay.nanos]
28-
[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 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
9+
port Port to use for the backend server health check
10+
check-delay Time to wait between two consecutive health checks
11+
check-timeout Maximum time a backend server has to reply to the health check
12+
check-max-retries Number of consecutive unsuccessful health checks after which the server will be considered dead
13+
backend-id Backend ID
14+
[check-send-proxy] Defines whether proxy protocol should be activated for the health check
15+
[mysql-config.user] MySQL user to use for the health check
16+
[pgsql-config.user] PostgreSQL user to use for the health check
17+
[http-config.uri] HTTP URI used for the health check
18+
[http-config.method] HTTP method used for the health check
19+
[http-config.code] HTTP response code expected for a successful health check
20+
[http-config.host-header] HTTP host header used for the health check
21+
[https-config.uri] HTTP URI used for the health check
22+
[https-config.method] HTTP method used for the health check
23+
[https-config.code] HTTP response code expected for a successful health check
24+
[https-config.host-header] HTTP host header used for the health check
25+
[https-config.sni] SNI used for SSL health checks
26+
[transient-check-delay=0.5s] Time to wait between two consecutive health checks when a backend server is in a transient state (going UP or DOWN)
27+
[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 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
2928

3029
FLAGS:
3130
-h, --help help for update-healthcheck

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ ARGS:
2424
[redispatch-attempt-count] Whether to use another backend server on each attempt
2525
[max-retries] Number of retries when a backend server connection failed
2626
[max-connections] Maximum number of connections allowed per backend server
27-
[timeout-queue.seconds]
28-
[timeout-queue.nanos]
27+
[timeout-queue] Maximum time for a request to be left pending in queue when `max_connections` is reached
2928
[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 | nl-ams-3 | pl-waw-1 | pl-waw-2 | pl-waw-3)
3029

3130
DEPRECATED ARGS:

cmd/scw/testdata/test-all-usage-vpc-gw-dhcp-create-usage.golden

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,9 @@ ARGS:
1212
[pool-low] Low IP (inclusive) of the dynamic address pool. Must be in the config's subnet. Defaults to the second address of the subnet
1313
[pool-high] High IP (inclusive) of the dynamic address pool. Must be in the config's subnet. Defaults to the last address of the subnet
1414
[enable-dynamic] Defines whether to enable dynamic pooling of IPs. When false, only pre-existing DHCP reservations will be handed out. Defaults to true
15-
[valid-lifetime.seconds]
16-
[valid-lifetime.nanos]
17-
[renew-timer.seconds]
18-
[renew-timer.nanos]
19-
[rebind-timer.seconds]
20-
[rebind-timer.nanos]
15+
[valid-lifetime] How long DHCP entries will be valid for. Defaults to 1h (3600s)
16+
[renew-timer] After how long a renew will be attempted. Must be 30s lower than `rebind_timer`. Defaults to 50m (3000s)
17+
[rebind-timer] After how long a DHCP client will query for a new lease if previous renews fail. Must be 30s lower than `valid_lifetime`. Defaults to 51m (3060s)
2118
[push-default-route] Defines whether the gateway should push a default route to DHCP clients or only hand out IPs. Defaults to true
2219
[push-dns-server] Defines whether the gateway should push custom DNS servers to clients. This allows for Instance hostname -> IP resolution. Defaults to true
2320
[dns-servers-override.{index}] Array of DNS server IP addresses used to override the DNS server list pushed to DHCP clients, instead of the gateway itself

0 commit comments

Comments
 (0)