Skip to content

Add sqlserverflex user delete/describe/list commands #386

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 8 commits into from
Jun 20, 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
8 changes: 4 additions & 4 deletions docs/stackit_beta_sqlserverflex_instance.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ stackit beta sqlserverflex instance [flags]
### SEE ALSO

* [stackit beta sqlserverflex](./stackit_beta_sqlserverflex.md) - Provides functionality for SQLServer Flex
* [stackit beta sqlserverflex instance create](./stackit_beta_sqlserverflex_instance_create.md) - Creates an SQLServer Flex instance
* [stackit beta sqlserverflex instance delete](./stackit_beta_sqlserverflex_instance_delete.md) - Deletes an SQLServer Flex instance
* [stackit beta sqlserverflex instance describe](./stackit_beta_sqlserverflex_instance_describe.md) - Shows details of an SQLServer Flex instance
* [stackit beta sqlserverflex instance create](./stackit_beta_sqlserverflex_instance_create.md) - Creates a SQLServer Flex instance
* [stackit beta sqlserverflex instance delete](./stackit_beta_sqlserverflex_instance_delete.md) - Deletes a SQLServer Flex instance
* [stackit beta sqlserverflex instance describe](./stackit_beta_sqlserverflex_instance_describe.md) - Shows details of a SQLServer Flex instance
* [stackit beta sqlserverflex instance list](./stackit_beta_sqlserverflex_instance_list.md) - Lists all SQLServer Flex instances
* [stackit beta sqlserverflex instance update](./stackit_beta_sqlserverflex_instance_update.md) - Updates an SQLServer Flex instance
* [stackit beta sqlserverflex instance update](./stackit_beta_sqlserverflex_instance_update.md) - Updates a SQLServer Flex instance

10 changes: 5 additions & 5 deletions docs/stackit_beta_sqlserverflex_instance_create.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit beta sqlserverflex instance create

Creates an SQLServer Flex instance
Creates a SQLServer Flex instance

### Synopsis

Creates an SQLServer Flex instance.
Creates a SQLServer Flex instance.

```
stackit beta sqlserverflex instance create [flags]
Expand All @@ -13,13 +13,13 @@ stackit beta sqlserverflex instance create [flags]
### Examples

```
Create an SQLServer Flex instance with name "my-instance" and specify flavor by CPU and RAM. Other parameters are set to default values
Create a SQLServer Flex instance with name "my-instance" and specify flavor by CPU and RAM. Other parameters are set to default values
$ stackit beta sqlserverflex instance create --name my-instance --cpu 1 --ram 4

Create an SQLServer Flex instance with name "my-instance" and specify flavor by ID. Other parameters are set to default values
Create a SQLServer Flex instance with name "my-instance" and specify flavor by ID. Other parameters are set to default values
$ stackit beta sqlserverflex instance create --name my-instance --flavor-id xxx

Create an SQLServer Flex instance with name "my-instance", specify flavor by CPU and RAM, set storage size to 20 GB, and restrict access to a specific range of IP addresses. Other parameters are set to default values
Create a SQLServer Flex instance with name "my-instance", specify flavor by CPU and RAM, set storage size to 20 GB, and restrict access to a specific range of IP addresses. Other parameters are set to default values
$ stackit beta sqlserverflex instance create --name my-instance --cpu 1 --ram 4 --storage-size 20 --acl 1.2.3.0/24
```

Expand Down
6 changes: 3 additions & 3 deletions docs/stackit_beta_sqlserverflex_instance_delete.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit beta sqlserverflex instance delete

Deletes an SQLServer Flex instance
Deletes a SQLServer Flex instance

### Synopsis

Deletes an SQLServer Flex instance.
Deletes a SQLServer Flex instance.

```
stackit beta sqlserverflex instance delete INSTANCE_ID [flags]
Expand All @@ -13,7 +13,7 @@ stackit beta sqlserverflex instance delete INSTANCE_ID [flags]
### Examples

```
Delete an SQLServer Flex instance with ID "xxx"
Delete a SQLServer Flex instance with ID "xxx"
$ stackit beta sqlserverflex instance delete xxx
```

Expand Down
8 changes: 4 additions & 4 deletions docs/stackit_beta_sqlserverflex_instance_describe.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit beta sqlserverflex instance describe

Shows details of an SQLServer Flex instance
Shows details of a SQLServer Flex instance

### Synopsis

Shows details of an SQLServer Flex instance.
Shows details of a SQLServer Flex instance.

```
stackit beta sqlserverflex instance describe INSTANCE_ID [flags]
Expand All @@ -13,10 +13,10 @@ stackit beta sqlserverflex instance describe INSTANCE_ID [flags]
### Examples

```
Get details of an SQLServer Flex instance with ID "xxx"
Get details of a SQLServer Flex instance with ID "xxx"
$ stackit beta sqlserverflex instance describe xxx

Get details of an SQLServer Flex instance with ID "xxx" in JSON format
Get details of a SQLServer Flex instance with ID "xxx" in JSON format
$ stackit beta sqlserverflex instance describe xxx --output-format json
```

Expand Down
8 changes: 4 additions & 4 deletions docs/stackit_beta_sqlserverflex_instance_update.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit beta sqlserverflex instance update

Updates an SQLServer Flex instance
Updates a SQLServer Flex instance

### Synopsis

Updates an SQLServer Flex instance.
Updates a SQLServer Flex instance.

```
stackit beta sqlserverflex instance update INSTANCE_ID [flags]
Expand All @@ -13,10 +13,10 @@ stackit beta sqlserverflex instance update INSTANCE_ID [flags]
### Examples

```
Update the name of an SQLServer Flex instance with ID "xxx"
Update the name of a SQLServer Flex instance with ID "xxx"
$ stackit beta sqlserverflex instance update xxx --name my-new-name

Update the backup schedule of an SQLServer Flex instance with ID "xxx"
Update the backup schedule of a SQLServer Flex instance with ID "xxx"
$ stackit beta sqlserverflex instance update xxx --backup-schedule "30 0 * * *"
```

Expand Down
7 changes: 5 additions & 2 deletions docs/stackit_beta_sqlserverflex_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ stackit beta sqlserverflex user [flags]
### SEE ALSO

* [stackit beta sqlserverflex](./stackit_beta_sqlserverflex.md) - Provides functionality for SQLServer Flex
* [stackit beta sqlserverflex user create](./stackit_beta_sqlserverflex_user_create.md) - Creates an SQLServer Flex user
* [stackit beta sqlserverflex user reset-password](./stackit_beta_sqlserverflex_user_reset-password.md) - Resets the password of an SQLServer Flex user
* [stackit beta sqlserverflex user create](./stackit_beta_sqlserverflex_user_create.md) - Creates a SQLServer Flex user
* [stackit beta sqlserverflex user delete](./stackit_beta_sqlserverflex_user_delete.md) - Deletes a SQLServer Flex user
* [stackit beta sqlserverflex user describe](./stackit_beta_sqlserverflex_user_describe.md) - Shows details of a SQLServer Flex user
* [stackit beta sqlserverflex user list](./stackit_beta_sqlserverflex_user_list.md) - Lists all SQLServer Flex users of an instance
* [stackit beta sqlserverflex user reset-password](./stackit_beta_sqlserverflex_user_reset-password.md) - Resets the password of a SQLServer Flex user

9 changes: 4 additions & 5 deletions docs/stackit_beta_sqlserverflex_user_create.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit beta sqlserverflex user create

Creates an SQLServer Flex user
Creates a SQLServer Flex user

### Synopsis

Creates an SQLServer Flex user for an instance.
Creates a SQLServer Flex user for an instance.
The password is only visible upon creation and cannot be retrieved later.
Alternatively, you can reset the password and access the new one by running:
$ stackit beta sqlserverflex user reset-password USER_ID --instance-id INSTANCE_ID
Expand All @@ -17,17 +17,16 @@ stackit beta sqlserverflex user create [flags]
### Examples

```
Create an SQLServer Flex user for instance with ID "xxx" and specify the username, role and database
Create a SQLServer Flex user for instance with ID "xxx" and specify the username, role and database
$ stackit beta sqlserverflex user create --instance-id xxx --username johndoe --roles my-role --database my-database

Create an SQLServer Flex user for instance with ID "xxx", specifying multiple roles
Create a SQLServer Flex user for instance with ID "xxx", specifying multiple roles
$ stackit beta sqlserverflex user create --instance-id xxx --username johndoe --roles "my-role-1,my-role-2
```

### Options

```
--database string Default database for the user
-h, --help Help for "stackit beta sqlserverflex user create"
--instance-id string ID of the instance
--roles strings Roles of the user
Expand Down
41 changes: 41 additions & 0 deletions docs/stackit_beta_sqlserverflex_user_delete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## stackit beta sqlserverflex user delete

Deletes a SQLServer Flex user

### Synopsis

Deletes a SQLServer Flex user by ID. You can get the IDs of users for an instance by running:
$ stackit beta sqlserverflex user list --instance-id <INSTANCE_ID>

```
stackit beta sqlserverflex user delete USER_ID [flags]
```

### Examples

```
Delete a SQLServer Flex user with ID "xxx" for instance with ID "yyy"
$ stackit beta sqlserverflex user delete xxx --instance-id yyy
```

### Options

```
-h, --help Help for "stackit beta sqlserverflex user delete"
--instance-id string Instance 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 sqlserverflex user](./stackit_beta_sqlserverflex_user.md) - Provides functionality for SQLServer Flex users

45 changes: 45 additions & 0 deletions docs/stackit_beta_sqlserverflex_user_describe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## stackit beta sqlserverflex user describe

Shows details of a SQLServer Flex user

### Synopsis

Shows details of a SQLServer Flex user.
The user password is only visible upon creation. You can reset it by running:
$ stackit beta sqlserverflex user reset-password USER_ID --instance-id INSTANCE_ID

```
stackit beta sqlserverflex user describe USER_ID [flags]
```

### Examples

```
Get details of a SQLServer Flex user with ID "xxx" of instance with ID "yyy"
$ stackit beta sqlserverflex user describe xxx --instance-id yyy

Get details of a SQLServer Flex user with ID "xxx" of instance with ID "yyy" in JSON format
$ stackit beta sqlserverflex user describe xxx --instance-id yyy --output-format json
```

### Options

```
-h, --help Help for "stackit beta sqlserverflex user describe"
--instance-id string ID 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
--verbosity string Verbosity of the CLI, one of ["debug" "info" "warning" "error"] (default "info")
```

### SEE ALSO

* [stackit beta sqlserverflex user](./stackit_beta_sqlserverflex_user.md) - Provides functionality for SQLServer Flex users

47 changes: 47 additions & 0 deletions docs/stackit_beta_sqlserverflex_user_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## stackit beta sqlserverflex user list

Lists all SQLServer Flex users of an instance

### Synopsis

Lists all SQLServer Flex users of an instance.

```
stackit beta sqlserverflex user list [flags]
```

### Examples

```
List all SQLServer Flex users of instance with ID "xxx"
$ stackit beta sqlserverflex user list --instance-id xxx

List all SQLServer Flex users of instance with ID "xxx" in JSON format
$ stackit beta sqlserverflex user list --instance-id xxx --output-format json

List up to 10 SQLServer Flex users of instance with ID "xxx"
$ stackit beta sqlserverflex user list --instance-id xxx --limit 10
```

### Options

```
-h, --help Help for "stackit beta sqlserverflex user list"
--instance-id string Instance ID
--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 sqlserverflex user](./stackit_beta_sqlserverflex_user.md) - Provides functionality for SQLServer Flex users

6 changes: 3 additions & 3 deletions docs/stackit_beta_sqlserverflex_user_reset-password.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## stackit beta sqlserverflex user reset-password

Resets the password of an SQLServer Flex user
Resets the password of a SQLServer Flex user

### Synopsis

Resets the password of an SQLServer Flex user.
Resets the password of a SQLServer Flex user.
sThe new password is visible after resetting and cannot be retrieved later.

```
Expand All @@ -14,7 +14,7 @@ stackit beta sqlserverflex user reset-password USER_ID [flags]
### Examples

```
Reset the password of an SQLServer Flex user with ID "xxx" of instance with ID "yyy"
Reset the password of a SQLServer Flex user with ID "xxx" of instance with ID "yyy"
$ stackit beta sqlserverflex user reset-password xxx --instance-id yyy
```

Expand Down
12 changes: 6 additions & 6 deletions internal/cmd/beta/sqlserverflex/instance/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ type inputModel struct {
func NewCmd(p *print.Printer) *cobra.Command {
cmd := &cobra.Command{
Use: "create",
Short: "Creates an SQLServer Flex instance",
Long: "Creates an SQLServer Flex instance.",
Short: "Creates a SQLServer Flex instance",
Long: "Creates a SQLServer Flex instance.",
Args: args.NoArgs,
Example: examples.Build(
examples.NewExample(
`Create an SQLServer Flex instance with name "my-instance" and specify flavor by CPU and RAM. Other parameters are set to default values`,
`Create a SQLServer Flex instance with name "my-instance" and specify flavor by CPU and RAM. Other parameters are set to default values`,
`$ stackit beta sqlserverflex instance create --name my-instance --cpu 1 --ram 4`),
examples.NewExample(
`Create an SQLServer Flex instance with name "my-instance" and specify flavor by ID. Other parameters are set to default values`,
`Create a SQLServer Flex instance with name "my-instance" and specify flavor by ID. Other parameters are set to default values`,
`$ stackit beta sqlserverflex instance create --name my-instance --flavor-id xxx`),
examples.NewExample(
`Create an SQLServer Flex instance with name "my-instance", specify flavor by CPU and RAM, set storage size to 20 GB, and restrict access to a specific range of IP addresses. Other parameters are set to default values`,
`Create a SQLServer Flex instance with name "my-instance", specify flavor by CPU and RAM, set storage size to 20 GB, and restrict access to a specific range of IP addresses. Other parameters are set to default values`,
`$ stackit beta sqlserverflex instance create --name my-instance --cpu 1 --ram 4 --storage-size 20 --acl 1.2.3.0/24`),
),
RunE: func(cmd *cobra.Command, args []string) error {
Expand All @@ -92,7 +92,7 @@ func NewCmd(p *print.Printer) *cobra.Command {
}

if !model.AssumeYes {
prompt := fmt.Sprintf("Are you sure you want to create an SQLServer Flex instance for project %q?", projectLabel)
prompt := fmt.Sprintf("Are you sure you want to create a SQLServer Flex instance for project %q?", projectLabel)
err = p.PromptForConfirmation(prompt)
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions internal/cmd/beta/sqlserverflex/instance/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ type inputModel struct {
func NewCmd(p *print.Printer) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("delete %s", instanceIdArg),
Short: "Deletes an SQLServer Flex instance",
Long: "Deletes an SQLServer Flex instance.",
Short: "Deletes a SQLServer Flex instance",
Long: "Deletes a SQLServer Flex instance.",
Args: args.SingleArg(instanceIdArg, utils.ValidateUUID),
Example: examples.Build(
examples.NewExample(
`Delete an SQLServer Flex instance with ID "xxx"`,
`Delete a SQLServer Flex instance with ID "xxx"`,
"$ stackit beta sqlserverflex instance delete xxx"),
),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ type inputModel struct {
func NewCmd(p *print.Printer) *cobra.Command {
cmd := &cobra.Command{
Use: fmt.Sprintf("describe %s", instanceIdArg),
Short: "Shows details of an SQLServer Flex instance",
Long: "Shows details of an SQLServer Flex instance.",
Short: "Shows details of a SQLServer Flex instance",
Long: "Shows details of a SQLServer Flex instance.",
Args: args.SingleArg(instanceIdArg, utils.ValidateUUID),
Example: examples.Build(
examples.NewExample(
`Get details of an SQLServer Flex instance with ID "xxx"`,
`Get details of a SQLServer Flex instance with ID "xxx"`,
"$ stackit beta sqlserverflex instance describe xxx"),
examples.NewExample(
`Get details of an SQLServer Flex instance with ID "xxx" in JSON format`,
`Get details of a SQLServer Flex instance with ID "xxx" in JSON format`,
"$ stackit beta sqlserverflex instance describe xxx --output-format json"),
),
RunE: func(cmd *cobra.Command, args []string) error {
Expand Down
Loading