@@ -46,6 +46,7 @@ func GetGeneratedCommands() *core.Commands {
46
46
cockpitDataSourceGet (),
47
47
cockpitDataSourceDelete (),
48
48
cockpitDataSourceList (),
49
+ cockpitDataSourceUpdate (),
49
50
cockpitUsageOverviewGet (),
50
51
cockpitTokenCreate (),
51
52
cockpitTokenList (),
@@ -684,6 +685,43 @@ You can list data sources by Project, type and origin.`,
684
685
}
685
686
}
686
687
688
+ func cockpitDataSourceUpdate () * core.Command {
689
+ return & core.Command {
690
+ Short : `Update a data source` ,
691
+ Long : `Update a given data source name, specified by the data source ID.` ,
692
+ Namespace : "cockpit" ,
693
+ Resource : "data-source" ,
694
+ Verb : "update" ,
695
+ // Deprecated: false,
696
+ ArgsType : reflect .TypeOf (cockpit.RegionalAPIUpdateDataSourceRequest {}),
697
+ ArgSpecs : core.ArgSpecs {
698
+ {
699
+ Name : "data-source-id" ,
700
+ Short : `ID of the data source to update` ,
701
+ Required : true ,
702
+ Deprecated : false ,
703
+ Positional : false ,
704
+ },
705
+ {
706
+ Name : "name" ,
707
+ Short : `Updated name of the data source` ,
708
+ Required : false ,
709
+ Deprecated : false ,
710
+ Positional : false ,
711
+ },
712
+ core .RegionArgSpec (scw .RegionFrPar , scw .RegionNlAms , scw .RegionPlWaw ),
713
+ },
714
+ Run : func (ctx context.Context , args interface {}) (i interface {}, e error ) {
715
+ request := args .(* cockpit.RegionalAPIUpdateDataSourceRequest )
716
+
717
+ client := core .ExtractClient (ctx )
718
+ api := cockpit .NewRegionalAPI (client )
719
+ return api .UpdateDataSource (request )
720
+
721
+ },
722
+ }
723
+ }
724
+
687
725
func cockpitUsageOverviewGet () * core.Command {
688
726
return & core.Command {
689
727
Short : `Get data source usage overview` ,
0 commit comments