File tree Expand file tree Collapse file tree 6 files changed +93
-3
lines changed
internal/namespaces/cockpit/v1beta1 Expand file tree Collapse file tree 6 files changed +93
-3
lines changed Original file line number Diff line number Diff line change
1
+ 🎲🎲🎲 EXIT CODE: 0 🎲🎲🎲
2
+ 🟥🟥🟥 STDERR️️ 🟥🟥🟥️
3
+ Get the cockpit metrics with the given project ID.
4
+
5
+ USAGE:
6
+ scw cockpit cockpit get-metrics [arg=value ...]
7
+
8
+ ARGS:
9
+ [project-id] Project ID to use. If none is passed the default project ID will be used
10
+ [start-date] Start date
11
+ [end-date] End date
12
+ [metric-name] Metric name
13
+
14
+ FLAGS:
15
+ -h, --help help for get-metrics
16
+
17
+ GLOBAL FLAGS:
18
+ -c, --config string The path to the config file
19
+ -D, --debug Enable debug mode
20
+ -o, --output string Output format: json or human, see 'scw help output' for more info (default "human")
21
+ -p, --profile string The config profile to use
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ AVAILABLE COMMANDS:
9
9
activate Activate a cockpit
10
10
deactivate Deactivate a cockpit
11
11
get Get cockpit
12
+ get-metrics Get cockpit metrics
12
13
reset-grafana Reset Grafana
13
14
14
15
WORKFLOW COMMANDS:
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Cockpit API.
10
10
- [ Activate a cockpit] ( #activate-a-cockpit )
11
11
- [ Deactivate a cockpit] ( #deactivate-a-cockpit )
12
12
- [ Get cockpit] ( #get-cockpit )
13
+ - [ Get cockpit metrics] ( #get-cockpit-metrics )
13
14
- [ Reset Grafana] ( #reset-grafana )
14
15
- [ Wait for a cockpit to reach a stable state (installation)] ( #wait-for-a-cockpit-to-reach-a-stable-state-(installation) )
15
16
- [ Contacts management commands] ( #contacts-management-commands )
@@ -152,6 +153,28 @@ scw cockpit cockpit get [arg=value ...]
152
153
153
154
154
155
156
+ ### Get cockpit metrics
157
+
158
+ Get the cockpit metrics with the given project ID.
159
+
160
+ ** Usage:**
161
+
162
+ ```
163
+ scw cockpit cockpit get-metrics [arg=value ...]
164
+ ```
165
+
166
+
167
+ ** Args:**
168
+
169
+ | Name | | Description |
170
+ | ------| ---| -------------|
171
+ | project-id | | Project ID to use. If none is passed the default project ID will be used |
172
+ | start-date | | Start date |
173
+ | end-date | | End date |
174
+ | metric-name | | Metric name |
175
+
176
+
177
+
155
178
### Reset Grafana
156
179
157
180
Reset the Grafana of your cockpit associated with the given project ID.
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ require (
22
22
github.com/moby/buildkit v0.11.5
23
23
github.com/opencontainers/go-digest v1.0.0
24
24
github.com/pkg/errors v0.9.1
25
- github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230327160534-01e8b89ed721
25
+ github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230328152143-e7dd9eaf36ab
26
26
github.com/spf13/cobra v1.6.1
27
27
github.com/spf13/pflag v1.0.5
28
28
github.com/stretchr/testify v1.8.2
Original file line number Diff line number Diff line change @@ -275,8 +275,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
275
275
github.com/russross/blackfriday v1.6.0 /go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY =
276
276
github.com/russross/blackfriday/v2 v2.0.1 /go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM =
277
277
github.com/russross/blackfriday/v2 v2.1.0 /go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM =
278
- github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230327160534-01e8b89ed721 h1:sH3/HWBjaFYFuWnmA2biULFcq6KTc1OP3cdz/OPMhAI =
279
- github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230327160534-01e8b89ed721 /go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg =
278
+ github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230328152143-e7dd9eaf36ab h1:VCye3DHBTXfYxCi014GkRliIOvKImUBySvyHwIROCaE =
279
+ github.com/scaleway/scaleway-sdk-go v1.0.0-beta.15.0.20230328152143-e7dd9eaf36ab /go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg =
280
280
github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646 /go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg =
281
281
github.com/secure-systems-lab/go-securesystemslib v0.4.0 h1:b23VGrQhTA8cN2CbBw7/FulN9fTtqYUdS5+Oxzt+DUE =
282
282
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ =
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ func GetGeneratedCommands() *core.Commands {
27
27
cockpitContact (),
28
28
cockpitCockpitActivate (),
29
29
cockpitCockpitGet (),
30
+ cockpitCockpitGetMetrics (),
30
31
cockpitCockpitDeactivate (),
31
32
cockpitCockpitResetGrafana (),
32
33
cockpitTokenCreate (),
@@ -144,6 +145,50 @@ func cockpitCockpitGet() *core.Command {
144
145
}
145
146
}
146
147
148
+ func cockpitCockpitGetMetrics () * core.Command {
149
+ return & core.Command {
150
+ Short : `Get cockpit metrics` ,
151
+ Long : `Get the cockpit metrics with the given project ID.` ,
152
+ Namespace : "cockpit" ,
153
+ Resource : "cockpit" ,
154
+ Verb : "get-metrics" ,
155
+ // Deprecated: false,
156
+ ArgsType : reflect .TypeOf (cockpit.GetCockpitMetricsRequest {}),
157
+ ArgSpecs : core.ArgSpecs {
158
+ core .ProjectIDArgSpec (),
159
+ {
160
+ Name : "start-date" ,
161
+ Short : `Start date` ,
162
+ Required : false ,
163
+ Deprecated : false ,
164
+ Positional : false ,
165
+ },
166
+ {
167
+ Name : "end-date" ,
168
+ Short : `End date` ,
169
+ Required : false ,
170
+ Deprecated : false ,
171
+ Positional : false ,
172
+ },
173
+ {
174
+ Name : "metric-name" ,
175
+ Short : `Metric name` ,
176
+ Required : false ,
177
+ Deprecated : false ,
178
+ Positional : false ,
179
+ },
180
+ },
181
+ Run : func (ctx context.Context , args interface {}) (i interface {}, e error ) {
182
+ request := args .(* cockpit.GetCockpitMetricsRequest )
183
+
184
+ client := core .ExtractClient (ctx )
185
+ api := cockpit .NewAPI (client )
186
+ return api .GetCockpitMetrics (request )
187
+
188
+ },
189
+ }
190
+ }
191
+
147
192
func cockpitCockpitDeactivate () * core.Command {
148
193
return & core.Command {
149
194
Short : `Deactivate a cockpit` ,
You can’t perform that action at this time.
0 commit comments