Skip to content

Commit 8a19894

Browse files
authored
feat(cockpit): create datasource (#3373)
1 parent 2708b8f commit 8a19894

12 files changed

+127
-86
lines changed

cmd/scw/testdata/test-all-usage-cockpit-alert-usage.golden

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

88
AVAILABLE COMMANDS:
9-
disable Disable managed alerts
10-
enable Enable managed alerts
11-
test Trigger a test alert
9+
disable Disable the sending of managed alerts for the specified Project's Cockpit
10+
enable Enable the sending of managed alerts for the specified Project's Cockpit
11+
test Trigger a test alert to all of the Cockpit's receivers
1212

1313
FLAGS:
1414
-h, --help help for alert

cmd/scw/testdata/test-all-usage-cockpit-cockpit-usage.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ USAGE:
66
scw cockpit cockpit <command>
77

88
AVAILABLE COMMANDS:
9-
activate Activate a Cockpit
10-
deactivate Deactivate a Cockpit
11-
get Get a Cockpit
12-
reset-grafana Reset a Grafana
9+
activate Activate the Cockpit of the specified Project ID
10+
deactivate Deactivate the Cockpit of the specified Project ID
11+
get Retrieve the Cockpit of the specified Project ID
12+
reset-grafana Reset your Cockpit's Grafana associated with the specified Project ID
1313

1414
WORKFLOW COMMANDS:
1515
wait Wait for a cockpit to reach a stable state (installation)

cmd/scw/testdata/test-all-usage-cockpit-contact-usage.golden

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

88
AVAILABLE COMMANDS:
9-
create Create a contact point
10-
delete Delete an alert contact point
11-
list List contact points
9+
create Create a contact point to receive alerts for the default receiver
10+
delete Delete a contact point for the default receiver
11+
list Get a list of contact points for the Cockpit associated with the specified Project ID
1212

1313
FLAGS:
1414
-h, --help help for contact
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2+
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3+
Datasource management commands.
4+
5+
USAGE:
6+
scw cockpit datasource
7+
8+
FLAGS:
9+
-h, --help help for datasource
10+
11+
GLOBAL FLAGS:
12+
-c, --config string The path to the config file
13+
-D, --debug Enable debug mode
14+
-o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
15+
-p, --profile string The config profile to use

cmd/scw/testdata/test-all-usage-cockpit-grafana-user-usage.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ USAGE:
66
scw cockpit grafana-user <command>
77

88
AVAILABLE COMMANDS:
9-
create Create a Grafana user
10-
delete Delete a Grafana user
11-
list List Grafana users
12-
reset-password Reset a Grafana user's password
9+
create Create a Grafana user for your Cockpit's Grafana instance. Make sure you save the automatically-generated password and the Grafana user ID
10+
delete Delete a Grafana user from a Grafana instance, specified by the Cockpit's Project ID and the Grafana user ID
11+
list Get a list of Grafana users who are able to connect to the Cockpit's Grafana instance
12+
reset-password Reset a Grafana user's password specified by the Cockpit's Project ID and the Grafana user ID
1313

1414
FLAGS:
1515
-h, --help help for grafana-user

cmd/scw/testdata/test-all-usage-cockpit-plan-usage.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ USAGE:
66
scw cockpit plan <command>
77

88
AVAILABLE COMMANDS:
9-
list List pricing plans
10-
select Select pricing plan
9+
list Get a list of all pricing plans available
10+
select Select your chosen pricing plan for your Cockpit, specifying the Cockpit's Project ID and the pricing plan's ID in the request
1111

1212
FLAGS:
1313
-h, --help help for plan

cmd/scw/testdata/test-all-usage-cockpit-token-usage.golden

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ USAGE:
66
scw cockpit token <command>
77

88
AVAILABLE COMMANDS:
9-
create Create a token
10-
delete Delete a token
11-
get Get a token
12-
list List tokens
9+
create Create a token associated with the specified Project ID
10+
delete Delete the token associated with the specified token ID
11+
get Retrieve the token associated with the specified token ID
12+
list Get a list of tokens associated with the specified Project ID
1313

1414
FLAGS:
1515
-h, --help help for token

cmd/scw/testdata/test-all-usage-cockpit-usage.golden

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
22
🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3-
Cockpit's API allows you to activate your Cockpit on your Projects. Scaleway's Cockpit stores metrics and logs and provides a dedicated Grafana for dashboarding to visualize them.
3+
Cockpit API.
44

55
USAGE:
66
scw cockpit <command>
@@ -9,6 +9,7 @@ AVAILABLE COMMANDS:
99
alert Managed alerts management commands
1010
cockpit Cockpit management commands
1111
contact Contacts management commands
12+
datasource Datasource management commands
1213
grafana-user Grafana user management commands
1314
plan Pricing plans management commands
1415
token Token management commands

docs/commands/cockpit.md

Lines changed: 56 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,43 @@
11
<!-- DO NOT EDIT: this file is automatically generated using scw-doc-gen -->
22
# Documentation for `scw cockpit`
3-
Cockpit's API allows you to activate your Cockpit on your Projects. Scaleway's Cockpit stores metrics and logs and provides a dedicated Grafana for dashboarding to visualize them.
3+
Cockpit API.
44

55
- [Managed alerts management commands](#managed-alerts-management-commands)
6-
- [Disable managed alerts](#disable-managed-alerts)
7-
- [Enable managed alerts](#enable-managed-alerts)
8-
- [Trigger a test alert](#trigger-a-test-alert)
6+
- [Disable the sending of managed alerts for the specified Project's Cockpit](#disable-the-sending-of-managed-alerts-for-the-specified-project's-cockpit)
7+
- [Enable the sending of managed alerts for the specified Project's Cockpit](#enable-the-sending-of-managed-alerts-for-the-specified-project's-cockpit)
8+
- [Trigger a test alert to all of the Cockpit's receivers](#trigger-a-test-alert-to-all-of-the-cockpit's-receivers)
99
- [Cockpit management commands](#cockpit-management-commands)
10-
- [Activate a Cockpit](#activate-a-cockpit)
11-
- [Deactivate a Cockpit](#deactivate-a-cockpit)
12-
- [Get a Cockpit](#get-a-cockpit)
13-
- [Reset a Grafana](#reset-a-grafana)
10+
- [Activate the Cockpit of the specified Project ID](#activate-the-cockpit-of-the-specified-project-id)
11+
- [Deactivate the Cockpit of the specified Project ID](#deactivate-the-cockpit-of-the-specified-project-id)
12+
- [Retrieve the Cockpit of the specified Project ID](#retrieve-the-cockpit-of-the-specified-project-id)
13+
- [Reset your Cockpit's Grafana associated with the specified Project ID](#reset-your-cockpit's-grafana-associated-with-the-specified-project-id)
1414
- [Wait for a cockpit to reach a stable state (installation)](#wait-for-a-cockpit-to-reach-a-stable-state-(installation))
1515
- [Contacts management commands](#contacts-management-commands)
16-
- [Create a contact point](#create-a-contact-point)
17-
- [Delete an alert contact point](#delete-an-alert-contact-point)
18-
- [List contact points](#list-contact-points)
16+
- [Create a contact point to receive alerts for the default receiver](#create-a-contact-point-to-receive-alerts-for-the-default-receiver)
17+
- [Delete a contact point for the default receiver](#delete-a-contact-point-for-the-default-receiver)
18+
- [Get a list of contact points for the Cockpit associated with the specified Project ID](#get-a-list-of-contact-points-for-the-cockpit-associated-with-the-specified-project-id)
19+
- [Datasource management commands](#datasource-management-commands)
1920
- [Grafana user management commands](#grafana-user-management-commands)
20-
- [Create a Grafana user](#create-a-grafana-user)
21-
- [Delete a Grafana user](#delete-a-grafana-user)
22-
- [List Grafana users](#list-grafana-users)
23-
- [Reset a Grafana user's password](#reset-a-grafana-user's-password)
21+
- [Create a Grafana user for your Cockpit's Grafana instance. Make sure you save the automatically-generated password and the Grafana user ID](#create-a-grafana-user-for-your-cockpit's-grafana-instance.-make-sure-you-save-the-automatically-generated-password-and-the-grafana-user-id)
22+
- [Delete a Grafana user from a Grafana instance, specified by the Cockpit's Project ID and the Grafana user ID](#delete-a-grafana-user-from-a-grafana-instance,-specified-by-the-cockpit's-project-id-and-the-grafana-user-id)
23+
- [Get a list of Grafana users who are able to connect to the Cockpit's Grafana instance](#get-a-list-of-grafana-users-who-are-able-to-connect-to-the-cockpit's-grafana-instance)
24+
- [Reset a Grafana user's password specified by the Cockpit's Project ID and the Grafana user ID](#reset-a-grafana-user's-password-specified-by-the-cockpit's-project-id-and-the-grafana-user-id)
2425
- [Pricing plans management commands](#pricing-plans-management-commands)
25-
- [List pricing plans](#list-pricing-plans)
26-
- [Select pricing plan](#select-pricing-plan)
26+
- [Get a list of all pricing plans available](#get-a-list-of-all-pricing-plans-available)
27+
- [Select your chosen pricing plan for your Cockpit, specifying the Cockpit's Project ID and the pricing plan's ID in the request](#select-your-chosen-pricing-plan-for-your-cockpit,-specifying-the-cockpit's-project-id-and-the-pricing-plan's-id-in-the-request)
2728
- [Token management commands](#token-management-commands)
28-
- [Create a token](#create-a-token)
29-
- [Delete a token](#delete-a-token)
30-
- [Get a token](#get-a-token)
31-
- [List tokens](#list-tokens)
29+
- [Create a token associated with the specified Project ID](#create-a-token-associated-with-the-specified-project-id)
30+
- [Delete the token associated with the specified token ID](#delete-the-token-associated-with-the-specified-token-id)
31+
- [Retrieve the token associated with the specified token ID](#retrieve-the-token-associated-with-the-specified-token-id)
32+
- [Get a list of tokens associated with the specified Project ID](#get-a-list-of-tokens-associated-with-the-specified-project-id)
3233

3334

3435
## Managed alerts management commands
3536

3637
Managed alerts management commands.
3738

3839

39-
### Disable managed alerts
40+
### Disable the sending of managed alerts for the specified Project's Cockpit
4041

4142
Disable the sending of managed alerts for the specified Project's Cockpit.
4243

@@ -55,7 +56,7 @@ scw cockpit alert disable [arg=value ...]
5556

5657

5758

58-
### Enable managed alerts
59+
### Enable the sending of managed alerts for the specified Project's Cockpit
5960

6061
Enable the sending of managed alerts for the specified Project's Cockpit.
6162

@@ -74,7 +75,7 @@ scw cockpit alert enable [arg=value ...]
7475

7576

7677

77-
### Trigger a test alert
78+
### Trigger a test alert to all of the Cockpit's receivers
7879

7980
Trigger a test alert to all of the Cockpit's receivers.
8081

@@ -98,7 +99,7 @@ scw cockpit alert test [arg=value ...]
9899
Cockpit management commands.
99100

100101

101-
### Activate a Cockpit
102+
### Activate the Cockpit of the specified Project ID
102103

103104
Activate the Cockpit of the specified Project ID.
104105

@@ -117,7 +118,7 @@ scw cockpit cockpit activate [arg=value ...]
117118

118119

119120

120-
### Deactivate a Cockpit
121+
### Deactivate the Cockpit of the specified Project ID
121122

122123
Deactivate the Cockpit of the specified Project ID.
123124

@@ -136,7 +137,7 @@ scw cockpit cockpit deactivate [arg=value ...]
136137

137138

138139

139-
### Get a Cockpit
140+
### Retrieve the Cockpit of the specified Project ID
140141

141142
Retrieve the Cockpit of the specified Project ID.
142143

@@ -155,7 +156,7 @@ scw cockpit cockpit get [arg=value ...]
155156

156157

157158

158-
### Reset a Grafana
159+
### Reset your Cockpit's Grafana associated with the specified Project ID
159160

160161
Reset your Cockpit's Grafana associated with the specified Project ID.
161162

@@ -209,7 +210,7 @@ scw cockpit cockpit wait 11111111-1111-1111-1111-111111111111
209210
Contacts management commands.
210211

211212

212-
### Create a contact point
213+
### Create a contact point to receive alerts for the default receiver
213214

214215
Create a contact point to receive alerts for the default receiver.
215216

@@ -229,7 +230,7 @@ scw cockpit contact create [arg=value ...]
229230

230231

231232

232-
### Delete an alert contact point
233+
### Delete a contact point for the default receiver
233234

234235
Delete a contact point for the default receiver.
235236

@@ -249,7 +250,7 @@ scw cockpit contact delete [arg=value ...]
249250

250251

251252

252-
### List contact points
253+
### Get a list of contact points for the Cockpit associated with the specified Project ID
253254

254255
Get a list of contact points for the Cockpit associated with the specified Project ID.
255256

@@ -268,12 +269,26 @@ scw cockpit contact list [arg=value ...]
268269

269270

270271

272+
## Datasource management commands
273+
274+
Datasource management commands.
275+
276+
Datasource management commands.
277+
278+
**Usage:**
279+
280+
```
281+
scw cockpit datasource
282+
```
283+
284+
285+
271286
## Grafana user management commands
272287

273288
Grafana user management commands.
274289

275290

276-
### Create a Grafana user
291+
### Create a Grafana user for your Cockpit's Grafana instance. Make sure you save the automatically-generated password and the Grafana user ID
277292

278293
Create a Grafana user for your Cockpit's Grafana instance. Make sure you save the automatically-generated password and the Grafana user ID.
279294

@@ -294,7 +309,7 @@ scw cockpit grafana-user create [arg=value ...]
294309

295310

296311

297-
### Delete a Grafana user
312+
### Delete a Grafana user from a Grafana instance, specified by the Cockpit's Project ID and the Grafana user ID
298313

299314
Delete a Grafana user from a Grafana instance, specified by the Cockpit's Project ID and the Grafana user ID.
300315

@@ -314,7 +329,7 @@ scw cockpit grafana-user delete [arg=value ...]
314329

315330

316331

317-
### List Grafana users
332+
### Get a list of Grafana users who are able to connect to the Cockpit's Grafana instance
318333

319334
Get a list of Grafana users who are able to connect to the Cockpit's Grafana instance.
320335

@@ -334,7 +349,7 @@ scw cockpit grafana-user list [arg=value ...]
334349

335350

336351

337-
### Reset a Grafana user's password
352+
### Reset a Grafana user's password specified by the Cockpit's Project ID and the Grafana user ID
338353

339354
Reset a Grafana user's password specified by the Cockpit's Project ID and the Grafana user ID.
340355

@@ -359,7 +374,7 @@ scw cockpit grafana-user reset-password [arg=value ...]
359374
Pricing plans management commands.
360375

361376

362-
### List pricing plans
377+
### Get a list of all pricing plans available
363378

364379
Get a list of all pricing plans available.
365380

@@ -378,7 +393,7 @@ scw cockpit plan list [arg=value ...]
378393

379394

380395

381-
### Select pricing plan
396+
### Select your chosen pricing plan for your Cockpit, specifying the Cockpit's Project ID and the pricing plan's ID in the request
382397

383398
Select your chosen pricing plan for your Cockpit, specifying the Cockpit's Project ID and the pricing plan's ID in the request.
384399

@@ -403,7 +418,7 @@ scw cockpit plan select [arg=value ...]
403418
Token management commands.
404419

405420

406-
### Create a token
421+
### Create a token associated with the specified Project ID
407422

408423
Create a token associated with the specified Project ID.
409424

@@ -432,7 +447,7 @@ scw cockpit token create [arg=value ...]
432447

433448

434449

435-
### Delete a token
450+
### Delete the token associated with the specified token ID
436451

437452
Delete the token associated with the specified token ID.
438453

@@ -451,7 +466,7 @@ scw cockpit token delete [arg=value ...]
451466

452467

453468

454-
### Get a token
469+
### Retrieve the token associated with the specified token ID
455470

456471
Retrieve the token associated with the specified token ID.
457472

@@ -470,7 +485,7 @@ scw cockpit token get <token-id ...> [arg=value ...]
470485

471486

472487

473-
### List tokens
488+
### Get a list of tokens associated with the specified Project ID
474489

475490
Get a list of tokens associated with the specified Project ID.
476491

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ require (
2424
github.com/moby/buildkit v0.11.6
2525
github.com/opencontainers/go-digest v1.0.0
2626
github.com/pkg/errors v0.9.1
27-
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20230915112452-d153ad293c76
27+
github.com/scaleway/scaleway-sdk-go v1.0.0-beta.21.0.20230918151823-4f048611ed7c
2828
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
2929
github.com/spf13/cobra v1.7.0
3030
github.com/spf13/pflag v1.0.5

0 commit comments

Comments
 (0)