Skip to content

Commit 9ed70a3

Browse files
refactor(mnq): make Permissions optional (#3038)
Co-authored-by: Rémy Léone <rleone@scaleway.com>
1 parent 36399c3 commit 9ed70a3

14 files changed

+101
-101
lines changed

cmd/scw/testdata/test-all-usage-mnq-credential-create-usage.golden

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Create a set of credentials for a specific namespace.
3+
Create a set of credentials for a Messaging and Queuing namespace, specified by its namespace ID. If creating credentials for a NATS namespace, the `permissions` object must not be included in the request. If creating credentials for an SQS/SNS namespace, the `permissions` object is required, with all three of its child attributes.
44

55
USAGE:
66
scw mnq credential create [arg=value ...]
77

88
ARGS:
9-
namespace-id Namespace containing the Credential
10-
[name=<generated>] Credential name
11-
[permissions.can-publish] Defines if user can publish messages to the service
12-
[permissions.can-receive] Defines if user can receive messages from the service
13-
[permissions.can-manage] Defines if user can manage the associated resource(s)
9+
namespace-id Namespace containing the credentials
10+
[name=<generated>] Name of the credentials
11+
[permissions.can-publish] Defines whether the credentials bearer can publish messages to the service (send messages to SQS queues or publish to SNS topics)
12+
[permissions.can-receive] Defines whether the credentials bearer can receive messages from the service
13+
[permissions.can-manage] Defines whether the credentials bearer can manage the associated resources (SQS queues or SNS topics or subscriptions)
1414
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1515

1616
FLAGS:

cmd/scw/testdata/test-all-usage-mnq-credential-delete-usage.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Delete credentials.
3+
Delete a set of credentials, specified by their credential ID. Deleting credentials is irreversible and cannot be undone. The credentials can no longer be used to access the namespace.
44

55
USAGE:
66
scw mnq credential delete <credential-id ...> [arg=value ...]
77

88
ARGS:
9-
credential-id ID of the Credential to delete
9+
credential-id ID of the credentials to delete
1010
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1111

1212
FLAGS:

cmd/scw/testdata/test-all-usage-mnq-credential-get-usage.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Get a set of credentials.
3+
Retrieve an existing set of credentials, identified by the `credential_id`. The credentials themselves, as well as their metadata (protocol, namespace ID etc), are returned in the response.
44

55
USAGE:
66
scw mnq credential get <credential-id ...> [arg=value ...]
77

88
ARGS:
9-
credential-id ID of the Credential to get
9+
credential-id ID of the credentials to get
1010
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1111

1212
FLAGS:

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
List credentials.
3+
List existing credentials in the specified region. The response contains only the metadata for the credentials, not the credentials themselves (for this, use **Get Credentials**).
44

55
USAGE:
66
scw mnq credential list [arg=value ...]
77

88
ARGS:
9-
[namespace-id] Namespace containing the Credential
10-
[order-by] Field used for sorting results (id_asc | id_desc | name_asc | name_desc)
9+
[namespace-id] Namespace containing the credentials
10+
[order-by] Order in which to return results (id_asc | id_desc | name_asc | name_desc)
1111
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all)
1212

1313
FLAGS:

cmd/scw/testdata/test-all-usage-mnq-credential-update-usage.golden

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Update a set of credentials.
3+
Update a set of credentials. You can update the credentials' name, or (in the case of SQS/SNS credentials only) their permissions. To update the name of NATS credentials, do not include the `permissions` object in your request.
44

55
USAGE:
66
scw mnq credential update <credential-id ...> [arg=value ...]
77

88
ARGS:
9-
credential-id ID of the Credential to update
10-
[name] Credential name
11-
[permissions.can-publish] Defines if user can publish messages to the service
12-
[permissions.can-receive] Defines if user can receive messages from the service
13-
[permissions.can-manage] Defines if user can manage the associated resource(s)
9+
credential-id ID of the credentials to update
10+
[name] Name of the credentials
11+
[permissions.can-publish] Defines whether the credentials bearer can publish messages to the service (send messages to SQS queues or publish to SNS topics)
12+
[permissions.can-receive] Defines whether the credentials bearer can receive messages from the service
13+
[permissions.can-manage] Defines whether the credentials bearer can manage the associated resources (SQS queues or SNS topics or subscriptions)
1414
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1515

1616
FLAGS:

cmd/scw/testdata/test-all-usage-mnq-credential-usage.golden

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ USAGE:
66
scw mnq credential <command>
77

88
AVAILABLE COMMANDS:
9-
create Create a set of credentials
9+
create Create credentials
1010
delete Delete credentials
11-
get Get a set of credentials
11+
get Get credentials
1212
list List credentials
13-
update Update a set of credentials
13+
update Update credentials
1414

1515
FLAGS:
1616
-h, --help help for credential

cmd/scw/testdata/test-all-usage-mnq-namespace-create-usage.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Create a namespace.
3+
Create a Messaging and Queuing namespace, set to the desired protocol.
44

55
USAGE:
66
scw mnq namespace create [arg=value ...]
77

88
ARGS:
99
[name=<generated>] Namespace name
10-
protocol Namespace protocol (unknown | nats | sqs_sns)
10+
protocol Namespace protocol. You must specify a valid protocol (and not `unknown`) to avoid an error. (unknown | nats | sqs_sns)
1111
[project-id] Project ID to use. If none is passed the default project ID will be used
1212
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1313

cmd/scw/testdata/test-all-usage-mnq-namespace-delete-usage.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Delete a namespace.
3+
Delete a Messaging and Queuing namespace, specified by its namespace ID. Note that deleting a namespace is irreversible, and any URLs, credentials and queued messages belonging to this namespace will also be deleted.
44

55
USAGE:
66
scw mnq namespace delete <namespace-id ...> [arg=value ...]
77

88
ARGS:
9-
namespace-id ID of the Namespace to delete
9+
namespace-id ID of the namespace to delete
1010
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par)
1111

1212
FLAGS:

cmd/scw/testdata/test-all-usage-mnq-namespace-get-usage.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Get a namespace.
3+
Retrieve information about an existing Messaging and Queuing namespace, identified by its namespace ID. Its full details, including name, endpoint and protocol, are returned in the response.
44

55
USAGE:
66
scw mnq namespace get <namespace-id ...> [arg=value ...]

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
List namespaces.
3+
List all Messaging and Queuing namespaces in the specified region, for a Scaleway Organization or Project. By default, the namespaces returned in the list are ordered by creation date in ascending order, though this can be modified via the `order_by` field.
44

55
USAGE:
66
scw mnq namespace list [arg=value ...]
77

88
ARGS:
9-
[project-id] Will list only the Namespaces contained into the specified project
10-
[order-by] Field used for sorting results (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | id_asc | id_desc | name_asc | name_desc | project_id_asc | project_id_desc)
11-
[organization-id] Will list only the Namespaces owned by the specified organization
9+
[project-id] Include only namespaces in this Project
10+
[order-by] Order in which to return results (created_at_asc | created_at_desc | updated_at_asc | updated_at_desc | id_asc | id_desc | name_asc | name_desc | project_id_asc | project_id_desc)
11+
[organization-id] Include only namespaces in this Organization
1212
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | all)
1313

1414
FLAGS:

0 commit comments

Comments
 (0)