feat: added functionality for remote delete command (#283)

* feat: added functionality for remote delete command

* chore: pulled recent openapi changes and ran make fmt
This commit is contained in:
mcfarlm3
2021-10-04 10:02:36 -07:00
committed by GitHub
parent d0640ad6c4
commit b7627a33c8
3 changed files with 43 additions and 4 deletions

View File

@ -92,13 +92,29 @@ func newRemoteCreateCmd() cli.Command {
}
func newRemoteDeleteCmd() cli.Command {
var remoteID string
return cli.Command{
Name: "delete",
Usage: "Delete an existing remote connection",
Before: middleware.WithBeforeFns(withCli(), withApi(true), middleware.NoArgs),
Flags: commonFlags(),
Action: func(ctx *cli.Context) {
fmt.Println("remote delete command was called")
Flags: append(
commonFlags(),
&cli.StringFlag{
Name: "remote-id, id",
Usage: "ID of the remote connection to be deleted",
Required: true,
Destination: &remoteID,
},
),
Action: func(ctx *cli.Context) error {
api := getAPI(ctx)
client := remote.Client{
CLI: getCLI(ctx),
RemoteConnectionsApi: api.RemoteConnectionsApi,
}
return client.Delete(getContext(ctx), remoteID)
},
}
}