diff --git a/README.md b/README.md index 2811d570c5..a2db08f02a 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ To enable beta features, you can set `SCW_ENABLE_BETA=1` in your environment. # Reference documentation | Namespace | Description | Documentation | -| -------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +|----------------|-----------------------------------------|-----------------------------------------------------------------------------------------------------------------| | `account` | Account API | [CLI](./docs/commands/account.md) | | `applesilicon` | Apple silicon API | [CLI](./docs/commands/apple-silicon.md) / [API](https://developers.scaleway.com/en/products/apple-silicon/api/) | | `autocomplete` | Autocomplete related commands | [CLI](./docs/commands/autocomplete.md) | @@ -138,6 +138,7 @@ To enable beta features, you can set `SCW_ENABLE_BETA=1` in your environment. | `rdb` | Database RDB API | [CLI](./docs/commands/rdb.md) / [API](https://developers.scaleway.com/en/products/rdb/api/) | | `redis` | Redis API | [CLI](./docs/commands/redis.md) / [API](https://developers.scaleway.com/en/products/redis/api/v1/) | | `registry` | Container registry API | [CLI](./docs/commands/registry.md) / [API](https://developers.scaleway.com/en/products/registry/api/) | +| `secret` | Secret manager API | [CLI](./docs/commands/secret.md) | | `shell` | Start Shell mode | [CLI](./docs/commands/shell.md) | | `tem` | Transactional Email API | [CLI](./docs/commands/tem.md) / [API](https://developers.scaleway.com/en/products/transactional_email/api/) | | `vpc-gw` | VPC Gateway API | [CLI](./docs/commands/vpc-gw.md) / [API](https://developers.scaleway.com/en/products/vpc-gw/api/v1/) | diff --git a/cmd/scw/testdata/test-all-usage-secret-secret-create-usage.golden b/cmd/scw/testdata/test-all-usage-secret-secret-create-usage.golden new file mode 100644 index 0000000000..b9401adb3a --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-secret-create-usage.golden @@ -0,0 +1,26 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a Secret containing no versions. + +USAGE: + scw secret secret create [arg=value ...] + +EXAMPLES: + Add a given secret + scw secret secret create name=foobar description="$(cat )" + +ARGS: + [project-id] Project ID to use. If none is passed the default project ID will be used + [name] Name of the Secret + [tags.{index}] List of tags associated to this Secret + [description] Description of the Secret + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + +FLAGS: + -h, --help help for create + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-secret-delete-usage.golden b/cmd/scw/testdata/test-all-usage-secret-secret-delete-usage.golden new file mode 100644 index 0000000000..b3adbf5f28 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-secret-delete-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete a secret. + +USAGE: + scw secret secret delete [arg=value ...] + +EXAMPLES: + Delete a given secret + scw secret secret delete secret-id=11111111-1111-1111-1111-111111111111 + +ARGS: + secret-id ID of the Secret + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + +FLAGS: + -h, --help help for delete + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-secret-get-usage.golden b/cmd/scw/testdata/test-all-usage-secret-secret-get-usage.golden new file mode 100644 index 0000000000..044becb0b8 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-secret-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Get metadata of a Secret. + +USAGE: + scw secret secret get [arg=value ...] + +ARGS: + secret-id ID of the Secret + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + +FLAGS: + -h, --help help for get + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-secret-list-usage.golden b/cmd/scw/testdata/test-all-usage-secret-secret-list-usage.golden new file mode 100644 index 0000000000..f6726d5673 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-secret-list-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List Secrets. + +USAGE: + scw secret secret list [arg=value ...] + +ARGS: + [project-id] ID of a project to filter on (optional) + [tags.{index}] List of tags to filter on (optional) + [order-by] (name_asc | name_desc | created_at_asc | created_at_desc | updated_at_asc | updated_at_desc) + [organization-id] ID of an organization to filter on (optional) + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all) + +FLAGS: + -h, --help help for list + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-secret-update-usage.golden b/cmd/scw/testdata/test-all-usage-secret-secret-update-usage.golden new file mode 100644 index 0000000000..ceb407ed93 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-secret-update-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update metadata of a Secret. + +USAGE: + scw secret secret update [arg=value ...] + +ARGS: + secret-id ID of the Secret + [name] New name of the Secret (optional) + [tags.{index}] New list of tags associated to this Secret (optional) + [description] Description of the Secret + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + +FLAGS: + -h, --help help for update + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-secret-usage.golden b/cmd/scw/testdata/test-all-usage-secret-secret-usage.golden new file mode 100644 index 0000000000..6e75375414 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-secret-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Logical container made up of zero or more immutable versions, that hold the sensitive data. + +USAGE: + scw secret secret + +AVAILABLE COMMANDS: + create Create a Secret containing no versions + delete Delete a secret + get Get metadata of a Secret + list List Secrets + update Update metadata of a Secret + +FLAGS: + -h, --help help for secret + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw secret secret [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-secret-usage.golden b/cmd/scw/testdata/test-all-usage-secret-usage.golden new file mode 100644 index 0000000000..79fc980945 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +This API allows you to conveniently store, access and share sensitive data + +USAGE: + scw secret + +AVAILABLE COMMANDS: + secret Secret management commands + version Secret Version management commands + +FLAGS: + -h, --help help for secret + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw secret [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-secret-version-access-usage.golden b/cmd/scw/testdata/test-all-usage-secret-version-access-usage.golden new file mode 100644 index 0000000000..7f76dcd3a3 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-version-access-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Access a SecretVersion, returning the sensitive data. + +USAGE: + scw secret version access [arg=value ...] + +ARGS: + secret-id ID of the Secret + revision Revision of the SecretVersion (may be a number or "latest") + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + +FLAGS: + -h, --help help for access + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-version-create-usage.golden b/cmd/scw/testdata/test-all-usage-secret-version-create-usage.golden new file mode 100644 index 0000000000..f44ff7a02a --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-version-create-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a SecretVersion. + +USAGE: + scw secret version create [arg=value ...] + +ARGS: + secret-id ID of the Secret + [data] The base64-encoded secret payload of the SecretVersion + [description] Description of the SecretVersion + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + +FLAGS: + -h, --help help for create + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-version-delete-usage.golden b/cmd/scw/testdata/test-all-usage-secret-version-delete-usage.golden new file mode 100644 index 0000000000..1a7e83bede --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-version-delete-usage.golden @@ -0,0 +1,24 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Destroy a SecretVersion, permanently destroying the sensitive data. + +USAGE: + scw secret version delete [arg=value ...] + +EXAMPLES: + Delete a given Secret Version + scw secret version delete secret-id=11111111-1111-1111-1111-111111111111 revision=1 + +ARGS: + secret-id ID of the Secret + revision Revision of the SecretVersion (may be a number or "latest") + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + +FLAGS: + -h, --help help for delete + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-version-disable-usage.golden b/cmd/scw/testdata/test-all-usage-secret-version-disable-usage.golden new file mode 100644 index 0000000000..3ff9386f77 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-version-disable-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Disable a SecretVersion. + +USAGE: + scw secret version disable [arg=value ...] + +ARGS: + secret-id ID of the Secret + revision Revision of the SecretVersion (may be a number or "latest") + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + +FLAGS: + -h, --help help for disable + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-version-enable-usage.golden b/cmd/scw/testdata/test-all-usage-secret-version-enable-usage.golden new file mode 100644 index 0000000000..083b63ee93 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-version-enable-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Enable a SecretVersion. + +USAGE: + scw secret version enable [arg=value ...] + +ARGS: + secret-id ID of the Secret + revision Revision of the SecretVersion (may be a number or "latest") + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + +FLAGS: + -h, --help help for enable + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-version-get-usage.golden b/cmd/scw/testdata/test-all-usage-secret-version-get-usage.golden new file mode 100644 index 0000000000..3142fd5530 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-version-get-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Get metadata of a SecretVersion. + +USAGE: + scw secret version get [arg=value ...] + +ARGS: + secret-id ID of the Secret + revision Revision of the SecretVersion (may be a number or "latest") + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + +FLAGS: + -h, --help help for get + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-version-list-usage.golden b/cmd/scw/testdata/test-all-usage-secret-version-list-usage.golden new file mode 100644 index 0000000000..ffd8380691 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-version-list-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List versions of a secret, not returning any sensitive data. + +USAGE: + scw secret version list [arg=value ...] + +ARGS: + secret-id ID of the Secret + [status.{index}] Filter results by status (unknown | enabled | disabled | destroyed) + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all) + +FLAGS: + -h, --help help for list + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-version-update-usage.golden b/cmd/scw/testdata/test-all-usage-secret-version-update-usage.golden new file mode 100644 index 0000000000..51ca8b9f79 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-version-update-usage.golden @@ -0,0 +1,21 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update metadata of a SecretVersion. + +USAGE: + scw secret version update [arg=value ...] + +ARGS: + secret-id ID of the Secret + revision Revision of the SecretVersion (may be a number or "latest") + [description] Description of the SecretVersion + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par) + +FLAGS: + -h, --help help for update + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use diff --git a/cmd/scw/testdata/test-all-usage-secret-version-usage.golden b/cmd/scw/testdata/test-all-usage-secret-version-usage.golden new file mode 100644 index 0000000000..bd6a0257a6 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-secret-version-usage.golden @@ -0,0 +1,27 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Immutable version of a secret. + +USAGE: + scw secret version + +AVAILABLE COMMANDS: + access Access a SecretVersion, returning the sensitive data + create Create a SecretVersion + delete Destroy a SecretVersion, permanently destroying the sensitive data + disable Disable a SecretVersion + enable Enable a SecretVersion + get Get metadata of a SecretVersion + list List versions of a secret, not returning any sensitive data + update Update metadata of a SecretVersion + +FLAGS: + -h, --help help for version + +GLOBAL FLAGS: + -c, --config string The path to the config file + -D, --debug Enable debug mode + -o, --output string Output format: json or human, see 'scw help output' for more info (default "human") + -p, --profile string The config profile to use + +Use "scw secret version [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-main-usage-usage.golden b/cmd/scw/testdata/test-main-usage-usage.golden index 8a60b9c84f..9a05abd0a1 100644 --- a/cmd/scw/testdata/test-main-usage-usage.golden +++ b/cmd/scw/testdata/test-main-usage-usage.golden @@ -28,6 +28,7 @@ AVAILABLE COMMANDS: rdb Database RDB API redis Managed Database for Redisβ„’ API registry Container registry API + secret This API allows you to conveniently store, access and share sensitive data shell Start shell mode tem Tem version Display cli version diff --git a/docs/commands/secret.md b/docs/commands/secret.md new file mode 100644 index 0000000000..afb0419b53 --- /dev/null +++ b/docs/commands/secret.md @@ -0,0 +1,342 @@ + +# Documentation for `scw secret` +This API allows you to conveniently store, access and share sensitive data + +- [Secret management commands](#secret-management-commands) + - [Create a Secret containing no versions](#create-a-secret-containing-no-versions) + - [Delete a secret](#delete-a-secret) + - [Get metadata of a Secret](#get-metadata-of-a-secret) + - [List Secrets](#list-secrets) + - [Update metadata of a Secret](#update-metadata-of-a-secret) +- [Secret Version management commands](#secret-version-management-commands) + - [Access a SecretVersion, returning the sensitive data](#access-a-secretversion,-returning-the-sensitive-data) + - [Create a SecretVersion](#create-a-secretversion) + - [Destroy a SecretVersion, permanently destroying the sensitive data](#destroy-a-secretversion,-permanently-destroying-the-sensitive-data) + - [Disable a SecretVersion](#disable-a-secretversion) + - [Enable a SecretVersion](#enable-a-secretversion) + - [Get metadata of a SecretVersion](#get-metadata-of-a-secretversion) + - [List versions of a secret, not returning any sensitive data](#list-versions-of-a-secret,-not-returning-any-sensitive-data) + - [Update metadata of a SecretVersion](#update-metadata-of-a-secretversion) + + +## Secret management commands + +Logical container made up of zero or more immutable versions, that hold the sensitive data. + + + +### Create a Secret containing no versions + +Create a Secret containing no versions. + +**Usage:** + +``` +scw secret secret create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | +| name | | Name of the Secret | +| tags.{index} | | List of tags associated to this Secret | +| description | | Description of the Secret | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + +**Examples:** + + +Add a given secret +``` +scw secret secret create name=foobar description="$(cat )" +``` + + + + +### Delete a secret + +Delete a secret. + +**Usage:** + +``` +scw secret secret delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| secret-id | Required | ID of the Secret | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + +**Examples:** + + +Delete a given secret +``` +scw secret secret delete secret-id=11111111-1111-1111-1111-111111111111 +``` + + + + +### Get metadata of a Secret + +Get metadata of a Secret. + +**Usage:** + +``` +scw secret secret get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| secret-id | Required | ID of the Secret | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### List Secrets + +List Secrets. + +**Usage:** + +``` +scw secret secret list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | ID of a project to filter on (optional) | +| tags.{index} | | List of tags to filter on (optional) | +| order-by | One of: `name_asc`, `name_desc`, `created_at_asc`, `created_at_desc`, `updated_at_asc`, `updated_at_desc` | | +| organization-id | | ID of an organization to filter on (optional) | +| region | Default: `fr-par`
One of: `fr-par`, `all` | Region to target. If none is passed will use default region from the config | + + + +### Update metadata of a Secret + +Update metadata of a Secret. + +**Usage:** + +``` +scw secret secret update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| secret-id | Required | ID of the Secret | +| name | | New name of the Secret (optional) | +| tags.{index} | | New list of tags associated to this Secret (optional) | +| description | | Description of the Secret | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +## Secret Version management commands + +Immutable version of a secret. + + + +### Access a SecretVersion, returning the sensitive data + +Access a SecretVersion, returning the sensitive data. + +**Usage:** + +``` +scw secret version access [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| secret-id | Required | ID of the Secret | +| revision | Required | Revision of the SecretVersion (may be a number or "latest") | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### Create a SecretVersion + +Create a SecretVersion. + +**Usage:** + +``` +scw secret version create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| secret-id | Required | ID of the Secret | +| data | | The base64-encoded secret payload of the SecretVersion | +| description | | Description of the SecretVersion | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### Destroy a SecretVersion, permanently destroying the sensitive data + +Destroy a SecretVersion, permanently destroying the sensitive data. + +**Usage:** + +``` +scw secret version delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| secret-id | Required | ID of the Secret | +| revision | Required | Revision of the SecretVersion (may be a number or "latest") | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + +**Examples:** + + +Delete a given Secret Version +``` +scw secret version delete secret-id=11111111-1111-1111-1111-111111111111 revision=1 +``` + + + + +### Disable a SecretVersion + +Disable a SecretVersion. + +**Usage:** + +``` +scw secret version disable [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| secret-id | Required | ID of the Secret | +| revision | Required | Revision of the SecretVersion (may be a number or "latest") | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### Enable a SecretVersion + +Enable a SecretVersion. + +**Usage:** + +``` +scw secret version enable [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| secret-id | Required | ID of the Secret | +| revision | Required | Revision of the SecretVersion (may be a number or "latest") | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### Get metadata of a SecretVersion + +Get metadata of a SecretVersion. + +**Usage:** + +``` +scw secret version get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| secret-id | Required | ID of the Secret | +| revision | Required | Revision of the SecretVersion (may be a number or "latest") | +| region | Default: `fr-par`
One of: `fr-par` | Region to target. If none is passed will use default region from the config | + + + +### List versions of a secret, not returning any sensitive data + +List versions of a secret, not returning any sensitive data. + +**Usage:** + +``` +scw secret version list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| secret-id | Required | ID of the Secret | +| status.{index} | One of: `unknown`, `enabled`, `disabled`, `destroyed` | Filter results by status | +| region | Default: `fr-par`
One of: `fr-par`, `all` | Region to target. If none is passed will use default region from the config | + + + +### Update metadata of a SecretVersion + +Update metadata of a SecretVersion. + +**Usage:** + +``` +scw secret version update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| secret-id | Required | ID of the Secret | +| revision | Required | Revision of the SecretVersion (may be a number or "latest") | +| description | | Description of the SecretVersion | +| 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/internal/namespaces/get_commands.go b/internal/namespaces/get_commands.go index b30def99fe..2ce81f8dcd 100644 --- a/internal/namespaces/get_commands.go +++ b/internal/namespaces/get_commands.go @@ -30,6 +30,7 @@ import ( "github.com/scaleway/scaleway-cli/v2/internal/namespaces/rdb/v1" "github.com/scaleway/scaleway-cli/v2/internal/namespaces/redis/v1" "github.com/scaleway/scaleway-cli/v2/internal/namespaces/registry/v1" + secret "github.com/scaleway/scaleway-cli/v2/internal/namespaces/secret/v1alpha1" "github.com/scaleway/scaleway-cli/v2/internal/namespaces/shell" tem "github.com/scaleway/scaleway-cli/v2/internal/namespaces/tem/v1alpha1" versionNamespace "github.com/scaleway/scaleway-cli/v2/internal/namespaces/version" @@ -73,6 +74,7 @@ func GetCommands(beta ...bool) *core.Commands { function.GetCommands(), vpcgw.GetCommands(), redis.GetCommands(), + secret.GetCommands(), shell.GetCommands(), tem.GetCommands(), mnq.GetCommands(), diff --git a/internal/namespaces/secret/v1alpha1/custom.go b/internal/namespaces/secret/v1alpha1/custom.go new file mode 100644 index 0000000000..17aaf56528 --- /dev/null +++ b/internal/namespaces/secret/v1alpha1/custom.go @@ -0,0 +1,11 @@ +package secret + +import ( + "github.com/scaleway/scaleway-cli/v2/internal/core" +) + +func GetCommands() *core.Commands { + cmds := GetGeneratedCommands() + + return cmds +}