Skip to content

Commit 32bd967

Browse files
authored
feat(git): add flags for flavor and acl to instance create cmd, add flavor list cmd (#841)
1 parent 0b8327e commit 32bd967

21 files changed

+654
-49
lines changed

docs/stackit_git.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ stackit git [flags]
3030
### SEE ALSO
3131

3232
* [stackit](./stackit.md) - Manage STACKIT resources using the command line
33-
* [stackit git create](./stackit_git_create.md) - Creates STACKIT Git instance
34-
* [stackit git delete](./stackit_git_delete.md) - Deletes STACKIT Git instance
35-
* [stackit git describe](./stackit_git_describe.md) - Describes STACKIT Git instance
36-
* [stackit git list](./stackit_git_list.md) - Lists all instances of STACKIT Git.
33+
* [stackit git flavor](./stackit_git_flavor.md) - Provides functionality for STACKIT Git flavors
34+
* [stackit git instance](./stackit_git_instance.md) - Provides functionality for STACKIT Git instances
3735

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
1-
## stackit git create
1+
## stackit git flavor
22

3-
Creates STACKIT Git instance
3+
Provides functionality for STACKIT Git flavors
44

55
### Synopsis
66

7-
Create a STACKIT Git instance by name.
7+
Provides functionality for STACKIT Git flavors.
88

99
```
10-
stackit git create [flags]
11-
```
12-
13-
### Examples
14-
15-
```
16-
Create a instance with name 'my-new-instance'
17-
$ stackit git create --name my-new-instance
10+
stackit git flavor [flags]
1811
```
1912

2013
### Options
2114

2215
```
23-
-h, --help Help for "stackit git create"
24-
--name string The name of the instance.
16+
-h, --help Help for "stackit git flavor"
2517
```
2618

2719
### Options inherited from parent commands
@@ -38,4 +30,5 @@ stackit git create [flags]
3830
### SEE ALSO
3931

4032
* [stackit git](./stackit_git.md) - Provides functionality for STACKIT Git
33+
* [stackit git flavor list](./stackit_git_flavor_list.md) - Lists instances flavors of STACKIT Git.
4134

docs/stackit_git_flavor_list.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## stackit git flavor list
2+
3+
Lists instances flavors of STACKIT Git.
4+
5+
### Synopsis
6+
7+
Lists instances flavors of STACKIT Git for the current project.
8+
9+
```
10+
stackit git flavor list [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
List STACKIT Git flavors
17+
$ stackit git flavor list
18+
19+
Lists up to 10 STACKIT Git flavors
20+
$ stackit git flavor list --limit=10
21+
```
22+
23+
### Options
24+
25+
```
26+
-h, --help Help for "stackit git flavor list"
27+
--limit int Limit the output to the first n elements
28+
```
29+
30+
### Options inherited from parent commands
31+
32+
```
33+
-y, --assume-yes If set, skips all confirmation prompts
34+
--async If set, runs the command asynchronously
35+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
36+
-p, --project-id string Project ID
37+
--region string Target region for region-specific requests
38+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
39+
```
40+
41+
### SEE ALSO
42+
43+
* [stackit git flavor](./stackit_git_flavor.md) - Provides functionality for STACKIT Git flavors
44+

docs/stackit_git_instance.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## stackit git instance
2+
3+
Provides functionality for STACKIT Git instances
4+
5+
### Synopsis
6+
7+
Provides functionality for STACKIT Git instances.
8+
9+
```
10+
stackit git instance [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit git instance"
17+
```
18+
19+
### Options inherited from parent commands
20+
21+
```
22+
-y, --assume-yes If set, skips all confirmation prompts
23+
--async If set, runs the command asynchronously
24+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
25+
-p, --project-id string Project ID
26+
--region string Target region for region-specific requests
27+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
28+
```
29+
30+
### SEE ALSO
31+
32+
* [stackit git](./stackit_git.md) - Provides functionality for STACKIT Git
33+
* [stackit git instance create](./stackit_git_instance_create.md) - Creates STACKIT Git instance
34+
* [stackit git instance delete](./stackit_git_instance_delete.md) - Deletes STACKIT Git instance
35+
* [stackit git instance describe](./stackit_git_instance_describe.md) - Describes STACKIT Git instance
36+
* [stackit git instance list](./stackit_git_instance_list.md) - Lists all instances of STACKIT Git.
37+

docs/stackit_git_instance_create.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## stackit git instance create
2+
3+
Creates STACKIT Git instance
4+
5+
### Synopsis
6+
7+
Create a STACKIT Git instance by name.
8+
9+
```
10+
stackit git instance create [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Create a instance with name 'my-new-instance'
17+
$ stackit git instance create --name my-new-instance
18+
19+
Create a instance with name 'my-new-instance' and flavor
20+
$ stackit git instance create --name my-new-instance --flavor git-100'
21+
22+
Create a instance with name 'my-new-instance' and acl
23+
$ stackit git instance create --name my-new-instance --acl 1.1.1.1/1'
24+
```
25+
26+
### Options
27+
28+
```
29+
--acl strings Acl for the instance.
30+
--flavor string Flavor of the instance.
31+
-h, --help Help for "stackit git instance create"
32+
--name string The name of the instance.
33+
```
34+
35+
### Options inherited from parent commands
36+
37+
```
38+
-y, --assume-yes If set, skips all confirmation prompts
39+
--async If set, runs the command asynchronously
40+
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
41+
-p, --project-id string Project ID
42+
--region string Target region for region-specific requests
43+
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
44+
```
45+
46+
### SEE ALSO
47+
48+
* [stackit git instance](./stackit_git_instance.md) - Provides functionality for STACKIT Git instances
49+

docs/stackit_git_delete.md renamed to docs/stackit_git_instance_delete.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## stackit git delete
1+
## stackit git instance delete
22

33
Deletes STACKIT Git instance
44

@@ -7,20 +7,20 @@ Deletes STACKIT Git instance
77
Deletes a STACKIT Git instance by its internal ID.
88

99
```
10-
stackit git delete INSTANCE_ID [flags]
10+
stackit git instance delete INSTANCE_ID [flags]
1111
```
1212

1313
### Examples
1414

1515
```
1616
Delete a instance with ID "xxx"
17-
$ stackit git delete xxx
17+
$ stackit git instance delete xxx
1818
```
1919

2020
### Options
2121

2222
```
23-
-h, --help Help for "stackit git delete"
23+
-h, --help Help for "stackit git instance delete"
2424
```
2525

2626
### Options inherited from parent commands
@@ -36,5 +36,5 @@ stackit git delete INSTANCE_ID [flags]
3636

3737
### SEE ALSO
3838

39-
* [stackit git](./stackit_git.md) - Provides functionality for STACKIT Git
39+
* [stackit git instance](./stackit_git_instance.md) - Provides functionality for STACKIT Git instances
4040

docs/stackit_git_describe.md renamed to docs/stackit_git_instance_describe.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## stackit git describe
1+
## stackit git instance describe
22

33
Describes STACKIT Git instance
44

@@ -7,7 +7,7 @@ Describes STACKIT Git instance
77
Describes a STACKIT Git instance by its internal ID.
88

99
```
10-
stackit git describe INSTANCE_ID [flags]
10+
stackit git instance describe INSTANCE_ID [flags]
1111
```
1212

1313
### Examples
@@ -20,7 +20,7 @@ stackit git describe INSTANCE_ID [flags]
2020
### Options
2121

2222
```
23-
-h, --help Help for "stackit git describe"
23+
-h, --help Help for "stackit git instance describe"
2424
```
2525

2626
### Options inherited from parent commands
@@ -36,5 +36,5 @@ stackit git describe INSTANCE_ID [flags]
3636

3737
### SEE ALSO
3838

39-
* [stackit git](./stackit_git.md) - Provides functionality for STACKIT Git
39+
* [stackit git instance](./stackit_git_instance.md) - Provides functionality for STACKIT Git instances
4040

docs/stackit_git_list.md renamed to docs/stackit_git_instance_list.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## stackit git list
1+
## stackit git instance list
22

33
Lists all instances of STACKIT Git.
44

@@ -7,7 +7,7 @@ Lists all instances of STACKIT Git.
77
Lists all instances of STACKIT Git for the current project.
88

99
```
10-
stackit git list [flags]
10+
stackit git instance list [flags]
1111
```
1212

1313
### Examples
@@ -23,7 +23,7 @@ stackit git list [flags]
2323
### Options
2424

2525
```
26-
-h, --help Help for "stackit git list"
26+
-h, --help Help for "stackit git instance list"
2727
--limit int Limit the output to the first n elements
2828
```
2929

@@ -40,5 +40,5 @@ stackit git list [flags]
4040

4141
### SEE ALSO
4242

43-
* [stackit git](./stackit_git.md) - Provides functionality for STACKIT Git
43+
* [stackit git instance](./stackit_git_instance.md) - Provides functionality for STACKIT Git instances
4444

internal/cmd/git/flavor/flavor.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package flavor
2+
3+
import (
4+
"github.com/stackitcloud/stackit-cli/internal/cmd/git/flavor/list"
5+
"github.com/stackitcloud/stackit-cli/internal/cmd/params"
6+
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
7+
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
8+
9+
"github.com/spf13/cobra"
10+
)
11+
12+
func NewCmd(params *params.CmdParams) *cobra.Command {
13+
cmd := &cobra.Command{
14+
Use: "flavor",
15+
Short: "Provides functionality for STACKIT Git flavors",
16+
Long: "Provides functionality for STACKIT Git flavors.",
17+
Args: args.NoArgs,
18+
Run: utils.CmdHelp,
19+
}
20+
addSubcommands(cmd, params)
21+
return cmd
22+
}
23+
24+
func addSubcommands(cmd *cobra.Command, params *params.CmdParams) {
25+
cmd.AddCommand(
26+
list.NewCmd(params),
27+
)
28+
}

0 commit comments

Comments
 (0)