From ab9ac1a4ed40c6ae942a9cc37bd4a61f0c38c7f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 18 May 2021 15:09:17 +0200 Subject: [PATCH] chore: make test fail if generated docs is not up to date --- .github/workflows/{docs.yaml => docs.yml} | 11 +- .../test-all-usage-config-get-usage.golden | 2 +- docs/commands/autocomplete.md | 2 +- docs/commands/config.md | 4 +- docs/commands/dns.md | 705 ++++++++++++++++++ docs/commands/init.md | 8 +- docs/commands/instance.md | 1 + docs/commands/iot.md | 104 ++- docs/commands/k8s.md | 4 +- docs/commands/lb.md | 76 +- docs/commands/rdb.md | 145 ++++ internal/namespaces/config/commands.go | 8 +- internal/namespaces/init/init.go | 10 +- 13 files changed, 1024 insertions(+), 56 deletions(-) rename .github/workflows/{docs.yaml => docs.yml} (55%) create mode 100644 docs/commands/dns.md diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yml similarity index 55% rename from .github/workflows/docs.yaml rename to .github/workflows/docs.yml index e56b57d307..bc095b834e 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yml @@ -9,9 +9,8 @@ jobs: - uses: actions/checkout@v2 - name: Generate code run: go run ./cmd/scw-doc-gen - - name: Compute git status - run: gitStatus=$(git status --porcelain) - - name: Show git status - run: echo $gitStatus - - name: Error if non empty - run: "[ -z $gitStatus ]" + env: + # We need this to enable autocomplete documentation generation default + SHELL: /bin/bash + - name: Exit 1 if not empty + run: git diff --exit-code diff --git a/cmd/scw/testdata/test-all-usage-config-get-usage.golden b/cmd/scw/testdata/test-all-usage-config-get-usage.golden index a3643c85db..6f3955408c 100644 --- a/cmd/scw/testdata/test-all-usage-config-get-usage.golden +++ b/cmd/scw/testdata/test-all-usage-config-get-usage.golden @@ -13,7 +13,7 @@ EXAMPLES: scw -p prod config get default_region ARGS: - key the key to get from the configt (access-key | secret-key | api-url | insecure | default-organization-id | default-project-id | default-region | default-zone | send-telemetry) + key the key to get from the config (access-key | secret-key | api-url | insecure | default-organization-id | default-project-id | default-region | default-zone | send-telemetry) FLAGS: -h, --help help for get diff --git a/docs/commands/autocomplete.md b/docs/commands/autocomplete.md index 4225c882f8..feb97e90d6 100644 --- a/docs/commands/autocomplete.md +++ b/docs/commands/autocomplete.md @@ -44,7 +44,7 @@ scw autocomplete script [arg=value ...] | Name | | Description | |------|---|-------------| -| shell | Default: `/bin/zsh` | | +| shell | Default: `/bin/bash` | | diff --git a/docs/commands/config.md b/docs/commands/config.md index 6d621992a2..8eba829be2 100644 --- a/docs/commands/config.md +++ b/docs/commands/config.md @@ -2,7 +2,7 @@ # Documentation for `scw config` Config management engine is common across all Scaleway developer tools (CLI, terraform, SDK, ... ). It allows to handle Scaleway config through two ways: environment variables and/or config file. -Scaleway config file is self-documented. We recommend you to have a look at it at least once before using Scaleway developer tools: /Users/sieben/.config/scw/config.yaml +You can see your current configuration by using: scw config dump In this CLI, environment variables have priority over the configuration file. @@ -63,7 +63,7 @@ scw config get [arg=value ...] | Name | | Description | |------|---|-------------| -| key | Required
One of: `access-key`, `secret-key`, `api-url`, `insecure`, `default-organization-id`, `default-project-id`, `default-region`, `default-zone`, `send-telemetry` | the key to get from the configt | +| key | Required
One of: `access-key`, `secret-key`, `api-url`, `insecure`, `default-organization-id`, `default-project-id`, `default-region`, `default-zone`, `send-telemetry` | the key to get from the config | **Examples:** diff --git a/docs/commands/dns.md b/docs/commands/dns.md new file mode 100644 index 0000000000..6533333b2b --- /dev/null +++ b/docs/commands/dns.md @@ -0,0 +1,705 @@ + +# Documentation for `scw dns` +Manage your DNS zones and records. + +- [TLS certificate management](#tls-certificate-management) + - [Create or return the zone TLS certificate](#create-or-return-the-zone-tls-certificate) + - [Delete an TLS certificate](#delete-an-tls-certificate) + - [Get the zone TLS certificate if it exists](#get-the-zone-tls-certificate-if-it-exists) + - [List all user TLS certificates](#list-all-user-tls-certificates) +- [DNS records management](#dns-records-management) + - [Add a new DNS record](#add-a-new-dns-record) + - [Update DNS zone records](#update-dns-zone-records) + - [Clear DNS zone records](#clear-dns-zone-records) + - [Delete a DNS record](#delete-a-dns-record) + - [List DNS zone records](#list-dns-zone-records) + - [List DNS zone nameservers](#list-dns-zone-nameservers) + - [Clear and set a DNS record](#clear-and-set-a-dns-record) + - [Update DNS zone nameservers](#update-dns-zone-nameservers) +- [Transaction SIGnature key management](#transaction-signature-key-management) + - [Delete the DNS zone TSIG Key](#delete-the-dns-zone-tsig-key) + - [Get the DNS zone TSIG Key](#get-the-dns-zone-tsig-key) +- [DNS zones version management](#dns-zones-version-management) + - [Get DNS zone version diff](#get-dns-zone-version-diff) + - [List DNS zone versions](#list-dns-zone-versions) + - [Restore DNS zone version](#restore-dns-zone-version) + - [List DNS zone version records](#list-dns-zone-version-records) +- [DNS Zones management](#dns-zones-management) + - [Clone a DNS zone](#clone-a-dns-zone) + - [Create a DNS zone](#create-a-dns-zone) + - [Delete DNS zone](#delete-dns-zone) + - [Export raw DNS zone](#export-raw-dns-zone) + - [Import raw DNS zone](#import-raw-dns-zone) + - [List DNS zones](#list-dns-zones) + - [Refresh DNS zone](#refresh-dns-zone) + - [Update a DNS zone](#update-a-dns-zone) + + +## TLS certificate management + +TLS certificate management. + + +### Create or return the zone TLS certificate + +Create or return the zone TLS certificate. + +**Usage:** + +``` +scw dns certificate create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | | +| alternative-dns-zones.{index} | | | + + + +### Delete an TLS certificate + +Delete an TLS certificate. + +**Usage:** + +``` +scw dns certificate delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | | + + + +### Get the zone TLS certificate if it exists + +Get the zone TLS certificate if it exists. + +**Usage:** + +``` +scw dns certificate get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | | + + + +### List all user TLS certificates + +List all user TLS certificates. + +**Usage:** + +``` +scw dns certificate list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | | +| project-id | | | + + + +## DNS records management + +DNS records management. + + +### Add a new DNS record + + + +**Usage:** + +``` +scw dns record add [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | DNS zone in which to add the record | +| data | Required | | +| name | | | +| priority | | | +| ttl | Required
Default: `300` | | +| type | Required
One of: `A`, `AAAA`, `CNAME`, `TXT`, `SRV`, `TLSA`, `MX`, `NS`, `PTR`, `CAA`, `ALIAS` | | +| comment | | | +| geo-ip-config.matches.{index}.countries.{index} | | | +| geo-ip-config.matches.{index}.continents.{index} | | | +| geo-ip-config.matches.{index}.data | | | +| geo-ip-config.default | | | +| http-service-config.ips.{index} | | | +| http-service-config.must-contain | | | +| http-service-config.url | | | +| http-service-config.user-agent | | | +| http-service-config.strategy | One of: `random`, `hashed` | | +| weighted-config.weighted-ips.{index}.ip | | | +| weighted-config.weighted-ips.{index}.weight | | | +| view-config.views.{index}.subnet | | | +| view-config.views.{index}.data | | | + + + +### Update DNS zone records + +Only available with default NS.
+Send a list of actions and records. + +Action can be: + - add: + - Add new record + - Can be more specific and add a new IP to an existing A record for example + - set: + - Edit a record + - Can be more specific and edit an IP from an existing A record for example + - delete: + - Delete a record + - Can be more specific and delete an IP from an existing A record for example + - clear: + - Delete all records from a DNS zone + +All edits will be versioned. + + +**Usage:** + +``` +scw dns record bulk-update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | The DNS zone where the DNS zone records will be updated | +| changes.{index}.add.records.{index}.data | | | +| changes.{index}.add.records.{index}.name | | | +| changes.{index}.add.records.{index}.priority | | | +| changes.{index}.add.records.{index}.ttl | | | +| changes.{index}.add.records.{index}.type | One of: `unknown`, `A`, `AAAA`, `CNAME`, `TXT`, `SRV`, `TLSA`, `MX`, `NS`, `PTR`, `CAA`, `ALIAS` | | +| changes.{index}.add.records.{index}.comment | | | +| changes.{index}.add.records.{index}.geo-ip-config.matches.{index}.countries.{index} | | | +| changes.{index}.add.records.{index}.geo-ip-config.matches.{index}.continents.{index} | | | +| changes.{index}.add.records.{index}.geo-ip-config.matches.{index}.data | | | +| changes.{index}.add.records.{index}.geo-ip-config.default | | | +| changes.{index}.add.records.{index}.http-service-config.ips.{index} | | | +| changes.{index}.add.records.{index}.http-service-config.must-contain | | | +| changes.{index}.add.records.{index}.http-service-config.url | | | +| changes.{index}.add.records.{index}.http-service-config.user-agent | | | +| changes.{index}.add.records.{index}.http-service-config.strategy | One of: `random`, `hashed` | | +| changes.{index}.add.records.{index}.weighted-config.weighted-ips.{index}.ip | | | +| changes.{index}.add.records.{index}.weighted-config.weighted-ips.{index}.weight | | | +| changes.{index}.add.records.{index}.view-config.views.{index}.subnet | | | +| changes.{index}.add.records.{index}.view-config.views.{index}.data | | | +| changes.{index}.add.records.{index}.id | | | +| changes.{index}.set.id | | | +| changes.{index}.set.id-fields.name | | | +| changes.{index}.set.id-fields.type | One of: `unknown`, `A`, `AAAA`, `CNAME`, `TXT`, `SRV`, `TLSA`, `MX`, `NS`, `PTR`, `CAA`, `ALIAS` | | +| changes.{index}.set.id-fields.data | | | +| changes.{index}.set.id-fields.ttl | | | +| changes.{index}.set.records.{index}.data | | | +| changes.{index}.set.records.{index}.name | | | +| changes.{index}.set.records.{index}.priority | | | +| changes.{index}.set.records.{index}.ttl | | | +| changes.{index}.set.records.{index}.type | One of: `unknown`, `A`, `AAAA`, `CNAME`, `TXT`, `SRV`, `TLSA`, `MX`, `NS`, `PTR`, `CAA`, `ALIAS` | | +| changes.{index}.set.records.{index}.comment | | | +| changes.{index}.set.records.{index}.geo-ip-config.matches.{index}.countries.{index} | | | +| changes.{index}.set.records.{index}.geo-ip-config.matches.{index}.continents.{index} | | | +| changes.{index}.set.records.{index}.geo-ip-config.matches.{index}.data | | | +| changes.{index}.set.records.{index}.geo-ip-config.default | | | +| changes.{index}.set.records.{index}.http-service-config.ips.{index} | | | +| changes.{index}.set.records.{index}.http-service-config.must-contain | | | +| changes.{index}.set.records.{index}.http-service-config.url | | | +| changes.{index}.set.records.{index}.http-service-config.user-agent | | | +| changes.{index}.set.records.{index}.http-service-config.strategy | One of: `random`, `hashed` | | +| changes.{index}.set.records.{index}.weighted-config.weighted-ips.{index}.ip | | | +| changes.{index}.set.records.{index}.weighted-config.weighted-ips.{index}.weight | | | +| changes.{index}.set.records.{index}.view-config.views.{index}.subnet | | | +| changes.{index}.set.records.{index}.view-config.views.{index}.data | | | +| changes.{index}.set.records.{index}.id | | | +| changes.{index}.delete.id | | | +| changes.{index}.delete.id-fields.name | | | +| changes.{index}.delete.id-fields.type | One of: `unknown`, `A`, `AAAA`, `CNAME`, `TXT`, `SRV`, `TLSA`, `MX`, `NS`, `PTR`, `CAA`, `ALIAS` | | +| changes.{index}.delete.id-fields.data | | | +| changes.{index}.delete.id-fields.ttl | | | +| return-all-records | | Whether or not to return all the records | + + + +### Clear DNS zone records + +Only available with default NS.
+Delete all the records from a DNS zone. +All edits will be versioned. + + +**Usage:** + +``` +scw dns record clear [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | The DNS zone to clear | + + + +### Delete a DNS record + + + +**Usage:** + +``` +scw dns record delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | DNS zone in which to delete the record | +| data | | | +| name | | | +| ttl | | | +| type | Required
One of: `A`, `AAAA`, `CNAME`, `TXT`, `SRV`, `TLSA`, `MX`, `NS`, `PTR`, `CAA`, `ALIAS` | | + + + +### List DNS zone records + +Returns a list of DNS records of a DNS zone with default NS. +You can filter the records by type and name. + + +**Usage:** + +``` +scw dns record list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | The project ID on which to filter the returned DNS zone records | +| order-by | One of: `name_asc`, `name_desc` | The sort order of the returned DNS zone records | +| dns-zone | Required | The DNS zone on which to filter the returned DNS zone records | +| name | | The name on which to filter the returned DNS zone records | +| type | One of: `unknown`, `A`, `AAAA`, `CNAME`, `TXT`, `SRV`, `TLSA`, `MX`, `NS`, `PTR`, `CAA`, `ALIAS` | The record type on which to filter the returned DNS zone records | + + + +### List DNS zone nameservers + +Returns a list of Nameservers and their optional glue records for a DNS zone. + +**Usage:** + +``` +scw dns record list-nameservers [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | The project ID on which to filter the returned DNS zone nameservers | +| dns-zone | Required | The DNS zone on which to filter the returned DNS zone nameservers | + + + +### Clear and set a DNS record + +This command will clear all the data for this record, replacing it with the given data. + +**Usage:** + +``` +scw dns record set [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | DNS zone in which to set the record | +| data.{index} | Required | | +| name | | | +| priority | | | +| ttl | Required
Default: `300` | | +| type | Required
One of: `A`, `AAAA`, `CNAME`, `TXT`, `SRV`, `TLSA`, `MX`, `NS`, `PTR`, `CAA`, `ALIAS` | | +| comment | | | +| geo-ip-config.matches.{index}.countries.{index} | | | +| geo-ip-config.matches.{index}.continents.{index} | | | +| geo-ip-config.matches.{index}.data | | | +| geo-ip-config.default | | | +| http-service-config.ips.{index} | | | +| http-service-config.must-contain | | | +| http-service-config.url | | | +| http-service-config.user-agent | | | +| http-service-config.strategy | One of: `random`, `hashed` | | +| weighted-config.weighted-ips.{index}.ip | | | +| weighted-config.weighted-ips.{index}.weight | | | +| view-config.views.{index}.subnet | | | +| view-config.views.{index}.data | | | + + + +### Update DNS zone nameservers + +Update DNS zone nameservers and set optional glue records. + +**Usage:** + +``` +scw dns record update-nameservers [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | The DNS zone where the DNS zone nameservers will be updated | +| ns.{index}.name | | | +| ns.{index}.ip.{index} | | | + + + +## Transaction SIGnature key management + +Transaction SIGnature key management. + + +### Delete the DNS zone TSIG Key + +Delete the DNS zone TSIG Key. + +**Usage:** + +``` +scw dns tsig-key delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | | + + + +### Get the DNS zone TSIG Key + +Get the DNS zone TSIG Key to allow AXFR request. + +**Usage:** + +``` +scw dns tsig-key get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | | + + + +## DNS zones version management + +DNS zones version management. + + +### Get DNS zone version diff + +Get all differences from a previous DNS zone version. + +**Usage:** + +``` +scw dns version diff [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone-version-id | Required | | + + + +### List DNS zone versions + +Get a list of DNS zone versions.
+The maximum version count is 100.
+If the count reaches this limit, the oldest version will be deleted after each new modification. + + +**Usage:** + +``` +scw dns version list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | | + + + +### Restore DNS zone version + +Restore and activate a previous DNS zone version. + +**Usage:** + +``` +scw dns version restore [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone-version-id | Required | | + + + +### List DNS zone version records + +Get a list of records from a previous DNS zone version. + +**Usage:** + +``` +scw dns version show [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone-version-id | Required | | + + + +## DNS Zones management + +DNS Zones management. + + +### Clone a DNS zone + +Clone an existed DNS zone with all its records into a new one. + +**Usage:** + +``` +scw dns zone clone [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | The DNS zone to clone | +| dest-dns-zone | Required | The destinaton DNS zone | +| overwrite | | Whether or not the destination DNS zone will be overwritten | +| project-id | | The project ID of the destination DNS zone | + + + +### Create a DNS zone + +Create a new DNS zone. + +**Usage:** + +``` +scw dns zone create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| domain | Required | The domain of the DNS zone to create | +| subdomain | Required | The subdomain of the DNS zone to create | +| project-id | | Project ID to use. If none is passed the default project ID will be used | + + + +### Delete DNS zone + +Delete a DNS zone and all it's records. + +**Usage:** + +``` +scw dns zone delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | The DNS zone to delete | +| project-id | | Project ID to use. If none is passed the default project ID will be used | + + + +### Export raw DNS zone + +Get a DNS zone in a given format with default NS. + +**Usage:** + +``` +scw dns zone export [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | The DNS zone to export | +| format | Default: `bind`
One of: `unknown_raw_format`, `bind` | Format for DNS zone | + + + +### Import raw DNS zone + +Import and replace records from a given provider format with default NS. + +**Usage:** + +``` +scw dns zone import [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | The DNS zone to import | +| content | | | +| project-id | | Project ID to use. If none is passed the default project ID will be used | +| format | One of: `unknown_raw_format`, `bind` | | + + + +### List DNS zones + +Returns a list of manageable DNS zones. +You can filter the DNS zones by domain name. + + +**Usage:** + +``` +scw dns zone list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | The project ID on which to filter the returned DNS zones | +| order-by | One of: `domain_asc`, `domain_desc`, `subdomain_asc`, `subdomain_desc` | The sort order of the returned DNS zones | +| domain | | The domain on which to filter the returned DNS zones | +| dns-zone | | The DNS zone on which to filter the returned DNS zones | +| organization-id | | The organization ID on which to filter the returned DNS zones | + + + +### Refresh DNS zone + +Refresh SOA DNS zone. +You can recreate the given DNS zone and its sub DNS zone if needed. + + +**Usage:** + +``` +scw dns zone refresh [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | The DNS zone to refresh | +| recreate-dns-zone | | Whether or not to recreate the DNS zone | +| recreate-sub-dns-zone | | Whether or not to recreate the sub DNS zone | + + + +### Update a DNS zone + +Update the name and/or the organizations for a DNS zone. + +**Usage:** + +``` +scw dns zone update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| dns-zone | Required | The DNS zone to update | +| new-dns-zone | Required | The new DNS zone | +| project-id | | Project ID to use. If none is passed the default project ID will be used | + + + diff --git a/docs/commands/init.md b/docs/commands/init.md index bc2f6c2d16..5a7109bbc9 100644 --- a/docs/commands/init.md +++ b/docs/commands/init.md @@ -1,6 +1,12 @@ # Documentation for `scw init` -Initialize the active profile of the config located in /Users/sieben/.config/scw/config.yaml +Initialize the active profile of the config. +Default path for configuration file is based on the following priority order: + +- $SCW_CONFIG_PATH +- $XDG_CONFIG_HOME/scw/config.yaml +- $HOME/.config/scw/config.yaml +- $USERPROFILE/.config/scw/config.yaml diff --git a/docs/commands/instance.md b/docs/commands/instance.md index 554bf3a981..2790c7d5ed 100644 --- a/docs/commands/instance.md +++ b/docs/commands/instance.md @@ -1629,6 +1629,7 @@ scw instance server update [arg=value ...] | private-nics.{index}.server-id | | The server the private NIC is attached to | | private-nics.{index}.private-network-id | | The private network where the private NIC is attached | | private-nics.{index}.mac-address | | The private NIC MAC address | +| private-nics.{index}.state | One of: `available`, `syncing`, `syncing_error` | The private NIC state | | 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 | diff --git a/docs/commands/iot.md b/docs/commands/iot.md index 270fe6271e..efac5e3def 100644 --- a/docs/commands/iot.md +++ b/docs/commands/iot.md @@ -8,9 +8,11 @@ This API allows you to manage IoT hubs and devices - [Disable a device](#disable-a-device) - [Enable a device](#enable-a-device) - [Get a device](#get-a-device) + - [Get a device's certificate](#get-a-device's-certificate) - [Get a device's metrics](#get-a-device's-metrics) - [List devices](#list-devices) - [Renew a device certificate](#renew-a-device-certificate) + - [Set a custom certificate on a device](#set-a-custom-certificate-on-a-device) - [Update a device](#update-a-device) - [IoT Hub commands](#iot-hub-commands) - [Create a hub](#create-a-hub) @@ -18,6 +20,7 @@ This API allows you to manage IoT hubs and devices - [Disable a hub](#disable-a-hub) - [Enable a hub](#enable-a-hub) - [Get a hub](#get-a-hub) + - [Get the certificate authority of a hub](#get-the-certificate-authority-of-a-hub) - [List hubs](#list-hubs) - [Set the certificate authority of a hub](#set-the-certificate-authority-of-a-hub) - [Update a hub](#update-a-hub) @@ -31,6 +34,7 @@ This API allows you to manage IoT hubs and devices - [Delete a route](#delete-a-route) - [Get a route](#get-a-route) - [List routes](#list-routes) + - [Update a route](#update-a-route) ## IoT Device commands @@ -146,6 +150,26 @@ scw iot device get [arg=value ...] +### Get a device's certificate + +Get a device's certificate. + +**Usage:** + +``` +scw iot device get-certificate [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| device-id | Required | Device ID | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + ### Get a device's metrics Get a device's metrics. @@ -211,6 +235,27 @@ scw iot device renew-certificate [arg=value ...] +### Set a custom certificate on a device + +Set a custom certificate on a device. + +**Usage:** + +``` +scw iot device set-certificate [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| device-id | Required | Device ID | +| certificate-pem | Required | The PEM-encoded custom certificate | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + ### Update a device Update a device. @@ -349,6 +394,26 @@ scw iot hub get [arg=value ...] +### Get the certificate authority of a hub + +Get the certificate authority of a hub. + +**Usage:** + +``` +scw iot hub get-ca [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| hub-id | Required | | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + ### List hubs List hubs. @@ -540,7 +605,7 @@ scw iot route create [arg=value ...] | Name | | Description | |------|---|-------------| -| name | | Route name | +| name | Default: `` | Route name | | hub-id | | ID of the route's hub | | topic | | Topic the route subscribes to. It must be a valid MQTT topic and up to 65535 characters | | s3-config.bucket-region | | | @@ -553,6 +618,7 @@ scw iot route create [arg=value ...] | db-config.username | | | | db-config.password | | | | db-config.query | | | +| db-config.engine | One of: `unknown`, `postgresql`, `mysql` | | | rest-config.verb | One of: `unknown`, `get`, `post`, `put`, `patch`, `delete` | | | rest-config.uri | | | | rest-config.headers.{key} | | | @@ -622,3 +688,39 @@ scw iot route list [arg=value ...] +### Update a route + +Update a route. + +**Usage:** + +``` +scw iot route update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| route-id | Required | Route id | +| name | | Route name | +| topic | | Topic the route subscribes to. It must be a valid MQTT topic and up to 65535 characters | +| s3-config.bucket-region | | | +| s3-config.bucket-name | | | +| s3-config.object-prefix | | | +| s3-config.strategy | One of: `unknown`, `per_topic`, `per_message` | | +| db-config.host | | | +| db-config.port | | | +| db-config.dbname | | | +| db-config.username | | | +| db-config.password | | | +| db-config.query | | | +| db-config.engine | One of: `unknown`, `postgresql`, `mysql` | | +| rest-config.verb | One of: `unknown`, `get`, `post`, `put`, `patch`, `delete` | | +| rest-config.uri | | | +| rest-config.headers.value.{key} | | | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + diff --git a/docs/commands/k8s.md b/docs/commands/k8s.md index 2af15ed850..c3d764c667 100644 --- a/docs/commands/k8s.md +++ b/docs/commands/k8s.md @@ -64,7 +64,7 @@ scw k8s cluster create [arg=value ...] | tags.{index} | | The tags associated with the cluster | | version | Required
Default: `latest` | The Kubernetes version of the cluster | | cni | Required
Default: `cilium`
One of: `unknown_cni`, `cilium`, `calico`, `weave`, `flannel` | The Container Network Interface (CNI) plugin that will run in the cluster | -| enable-dashboard | | The enablement of the Kubernetes Dashboard in the cluster | +| ~~enable-dashboard~~ | Deprecated | The enablement of the Kubernetes Dashboard in the cluster | | ingress | One of: `unknown_ingress`, `none`, `nginx`, `traefik`, `traefik2` | The Ingress Controller that will run in the cluster | | pools.{index}.name | Required | The name of the pool | | pools.{index}.node-type | Required | The node type is the type of Scaleway Instance wanted for the pool | @@ -317,7 +317,7 @@ scw k8s cluster update [arg=value ...] | autoscaler-config.scale-down-unneeded-time | | How long a node should be unneeded before it is eligible for scale down | | autoscaler-config.scale-down-utilization-threshold | | Node utilization level, defined as sum of requested resources divided by capacity, below which a node can be considered for scale down | | autoscaler-config.max-graceful-termination-sec | | Maximum number of seconds the cluster autoscaler waits for pod termination when trying to scale down a node | -| enable-dashboard | | The new value of the Kubernetes Dashboard enablement | +| ~~enable-dashboard~~ | Deprecated | The new value of the Kubernetes Dashboard enablement | | ingress | One of: `unknown_ingress`, `none`, `nginx`, `traefik`, `traefik2` | The new Ingress Controller for the cluster | | auto-upgrade.enable | | Whether or not auto upgrade is enabled for the cluster | | auto-upgrade.maintenance-window.start-hour | | The start hour of the 2-hour maintenance window | diff --git a/docs/commands/lb.md b/docs/commands/lb.md index 3af77d3598..655ab91af2 100644 --- a/docs/commands/lb.md +++ b/docs/commands/lb.md @@ -77,7 +77,7 @@ scw lb acl create [arg=value ...] | match.http-filter-value.{index} | | A list of possible values to match for the given HTTP 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) | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -97,7 +97,7 @@ scw lb acl delete [arg=value ...] | Name | | Description | |------|---|-------------| | acl-id | Required | ID of your ACL ressource | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -117,7 +117,7 @@ scw lb acl get [arg=value ...] | Name | | Description | |------|---|-------------| | acl-id | Required | ID of your ACL ressource | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -139,7 +139,7 @@ scw lb acl list [arg=value ...] | 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 | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -166,7 +166,7 @@ scw lb acl update [arg=value ...] | match.http-filter-value.{index} | | A list of possible values to match for the given HTTP 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) | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -192,7 +192,7 @@ scw lb backend add-servers [arg=value ...] |------|---|-------------| | backend-id | Required | Backend ID | | server-ip.{index} | Required | Set all IPs to add on your backend | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -238,7 +238,7 @@ scw lb backend create [arg=value ...] | 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) | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -258,7 +258,7 @@ scw lb backend delete [arg=value ...] | Name | | Description | |------|---|-------------| | backend-id | Required | ID of the backend to delete | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -278,7 +278,7 @@ scw lb backend get [arg=value ...] | Name | | Description | |------|---|-------------| | backend-id | Required | Backend ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -300,7 +300,7 @@ scw lb backend list [arg=value ...] | 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 | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -321,7 +321,7 @@ scw lb backend remove-servers [arg=value ...] |------|---|-------------| | backend-id | Required | Backend ID | | server-ip.{index} | Required | Set all IPs to remove of your backend | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -342,7 +342,7 @@ scw lb backend set-servers [arg=value ...] |------|---|-------------| | backend-id | Required | Backend ID | | server-ip.{index} | Required | Set all IPs to add on your backend and remove all other | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -374,7 +374,7 @@ scw lb backend update [arg=value ...] | 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` | | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -407,7 +407,7 @@ scw lb backend update-healthcheck [arg=value ...] | https-config.method | | | | https-config.code | | | | check-send-proxy | | It defines whether the healthcheck should be done considering the proxy protocol | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -436,7 +436,7 @@ scw lb certificate create [arg=value ...] | 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. | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -456,7 +456,7 @@ scw lb certificate delete [arg=value ...] | Name | | Description | |------|---|-------------| | certificate-id | Required | Certificate ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -476,7 +476,7 @@ scw lb certificate get [arg=value ...] | Name | | Description | |------|---|-------------| | certificate-id | Required | Certificate ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -498,7 +498,7 @@ scw lb certificate list [arg=value ...] | 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 | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -519,7 +519,7 @@ scw lb certificate update [arg=value ...] |------|---|-------------| | certificate-id | Required | Certificate ID | | name | Required | Certificate name | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -550,7 +550,7 @@ scw lb frontend create [arg=value ...] | 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 | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -570,7 +570,7 @@ scw lb frontend delete [arg=value ...] | Name | | Description | |------|---|-------------| | frontend-id | Required | Frontend ID to delete | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -590,7 +590,7 @@ scw lb frontend get [arg=value ...] | Name | | Description | |------|---|-------------| | frontend-id | Required | Frontend ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -612,7 +612,7 @@ scw lb frontend list [arg=value ...] | 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 | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -638,7 +638,7 @@ scw lb frontend update [arg=value ...] | 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 | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -665,7 +665,7 @@ scw lb ip create [arg=value ...] | 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 | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -685,7 +685,7 @@ scw lb ip delete [arg=value ...] | Name | | Description | |------|---|-------------| | ip-id | Required | IP address ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -705,7 +705,7 @@ scw lb ip get [arg=value ...] | Name | | Description | |------|---|-------------| | ip-id | Required | IP address ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -727,7 +727,7 @@ scw lb ip list [arg=value ...] | ip-address | | Use this to search by IP address | | project-id | | Filter IPs by project ID | | organization-id | | Filter IPs by organization id | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -748,7 +748,7 @@ scw lb ip update [arg=value ...] |------|---|-------------| | ip-id | Required | IP address ID | | reverse | | Reverse DNS | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -780,7 +780,7 @@ scw lb lb create [arg=value ...] | 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 | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -801,7 +801,7 @@ scw lb lb delete [arg=value ...] |------|---|-------------| | lb-id | Required | Load balancer ID | | release-ip | | Set true if you don't want to keep this IP address | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -821,7 +821,7 @@ scw lb lb get [arg=value ...] | Name | | Description | |------|---|-------------| | lb-id | Required | Load balancer ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -841,7 +841,7 @@ scw lb lb get-stats [arg=value ...] | Name | | Description | |------|---|-------------| | lb-id | Required | Load balancer ID | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -864,7 +864,7 @@ scw lb lb list [arg=value ...] | 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 | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -885,7 +885,7 @@ scw lb lb migrate [arg=value ...] |------|---|-------------| | 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) | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -909,7 +909,7 @@ scw lb lb update [arg=value ...] | 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` | | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | @@ -929,7 +929,7 @@ scw lb lb wait [arg=value ...] | Name | | Description | |------|---|-------------| | lb-id | Required | ID of the load balancer you want to wait for. | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams` | Region to target. If none is passed will use default region from the config | +| 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:** @@ -963,7 +963,7 @@ scw lb lb-types list [arg=value ...] | Name | | Description | |------|---|-------------| -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `nl-ams-1`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | diff --git a/docs/commands/rdb.md b/docs/commands/rdb.md index 46cffc3f92..c399c5cc75 100644 --- a/docs/commands/rdb.md +++ b/docs/commands/rdb.md @@ -42,6 +42,13 @@ Database RDB API - [User privileges management commands](#user-privileges-management-commands) - [List privileges of a given user for a given database on a given instance](#list-privileges-of-a-given-user-for-a-given-database-on-a-given-instance) - [Set privileges of a given user for a given database on a given instance](#set-privileges-of-a-given-user-for-a-given-database-on-a-given-instance) +- [Block snapshot management](#block-snapshot-management) + - [Create an instance snapshot](#create-an-instance-snapshot) + - [Delete an instance snapshot](#delete-an-instance-snapshot) + - [Get an instance snapshot](#get-an-instance-snapshot) + - [List instance snapshots](#list-instance-snapshots) + - [Create a new instance from a given snapshot](#create-a-new-instance-from-a-given-snapshot) + - [Update an instance snapshot](#update-an-instance-snapshot) - [User management commands](#user-management-commands) - [Create a user on a given instance](#create-a-user-on-a-given-instance) - [Delete a user on a given instance](#delete-a-user-on-a-given-instance) @@ -645,6 +652,7 @@ scw rdb instance upgrade [arg=value ...] | node-type | One of: `DB-DEV-S`, `DB-DEV-M`, `DB-DEV-L`, `DB-DEV-XL`, `DB-GP-XS`, `DB-GP-S`, `DB-GP-M`, `DB-GP-L`, `DB-GP-XL` | Node type of the instance you want to upgrade to | | enable-ha | | Set to true to enable high availability on your instance | | volume-size | | Increase your block storage volume size | +| volume-type | One of: `lssd`, `bssd` | Change your instance storage type | | region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | @@ -825,6 +833,143 @@ scw rdb privilege set [arg=value ...] +## Block snapshot management + +Create, restore and manage block snapshot + + + +### Create an instance snapshot + +Create an instance snapshot. + +**Usage:** + +``` +scw rdb snapshot create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| instance-id | Required | UUID of the instance | +| name | Required
Default: `` | Name of the snapshot | +| expires-at | | Expiration date (Format ISO 8601) | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Delete an instance snapshot + +Delete an instance snapshot. + +**Usage:** + +``` +scw rdb snapshot delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| snapshot-id | Required | UUID of the snapshot to delete | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Get an instance snapshot + +Get an instance snapshot. + +**Usage:** + +``` +scw rdb snapshot get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| snapshot-id | Required | UUID of the snapshot | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### List instance snapshots + +List instance snapshots. + +**Usage:** + +``` +scw rdb snapshot list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| name | | Name of the snapshot | +| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc`, `expires_at_asc`, `expires_at_desc` | Criteria to use when ordering snapshot listing | +| instance-id | | UUID of the instance | +| project-id | | Project ID the snapshots belongs to | +| organization-id | | Organization ID the snapshots belongs to | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Create a new instance from a given snapshot + +Create a new instance from a given snapshot. + +**Usage:** + +``` +scw rdb snapshot restore [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| snapshot-id | Required | Block snapshot of the instance | +| instance-name | | Name of the instance created with the snapshot | +| is-ha-cluster | | Whether or not High-Availability is enabled on the new instance | +| node-type | | The node type used to restore the snapshot | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + +### Update an instance snapshot + +Update an instance snapshot. + +**Usage:** + +``` +scw rdb snapshot update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| snapshot-id | Required | UUID of the snapshot to update | +| name | | Name of the snapshot | +| expires-at | | Expiration date (Format ISO 8601) | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw` | Region to target. If none is passed will use default region from the config | + + + ## User management commands Manage users on your instance diff --git a/internal/namespaces/config/commands.go b/internal/namespaces/config/commands.go index 4553917eef..6fdd9bbeaa 100644 --- a/internal/namespaces/config/commands.go +++ b/internal/namespaces/config/commands.go @@ -55,8 +55,12 @@ func configRoot() *core.Command { Short: `Config file management`, Long: interactive.RemoveIndent(` Config management engine is common across all Scaleway developer tools (CLI, terraform, SDK, ... ). It allows to handle Scaleway config through two ways: environment variables and/or config file. + Default path for configuration file is based on the following priority order: - Scaleway config file is self-documented. We recommend you to have a look at it at least once before using Scaleway developer tools: ` + terminal.Style(configPath, color.Bold, color.FgBlue) + ` + - $SCW_CONFIG_PATH + - $XDG_CONFIG_HOME/scw/config.yaml + - $HOME/.config/scw/config.yaml + - $USERPROFILE/.config/scw/config.yaml In this CLI, ` + terminal.Style(`environment variables have priority over the configuration file`, color.Bold) + `. @@ -106,7 +110,7 @@ func configGetCommand() *core.Command { ArgSpecs: core.ArgSpecs{ { Name: "key", - Short: "the key to get from the configt", + Short: "the key to get from the config", Required: true, EnumValues: getProfileKeys(), Positional: true, diff --git a/internal/namespaces/init/init.go b/internal/namespaces/init/init.go index c0fd1c1e05..52bf2ac018 100644 --- a/internal/namespaces/init/init.go +++ b/internal/namespaces/init/init.go @@ -71,8 +71,14 @@ type initArgs struct { func initCommand() *core.Command { return &core.Command{ - Short: `Initialize the config`, - Long: `Initialize the active profile of the config located in ` + scw.GetConfigPath(), + Short: `Initialize the config`, + Long: `Initialize the active profile of the config. +Default path for configuration file is based on the following priority order: + +- $SCW_CONFIG_PATH +- $XDG_CONFIG_HOME/scw/config.yaml +- $HOME/.config/scw/config.yaml +- $USERPROFILE/.config/scw/config.yaml`, Namespace: "init", AllowAnonymousClient: true, ArgsType: reflect.TypeOf(initArgs{}),