diff --git a/cmd/scw/testdata/test-all-usage-cockpit-alert-disable-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-alert-disable-usage.golden new file mode 100644 index 0000000000..a49027a3ee --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-cockpit-alert-disable-usage.golden @@ -0,0 +1,18 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Disable managed alerts. + +USAGE: + scw cockpit alert disable [arg=value ...] + +ARGS: + [project-id] Project ID to use. If none is passed the default project ID will be used + +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-cockpit-alert-enable-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-alert-enable-usage.golden new file mode 100644 index 0000000000..58879150d9 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-cockpit-alert-enable-usage.golden @@ -0,0 +1,18 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Enable managed alerts. + +USAGE: + scw cockpit alert enable [arg=value ...] + +ARGS: + [project-id] Project ID to use. If none is passed the default project ID will be used + +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-cockpit-alert-test-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-alert-test-usage.golden new file mode 100644 index 0000000000..6d11347b1f --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-cockpit-alert-test-usage.golden @@ -0,0 +1,18 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Trigger a test alert to all receivers. + +USAGE: + scw cockpit alert test [arg=value ...] + +ARGS: + [project-id] Project ID to use. If none is passed the default project ID will be used + +FLAGS: + -h, --help help for test + +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-cockpit-alert-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-alert-usage.golden new file mode 100644 index 0000000000..2cadb0fe85 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-cockpit-alert-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Managed alerts management commands. + +USAGE: + scw cockpit alert + +AVAILABLE COMMANDS: + disable Disable managed alerts + enable Enable managed alerts + test Trigger a test alert + +FLAGS: + -h, --help help for alert + +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 cockpit alert [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-cockpit-contact-create-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-contact-create-usage.golden new file mode 100644 index 0000000000..15e9cf4b26 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-cockpit-contact-create-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create an alert contact point for the default receiver. + +USAGE: + scw cockpit contact create [arg=value ...] + +ARGS: + [project-id] Project ID to use. If none is passed the default project ID will be used + [contact-point.email.to] + +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-cockpit-contact-delete-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-contact-delete-usage.golden new file mode 100644 index 0000000000..280a844ab8 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-cockpit-contact-delete-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete an alert contact point for the default receiver. + +USAGE: + scw cockpit contact delete [arg=value ...] + +ARGS: + [project-id] Project ID to use. If none is passed the default project ID will be used + [contact-point.email.to] + +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-cockpit-contact-list-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-contact-list-usage.golden new file mode 100644 index 0000000000..15d6431f6f --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-cockpit-contact-list-usage.golden @@ -0,0 +1,18 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List alert contact points associated with the given cockpit ID. + +USAGE: + scw cockpit contact list [arg=value ...] + +ARGS: + [project-id] Project ID to use. If none is passed the default project ID will be used + +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-cockpit-contact-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-contact-usage.golden new file mode 100644 index 0000000000..d5d3197a30 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-cockpit-contact-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Contacts management commands. + +USAGE: + scw cockpit contact + +AVAILABLE COMMANDS: + create Create an alert contact point + delete Delete an alert contact point + list List alert contact points + +FLAGS: + -h, --help help for contact + +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 cockpit contact [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-cockpit-usage.golden b/cmd/scw/testdata/test-all-usage-cockpit-usage.golden index 48eaffbd76..9784e31b36 100644 --- a/cmd/scw/testdata/test-all-usage-cockpit-usage.golden +++ b/cmd/scw/testdata/test-all-usage-cockpit-usage.golden @@ -6,7 +6,9 @@ USAGE: scw cockpit AVAILABLE COMMANDS: + alert Managed alerts management commands cockpit Cockpit management commands + contact Contacts management commands grafana-user Grafana user management commands token Token management commands diff --git a/cmd/scw/testdata/test-all-usage-container-container-get-logs-usage.golden b/cmd/scw/testdata/test-all-usage-container-container-get-logs-usage.golden new file mode 100644 index 0000000000..8c0cdb2b1c --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-container-container-get-logs-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List your container logs. + +USAGE: + scw container container get-logs [arg=value ...] + +ARGS: + container-id + [order-by] (timestamp_desc | timestamp_asc) + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all) + +FLAGS: + -h, --help help for get-logs + +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-container-container-usage.golden b/cmd/scw/testdata/test-all-usage-container-container-usage.golden index aea18c6bde..31f335798d 100644 --- a/cmd/scw/testdata/test-all-usage-container-container-usage.golden +++ b/cmd/scw/testdata/test-all-usage-container-container-usage.golden @@ -10,6 +10,7 @@ AVAILABLE COMMANDS: delete Delete a container deploy Deploy a container get Get a container + get-logs List your container logs list List all your containers update Update an existing container diff --git a/cmd/scw/testdata/test-all-usage-function-function-get-logs-usage.golden b/cmd/scw/testdata/test-all-usage-function-function-get-logs-usage.golden new file mode 100644 index 0000000000..4650fcf1fc --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-function-function-get-logs-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List your application logs. + +USAGE: + scw function function get-logs [arg=value ...] + +ARGS: + function-id + [order-by] (timestamp_desc | timestamp_asc) + [region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw | all) + +FLAGS: + -h, --help help for get-logs + +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-function-function-usage.golden b/cmd/scw/testdata/test-all-usage-function-function-usage.golden index a6f30d7ebd..a2a0777ddc 100644 --- a/cmd/scw/testdata/test-all-usage-function-function-usage.golden +++ b/cmd/scw/testdata/test-all-usage-function-function-usage.golden @@ -11,6 +11,7 @@ AVAILABLE COMMANDS: deploy Deploy a function get Get a function get-download-url Get a download URL of a function + get-logs List your application logs get-upload-url Get an upload URL of a function list List all your functions update Update an existing function diff --git a/cmd/scw/testdata/test-all-usage-function-usage.golden b/cmd/scw/testdata/test-all-usage-function-usage.golden index 18c00f7355..378ef783b8 100644 --- a/cmd/scw/testdata/test-all-usage-function-usage.golden +++ b/cmd/scw/testdata/test-all-usage-function-usage.golden @@ -9,7 +9,6 @@ AVAILABLE COMMANDS: cron Cron management commands domain Domain management commands function Function management commands - logs Logs management commands namespace Function namespace management commands runtime Runtime management commands token Token management commands diff --git a/cmd/scw/testdata/test-all-usage-lb-backend-list-statistics-usage.golden b/cmd/scw/testdata/test-all-usage-lb-backend-list-statistics-usage.golden new file mode 100644 index 0000000000..a4960579ad --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-lb-backend-list-statistics-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List information about your backend servers, including their state and the result of their last health check. + +USAGE: + scw lb backend list-statistics [arg=value ...] + +ARGS: + lb-id Load Balancer ID + [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 | pl-waw-2 | all) + +FLAGS: + -h, --help help for list-statistics + +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-lb-backend-usage.golden b/cmd/scw/testdata/test-all-usage-lb-backend-usage.golden index 7fc6108772..77865fcd05 100644 --- a/cmd/scw/testdata/test-all-usage-lb-backend-usage.golden +++ b/cmd/scw/testdata/test-all-usage-lb-backend-usage.golden @@ -11,6 +11,7 @@ AVAILABLE COMMANDS: delete Delete a backend of a given Load Balancer get Get a backend of a given Load Balancer list List the backends of a given Load Balancer + list-statistics List backend server statistics remove-servers Remove a set of servers for a given backend set-servers Define all backend servers for a given backend update Update a backend of a given Load Balancer diff --git a/cmd/scw/testdata/test-all-usage-lb-subscriber-create-usage.golden b/cmd/scw/testdata/test-all-usage-lb-subscriber-create-usage.golden new file mode 100644 index 0000000000..9e853ffa26 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-lb-subscriber-create-usage.golden @@ -0,0 +1,23 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Create a new subscriber, either with an email configuration or a webhook configuration, for a specified Scaleway Project. + +USAGE: + scw lb subscriber create [arg=value ...] + +ARGS: + name Subscriber name + email-config.email Email address to send alerts to + webhook-config.uri URI to receive POST requests + [project-id] Project ID to use. If none is passed the default project ID will be used + [organization-id] Organization ID to use. If none is passed the default organization ID will be used + [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 | pl-waw-2) + +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-lb-subscriber-delete-usage.golden b/cmd/scw/testdata/test-all-usage-lb-subscriber-delete-usage.golden new file mode 100644 index 0000000000..9abe9a7eec --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-lb-subscriber-delete-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Delete an existing subscriber, specified by its subscriber ID. Deleting a subscriber is permanent, and cannot be undone. + +USAGE: + scw lb subscriber delete [arg=value ...] + +ARGS: + subscriber-id Subscriber ID + [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 | pl-waw-2) + +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-lb-subscriber-get-usage.golden b/cmd/scw/testdata/test-all-usage-lb-subscriber-get-usage.golden new file mode 100644 index 0000000000..03e0f86815 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-lb-subscriber-get-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Retrieve information about an existing subscriber, specified by its subscriber ID. Its full details, including name and email/webhook configuration, are returned in the response object. + +USAGE: + scw lb subscriber get [arg=value ...] + +ARGS: + subscriber-id Subscriber ID + [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 | pl-waw-2) + +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-lb-subscriber-list-usage.golden b/cmd/scw/testdata/test-all-usage-lb-subscriber-list-usage.golden new file mode 100644 index 0000000000..aa1d2f2cc7 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-lb-subscriber-list-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +List all subscribers to Load Balancer alerts. By default, returns all subscribers to Load Balancer alerts for the Organization associated with the authentication token used for the request. + +USAGE: + scw lb subscriber list [arg=value ...] + +ARGS: + [order-by] Sort order of subscribers in the response (created_at_asc | created_at_desc | name_asc | name_desc) + name Subscriber name to search for + [project-id] Filter subscribers by Project ID + [organization-id] Filter subscribers by Organization ID + [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 | pl-waw-2 | 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-lb-subscriber-subscribe-usage.golden b/cmd/scw/testdata/test-all-usage-lb-subscriber-subscribe-usage.golden new file mode 100644 index 0000000000..5bf9382ea0 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-lb-subscriber-subscribe-usage.golden @@ -0,0 +1,20 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Subscribe an existing subscriber to alerts for a given Load Balancer. + +USAGE: + scw lb subscriber subscribe [arg=value ...] + +ARGS: + lb-id Load Balancer ID + subscriber-id Subscriber ID + [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 | pl-waw-2) + +FLAGS: + -h, --help help for subscribe + +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-lb-subscriber-unsubscribe-usage.golden b/cmd/scw/testdata/test-all-usage-lb-subscriber-unsubscribe-usage.golden new file mode 100644 index 0000000000..3dd5134f79 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-lb-subscriber-unsubscribe-usage.golden @@ -0,0 +1,19 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Unsubscribe a subscriber from alerts for a given Load Balancer. The subscriber is not deleted, and can be resubscribed in the future if necessary. + +USAGE: + scw lb subscriber unsubscribe [arg=value ...] + +ARGS: + lb-id Load Balancer ID + [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 | pl-waw-2) + +FLAGS: + -h, --help help for unsubscribe + +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-lb-subscriber-update-usage.golden b/cmd/scw/testdata/test-all-usage-lb-subscriber-update-usage.golden new file mode 100644 index 0000000000..68b96e548b --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-lb-subscriber-update-usage.golden @@ -0,0 +1,22 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Update the parameters of a given subscriber (e.g. name, webhook configuration, email configuration), specified by its subscriber ID. + +USAGE: + scw lb subscriber update [arg=value ...] + +ARGS: + subscriber-id Subscriber ID + name Subscriber name + email-config.email Email address to send alerts to + webhook-config.uri URI to receive POST requests + [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 | pl-waw-2) + +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-lb-subscriber-usage.golden b/cmd/scw/testdata/test-all-usage-lb-subscriber-usage.golden new file mode 100644 index 0000000000..c408e9c2e7 --- /dev/null +++ b/cmd/scw/testdata/test-all-usage-lb-subscriber-usage.golden @@ -0,0 +1,26 @@ +🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲 +πŸŸ₯πŸŸ₯πŸŸ₯ STDERR️️ πŸŸ₯πŸŸ₯πŸŸ₯️ +Subscriber management commands. + +USAGE: + scw lb subscriber + +AVAILABLE COMMANDS: + create Create a subscriber + delete Delete a subscriber + get Get a subscriber + list List all subscribers + subscribe Subscribe a subscriber to alerts for a given Load Balancer + unsubscribe Unsubscribe a subscriber from alerts for a given Load Balancer + update Update a subscriber + +FLAGS: + -h, --help help for subscriber + +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 lb subscriber [command] --help" for more information about a command. diff --git a/cmd/scw/testdata/test-all-usage-lb-usage.golden b/cmd/scw/testdata/test-all-usage-lb-usage.golden index 58c04ab797..06ce0b56b8 100644 --- a/cmd/scw/testdata/test-all-usage-lb-usage.golden +++ b/cmd/scw/testdata/test-all-usage-lb-usage.golden @@ -15,6 +15,7 @@ AVAILABLE COMMANDS: lb-types Load balancer types management commands private-network Private networks management commands route Route rules management commands + subscriber Subscriber management commands FLAGS: -h, --help help for lb diff --git a/docs/commands/cockpit.md b/docs/commands/cockpit.md index 2492dac166..0285da2032 100644 --- a/docs/commands/cockpit.md +++ b/docs/commands/cockpit.md @@ -2,12 +2,20 @@ # Documentation for `scw cockpit` Cockpit API. +- [Managed alerts management commands](#managed-alerts-management-commands) + - [Disable managed alerts](#disable-managed-alerts) + - [Enable managed alerts](#enable-managed-alerts) + - [Trigger a test alert](#trigger-a-test-alert) - [Cockpit management commands](#cockpit-management-commands) - [Activate a cockpit](#activate-a-cockpit) - [Deactivate a cockpit](#deactivate-a-cockpit) - [Get cockpit](#get-cockpit) - [Reset Grafana](#reset-grafana) - [Wait for a cockpit to reach a stable state (installation)](#wait-for-a-cockpit-to-reach-a-stable-state-(installation)) +- [Contacts management commands](#contacts-management-commands) + - [Create an alert contact point](#create-an-alert-contact-point) + - [Delete an alert contact point](#delete-an-alert-contact-point) + - [List alert contact points](#list-alert-contact-points) - [Grafana user management commands](#grafana-user-management-commands) - [Create a grafana user](#create-a-grafana-user) - [Delete a grafana user](#delete-a-grafana-user) @@ -20,6 +28,68 @@ Cockpit API. - [List tokens](#list-tokens) +## Managed alerts management commands + +Managed alerts management commands. + + +### Disable managed alerts + +Disable managed alerts. + +**Usage:** + +``` +scw cockpit alert disable [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | + + + +### Enable managed alerts + +Enable managed alerts. + +**Usage:** + +``` +scw cockpit alert enable [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | + + + +### Trigger a test alert + +Trigger a test alert to all receivers. + +**Usage:** + +``` +scw cockpit alert test [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | + + + ## Cockpit management commands Cockpit management commands. @@ -130,6 +200,70 @@ scw cockpit cockpit wait 11111111-1111-1111-1111-111111111111 +## Contacts management commands + +Contacts management commands. + + +### Create an alert contact point + +Create an alert contact point for the default receiver. + +**Usage:** + +``` +scw cockpit contact create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | +| contact-point.email.to | | | + + + +### Delete an alert contact point + +Delete an alert contact point for the default receiver. + +**Usage:** + +``` +scw cockpit contact delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | +| contact-point.email.to | | | + + + +### List alert contact points + +List alert contact points associated with the given cockpit ID. + +**Usage:** + +``` +scw cockpit contact list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| project-id | | Project ID to use. If none is passed the default project ID will be used | + + + ## Grafana user management commands Grafana user management commands. diff --git a/docs/commands/container.md b/docs/commands/container.md index ba056b9533..5ba640418c 100644 --- a/docs/commands/container.md +++ b/docs/commands/container.md @@ -7,6 +7,7 @@ Containers API. - [Delete a container](#delete-a-container) - [Deploy a container](#deploy-a-container) - [Get a container](#get-a-container) + - [List your container logs](#list-your-container-logs) - [List all your containers](#list-all-your-containers) - [Update an existing container](#update-an-existing-container) - [Cron management commands](#cron-management-commands) @@ -134,6 +135,27 @@ scw container container get [arg=value ...] +### List your container logs + +List your container logs. + +**Usage:** + +``` +scw container container get-logs [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| container-id | Required | | +| order-by | One of: `timestamp_desc`, `timestamp_asc` | | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | + + + ### List all your containers List all your containers. diff --git a/docs/commands/function.md b/docs/commands/function.md index 3c2b6013fb..3dfbf44598 100644 --- a/docs/commands/function.md +++ b/docs/commands/function.md @@ -19,11 +19,10 @@ Functions API. - [Deploy a function](#deploy-a-function) - [Get a function](#get-a-function) - [Get a download URL of a function](#get-a-download-url-of-a-function) + - [List your application logs](#list-your-application-logs) - [Get an upload URL of a function](#get-an-upload-url-of-a-function) - [List all your functions](#list-all-your-functions) - [Update an existing function](#update-an-existing-function) -- [Logs management commands](#logs-management-commands) - - [List your application logs](#list-your-application-logs) - [Function namespace management commands](#function-namespace-management-commands) - [Create a new namespace](#create-a-new-namespace) - [Delete an existing namespace](#delete-an-existing-namespace) @@ -358,6 +357,27 @@ scw function function get-download-url [arg=value ...] +### List your application logs + +List your application logs. + +**Usage:** + +``` +scw function function get-logs [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| function-id | Required | | +| order-by | One of: `timestamp_desc`, `timestamp_asc` | | +| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | + + + ### Get an upload URL of a function Get an upload URL of a function associated with the given id. @@ -437,32 +457,6 @@ scw function function update [arg=value ...] -## Logs management commands - -Logs management commands. - - -### List your application logs - -List your application logs. - -**Usage:** - -``` -scw function logs list [arg=value ...] -``` - - -**Args:** - -| Name | | Description | -|------|---|-------------| -| function-id | Required | | -| order-by | One of: `timestamp_desc`, `timestamp_asc` | | -| region | Default: `fr-par`
One of: `fr-par`, `nl-ams`, `pl-waw`, `all` | Region to target. If none is passed will use default region from the config | - - - ## Function namespace management commands Function namespace management commands. diff --git a/docs/commands/lb.md b/docs/commands/lb.md index 17f12b0837..a5ecb9f4c5 100644 --- a/docs/commands/lb.md +++ b/docs/commands/lb.md @@ -15,6 +15,7 @@ Load Balancer API. - [Delete a backend of a given Load Balancer](#delete-a-backend-of-a-given-load-balancer) - [Get a backend of a given Load Balancer](#get-a-backend-of-a-given-load-balancer) - [List the backends of a given Load Balancer](#list-the-backends-of-a-given-load-balancer) + - [List backend server statistics](#list-backend-server-statistics) - [Remove a set of servers for a given backend](#remove-a-set-of-servers-for-a-given-backend) - [Define all backend servers for a given backend](#define-all-backend-servers-for-a-given-backend) - [Update a backend of a given Load Balancer](#update-a-backend-of-a-given-load-balancer) @@ -58,6 +59,14 @@ Load Balancer API. - [Get a route](#get-a-route) - [List all routes](#list-all-routes) - [Update a route](#update-a-route) +- [Subscriber management commands](#subscriber-management-commands) + - [Create a subscriber](#create-a-subscriber) + - [Delete a subscriber](#delete-a-subscriber) + - [Get a subscriber](#get-a-subscriber) + - [List all subscribers](#list-all-subscribers) + - [Subscribe a subscriber to alerts for a given Load Balancer](#subscribe-a-subscriber-to-alerts-for-a-given-load-balancer) + - [Unsubscribe a subscriber from alerts for a given Load Balancer](#unsubscribe-a-subscriber-from-alerts-for-a-given-load-balancer) + - [Update a subscriber](#update-a-subscriber) ## Access Control List (ACL) management commands @@ -373,6 +382,26 @@ scw lb backend list [arg=value ...] +### List backend server statistics + +List information about your backend servers, including their state and the result of their last health check. + +**Usage:** + +``` +scw lb backend list-statistics [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| lb-id | Required | Load Balancer ID | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2`, `all` | Zone to target. If none is passed will use default zone from the config | + + + ### Remove a set of servers for a given backend For a given backend specified by its backend ID, remove the specified backend servers (identified by their IP addresses) so that it no longer forwards traffic to them. @@ -1235,3 +1264,159 @@ scw lb route update [arg=value ...] +## Subscriber management commands + +Subscriber management commands. + + +### Create a subscriber + +Create a new subscriber, either with an email configuration or a webhook configuration, for a specified Scaleway Project. + +**Usage:** + +``` +scw lb subscriber create [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| name | Required | Subscriber name | +| email-config.email | Required | Email address to send alerts to | +| webhook-config.uri | Required | URI to receive POST requests | +| project-id | | Project ID to use. If none is passed the default project ID will be used | +| organization-id | | Organization ID to use. If none is passed the default organization ID will be used | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config | + + + +### Delete a subscriber + +Delete an existing subscriber, specified by its subscriber ID. Deleting a subscriber is permanent, and cannot be undone. + +**Usage:** + +``` +scw lb subscriber delete [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| subscriber-id | Required | Subscriber ID | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config | + + + +### Get a subscriber + +Retrieve information about an existing subscriber, specified by its subscriber ID. Its full details, including name and email/webhook configuration, are returned in the response object. + +**Usage:** + +``` +scw lb subscriber get [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| subscriber-id | Required | Subscriber ID | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config | + + + +### List all subscribers + +List all subscribers to Load Balancer alerts. By default, returns all subscribers to Load Balancer alerts for the Organization associated with the authentication token used for the request. + +**Usage:** + +``` +scw lb subscriber list [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| order-by | One of: `created_at_asc`, `created_at_desc`, `name_asc`, `name_desc` | Sort order of subscribers in the response | +| name | Required | Subscriber name to search for | +| project-id | | Filter subscribers by Project ID | +| organization-id | | Filter subscribers by Organization ID | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2`, `all` | Zone to target. If none is passed will use default zone from the config | + + + +### Subscribe a subscriber to alerts for a given Load Balancer + +Subscribe an existing subscriber to alerts for a given Load Balancer. + +**Usage:** + +``` +scw lb subscriber subscribe [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| lb-id | Required | Load Balancer ID | +| subscriber-id | Required | Subscriber ID | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config | + + + +### Unsubscribe a subscriber from alerts for a given Load Balancer + +Unsubscribe a subscriber from alerts for a given Load Balancer. The subscriber is not deleted, and can be resubscribed in the future if necessary. + +**Usage:** + +``` +scw lb subscriber unsubscribe [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| lb-id | Required | Load Balancer ID | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config | + + + +### Update a subscriber + +Update the parameters of a given subscriber (e.g. name, webhook configuration, email configuration), specified by its subscriber ID. + +**Usage:** + +``` +scw lb subscriber update [arg=value ...] +``` + + +**Args:** + +| Name | | Description | +|------|---|-------------| +| subscriber-id | Required | Subscriber ID | +| name | Required | Subscriber name | +| email-config.email | Required | Email address to send alerts to | +| webhook-config.uri | Required | URI to receive POST requests | +| zone | Default: `fr-par-1`
One of: `fr-par-1`, `fr-par-2`, `nl-ams-1`, `nl-ams-2`, `pl-waw-1`, `pl-waw-2` | Zone to target. If none is passed will use default zone from the config | + + + diff --git a/internal/namespaces/container/v1beta1/container_cli.go b/internal/namespaces/container/v1beta1/container_cli.go index eb1c4c5d22..e36258cfee 100644 --- a/internal/namespaces/container/v1beta1/container_cli.go +++ b/internal/namespaces/container/v1beta1/container_cli.go @@ -41,6 +41,7 @@ func GetGeneratedCommands() *core.Commands { containerCronCreate(), containerCronUpdate(), containerCronDelete(), + containerContainerGetLogs(), containerDomainList(), containerDomainGet(), containerDomainCreate(), @@ -941,6 +942,51 @@ func containerCronDelete() *core.Command { } } +func containerContainerGetLogs() *core.Command { + return &core.Command{ + Short: `List your container logs`, + Long: `List your container logs.`, + Namespace: "container", + Resource: "container", + Verb: "get-logs", + // Deprecated: false, + ArgsType: reflect.TypeOf(container.ListLogsRequest{}), + ArgSpecs: core.ArgSpecs{ + { + Name: "container-id", + Required: true, + Deprecated: false, + Positional: true, + }, + { + Name: "order-by", + Required: false, + Deprecated: false, + Positional: false, + EnumValues: []string{"timestamp_desc", "timestamp_asc"}, + }, + core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms, scw.RegionPlWaw, scw.Region(core.AllLocalities)), + }, + Run: func(ctx context.Context, args interface{}) (i interface{}, e error) { + request := args.(*container.ListLogsRequest) + + client := core.ExtractClient(ctx) + api := container.NewAPI(client) + opts := []scw.RequestOption{scw.WithAllPages()} + if request.Region == scw.Region(core.AllLocalities) { + opts = append(opts, scw.WithRegions(api.Regions()...)) + request.Region = "" + } + resp, err := api.ListLogs(request, opts...) + if err != nil { + return nil, err + } + return resp.Logs, nil + + }, + } +} + func containerDomainList() *core.Command { return &core.Command{ Short: `List all domain name bindings`, diff --git a/internal/namespaces/function/v1beta1/function_cli.go b/internal/namespaces/function/v1beta1/function_cli.go index fa24284a41..74ee746813 100644 --- a/internal/namespaces/function/v1beta1/function_cli.go +++ b/internal/namespaces/function/v1beta1/function_cli.go @@ -24,7 +24,6 @@ func GetGeneratedCommands() *core.Commands { functionFunction(), functionCron(), functionRuntime(), - functionLogs(), functionDomain(), functionToken(), functionNamespaceList(), @@ -46,7 +45,7 @@ func GetGeneratedCommands() *core.Commands { functionCronCreate(), functionCronUpdate(), functionCronDelete(), - functionLogsList(), + functionFunctionGetLogs(), functionDomainList(), functionDomainGet(), functionDomainCreate(), @@ -101,15 +100,6 @@ func functionRuntime() *core.Command { } } -func functionLogs() *core.Command { - return &core.Command{ - Short: `Logs management commands`, - Long: `Logs management commands.`, - Namespace: "function", - Resource: "logs", - } -} - func functionDomain() *core.Command { return &core.Command{ Short: `Domain management commands`, @@ -1063,13 +1053,13 @@ func functionCronDelete() *core.Command { } } -func functionLogsList() *core.Command { +func functionFunctionGetLogs() *core.Command { return &core.Command{ Short: `List your application logs`, Long: `List your application logs.`, Namespace: "function", - Resource: "logs", - Verb: "list", + Resource: "function", + Verb: "get-logs", // Deprecated: false, ArgsType: reflect.TypeOf(function.ListLogsRequest{}), ArgSpecs: core.ArgSpecs{ @@ -1077,7 +1067,7 @@ func functionLogsList() *core.Command { Name: "function-id", Required: true, Deprecated: false, - Positional: false, + Positional: true, }, { Name: "order-by",