@@ -78,7 +78,11 @@ func egressWebhooksGet() *cobra.Command {
7878 Short : "get an egress webhook" ,
7979 Args : cobra .ExactArgs (1 ),
8080 RunE : func (cmd * cobra.Command , args []string ) error {
81- id := klev .EgressWebhookID (args [0 ])
81+ id , err := klev .ParseEgressWebhookID (args [0 ])
82+ if err != nil {
83+ return err
84+ }
85+
8286 out , err := klient .EgressWebhooks .Get (cmd .Context (), id )
8387 return output (out , err )
8488 },
@@ -97,7 +101,11 @@ func egressWebhooksRotate() *cobra.Command {
97101 cmd .Flags ().Int64Var (& in .ExpireSeconds , "expire-seconds" , 0 , "for how long the old secret is valid" )
98102
99103 cmd .RunE = func (cmd * cobra.Command , args []string ) error {
100- id := klev .EgressWebhookID (args [0 ])
104+ id , err := klev .ParseEgressWebhookID (args [0 ])
105+ if err != nil {
106+ return err
107+ }
108+
101109 out , err := klient .EgressWebhooks .RotateRaw (cmd .Context (), id , in )
102110 return output (out , err )
103111 }
@@ -111,7 +119,11 @@ func egressWebhooksStatus() *cobra.Command {
111119 Short : "status an egress webhook" ,
112120 Args : cobra .ExactArgs (1 ),
113121 RunE : func (cmd * cobra.Command , args []string ) error {
114- id := klev .EgressWebhookID (args [0 ])
122+ id , err := klev .ParseEgressWebhookID (args [0 ])
123+ if err != nil {
124+ return err
125+ }
126+
115127 out , err := klient .EgressWebhooks .Status (cmd .Context (), id )
116128 return output (out , err )
117129 },
@@ -129,6 +141,11 @@ func egressWebhooksUpdate() *cobra.Command {
129141 destination := cmd .Flags ().String ("destination" , "" , "where to deliver data" )
130142
131143 cmd .RunE = func (cmd * cobra.Command , args []string ) error {
144+ id , err := klev .ParseEgressWebhookID (args [0 ])
145+ if err != nil {
146+ return err
147+ }
148+
132149 var in klev.EgressWebhookUpdateParams
133150
134151 if cmd .Flags ().Changed ("metadata" ) {
@@ -138,7 +155,6 @@ func egressWebhooksUpdate() *cobra.Command {
138155 in .Destination = destination
139156 }
140157
141- id := klev .EgressWebhookID (args [0 ])
142158 out , err := klient .EgressWebhooks .UpdateRaw (cmd .Context (), id , in )
143159 return output (out , err )
144160 }
@@ -152,7 +168,11 @@ func egressWebhooksDelete() *cobra.Command {
152168 Short : "delete an egress webhook" ,
153169 Args : cobra .ExactArgs (1 ),
154170 RunE : func (cmd * cobra.Command , args []string ) error {
155- id := klev .EgressWebhookID (args [0 ])
171+ id , err := klev .ParseEgressWebhookID (args [0 ])
172+ if err != nil {
173+ return err
174+ }
175+
156176 out , err := klient .EgressWebhooks .Delete (cmd .Context (), id )
157177 return output (out , err )
158178 },
0 commit comments