MCPcopy Create free account
hub / github.com/VirusTotal/vt-cli / NewMonitorCmd

Function NewMonitorCmd

cmd/monitor.go:448–480  ·  view source on GitHub ↗

NewMonitorCmd returns a new instance of the 'monitor_item' command.

()

Source from the content-addressed store, hash-verified

446
447// NewMonitorCmd returns a new instance of the 'monitor_item' command.
448func 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}

Callers 1

NewVTCommandFunction · 0.85

Calls 12

GetAndPrintObjectsMethod · 0.95
StringReaderFromCmdArgsFunction · 0.92
addThreadsFlagFunction · 0.85
addIncludeExcludeFlagsFunction · 0.85
NewMonitorItemsListCmdFunction · 0.85
NewMonitorItemsUploadCmdFunction · 0.85
NewMonitorItemsDeleteCmdFunction · 0.85
addRelationshipCmdsFunction · 0.85
NewPrinterFunction · 0.70

Tested by

no test coverage detected