Skip to content

Latest commit

 

History

History
1002 lines (622 loc) · 29 KB

lb.md

File metadata and controls

1002 lines (622 loc) · 29 KB

Documentation for scw lb

This API allows you to manage your load balancer service

Access Control List (ACL) management commands

Access Control List (ACL) management commands.

Create an ACL for a given frontend

Create an ACL for a given frontend.

Usage:

scw lb acl create [arg=value ...]

Args:

Name Description
frontend-id Required ID of your frontend
name Required
Default: <generated>
Name of your ACL ressource
action.type One of: allow, deny The action type
match.ip-subnet.{index} A list of IPs or CIDR v4/v6 addresses of the client of the session to match
match.http-filter One of: acl_http_filter_none, path_begin, path_end, regex, http_header_match The HTTP filter to match
match.http-filter-value.{index} A list of possible values to match for the given HTTP filter
match.http-filter-option A exra parameter. You can use this field with http_header_match acl type to set the header name to filter
match.invert If set to true, the ACL matching condition will be of type "UNLESS"
index Required Order between your Acls (ascending order, 0 is first acl executed)
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Delete an ACL

Delete an ACL.

Usage:

scw lb acl delete <acl-id ...> [arg=value ...]

Args:

Name Description
acl-id Required ID of your ACL ressource
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Get an ACL

Get an ACL.

Usage:

scw lb acl get <acl-id ...> [arg=value ...]

Args:

Name Description
acl-id Required ID of your ACL ressource
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

List ACL for a given frontend

List ACL for a given frontend.

Usage:

scw lb acl list [arg=value ...]

Args:

Name Description
frontend-id Required ID of your frontend
order-by One of: created_at_asc, created_at_desc, name_asc, name_desc You can order the response by created_at asc/desc or name asc/desc
name Filter acl per name
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Set all ACLs for a given frontend

Set all ACLs for a given frontend.

Usage:

scw lb acl set [arg=value ...]

Args:

Name Description
acls.{index}.name Required Name of your ACL resource
acls.{index}.action.type One of: allow, deny The action type
acls.{index}.match.ip-subnet.{index} A list of IPs or CIDR v4/v6 addresses of the client of the session to match
acls.{index}.match.http-filter One of: acl_http_filter_none, path_begin, path_end, regex, http_header_match The HTTP filter to match
acls.{index}.match.http-filter-value.{index} A list of possible values to match for the given HTTP filter
acls.{index}.match.http-filter-option A exra parameter. You can use this field with http_header_match acl type to set the header name to filter
acls.{index}.match.invert If set to true, the ACL matching condition will be of type "UNLESS"
acls.{index}.index Required Order between your Acls (ascending order, 0 is first acl executed)
frontend-id Required The Frontend to change ACL to
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Update an ACL

Update an ACL.

Usage:

scw lb acl update <acl-id ...> [arg=value ...]

Args:

Name Description
acl-id Required ID of your ACL ressource
name Required Name of your ACL ressource
action.type One of: allow, deny The action type
match.ip-subnet.{index} A list of IPs or CIDR v4/v6 addresses of the client of the session to match
match.http-filter One of: acl_http_filter_none, path_begin, path_end, regex, http_header_match The HTTP filter to match
match.http-filter-value.{index} A list of possible values to match for the given HTTP filter
match.http-filter-option A exra parameter. You can use this field with http_header_match acl type to set the header name to filter
match.invert If set to true, the ACL matching condition will be of type "UNLESS"
index Required Order between your Acls (ascending order, 0 is first acl executed)
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Backend management commands

Backend management commands.

Add a set of servers in a given backend

Add a set of servers in a given backend.

Usage:

scw lb backend add-servers <backend-id ...> [arg=value ...]

Args:

Name Description
backend-id Required Backend ID
server-ip.{index} Required Set all IPs to add on your backend
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Create a backend in a given load balancer

Create a backend in a given load balancer.

Usage:

scw lb backend create [arg=value ...]

Args:

Name Description
name Required
Default: <generated>
Resource name
forward-protocol Required
One of: tcp, http
Backend protocol. TCP or HTTP
forward-port Required User sessions will be forwarded to this port of backend servers
forward-port-algorithm Required
Default: roundrobin
One of: roundrobin, leastconn, first
Load balancing algorithm
sticky-sessions Required
Default: none
One of: none, cookie, table
Enables cookie-based session persistence
sticky-sessions-cookie-name Cookie name for for sticky sessions
health-check.mysql-config.user
health-check.check-max-retries
health-check.pgsql-config.user
health-check.http-config.uri
health-check.http-config.method
health-check.http-config.code
health-check.https-config.uri
health-check.https-config.method
health-check.https-config.code
health-check.port
health-check.check-timeout
health-check.check-delay
health-check.check-send-proxy It defines whether the healthcheck should be done considering the proxy protocol
lb-id Required Load balancer ID
server-ip.{index} Required Backend server IP addresses list (IPv4 or IPv6)
send-proxy-v2 Deprecated Deprecated in favor of proxy_protocol field !
timeout-server Maximum server connection inactivity time
timeout-connect Maximum initical server connection establishment time
timeout-tunnel Maximum tunnel inactivity time
on-marked-down-action One of: on_marked_down_action_none, shutdown_sessions Modify what occurs when a backend server is marked down
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)
failover-host Scaleway S3 bucket website to be served in case all backend servers are down
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Delete a backend in a given load balancer

Delete a backend in a given load balancer.

Usage:

scw lb backend delete <backend-id ...> [arg=value ...]

Args:

Name Description
backend-id Required ID of the backend to delete
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Get a backend in a given load balancer

Get a backend in a given load balancer.

Usage:

scw lb backend get <backend-id ...> [arg=value ...]

Args:

Name Description
backend-id Required Backend ID
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

List backends in a given load balancer

List backends in a given load balancer.

Usage:

scw lb backend list [arg=value ...]

Args:

Name Description
lb-id Required Load balancer ID
name Use this to search by name
order-by One of: created_at_asc, created_at_desc, name_asc, name_desc Choose order of response
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Remove a set of servers for a given backend

Remove a set of servers for a given backend.

Usage:

scw lb backend remove-servers <backend-id ...> [arg=value ...]

Args:

Name Description
backend-id Required Backend ID
server-ip.{index} Required Set all IPs to remove of your backend
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Define all servers in a given backend

Define all servers in a given backend.

Usage:

scw lb backend set-servers <backend-id ...> [arg=value ...]

Args:

Name Description
backend-id Required Backend ID
server-ip.{index} Required Set all IPs to add on your backend and remove all other
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Update a backend in a given load balancer

Update a backend in a given load balancer.

Usage:

scw lb backend update [arg=value ...]

Args:

Name Description
backend-id Required
name
forward-protocol One of: tcp, http
forward-port
forward-port-algorithm One of: roundrobin, leastconn, first
sticky-sessions One of: none, cookie, table
sticky-sessions-cookie-name
send-proxy-v2 Deprecated
timeout-server
timeout-connect
timeout-tunnel
on-marked-down-action One of: on_marked_down_action_none, shutdown_sessions
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
failover-host
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Update an healthcheck for a given backend

Update an healthcheck for a given backend.

Usage:

scw lb backend update-healthcheck [arg=value ...]

Args:

Name Description
port Required Specify the port used to health check
check-delay Required Time between two consecutive health checks
check-timeout Required Additional check timeout, after the connection has been already established
check-max-retries Required Number of consecutive unsuccessful health checks, after wich the server will be considered dead
backend-id Required Backend ID
mysql-config.user
pgsql-config.user
http-config.uri
http-config.method
http-config.code
https-config.uri
https-config.method
https-config.code
check-send-proxy It defines whether the healthcheck should be done considering the proxy protocol
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

TLS certificate management commands

TLS certificate management commands.

Create a TLS certificate

Generate a new TLS certificate using Let's Encrypt or import your certificate.

Usage:

scw lb certificate create [arg=value ...]

Args:

Name Description
lb-id Required Load balancer ID
name Required
Default: <generated>
Certificate name
letsencrypt-common-name Main domain name of certificate (make sure this domain exists and resolves to your load balancer HA IP)
letsencrypt-alternative-name.{index} Alternative domain names (make sure all domain names exists and resolves to your load balancer HA IP)
custom-certificate-chain The full PEM-formatted include an entire certificate chain including public key, private key, and optionally certificate authorities.
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Delete a TLS certificate

Delete a TLS certificate.

Usage:

scw lb certificate delete <certificate-id ...> [arg=value ...]

Args:

Name Description
certificate-id Required Certificate ID
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Get a TLS certificate

Get a TLS certificate.

Usage:

scw lb certificate get <certificate-id ...> [arg=value ...]

Args:

Name Description
certificate-id Required Certificate ID
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

List all TLS certificates on a given load balancer

List all TLS certificates on a given load balancer.

Usage:

scw lb certificate list [arg=value ...]

Args:

Name Description
lb-id Required Load balancer ID
order-by One of: created_at_asc, created_at_desc, name_asc, name_desc You can order the response by created_at asc/desc or name asc/desc
name Use this to search by name
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Update a TLS certificate

Update a TLS certificate.

Usage:

scw lb certificate update <certificate-id ...> [arg=value ...]

Args:

Name Description
certificate-id Required Certificate ID
name Required Certificate name
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Frontend management commands

Frontend management commands.

Create a frontend in a given load balancer

Create a frontend in a given load balancer.

Usage:

scw lb frontend create [arg=value ...]

Args:

Name Description
name Required
Default: <generated>
Resource name
inbound-port Required TCP port to listen on the front side
lb-id Required Load balancer ID
backend-id Required Backend ID
timeout-client Set the maximum inactivity time on the client side
certificate-id Deprecated Certificate ID, deprecated in favor of certificate_ids array !
certificate-ids.{index} List of certificate IDs to bind on the frontend
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Delete a frontend

Delete a frontend.

Usage:

scw lb frontend delete <frontend-id ...> [arg=value ...]

Args:

Name Description
frontend-id Required Frontend ID to delete
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Get a frontend

Get a frontend.

Usage:

scw lb frontend get <frontend-id ...> [arg=value ...]

Args:

Name Description
frontend-id Required Frontend ID
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

List frontends in a given load balancer

List frontends in a given load balancer.

Usage:

scw lb frontend list [arg=value ...]

Args:

Name Description
lb-id Required Load balancer ID
name Use this to search by name
order-by One of: created_at_asc, created_at_desc, name_asc, name_desc Response order
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Update a frontend

Update a frontend.

Usage:

scw lb frontend update <frontend-id ...> [arg=value ...]

Args:

Name Description
frontend-id Required Frontend ID
name Required Resource name
inbound-port Required TCP port to listen on the front side
backend-id Required Backend ID
timeout-client Client session maximum inactivity time
certificate-id Deprecated Certificate ID, deprecated in favor of certificate_ids array!
certificate-ids.{index} List of certificate IDs to bind on the frontend
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

IP management commands

IP management commands.

Create an IP

Create an IP.

Usage:

scw lb ip create [arg=value ...]

Args:

Name Description
project-id Project ID to use. If none is passed the default project ID will be used
reverse Reverse domain name
organization-id Organization ID to use. If none is passed the default organization ID will be used
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Delete an IP

Delete an IP.

Usage:

scw lb ip delete <ip-id ...> [arg=value ...]

Args:

Name Description
ip-id Required IP address ID
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Get an IP

Get an IP.

Usage:

scw lb ip get <ip-id ...> [arg=value ...]

Args:

Name Description
ip-id Required IP address ID
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

List IPs

List IPs.

Usage:

scw lb ip list [arg=value ...]

Args:

Name Description
ip-address Use this to search by IP address
project-id Filter IPs by project ID
organization-id Filter IPs by organization id
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Update an IP

Update an IP.

Usage:

scw lb ip update <ip-id ...> [arg=value ...]

Args:

Name Description
ip-id Required IP address ID
reverse Reverse DNS
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Load-balancer management commands

Load-balancer management commands.

Create a load balancer

Create a load balancer.

Usage:

scw lb lb create [arg=value ...]

Args:

Name Description
project-id Project ID to use. If none is passed the default project ID will be used
name Required
Default: <generated>
Resource names
description Resource description
ip-id Just like for compute instances, when you destroy a load balancer, you can keep its highly available IP address and reuse it for another load balancer later
tags.{index} List of keyword
type Default: LB-S
One of: LB-S, LB-GP-M, LB-GP-L
Load balancer offer type
ssl-compatibility-level One of: ssl_compatibility_level_unknown, ssl_compatibility_level_intermediate, ssl_compatibility_level_modern, ssl_compatibility_level_old
organization-id Organization ID to use. If none is passed the default organization ID will be used
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Delete a load balancer

Delete a load balancer.

Usage:

scw lb lb delete <lb-id ...> [arg=value ...]

Args:

Name Description
lb-id Required Load balancer ID
release-ip Set true if you don't want to keep this IP address
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Get a load balancer

Get a load balancer.

Usage:

scw lb lb get <lb-id ...> [arg=value ...]

Args:

Name Description
lb-id Required Load balancer ID
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Get usage statistics of a given load balancer

Get usage statistics of a given load balancer.

Usage:

scw lb lb get-stats <lb-id ...> [arg=value ...]

Args:

Name Description
lb-id Required Load balancer ID
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

List load balancers

List load balancers.

Usage:

scw lb lb list [arg=value ...]

Args:

Name Description
name Use this to search by name
order-by One of: created_at_asc, created_at_desc, name_asc, name_desc
project-id Filter LBs by project ID
organization-id Filter LBs by organization ID
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Migrate a load balancer

Migrate a load balancer.

Usage:

scw lb lb migrate <lb-id ...> [arg=value ...]

Args:

Name Description
lb-id Required Load balancer ID
type Required
One of: LB-S, LB-GP-M, LB-GP-L
Load balancer type (check /lb-types to list all type)
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Update a load balancer

Update a load balancer.

Usage:

scw lb lb update <lb-id ...> [arg=value ...]

Args:

Name Description
lb-id Required Load balancer ID
name Required Resource name
description Required Resource description
tags.{index} List of keywords
ssl-compatibility-level One of: ssl_compatibility_level_unknown, ssl_compatibility_level_intermediate, ssl_compatibility_level_modern, ssl_compatibility_level_old
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config

Wait for a load balancer to reach a stable state

Wait for a load balancer to reach a stable state. This is similar to using --wait flag.

Usage:

scw lb lb wait <lb-id ...> [arg=value ...]

Args:

Name Description
lb-id Required ID of the load balancer you want to wait for.
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, pl-waw-1, nl-ams-1
Zone to target. If none is passed will use default zone from the config

Examples:

Wait for a load balancer to reach a stable state

scw lb lb wait 11111111-1111-1111-1111-111111111111

Load-balancer types management commands

Load-balancer types management commands.

List all load balancer offer type

List all load balancer offer type.

Usage:

scw lb lb-types list [arg=value ...]

Args:

Name Description
zone Default: fr-par-1
One of: fr-par-1, fr-par-2, nl-ams-1, pl-waw-1
Zone to target. If none is passed will use default zone from the config