Skip to content

git cmd structure, adding flavor and acl to create flow, create list flavor endpoint #841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions docs/stackit_git.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ stackit git [flags]
### SEE ALSO

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

19 changes: 6 additions & 13 deletions docs/stackit_git_create.md → docs/stackit_git_flavor.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
## stackit git create
## stackit git flavor

Creates STACKIT Git instance
Provides functionality for STACKIT Git flavors

### Synopsis

Create a STACKIT Git instance by name.
Provides functionality for STACKIT Git flavors.

```
stackit git create [flags]
```

### Examples

```
Create a instance with name 'my-new-instance'
$ stackit git create --name my-new-instance
stackit git flavor [flags]
```

### Options

```
-h, --help Help for "stackit git create"
--name string The name of the instance.
-h, --help Help for "stackit git flavor"
```

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

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

44 changes: 44 additions & 0 deletions docs/stackit_git_flavor_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## stackit git flavor list

Lists instances flavors of STACKIT Git.

### Synopsis

Lists instances flavors of STACKIT Git for the current project.

```
stackit git flavor list [flags]
```

### Examples

```
List STACKIT Git flavors
$ stackit git flavor list

Lists up to 10 STACKIT Git flavors
$ stackit git flavor list --limit=10
```

### Options

```
-h, --help Help for "stackit git flavor list"
--limit int Limit the output to the first n elements
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit git flavor](./stackit_git_flavor.md) - Provides functionality for STACKIT Git flavors

37 changes: 37 additions & 0 deletions docs/stackit_git_instance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## stackit git instance

Provides functionality for STACKIT Git instances

### Synopsis

Provides functionality for STACKIT Git instances.

```
stackit git instance [flags]
```

### Options

```
-h, --help Help for "stackit git instance"
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit git](./stackit_git.md) - Provides functionality for STACKIT Git
* [stackit git instance create](./stackit_git_instance_create.md) - Creates STACKIT Git instance
* [stackit git instance delete](./stackit_git_instance_delete.md) - Deletes STACKIT Git instance
* [stackit git instance describe](./stackit_git_instance_describe.md) - Describes STACKIT Git instance
* [stackit git instance list](./stackit_git_instance_list.md) - Lists all instances of STACKIT Git.

49 changes: 49 additions & 0 deletions docs/stackit_git_instance_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
## stackit git instance create

Creates STACKIT Git instance

### Synopsis

Create a STACKIT Git instance by name.

```
stackit git instance create [flags]
```

### Examples

```
Create a instance with name 'my-new-instance'
$ stackit git instance create --name my-new-instance

Create a instance with name 'my-new-instance' and flavor
$ stackit git instance create --name my-new-instance --flavor git-100'

Create a instance with name 'my-new-instance' and acl
$ stackit git instance create --name my-new-instance --acl 1.1.1.1/1'
```

### Options

```
--acl strings Acl for the instance.
--flavor string Flavor of the instance.
-h, --help Help for "stackit git instance create"
--name string The name of the instance.
```

### Options inherited from parent commands

```
-y, --assume-yes If set, skips all confirmation prompts
--async If set, runs the command asynchronously
-o, --output-format string Output format, one of ["json" "pretty" "none" "yaml"]
-p, --project-id string Project ID
--region string Target region for region-specific requests
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## stackit git delete
## stackit git instance delete

Deletes STACKIT Git instance

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

```
stackit git delete INSTANCE_ID [flags]
stackit git instance delete INSTANCE_ID [flags]
```

### Examples

```
Delete a instance with ID "xxx"
$ stackit git delete xxx
$ stackit git instance delete xxx
```

### Options

```
-h, --help Help for "stackit git delete"
-h, --help Help for "stackit git instance delete"
```

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

### SEE ALSO

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## stackit git describe
## stackit git instance describe

Describes STACKIT Git instance

Expand All @@ -7,7 +7,7 @@ Describes STACKIT Git instance
Describes a STACKIT Git instance by its internal ID.

```
stackit git describe INSTANCE_ID [flags]
stackit git instance describe INSTANCE_ID [flags]
```

### Examples
Expand All @@ -20,7 +20,7 @@ stackit git describe INSTANCE_ID [flags]
### Options

```
-h, --help Help for "stackit git describe"
-h, --help Help for "stackit git instance describe"
```

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

### SEE ALSO

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

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## stackit git list
## stackit git instance list

Lists all instances of STACKIT Git.

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

```
stackit git list [flags]
stackit git instance list [flags]
```

### Examples
Expand All @@ -23,7 +23,7 @@ stackit git list [flags]
### Options

```
-h, --help Help for "stackit git list"
-h, --help Help for "stackit git instance list"
--limit int Limit the output to the first n elements
```

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

### SEE ALSO

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

28 changes: 28 additions & 0 deletions internal/cmd/git/flavor/flavor.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package flavor

import (
"github.com/stackitcloud/stackit-cli/internal/cmd/git/flavor/list"
"github.com/stackitcloud/stackit-cli/internal/cmd/params"
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"

"github.com/spf13/cobra"
)

func NewCmd(params *params.CmdParams) *cobra.Command {
cmd := &cobra.Command{
Use: "flavor",
Short: "Provides functionality for STACKIT Git flavors",
Long: "Provides functionality for STACKIT Git flavors.",
Args: args.NoArgs,
Run: utils.CmdHelp,
}
addSubcommands(cmd, params)
return cmd
}

func addSubcommands(cmd *cobra.Command, params *params.CmdParams) {
cmd.AddCommand(
list.NewCmd(params),
)
}
Loading