MCPcopy Create free account
hub / github.com/clouditor/clouditor / NewRemoveCertificationTargetComand

Function NewRemoveCertificationTargetComand

cli/commands/cloud/cloud.go:154–184  ·  view source on GitHub ↗

NewRemoveCertificationTargetComand returns a cobra command for the `get` subcommand

()

Source from the content-addressed store, hash-verified

152
153// NewRemoveCertificationTargetComand returns a cobra command for the `get` subcommand
154func NewRemoveCertificationTargetComand() *cobra.Command {
155 cmd := &cobra.Command{
156 Use: "remove [id]",
157 Short: "Removes a target certification target by its ID",
158 Args: cobra.ExactArgs(1),
159 RunE: func(cmd *cobra.Command, args []string) error {
160 var (
161 err error
162 session *cli.Session
163 client orchestrator.OrchestratorClient
164 res *emptypb.Empty
165 )
166
167 if session, err = cli.ContinueSession(); err != nil {
168 fmt.Printf("Error while retrieving the session. Please re-authenticate.\n")
169 return nil
170 }
171
172 client = orchestrator.NewOrchestratorClient(session)
173
174 targetID := args[0]
175
176 res, err = client.RemoveCertificationTarget(context.Background(), &orchestrator.RemoveCertificationTargetRequest{CertificationTargetId: targetID})
177
178 return session.HandleResponse(res, err)
179 },
180 ValidArgsFunction: cli.DefaultArgsShellComp,
181 }
182
183 return cmd
184}
185
186// NewUpdateCertificationTargetCommand returns a cobra command for the `update` subcommand
187func NewUpdateCertificationTargetCommand() *cobra.Command {

Callers 2

AddCommandsFunction · 0.85

Calls 4

ContinueSessionFunction · 0.92
NewOrchestratorClientFunction · 0.92
HandleResponseMethod · 0.80

Tested by 1