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

Method Commit

pkg/cmd/tenant/create/create_opts.go:31–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29}
30
31func (co *CreateOptions) Commit() error {
32
33 tenant := tenants.NewTenant(co.Name.Value)
34 tenant.Description = co.Description.Value
35 tenant.TenantTags = co.Tag.Value
36
37 createdTenant, err := co.Client.Tenants.Add(tenant)
38 if err != nil {
39 return err
40 }
41
42 _, err = fmt.Fprintf(co.Out, "\nSuccessfully created tenant %s (%s).\n", createdTenant.Name, createdTenant.ID)
43 if err != nil {
44 return err
45 }
46
47 link := output.Bluef("%s/app#/%s/tenants/%s/overview", co.Host, co.Space.GetID(), createdTenant.GetID())
48 fmt.Fprintf(co.Out, "View this tenant on Octopus Deploy: %s\n", link)
49
50 return nil
51}
52
53func (co *CreateOptions) GenerateAutomationCmd() {
54 if !co.NoPrompt {

Callers

nothing calls this directly

Calls 1

BluefFunction · 0.92

Tested by

no test coverage detected