Skip to content

Commit 54e9669

Browse files
feat(mnq): allow filtering nats credentials listing by project id (scaleway#4331)
Co-authored-by: Laure-di <[email protected]>
1 parent 4605322 commit 54e9669

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

cmd/scw/testdata/test-all-usage-mnq-nats-list-credentials-usage.golden

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ USAGE:
66
scw mnq nats list-credentials [arg=value ...]
77

88
ARGS:
9-
nats-account-id Include only credentials for this NATS account
10-
[order-by] Order in which to return results (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | name_asc | name_desc)
11-
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | all)
9+
[project-id] Include only NATS accounts in this Project
10+
[nats-account-id] Include only credentials for this NATS account
11+
[order-by] Order in which to return results (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | name_asc | name_desc)
12+
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | all)
1213

1314
FLAGS:
1415
-h, --help help for list-credentials

docs/commands/mnq.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ scw mnq nats list-credentials [arg=value ...]
230230

231231
| Name | | Description |
232232
|------|---|-------------|
233-
| nats-account-id | Required | Include only credentials for this NATS account |
233+
| project-id | | Include only NATS accounts in this Project |
234+
| nats-account-id | | Include only credentials for this NATS account |
234235
| order-by | One of: `created_at_asc`, `created_at_desc`, `updated_at_asc`, `updated_at_desc`, `name_asc`, `name_desc` | Order in which to return results |
235236
| region | Default: `fr-par`<br />One of: `fr-par`, `nl-ams`, `all` | Region to target. If none is passed will use default region from the config |
236237

internal/namespaces/mnq/v1beta1/mnq_cli.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,17 @@ func mnqNatsListCredentials() *core.Command {
381381
// Deprecated: false,
382382
ArgsType: reflect.TypeOf(mnq.NatsAPIListNatsCredentialsRequest{}),
383383
ArgSpecs: core.ArgSpecs{
384+
{
385+
Name: "project-id",
386+
Short: `Include only NATS accounts in this Project`,
387+
Required: false,
388+
Deprecated: false,
389+
Positional: false,
390+
},
384391
{
385392
Name: "nats-account-id",
386393
Short: `Include only credentials for this NATS account`,
387-
Required: true,
394+
Required: false,
388395
Deprecated: false,
389396
Positional: false,
390397
},

0 commit comments

Comments
 (0)