Skip to content

Commit

Permalink
chore: migrate to cockpit v1 (#4091)
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone authored Aug 30, 2024
1 parent 4931ffd commit ff443f0
Show file tree
Hide file tree
Showing 48 changed files with 962 additions and 1,103 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Disabling the Alert manager deletes the contact points you have created and disables managed alerts in the specified Project and region.

USAGE:
scw cockpit alert-manager disable [arg=value ...]

ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Enabling the Alert manager allows you to enable managed alerts and create contact points in the specified Project and region, to be notified when your Scaleway resources may require your attention.

USAGE:
scw cockpit alert-manager enable [arg=value ...]

ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Retrieve information about the Alert manager which is unique per Project and region. By default the Alert manager is disabled.
The output returned displays a URL to access the Alert manager, and whether the Alert manager and managed alerts are enabled.

USAGE:
scw cockpit alert-manager get [arg=value ...]

ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

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
22 changes: 22 additions & 0 deletions cmd/scw/testdata/test-all-usage-cockpit-alert-manager-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Alerting management commands.

USAGE:
scw cockpit alert-manager <command>

AVAILABLE COMMANDS:
disable Disable the Alert manager
enable Enable the Alert manager
get Get the Alert manager

FLAGS:
-h, --help help for alert-manager

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-manager [command] --help" for more information about a command.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Contact points are email addresses associated with the default receiver, that the Alert manager sends alerts to.
The source of the alerts are data sources within the same Project and region as the Alert manager.
If you need to receive alerts for other receivers, you can create additional contact points and receivers in Grafana. Make sure that you select the Scaleway Alert manager.

USAGE:
scw cockpit contact-point create [arg=value ...]

ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[email.to]
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete a contact point associated with the default receiver.

USAGE:
scw cockpit contact-point delete [arg=value ...]

ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[email.to]
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Retrieve a list of contact points for the specified Project. The response lists all contact points and receivers created in Grafana or via the API.

USAGE:
scw cockpit contact-point list [arg=value ...]

ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[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 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
22 changes: 22 additions & 0 deletions cmd/scw/testdata/test-all-usage-cockpit-contact-point-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Contact point management commands.

USAGE:
scw cockpit contact-point <command>

AVAILABLE COMMANDS:
create Create a contact point
delete Delete a contact point
list List contact points

FLAGS:
-h, --help help for contact-point

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-point [command] --help" for more information about a command.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
You must specify the data source type upon creation. Available data source types include:
- metrics
- logs
- traces
The name of the data source will then be used as reference to name the associated Grafana data source.

USAGE:
scw cockpit data-source create [arg=value ...]

ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[name] Data source name
[type] Data source type (unknown_type | metrics | logs | traces)
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Delete a given data source, specified by the data source ID. Note that deleting a data source is irreversible, and cannot be undone.

USAGE:
scw cockpit data-source delete [arg=value ...]

ARGS:
data-source-id ID of the data source to delete
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Retrieve information about a given data source, specified by the data source ID. The data source's information such as its name, type, URL, origin, and retention period, is returned.

USAGE:
scw cockpit data-source get [arg=value ...]

ARGS:
data-source-id ID of the relevant data source
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Retrieve the list of data sources available in the specified region. By default, the data sources returned in the list are ordered by creation date, in ascending order.
You can list data sources by Project, type and origin.

USAGE:
scw cockpit data-source list [arg=value ...]

ARGS:
[order-by] Sort order for data sources in the response (created_at_asc | created_at_desc | name_asc | name_desc | type_asc | type_desc)
[project-id] Project ID to use. If none is passed the default project ID will be used
[origin] Origin to filter for, only data sources with matching origin will be returned (unknown_origin | scaleway | external)
[types.{index}] Types to filter for, only data sources with matching types will be returned (unknown_type | metrics | logs | traces)
[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 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Update a given data source name, specified by the data source ID.

USAGE:
scw cockpit data-source update [arg=value ...]

ARGS:
data-source-id ID of the data source to update
[name] Updated name of the data source
[region=fr-par] Region to target. If none is passed will use default region from the config (fr-par | nl-ams | pl-waw)

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
24 changes: 24 additions & 0 deletions cmd/scw/testdata/test-all-usage-cockpit-data-source-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Datasource management commands.

USAGE:
scw cockpit data-source <command>

AVAILABLE COMMANDS:
create Create a data source
delete Delete a data source
get Get a data source
list List data sources
update Update a data source

FLAGS:
-h, --help help for data-source

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 data-source [command] --help" for more information about a command.
19 changes: 19 additions & 0 deletions cmd/scw/testdata/test-all-usage-cockpit-grafana-get-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Retrieve information on your Cockpit's Grafana, specified by the ID of the Project the Cockpit belongs to.
The output returned displays the URL to access your Cockpit's Grafana.

USAGE:
scw cockpit grafana get [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 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Trigger the synchronization of all your data sources and the alert manager in the relevant regions. The alert manager will only be synchronized if you have enabled it.

USAGE:
scw cockpit grafana sync-data-sources [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 sync-data-sources

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
21 changes: 21 additions & 0 deletions cmd/scw/testdata/test-all-usage-cockpit-grafana-usage.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Grafana user management commands.

USAGE:
scw cockpit grafana <command>

AVAILABLE COMMANDS:
get Get your Cockpit's Grafana
sync-data-sources Synchronize Grafana data sources

FLAGS:
-h, --help help for grafana

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 grafana [command] --help" for more information about a command.
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Create a Grafana user for your Cockpit's Grafana. Make sure you save the automatically-generated password and the Grafana user ID.
Create a Grafana user to connect to your Cockpit's Grafana. Upon creation, your user password displays only once, so make sure that you save it.
Each Grafana user is associated with a role: viewer or editor. A viewer can only view dashboards, whereas an editor can create and edit dashboards. Note that the `admin` username is not available for creation.

USAGE:
scw cockpit grafana-user create [arg=value ...]

ARGS:
[project-id] Project ID to use. If none is passed the default project ID will be used
[login] Username of the Grafana user
[login] Username of the Grafana user. Note that the `admin` username is not available for creation
[role] Role assigned to the Grafana user (unknown_role | editor | viewer)

FLAGS:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
Get a list of all Grafana users created in your Cockpit's Grafana.
List all Grafana users created in your Cockpit's Grafana. By default, the Grafana users returned in the list are ordered in ascending order.

USAGE:
scw cockpit grafana-user list [arg=value ...]

ARGS:
[order-by] (login_asc | login_desc)
[order-by] Order of the Grafana users (login_asc | login_desc)
[project-id] Project ID to use. If none is passed the default project ID will be used

FLAGS:
Expand Down
Loading

0 comments on commit ff443f0

Please sign in to comment.