NewMonitorCmd returns a new instance of the 'monitor_item' command.
()
| 446 | |
| 447 | // NewMonitorCmd returns a new instance of the 'monitor_item' command. |
| 448 | func NewMonitorCmd() *cobra.Command { |
| 449 | cmd := &cobra.Command{ |
| 450 | Use: "monitor [monitor_id]...", |
| 451 | Short: "Manage your monitor account", |
| 452 | Long: monitorCmdHelp, |
| 453 | Args: cobra.MinimumNArgs(1), |
| 454 | |
| 455 | RunE: func(cmd *cobra.Command, args []string) error { |
| 456 | re, _ := regexp.Compile(base64RegExp) |
| 457 | p, err := NewPrinter(cmd) |
| 458 | if err != nil { |
| 459 | return err |
| 460 | } |
| 461 | return p.GetAndPrintObjects("monitor/items/%s", |
| 462 | utils.StringReaderFromCmdArgs(args), |
| 463 | re) |
| 464 | }, |
| 465 | } |
| 466 | |
| 467 | addThreadsFlag(cmd.Flags()) |
| 468 | addIncludeExcludeFlags(cmd.Flags()) |
| 469 | |
| 470 | cmd.AddCommand(NewMonitorItemsListCmd()) |
| 471 | cmd.AddCommand(NewMonitorItemsUploadCmd()) |
| 472 | cmd.AddCommand(NewMonitorItemsDeleteCmd()) |
| 473 | cmd.AddCommand(NewMonitorItemsDownloadCmd()) |
| 474 | cmd.AddCommand(NewMonitorItemsSetDetailsCmd()) |
| 475 | cmd.AddCommand(NewMonitorItemsDeleteDetailsCmd()) |
| 476 | |
| 477 | addRelationshipCmds(cmd, "monitor/items", "monitor_item", "[monitor_id]", false) |
| 478 | |
| 479 | return cmd |
| 480 | } |
no test coverage detected