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

Function enableRun

pkg/cmd/tenant/enable/enable.go:49–72  ·  view source on GitHub ↗
(opts *EnableOptions)

Source from the content-addressed store, hash-verified

47}
48
49func enableRun(opts *EnableOptions) error {
50 if !opts.NoPrompt {
51 if err := PromptMissing(opts); err != nil {
52 return err
53 }
54 }
55
56 if opts.IdOrName == "" {
57 return fmt.Errorf("tenant identifier is required but was not provided")
58 }
59
60 tenantToUpdate, err := opts.Client.Tenants.GetByIdentifier(opts.IdOrName)
61 if err != nil {
62 return err
63 }
64
65 tenantToUpdate.IsDisabled = false
66 _, err = tenants.Update(opts.Client, tenantToUpdate)
67 if err != nil {
68 return err
69 }
70
71 return nil
72}
73
74func PromptMissing(opts *EnableOptions) error {
75 if opts.IdOrName == "" {

Callers 1

NewCmdEnableFunction · 0.85

Calls 1

PromptMissingFunction · 0.70

Tested by

no test coverage detected