@@ -3,6 +3,7 @@ package describe
33import (
44 "context"
55 "fmt"
6+ "strings"
67
78 "github.com/stackitcloud/stackit-cli/internal/pkg/types"
89
@@ -29,11 +30,16 @@ const instanceIdArg = "INSTANCE_ID"
2930func NewCmd (params * types.CmdParams ) * cobra.Command {
3031 cmd := & cobra.Command {
3132 Use : fmt .Sprintf ("describe %s" , instanceIdArg ),
32- Short : "Describes STACKIT Git instance" ,
33- Long : "Describes a STACKIT Git instance by its internal ID ." ,
33+ Short : "Shows details of a STACKIT Git instance" ,
34+ Long : "Shows details of a STACKIT Git instance." ,
3435 Args : args .SingleArg (instanceIdArg , utils .ValidateUUID ),
3536 Example : examples .Build (
36- examples .NewExample (`Describe instance "xxx"` , `$ stackit git describe xxx` ),
37+ examples .NewExample (
38+ `Get details of a STACKIT Git instance with ID "xxx"` ,
39+ `$ stackit git instance describe xxx` ),
40+ examples .NewExample (
41+ `Get details of a STACKIT Git instance with ID "xxx" in JSON format` ,
42+ `$ stackit git instance describe xxx --output-format json` ),
3743 ),
3844 RunE : func (cmd * cobra.Command , args []string ) error {
3945 ctx := context .Background ()
@@ -102,10 +108,16 @@ func outputResult(p *print.Printer, outputFormat string, resp *git.Instance) err
102108 table .AddSeparator ()
103109 table .AddRow ("VERSION" , resp .Version )
104110 table .AddSeparator ()
111+ table .AddRow ("FLAVOR" , resp .Flavor )
112+ table .AddSeparator ()
105113 table .AddRow ("STATE" , resp .State )
106114 table .AddSeparator ()
107115 table .AddRow ("CREATED" , resp .Created )
108116 table .AddSeparator ()
117+ if len (resp .Acl ) > 0 {
118+ table .AddRow ("ACL" , strings .Join (resp .Acl , "," ))
119+ table .AddSeparator ()
120+ }
109121
110122 if err := table .Display (p ); err != nil {
111123 return fmt .Errorf ("render table: %w" , err )
0 commit comments