Skip to content

ref 644499 - server command #421

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

Merged
merged 1 commit into from
Aug 14, 2024
Merged
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
1 change: 1 addition & 0 deletions docs/stackit_beta_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ stackit beta server [flags]

* [stackit beta](./stackit_beta.md) - Contains beta STACKIT CLI commands
* [stackit beta server backup](./stackit_beta_server_backup.md) - Provides functionality for Server Backup
* [stackit beta server command](./stackit_beta_server_command.md) - Provides functionality for Server Command

36 changes: 36 additions & 0 deletions docs/stackit_beta_server_command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## stackit beta server command

Provides functionality for Server Command

### Synopsis

Provides functionality for Server Command.

```
stackit beta server command [flags]
```

### Options

```
-h, --help Help for "stackit beta server command"
```

### 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
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit beta server](./stackit_beta_server.md) - Provides functionality for Server
* [stackit beta server command create](./stackit_beta_server_command_create.md) - Creates a Server Command
* [stackit beta server command describe](./stackit_beta_server_command_describe.md) - Shows details of a Server Command
* [stackit beta server command list](./stackit_beta_server_command_list.md) - Lists all server commands
* [stackit beta server command template](./stackit_beta_server_command_template.md) - Provides functionality for Server Command Template

45 changes: 45 additions & 0 deletions docs/stackit_beta_server_command_create.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## stackit beta server command create

Creates a Server Command

### Synopsis

Creates a Server Command.

```
stackit beta server command create [flags]
```

### Examples

```
Create a server command for server with ID "xxx", template name "RunShellScript" and a script from a file (using the @{...} format)
$ stackit beta server command create --server-id xxx --template-name=RunShellScript --params script='@{/path/to/script.sh}'

Create a server command for server with ID "xxx", template name "RunShellScript" and a script provided on the command line
$ stackit beta server command create --server-id xxx --template-name=RunShellScript --params script='echo hello'
```

### Options

```
-h, --help Help for "stackit beta server command create"
-r, --params stringToString Params can be provided with the format key=value and the flag can be used multiple times to provide a list of labels (default [])
-s, --server-id string Server ID
-n, --template-name string Template name
```

### 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
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit beta server command](./stackit_beta_server_command.md) - Provides functionality for Server Command

43 changes: 43 additions & 0 deletions docs/stackit_beta_server_command_describe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## stackit beta server command describe

Shows details of a Server Command

### Synopsis

Shows details of a Server Command.

```
stackit beta server command describe COMMAND_ID [flags]
```

### Examples

```
Get details of a Server Command with ID "xxx" for server with ID "yyy"
$ stackit beta server command describe xxx --server-id=yyy

Get details of a Server Command with ID "xxx" for server with ID "yyy" in JSON format
$ stackit beta server command describe xxx --server-id=yyy --output-format json
```

### Options

```
-h, --help Help for "stackit beta server command describe"
-s, --server-id string Server ID
```

### 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
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit beta server command](./stackit_beta_server_command.md) - Provides functionality for Server Command

44 changes: 44 additions & 0 deletions docs/stackit_beta_server_command_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## stackit beta server command list

Lists all server commands

### Synopsis

Lists all server commands.

```
stackit beta server command list [flags]
```

### Examples

```
List all commands for a server with ID "xxx"
$ stackit beta server command list --server-id xxx

List all commands for a server with ID "xxx" in JSON format
$ stackit beta server command list --server-id xxx --output-format json
```

### Options

```
-h, --help Help for "stackit beta server command list"
--limit int Maximum number of entries to list
-s, --server-id string Server ID
```

### 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
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit beta server command](./stackit_beta_server_command.md) - Provides functionality for Server Command

34 changes: 34 additions & 0 deletions docs/stackit_beta_server_command_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## stackit beta server command template

Provides functionality for Server Command Template

### Synopsis

Provides functionality for Server Command Template.

```
stackit beta server command template [flags]
```

### Options

```
-h, --help Help for "stackit beta server command template"
```

### 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
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit beta server command](./stackit_beta_server_command.md) - Provides functionality for Server Command
* [stackit beta server command template describe](./stackit_beta_server_command_template_describe.md) - Shows details of a Server Command Template
* [stackit beta server command template list](./stackit_beta_server_command_template_list.md) - Lists all server command templates

43 changes: 43 additions & 0 deletions docs/stackit_beta_server_command_template_describe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## stackit beta server command template describe

Shows details of a Server Command Template

### Synopsis

Shows details of a Server Command Template.

```
stackit beta server command template describe COMMAND_TEMPLATE_NAME [flags]
```

### Examples

```
Get details of a Server Command Template with name "RunShellScript" for server with ID "xxx"
$ stackit beta server command template describe RunShellScript --server-id=xxx

Get details of a Server Command Template with name "RunShellScript" for server with ID "xxx" in JSON format
$ stackit beta server command template describe RunShellScript --server-id=xxx --output-format json
```

### Options

```
-h, --help Help for "stackit beta server command template describe"
-s, --server-id string Server ID
```

### 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
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit beta server command template](./stackit_beta_server_command_template.md) - Provides functionality for Server Command Template

43 changes: 43 additions & 0 deletions docs/stackit_beta_server_command_template_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## stackit beta server command template list

Lists all server command templates

### Synopsis

Lists all server command templates.

```
stackit beta server command template list [flags]
```

### Examples

```
List all command templates
$ stackit beta server command template list

List all commands templates in JSON format
$ stackit beta server command template list --output-format json
```

### Options

```
-h, --help Help for "stackit beta server command template list"
--limit int Maximum number of entries to list
```

### 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
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit beta server command template](./stackit_beta_server_command_template.md) - Provides functionality for Server Command Template

1 change: 1 addition & 0 deletions docs/stackit_config_set.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ stackit config set [flags]
--rabbitmq-custom-endpoint string RabbitMQ API base URL, used in calls to this API
--redis-custom-endpoint string Redis API base URL, used in calls to this API
--resource-manager-custom-endpoint string Resource Manager API base URL, used in calls to this API
--runcommand-custom-endpoint string Run Command API base URL, used in calls to this API
--secrets-manager-custom-endpoint string Secrets Manager API base URL, used in calls to this API
--serverbackup-custom-endpoint string Server Backup API base URL, used in calls to this API
--service-account-custom-endpoint string Service Account API base URL, used in calls to this API
Expand Down
1 change: 1 addition & 0 deletions docs/stackit_config_unset.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ stackit config unset [flags]
--rabbitmq-custom-endpoint RabbitMQ API base URL. If unset, uses the default base URL
--redis-custom-endpoint Redis API base URL. If unset, uses the default base URL
--resource-manager-custom-endpoint Resource Manager API base URL. If unset, uses the default base URL
--runcommand-custom-endpoint Server Command base URL. If unset, uses the default base URL
--secrets-manager-custom-endpoint Secrets Manager API base URL. If unset, uses the default base URL
--serverbackup-custom-endpoint Server Backup base URL. If unset, uses the default base URL
--service-account-custom-endpoint Service Account API base URL. If unset, uses the default base URL
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ require (
github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.16.0
github.com/stackitcloud/stackit-sdk-go/services/postgresflex v0.15.0
github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.9.0
github.com/stackitcloud/stackit-sdk-go/services/runcommand v0.1.0
github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.8.0
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v0.1.0
github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.4.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ github.com/stackitcloud/stackit-sdk-go/services/redis v0.17.0 h1:jnApmhchW5FYNWs
github.com/stackitcloud/stackit-sdk-go/services/redis v0.17.0/go.mod h1:3LhiTR/DMbKR2HuleTzlFHltR1MT1KD0DeW46X6K2GE=
github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.9.0 h1:qCbvGqdG9saRB++UlhXt5ieCCDCITROqL5K2nm38efU=
github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.9.0/go.mod h1:p16qz/pAW8b1gEhqMpIgJfutRPeDPqQLlbVGyCo3f8o=
github.com/stackitcloud/stackit-sdk-go/services/runcommand v0.1.0 h1:4EApay9ceTTmIG7bI1XWN1zcevkAiCyAvHrS4sp7s5g=
github.com/stackitcloud/stackit-sdk-go/services/runcommand v0.1.0/go.mod h1:pSDRPhmRYgRmKoQKL+tzgOmnin90sXUjfnc9jaTir8c=
github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.8.0 h1:pJBG455kmtbQFpCxcBfBK8wOuEnmsMv3h90LFcdj3q0=
github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.8.0/go.mod h1:LX0Mcyr7/QP77zf7e05fHCJO38RMuTxr7nEDUDZ3oPQ=
github.com/stackitcloud/stackit-sdk-go/services/serverbackup v0.1.0 h1:fYCBNvh4tqE+DXYDfbJEjC3n/I78zTZajdcPTPB/yig=
Expand Down
32 changes: 32 additions & 0 deletions internal/cmd/beta/server/command/command.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package command

import (
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/server/command/create"
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/server/command/describe"
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/server/command/list"
"github.com/stackitcloud/stackit-cli/internal/cmd/beta/server/command/template"
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"

"github.com/spf13/cobra"
)

func NewCmd(p *print.Printer) *cobra.Command {
cmd := &cobra.Command{
Use: "command",
Short: "Provides functionality for Server Command",
Long: "Provides functionality for Server Command.",
Args: args.NoArgs,
Run: utils.CmdHelp,
}
addSubcommands(cmd, p)
return cmd
}

func addSubcommands(cmd *cobra.Command, p *print.Printer) {
cmd.AddCommand(create.NewCmd(p))
cmd.AddCommand(describe.NewCmd(p))
cmd.AddCommand(list.NewCmd(p))
cmd.AddCommand(template.NewCmd(p))
}
Loading