Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Cmd = &command.Command{ Cobra: &cobra.Command{ Args: cobra.NoArgs, Use: "get", Short: "get triton package", SilenceUsage: true, PreRunE: func(cmd *cobra.Command, args []string) error { if cfg.GetPkgID() == "" && cfg.GetPkgName() == "" { return errors.New("Either `id` or `name` must be specified") } if cfg.GetPkgID() != "" && cfg.GetPkgName() != "" { return errors.New("Only 1 of `id` or `name` must be specified") } return nil }, RunE: func(cmd *cobra.Command, args []string) error { cons := conswriter.GetTerminal() c, err := cfg.NewTritonConfig() if err != nil { return err } a, err := compute.NewComputeClient(c) if err != nil { return err } pkg, err := a.GetPackage() if err != nil { return err } bytes, err := json.Marshal(pkg) if err != nil { return err } output, _ := prettyPrintJSON(bytes) cons.Write(output) return nil }, }, Setup: func(parent *command.Command) error { return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.