@@ -14,8 +14,10 @@ var integrationsKubernetesCmd = &cobra.Command{
1414}
1515
1616var integrationsKubernetesList = & cobra.Command {
17- Use : "list" ,
18- Short : "List integrations" ,
17+ Use : "list" ,
18+ Aliases : []string {"ls" },
19+ Args : cobra .ExactArgs (0 ),
20+ Short : "List integrations" ,
1921 RunE : func (cmd * cobra.Command , args []string ) error {
2022 client , err := api .NewAPIClient ()
2123 if err != nil {
@@ -40,3 +42,35 @@ var integrationsKubernetesList = &cobra.Command{
4042 return nil
4143 },
4244}
45+
46+ var integrationsKubernetesDelete = & cobra.Command {
47+ Use : "delete" ,
48+ Aliases : []string {"del" },
49+ Args : cobra .ExactArgs (1 ),
50+ Short : "Delete integration given an id" ,
51+ RunE : func (cmd * cobra.Command , args []string ) error {
52+ id := args [0 ]
53+ client , err := api .NewAPIClient ()
54+ if err != nil {
55+ return err
56+ }
57+ res , err := client .DeleteV1IntegrationsKubernetesIdWithResponse (context .Background (), id )
58+ if err != nil {
59+ return err
60+ }
61+ if res .JSON200 != nil {
62+ print (res .JSON200 , func () {
63+ fmt .Println ("Integration deleted" )
64+ })
65+ } else if res .JSON404 != nil {
66+ print (res .JSON404 , func () {
67+ fmt .Println ("Integration not found" )
68+ })
69+ } else if res .JSON500 != nil {
70+ print (res .JSON500 , func () {
71+ fmt .Println ("Error deleting integration" , res .JSON500 .Message )
72+ })
73+ }
74+ return nil
75+ },
76+ }
0 commit comments