Skip to content

Commit 61b9c73

Browse files
authored
Stop using new variables for the globalflags.ProjectIdFlag and Docs generation
* Stop using new variables for the globalflags.ProjectIdFlag and minor issues * Add docs of the stackit git instance command
1 parent 67d5569 commit 61b9c73

File tree

12 files changed

+217
-26
lines changed

12 files changed

+217
-26
lines changed

docs/stackit.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ stackit [flags]
3333
* [stackit config](./stackit_config.md) - Provides functionality for CLI configuration options
3434
* [stackit curl](./stackit_curl.md) - Executes an authenticated HTTP request to an endpoint
3535
* [stackit dns](./stackit_dns.md) - Provides functionality for DNS
36+
* [stackit git](./stackit_git.md) - Provides functionality for STACKIT Git
3637
* [stackit image](./stackit_image.md) - Manage server images
3738
* [stackit key-pair](./stackit_key-pair.md) - Provides functionality for SSH key pairs
3839
* [stackit load-balancer](./stackit_load-balancer.md) - Provides functionality for Load Balancer

docs/stackit_git.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## stackit git
2+
3+
Provides functionality for STACKIT Git
4+
5+
### Synopsis
6+
7+
Provides functionality for STACKIT Git.
8+
9+
```
10+
stackit git [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit git"
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](./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.
37+

docs/stackit_git_create.md

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

docs/stackit_git_delete.md

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

docs/stackit_git_describe.md

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

docs/stackit_git_list.md

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

internal/cmd/git/create/create.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ type inputModel struct {
3333
func NewCmd(p *print.Printer) *cobra.Command {
3434
cmd := &cobra.Command{
3535
Use: "create",
36-
Short: "Creates stackit git instance",
37-
Long: "Create an stackit git instance by name.",
36+
Short: "Creates STACKIT Git instance",
37+
Long: "Create an STACKIT Git instance by name.",
3838
Args: args.NoArgs,
3939
Example: examples.Build(
4040
examples.NewExample(

internal/cmd/git/create/create_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import (
1313
"github.com/stackitcloud/stackit-sdk-go/services/git"
1414
)
1515

16-
var projectIdFlag = globalflags.ProjectIdFlag
17-
1816
type testCtxKey struct{}
1917

2018
var (
@@ -27,7 +25,7 @@ var (
2725

2826
func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string {
2927
flagValues := map[string]string{
30-
projectIdFlag: testProjectId,
28+
globalflags.ProjectIdFlag: testProjectId,
3129

3230
nameFlag: testName,
3331
}
@@ -90,21 +88,21 @@ func TestParseInput(t *testing.T) {
9088
{
9189
description: "project id missing",
9290
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
93-
delete(flagValues, projectIdFlag)
91+
delete(flagValues, globalflags.ProjectIdFlag)
9492
}),
9593
isValid: false,
9694
},
9795
{
9896
description: "project id invalid 1",
9997
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
100-
flagValues[projectIdFlag] = ""
98+
flagValues[globalflags.ProjectIdFlag] = ""
10199
}),
102100
isValid: false,
103101
},
104102
{
105103
description: "project id invalid 2",
106104
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
107-
flagValues[projectIdFlag] = "invalid-uuid"
105+
flagValues[globalflags.ProjectIdFlag] = "invalid-uuid"
108106
}),
109107
isValid: false,
110108
},

internal/cmd/git/delete/delete_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ import (
1313
"github.com/stackitcloud/stackit-sdk-go/services/git"
1414
)
1515

16-
var projectIdFlag = globalflags.ProjectIdFlag
17-
1816
type testCtxKey struct{}
1917

2018
var (
@@ -26,7 +24,7 @@ var (
2624

2725
func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string {
2826
flagValues := map[string]string{
29-
projectIdFlag: testProjectId,
27+
globalflags.ProjectIdFlag: testProjectId,
3028
}
3129
for _, mod := range mods {
3230
mod(flagValues)
@@ -71,14 +69,14 @@ func TestParseInput(t *testing.T) {
7169
{
7270
description: "project id invalid 1",
7371
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
74-
flagValues[projectIdFlag] = ""
72+
flagValues[globalflags.ProjectIdFlag] = ""
7573
}),
7674
isValid: false,
7775
},
7876
{
7977
description: "project id invalid 2",
8078
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
81-
flagValues[projectIdFlag] = "invalid-uuid"
79+
flagValues[globalflags.ProjectIdFlag] = "invalid-uuid"
8280
}),
8381
isValid: false,
8482
},

internal/cmd/git/describe/describe_test.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ import (
1212
"github.com/stackitcloud/stackit-sdk-go/services/git"
1313
)
1414

15-
var projectIdFlag = globalflags.ProjectIdFlag
16-
1715
type testCtxKey struct{}
1816

1917
var (
@@ -25,7 +23,7 @@ var (
2523

2624
func fixtureFlagValues(mods ...func(flagValues map[string]string)) map[string]string {
2725
flagValues := map[string]string{
28-
projectIdFlag: testProjectId,
26+
globalflags.ProjectIdFlag: testProjectId,
2927
}
3028
for _, mod := range mods {
3129
mod(flagValues)
@@ -76,23 +74,23 @@ func TestParseInput(t *testing.T) {
7674
{
7775
description: "project id missing",
7876
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
79-
delete(flagValues, projectIdFlag)
77+
delete(flagValues, globalflags.ProjectIdFlag)
8078
}),
8179
args: testInstanceId,
8280
isValid: false,
8381
},
8482
{
8583
description: "project id invalid 1",
8684
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
87-
flagValues[projectIdFlag] = ""
85+
flagValues[globalflags.ProjectIdFlag] = ""
8886
}),
8987
args: testInstanceId,
9088
isValid: false,
9189
},
9290
{
9391
description: "project id invalid 2",
9492
flagValues: fixtureFlagValues(func(flagValues map[string]string) {
95-
flagValues[projectIdFlag] = "invalid-uuid"
93+
flagValues[globalflags.ProjectIdFlag] = "invalid-uuid"
9694
}),
9795
args: testInstanceId,
9896
isValid: false,

0 commit comments

Comments
 (0)