| 29 | } |
| 30 | |
| 31 | func (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 | |
| 53 | func (co *CreateOptions) GenerateAutomationCmd() { |
| 54 | if !co.NoPrompt { |