From 9b1305f11b7a19188b7b9d8212d64e5a92389991 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 25 Oct 2022 14:20:44 +0200 Subject: [PATCH 1/3] feat: update generated APIs --- ...-all-usage-redis-cluster-list-usage.golden | 1 + docs/commands/redis.md | 1 + docs/commands/tem.md | 256 ++++++++++++++++++ go.mod | 2 +- go.sum | 4 +- internal/namespaces/redis/v1/redis_cli.go | 7 + 6 files changed, 268 insertions(+), 3 deletions(-) create mode 100644 docs/commands/tem.md diff --git a/cmd/scw/testdata/test-all-usage-redis-cluster-list-usage.golden b/cmd/scw/testdata/test-all-usage-redis-cluster-list-usage.golden index 145de035e8..ac201f3d74 100644 --- a/cmd/scw/testdata/test-all-usage-redis-cluster-list-usage.golden +++ b/cmd/scw/testdata/test-all-usage-redis-cluster-list-usage.golden @@ -10,6 +10,7 @@ ARGS: [name] Name of the clusters to filter upon [order-by] Criteria to use when ordering cluster listing (created_at_asc | created_at_desc | name_asc | name_desc) [project-id] Project ID to list the cluster of + [version] Version of the clusters to filter upon [organization-id] Organization ID to list the cluster of [zone=fr-par-1] Zone to target. If none is passed will use default zone from the config (fr-par-1 | fr-par-2 | nl-ams-1 | nl-ams-2 | pl-waw-1) diff --git a/docs/commands/redis.md b/docs/commands/redis.md index 2cbe9117f3..cc1547fa28 100644 --- a/docs/commands/redis.md +++ b/docs/commands/redis.md @@ -241,6 +241,7 @@ scw redis cluster list [arg=value ...] | name | | Name of the clusters to filter upon | | order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc` | Criteria to use when ordering cluster listing | | project-id | | Project ID to list the cluster of | +| version | | Version of the clusters to filter upon | | organization-id | | Organization ID to list the cluster of | | zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1` | Zone to target. If none is passed will use default zone from the config | diff --git a/docs/commands/tem.md b/docs/commands/tem.md new file mode 100644 index 0000000000..3e6888a66e --- /dev/null +++ b/docs/commands/tem.md @@ -0,0 +1,256 @@ + +# Documentation for `scw tem` +Tem + +- [Domain management commands](#domain-management-commands) + - [Ask for an immediate check of a domain (DNS check)](#ask-for-an-immediate-check-of-a-domain-(dns-check)) + - [Register a domain in a project](#register-a-domain-in-a-project) + - [Get information about a domain](#get-information-about-a-domain) + - [List domains in a project and/or in an organization](#list-domains-in-a-project-andor-in-an-organization) + - [Revoke a domain](#revoke-a-domain) +- [Email management commands](#email-management-commands) + - [Try to cancel an email if it has not yet been sent](#try-to-cancel-an-email-if-it-has-not-yet-been-sent) + - [Send an email](#send-an-email) + - [Get information about an email](#get-information-about-an-email) + - [Get statistics on the email statuses](#get-statistics-on-the-email-statuses) + - [List emails sent from a domain and/or for a project and/or for an organization](#list-emails-sent-from-a-domain-andor-for-a-project-andor-for-an-organization) + + +## Domain management commands + +Domain management commands. + + +### Ask for an immediate check of a domain (DNS check) + +Ask for an immediate check of a domain (DNS check). + +**Usage:** + +``` +scw tem domain check [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| domain-id | Required | ID of the domain to check | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### Register a domain in a project + +Register a domain in a project. + +**Usage:** + +``` +scw tem domain create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | +| domain-name | | | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### Get information about a domain + +Get information about a domain. + +**Usage:** + +``` +scw tem domain get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| domain-id | Required | ID of the domain | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### List domains in a project and/or in an organization + +List domains in a project and/or in an organization. + +**Usage:** + +``` +scw tem domain list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | | +| status.{index} | One of: `unknown`, `checked`, `unchecked`, `invalid`, `locked`, `revoked`, `pending` | | +| organization-id | | | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### Revoke a domain + +Revoke a domain. + +**Usage:** + +``` +scw tem domain revoke [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| domain-id | Required | ID of the domain to revoke | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +## Email management commands + +Email management commands. + + +### Try to cancel an email if it has not yet been sent + +Try to cancel an email if it has not yet been sent. + +**Usage:** + +``` +scw tem email cancel [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| email-id | Required | ID of the email to cancel | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### Send an email + +Send an email. + +**Usage:** + +``` +scw tem email create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| from.email | | Email address | +| from.name | | Optional display name | +| to.{index}.email | | Email address | +| to.{index}.name | | Optional display name | +| cc.{index}.email | | Email address | +| cc.{index}.name | | Optional display name | +| bcc.{index}.email | | Email address | +| bcc.{index}.name | | Optional display name | +| subject | | Message subject | +| text | | Text content | +| html | | HTML content | +| project-id | | Project ID to use. If none is passed the default project ID will be used | +| attachments.{index}.name | | Filename of the attachment | +| attachments.{index}.type | | MIME type of the attachment (Currently only allow, text files, pdf and html files) | +| attachments.{index}.content | | Content of the attachment, encoded in base64 | +| send-before | | Maximum date to deliver mail | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### Get information about an email + +Get information about an email. + +**Usage:** + +``` +scw tem email get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| email-id | Required | ID of the email to retrieve | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### Get statistics on the email statuses + +Get statistics on the email statuses. + +**Usage:** + +``` +scw tem email get-statistics [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Optional, count emails for this project | +| domain-id | | Optional, count emails send from this domain (must be coherent with the `project_id` and the `organization_id`) | +| since | | Optional, count emails created after this date | +| until | | Optional, count emails created before this date | +| mail-from | | Optional, count emails sent with this `mail_from` sender's address | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### List emails sent from a domain and/or for a project and/or for an organization + +List emails sent from a domain and/or for a project and/or for an organization. + +**Usage:** + +``` +scw tem email list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Optional ID of the project in which to list the emails | +| domain-id | | Optional ID of the domain for which to list the emails | +| since | | Optional, list emails created after this date | +| until | | Optional, list emails created before this date | +| mail-from | | Optional, list emails sent with this `mail_from` sender's address | +| mail-to | | Optional, list emails sent with this `mail_to` recipient's address | +| statuses.{index} | One of: `unknown`, `new`, `sending`, `sent`, `failed`, `canceled` | Optional, list emails having any of this status | +| 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/go.mod b/go.mod index 2816dfab1a..527b5a5d68 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/kubernetes-client/go-base v0.0.0-20190205182333-3d0e39759d98 github.com/mattn/go-colorable v0.1.13 github.com/mattn/go-isatty v0.0.16 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021090213-af5c083146b1 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021141608-46b0ab7eac06 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 diff --git a/go.sum b/go.sum index e501900060..63b178f017 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,8 @@ github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021090213-af5c083146b1 h1:iIJOeHT9KHf8gqt8iFVPuPBkIQddUket5AyFdfrv0Jg= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021090213-af5c083146b1/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021141608-46b0ab7eac06 h1:ecojqdpxlFXMtyIsbHJ44JNi//2GDEcL1D0ZGboU9h4= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021141608-46b0ab7eac06/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= diff --git a/internal/namespaces/redis/v1/redis_cli.go b/internal/namespaces/redis/v1/redis_cli.go index a2c2ac9a74..d3bdade3bc 100644 --- a/internal/namespaces/redis/v1/redis_cli.go +++ b/internal/namespaces/redis/v1/redis_cli.go @@ -367,6 +367,13 @@ func redisClusterList() *core.Command { Deprecated: false, Positional: false, }, + { + Name: "version", + Short: `Version of the clusters to filter upon`, + Required: false, + Deprecated: false, + Positional: false, + }, { Name: "organization-id", Short: `Organization ID to list the cluster of`, From 9b9c2d2124d2c923617645ef32a2ef80a10f7be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 25 Oct 2022 14:18:47 +0200 Subject: [PATCH 2/3] FIx --- docs/commands/tem.md | 256 ------------------------------------------- 1 file changed, 256 deletions(-) delete mode 100644 docs/commands/tem.md diff --git a/docs/commands/tem.md b/docs/commands/tem.md deleted file mode 100644 index 3e6888a66e..0000000000 --- a/docs/commands/tem.md +++ /dev/null @@ -1,256 +0,0 @@ - -# Documentation for `scw tem` -Tem - -- [Domain management commands](#domain-management-commands) - - [Ask for an immediate check of a domain (DNS check)](#ask-for-an-immediate-check-of-a-domain-(dns-check)) - - [Register a domain in a project](#register-a-domain-in-a-project) - - [Get information about a domain](#get-information-about-a-domain) - - [List domains in a project and/or in an organization](#list-domains-in-a-project-andor-in-an-organization) - - [Revoke a domain](#revoke-a-domain) -- [Email management commands](#email-management-commands) - - [Try to cancel an email if it has not yet been sent](#try-to-cancel-an-email-if-it-has-not-yet-been-sent) - - [Send an email](#send-an-email) - - [Get information about an email](#get-information-about-an-email) - - [Get statistics on the email statuses](#get-statistics-on-the-email-statuses) - - [List emails sent from a domain and/or for a project and/or for an organization](#list-emails-sent-from-a-domain-andor-for-a-project-andor-for-an-organization) - - -## Domain management commands - -Domain management commands. - - -### Ask for an immediate check of a domain (DNS check) - -Ask for an immediate check of a domain (DNS check). - -**Usage:** - -``` -scw tem domain check [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| domain-id | Required | ID of the domain to check | -| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | - - - -### Register a domain in a project - -Register a domain in a project. - -**Usage:** - -``` -scw tem domain create [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| project-id | | Project ID to use. If none is passed the default project ID will be used | -| domain-name | | | -| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | - - - -### Get information about a domain - -Get information about a domain. - -**Usage:** - -``` -scw tem domain get [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| domain-id | Required | ID of the domain | -| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | - - - -### List domains in a project and/or in an organization - -List domains in a project and/or in an organization. - -**Usage:** - -``` -scw tem domain list [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| project-id | | | -| status.{index} | One of: `unknown`, `checked`, `unchecked`, `invalid`, `locked`, `revoked`, `pending` | | -| organization-id | | | -| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | - - - -### Revoke a domain - -Revoke a domain. - -**Usage:** - -``` -scw tem domain revoke [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| domain-id | Required | ID of the domain to revoke | -| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | - - - -## Email management commands - -Email management commands. - - -### Try to cancel an email if it has not yet been sent - -Try to cancel an email if it has not yet been sent. - -**Usage:** - -``` -scw tem email cancel [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| email-id | Required | ID of the email to cancel | -| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | - - - -### Send an email - -Send an email. - -**Usage:** - -``` -scw tem email create [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| from.email | | Email address | -| from.name | | Optional display name | -| to.{index}.email | | Email address | -| to.{index}.name | | Optional display name | -| cc.{index}.email | | Email address | -| cc.{index}.name | | Optional display name | -| bcc.{index}.email | | Email address | -| bcc.{index}.name | | Optional display name | -| subject | | Message subject | -| text | | Text content | -| html | | HTML content | -| project-id | | Project ID to use. If none is passed the default project ID will be used | -| attachments.{index}.name | | Filename of the attachment | -| attachments.{index}.type | | MIME type of the attachment (Currently only allow, text files, pdf and html files) | -| attachments.{index}.content | | Content of the attachment, encoded in base64 | -| send-before | | Maximum date to deliver mail | -| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | - - - -### Get information about an email - -Get information about an email. - -**Usage:** - -``` -scw tem email get [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| email-id | Required | ID of the email to retrieve | -| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | - - - -### Get statistics on the email statuses - -Get statistics on the email statuses. - -**Usage:** - -``` -scw tem email get-statistics [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| project-id | | Optional, count emails for this project | -| domain-id | | Optional, count emails send from this domain (must be coherent with the `project_id` and the `organization_id`) | -| since | | Optional, count emails created after this date | -| until | | Optional, count emails created before this date | -| mail-from | | Optional, count emails sent with this `mail_from` sender's address | -| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | - - - -### List emails sent from a domain and/or for a project and/or for an organization - -List emails sent from a domain and/or for a project and/or for an organization. - -**Usage:** - -``` -scw tem email list [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| project-id | | Optional ID of the project in which to list the emails | -| domain-id | | Optional ID of the domain for which to list the emails | -| since | | Optional, list emails created after this date | -| until | | Optional, list emails created before this date | -| mail-from | | Optional, list emails sent with this `mail_from` sender's address | -| mail-to | | Optional, list emails sent with this `mail_to` recipient's address | -| statuses.{index} | One of: `unknown`, `new`, `sending`, `sent`, `failed`, `canceled` | Optional, list emails having any of this status | -| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | - - - From 20ec93cad38dfe577ce8a1fff372cb4cb770a359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20L=C3=A9one?= Date: Tue, 25 Oct 2022 14:23:05 +0200 Subject: [PATCH 3/3] Fix --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 527b5a5d68..61b39059c5 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/kubernetes-client/go-base v0.0.0-20190205182333-3d0e39759d98 github.com/mattn/go-colorable v0.1.13 github.com/mattn/go-isatty v0.0.16 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021141608-46b0ab7eac06 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221025083458-eee4b9bd7660 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 diff --git a/go.sum b/go.sum index 63b178f017..092924b41b 100644 --- a/go.sum +++ b/go.sum @@ -71,8 +71,8 @@ github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021141608-46b0ab7eac06 h1:ecojqdpxlFXMtyIsbHJ44JNi//2GDEcL1D0ZGboU9h4= -github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221021141608-46b0ab7eac06/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221025083458-eee4b9bd7660 h1:5M5cNSXGDMtxB/hBDwMSkrllHO0iqNCP3irPrrBc7GA= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.9.0.20221025083458-eee4b9bd7660/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=