MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / NewCmdCreate

Function NewCmdCreate

pkg/cmd/workerpool/dynamic/create/create.go:63–88  ·  view source on GitHub ↗
(f factory.Factory)

Source from the content-addressed store, hash-verified

61}
62
63func NewCmdCreate(f factory.Factory) *cobra.Command {
64 createFlags := NewCreateFlags()
65
66 cmd := &cobra.Command{
67 Use: "create",
68 Short: "Create a dynamic worker pool",
69 Long: "Create a dynamic worker pool in Octopus Deploy",
70 Example: heredoc.Docf(`
71 %s worker-pool dynamic create
72 `, constants.ExecutableName),
73 RunE: func(c *cobra.Command, _ []string) error {
74 opts := NewCreateOptions(createFlags, cmd.NewDependencies(f, c))
75
76 return createRun(opts)
77 },
78 }
79
80 flags := cmd.Flags()
81 flags.StringVarP(&createFlags.Name.Value, createFlags.Name.Name, "n", "", "A short, memorable, unique name for this worker pool.")
82 flags.StringVar(&createFlags.Type.Value, createFlags.Type.Name, "", "The worker type to use for all leased workers.")
83 flags.StringVar(&createFlags.Description.Value, createFlags.Description.Name, "", "Description of the worker pool.")
84
85 machinescommon.RegisterWebFlag(cmd, createFlags.WebFlags)
86
87 return cmd
88}
89
90func createRun(opts *CreateOptions) error {
91 if !opts.NoPrompt {

Callers

nothing calls this directly

Calls 4

RegisterWebFlagFunction · 0.92
NewCreateFlagsFunction · 0.70
NewCreateOptionsFunction · 0.70
createRunFunction · 0.70

Tested by

no test coverage detected