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

Function NewCmdCreate

pkg/cmd/workerpool/static/create/create.go:48–72  ·  view source on GitHub ↗
(f factory.Factory)

Source from the content-addressed store, hash-verified

46}
47
48func NewCmdCreate(f factory.Factory) *cobra.Command {
49 createFlags := NewCreateFlags()
50
51 cmd := &cobra.Command{
52 Use: "create",
53 Short: "Create a static worker pool",
54 Long: "Create a static worker pool in Octopus Deploy",
55 Example: heredoc.Docf(`
56 %s worker-pool static create
57 `, constants.ExecutableName),
58 RunE: func(c *cobra.Command, _ []string) error {
59 opts := NewCreateOptions(createFlags, cmd.NewDependencies(f, c))
60
61 return createRun(opts)
62 },
63 }
64
65 flags := cmd.Flags()
66 flags.StringVarP(&createFlags.Name.Value, createFlags.Name.Name, "n", "", "A short, memorable, unique name for this worker pool.")
67 flags.StringVar(&createFlags.Description.Value, createFlags.Description.Name, "", "Description of the worker pool.")
68
69 machinescommon.RegisterWebFlag(cmd, createFlags.WebFlags)
70
71 return cmd
72}
73
74func createRun(opts *CreateOptions) error {
75 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