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

Function NewCollectionCmd

cmd/collection.go:37–69  ·  view source on GitHub ↗

NewCollectionCmd returns a new instance of the 'collection' command.

()

Source from the content-addressed store, hash-verified

35
36// NewCollectionCmd returns a new instance of the 'collection' command.
37func NewCollectionCmd() *cobra.Command {
38 cmd := &cobra.Command{
39 Use: "collection [collection]...",
40 Short: "Get information about collections",
41 Long: collectionCmdHelp,
42 Example: collectionCmdExample,
43 Args: cobra.MinimumNArgs(1),
44
45 RunE: func(cmd *cobra.Command, args []string) error {
46 p, err := NewPrinter(cmd)
47 if err != nil {
48 return err
49 }
50 return p.GetAndPrintObjects(
51 "collections/%s",
52 utils.StringReaderFromCmdArgs(args),
53 nil)
54 },
55 }
56
57 cmd.AddCommand(NewCollectionCreateCmd())
58 cmd.AddCommand(NewCollectionRenameCmd())
59 cmd.AddCommand(NewCollectionUpdateCmd())
60 cmd.AddCommand(NewCollectionDeleteCmd())
61 cmd.AddCommand(NewCollectionRemoveItemsCmd())
62
63 addRelationshipCmds(cmd, "collections", "collection", "[collection]", false)
64 addThreadsFlag(cmd.Flags())
65 addIncludeExcludeFlags(cmd.Flags())
66 addIDOnlyFlag(cmd.Flags())
67
68 return cmd
69}
70
71var createCollectionCmdHelp = `Creates a collection from a list of IOCs.
72

Callers 1

NewVTCommandFunction · 0.85

Calls 12

GetAndPrintObjectsMethod · 0.95
StringReaderFromCmdArgsFunction · 0.92
NewCollectionCreateCmdFunction · 0.85
NewCollectionRenameCmdFunction · 0.85
NewCollectionUpdateCmdFunction · 0.85
NewCollectionDeleteCmdFunction · 0.85
addRelationshipCmdsFunction · 0.85
addThreadsFlagFunction · 0.85
addIncludeExcludeFlagsFunction · 0.85
addIDOnlyFlagFunction · 0.85
NewPrinterFunction · 0.70

Tested by

no test coverage detected