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

Function NewCmdCreate

pkg/cmd/tenant/create/create.go:36–58  ·  view source on GitHub ↗
(f factory.Factory)

Source from the content-addressed store, hash-verified

34}
35
36func NewCmdCreate(f factory.Factory) *cobra.Command {
37 createFlags := NewCreateFlags()
38
39 cmd := &cobra.Command{
40 Use: "create",
41 Short: "Create a tenant",
42 Long: "Create a tenant in Octopus Deploy",
43 Example: heredoc.Docf("%s tenant create", constants.ExecutableName),
44 Aliases: []string{"new"},
45 RunE: func(c *cobra.Command, _ []string) error {
46 opts := NewCreateOptions(createFlags, cmd.NewDependencies(f, c))
47
48 return createRun(opts)
49 },
50 }
51
52 flags := cmd.Flags()
53 flags.StringVarP(&createFlags.Name.Value, createFlags.Name.Name, "n", "", "Name of the tenant")
54 flags.StringVarP(&createFlags.Description.Value, createFlags.Description.Name, "d", "", "Description of the tenant")
55 flags.StringArrayVarP(&createFlags.Tag.Value, createFlags.Tag.Name, "t", []string{}, "Tag to apply to tenant, must use canonical name: <tag_set>/<tag_name>")
56
57 return cmd
58}
59
60func createRun(opts *CreateOptions) error {
61 var optsArray []cmd.Dependable

Callers

nothing calls this directly

Calls 3

NewCreateFlagsFunction · 0.70
NewCreateOptionsFunction · 0.70
createRunFunction · 0.70

Tested by

no test coverage detected