feat(recording): Delete Session Recording
This commit is contained in:
1 parent
0a853c2262
commit
f26243e9af
17 files changed
+641
-138
No files matched your search
@@ -70,6 +70,9 @@ func (c *Command) Help() string {
|
||||
|
||||
switch c.Func {
|
||||
|
||||
case "delete":
|
||||
helpStr = helpMap[c.Func]() + c.Flags().Help()
|
||||
|
||||
case "read":
|
||||
helpStr = helpMap[c.Func]() + c.Flags().Help()
|
||||
|
||||
@@ -89,6 +92,8 @@ func (c *Command) Help() string {
|
||||
|
||||
var flagsMap = map[string][]string{
|
||||
|
||||
"delete": {"id"},
|
||||
|
||||
"read": {"id"},
|
||||
|
||||
"list": {"scope-id", "recursive"},
|
||||
@@ -185,12 +190,21 @@ func (c *Command) Run(args []string) int {
|
||||
|
||||
var items []*sessionrecordings.SessionRecording
|
||||
|
||||
var deleteResult *sessionrecordings.SessionRecordingDeleteResult
|
||||
|
||||
var readResult *sessionrecordings.SessionRecordingReadResult
|
||||
|
||||
var listResult *sessionrecordings.SessionRecordingListResult
|
||||
|
||||
switch c.Func {
|
||||
|
||||
case "delete":
|
||||
deleteResult, err = sessionrecordingsClient.Delete(c.Context, c.FlagId, opts...)
|
||||
if exitCode := c.checkFuncError(err); exitCode > 0 {
|
||||
return exitCode
|
||||
}
|
||||
resp = deleteResult.GetResponse()
|
||||
|
||||
case "read":
|
||||
readResult, err = sessionrecordingsClient.Read(c.Context, c.FlagId, opts...)
|
||||
if exitCode := c.checkFuncError(err); exitCode > 0 {
|
||||
@@ -225,6 +239,19 @@ func (c *Command) Run(args []string) int {
|
||||
|
||||
switch c.Func {
|
||||
|
||||
case "delete":
|
||||
switch base.Format(c.UI) {
|
||||
case "json":
|
||||
if ok := c.PrintJsonItem(resp); !ok {
|
||||
return base.CommandCliError
|
||||
}
|
||||
|
||||
case "table":
|
||||
c.UI.Output("The delete operation completed successfully.")
|
||||
}
|
||||
|
||||
return base.CommandSuccess
|
||||
|
||||
case "list":
|
||||
switch base.Format(c.UI) {
|
||||
case "json":
|
||||
|
||||
Reference in new issue
Block a user