Skip to content

Commit c2552eb

Browse files
hcsa73Henrique Santos
andauthored
Implement postgresflex user (#61)
* Add user utils * Add user create * Fix typo * Add user describe * Add user list * Add user delete * Add alias * Add user update * Fix tests * Add user reset-password * Fix import paths * Reword long description * Add user group * Generate docs * Update dependency * Reword descriptions, fix command indication * Fix command description * Generate docs * Fix test --------- Co-authored-by: Henrique Santos <henrique.santos@freiheit.com>
1 parent 71dbbcc commit c2552eb

32 files changed

+2633
-22
lines changed

docs/stackit_mongodbflex_instance_create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ stackit mongodbflex instance create [flags]
3535
--ram int Amount of RAM (in GB)
3636
--storage-class string Storage class (default "premium-perf2-mongodb")
3737
--storage-size int Storage size (in GB) (default 10)
38-
--type string Instance type, one of ["Single" "Replica" "Sharded"] (default "Replica")
38+
--type string Instance type, one of ["Replica" "Sharded" "Single"] (default "Replica")
3939
--version string Version (default "6.0")
4040
```
4141

docs/stackit_mongodbflex_user_create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Creates a MongoDB Flex user
77
Creates a MongoDB Flex user.
88
The password is only visible upon creation and cannot be retrieved later.
99
Alternatively, you can reset the password and access the new one by running:
10-
$ stackit mongodbflex user reset-password --instance-id <INSTANCE_ID> --user-id <USER_ID>
10+
$ stackit mongodbflex user reset-password USER_ID --instance-id INSTANCE_ID
1111

1212
```
1313
stackit mongodbflex user create [flags]

docs/stackit_mongodbflex_user_describe.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Shows details of a MongoDB Flex user
66

77
Shows details of a MongoDB Flex user.
88
The user password is hidden inside the "host" field and replaced with asterisks, as it is only visible upon creation. You can reset it by running:
9-
$ stackit mongodbflex user reset-password <USER_ID> --instance-id <INSTANCE_ID>
9+
$ stackit mongodbflex user reset-password USER_ID --instance-id INSTANCE_ID
1010

1111
```
1212
stackit mongodbflex user describe USER_ID [flags]
@@ -18,7 +18,7 @@ stackit mongodbflex user describe USER_ID [flags]
1818
Get details of a MongoDB Flex user with ID "xxx" of instance with ID "yyy"
1919
$ stackit mongodbflex user list xxx --instance-id yyy
2020
21-
Get details of a MongoDB Flex user with ID "xxx" of instance with ID "xxx" in table format
21+
Get details of a MongoDB Flex user with ID "xxx" of instance with ID "yyy" in table format
2222
$ stackit mongodbflex user list xxx --instance-id yyy --output-format pretty
2323
```
2424

docs/stackit_postgresflex.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ stackit postgresflex [flags]
2929

3030
* [stackit](./stackit.md) - Manage STACKIT resources using the command line
3131
* [stackit postgresflex instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances
32+
* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users
3233

docs/stackit_postgresflex_user.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## stackit postgresflex user
2+
3+
Provides functionality for PostgreSQL Flex users
4+
5+
### Synopsis
6+
7+
Provides functionality for PostgreSQL Flex users.
8+
9+
```
10+
stackit postgresflex user [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit postgresflex user"
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"]
25+
-p, --project-id string Project ID
26+
```
27+
28+
### SEE ALSO
29+
30+
* [stackit postgresflex](./stackit_postgresflex.md) - Provides functionality for PostgreSQL Flex
31+
* [stackit postgresflex user create](./stackit_postgresflex_user_create.md) - Creates a PostgreSQL Flex user
32+
* [stackit postgresflex user delete](./stackit_postgresflex_user_delete.md) - Deletes a PostgreSQL Flex user
33+
* [stackit postgresflex user describe](./stackit_postgresflex_user_describe.md) - Shows details of a PostgreSQL Flex user
34+
* [stackit postgresflex user list](./stackit_postgresflex_user_list.md) - Lists all PostgreSQL Flex users of an instance
35+
* [stackit postgresflex user reset-password](./stackit_postgresflex_user_reset-password.md) - Resets the password of a PostgreSQL Flex user
36+
* [stackit postgresflex user update](./stackit_postgresflex_user_update.md) - Updates a PostgreSQL Flex user
37+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
## stackit postgresflex user create
2+
3+
Creates a PostgreSQL Flex user
4+
5+
### Synopsis
6+
7+
Creates a PostgreSQL Flex user.
8+
The password is only visible upon creation and cannot be retrieved later.
9+
Alternatively, you can reset the password and access the new one by running:
10+
$ stackit postgresflex user reset-password USER_ID --instance-id INSTANCE_ID
11+
12+
```
13+
stackit postgresflex user create [flags]
14+
```
15+
16+
### Examples
17+
18+
```
19+
Create a PostgreSQL Flex user for instance with ID "xxx" and specify the username
20+
$ stackit postgresflex user create --instance-id xxx --username johndoe --roles read
21+
22+
Create a PostgreSQL Flex user for instance with ID "xxx" with an automatically generated username
23+
$ stackit postgresflex user create --instance-id xxx --roles read
24+
```
25+
26+
### Options
27+
28+
```
29+
-h, --help Help for "stackit postgresflex user create"
30+
--instance-id string ID of the instance
31+
--roles strings Roles of the user, possible values are ["read" "readWrite"] (default [read])
32+
--username string Username of the user. If not specified, a random username will be assigned
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"]
41+
-p, --project-id string Project ID
42+
```
43+
44+
### SEE ALSO
45+
46+
* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users
47+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## stackit postgresflex user delete
2+
3+
Deletes a PostgreSQL Flex user
4+
5+
### Synopsis
6+
7+
Deletes a PostgreSQL Flex user by ID.
8+
You can get the IDs of users for an instance by running:
9+
$ stackit postgresflex user list --instance-id <INSTANCE_ID>
10+
11+
```
12+
stackit postgresflex user delete USER_ID [flags]
13+
```
14+
15+
### Examples
16+
17+
```
18+
Delete a PostgreSQL Flex user with ID "xxx" for instance with ID "yyy"
19+
$ stackit postgresflex user delete xxx --instance-id yyy
20+
```
21+
22+
### Options
23+
24+
```
25+
-h, --help Help for "stackit postgresflex user delete"
26+
--instance-id string Instance ID
27+
```
28+
29+
### Options inherited from parent commands
30+
31+
```
32+
-y, --assume-yes If set, skips all confirmation prompts
33+
--async If set, runs the command asynchronously
34+
-o, --output-format string Output format, one of ["json" "pretty"]
35+
-p, --project-id string Project ID
36+
```
37+
38+
### SEE ALSO
39+
40+
* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users
41+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## stackit postgresflex user describe
2+
3+
Shows details of a PostgreSQL Flex user
4+
5+
### Synopsis
6+
7+
Shows details of a PostgreSQL Flex user.
8+
The user password is hidden inside the "host" field and replaced with asterisks, as it is only visible upon creation. You can reset it by running:
9+
$ stackit postgresflex user reset-password USER_ID --instance-id INSTANCE_ID
10+
11+
```
12+
stackit postgresflex user describe USER_ID [flags]
13+
```
14+
15+
### Examples
16+
17+
```
18+
Get details of a PostgreSQL Flex user with ID "xxx" of instance with ID "yyy"
19+
$ stackit postgresflex user list xxx --instance-id yyy
20+
21+
Get details of a PostgreSQL Flex user with ID "xxx" of instance with ID "yyy" in table format
22+
$ stackit postgresflex user list xxx --instance-id yyy --output-format pretty
23+
```
24+
25+
### Options
26+
27+
```
28+
-h, --help Help for "stackit postgresflex user describe"
29+
--instance-id string ID of the instance
30+
```
31+
32+
### Options inherited from parent commands
33+
34+
```
35+
-y, --assume-yes If set, skips all confirmation prompts
36+
--async If set, runs the command asynchronously
37+
-o, --output-format string Output format, one of ["json" "pretty"]
38+
-p, --project-id string Project ID
39+
```
40+
41+
### SEE ALSO
42+
43+
* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users
44+
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## stackit postgresflex user list
2+
3+
Lists all PostgreSQL Flex users of an instance
4+
5+
### Synopsis
6+
7+
Lists all PostgreSQL Flex users of an instance.
8+
9+
```
10+
stackit postgresflex user list [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
List all PostgreSQL Flex users of instance with ID "xxx"
17+
$ stackit postgresflex user list --instance-id xxx
18+
19+
List all PostgreSQL Flex users of instance with ID "xxx" in JSON format
20+
$ stackit postgresflex user list --instance-id xxx --output-format json
21+
22+
List up to 10 PostgreSQL Flex users of instance with ID "xxx"
23+
$ stackit postgresflex user list --instance-id xxx --limit 10
24+
```
25+
26+
### Options
27+
28+
```
29+
-h, --help Help for "stackit postgresflex user list"
30+
--instance-id string Instance ID
31+
--limit int Maximum number of entries to list
32+
```
33+
34+
### Options inherited from parent commands
35+
36+
```
37+
-y, --assume-yes If set, skips all confirmation prompts
38+
--async If set, runs the command asynchronously
39+
-o, --output-format string Output format, one of ["json" "pretty"]
40+
-p, --project-id string Project ID
41+
```
42+
43+
### SEE ALSO
44+
45+
* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users
46+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
## stackit postgresflex user reset-password
2+
3+
Resets the password of a PostgreSQL Flex user
4+
5+
### Synopsis
6+
7+
Resets the password of a PostgreSQL Flex user. The new password is returned in the response.
8+
9+
```
10+
stackit postgresflex user reset-password USER_ID [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Reset the password of a PostgreSQL Flex user with ID "xxx" of instance with ID "yyy"
17+
$ stackit postgresflex user reset-password xxx --instance-id yyy
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit postgresflex user reset-password"
24+
--instance-id string ID 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"]
33+
-p, --project-id string Project ID
34+
```
35+
36+
### SEE ALSO
37+
38+
* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users
39+

0 commit comments

Comments
 (0)