Skip to content

Commit 95b3bda

Browse files
hcsa73Henrique Santos
andauthored
Implement postgresflex instance (#56)
* Add setting for custom endpoint * Add unset option * Add postgresflex * Add utils * Add instance create * Change storage class to non-default * Add instance describe * Add instance list * Fix name * Fix typo * Fix name * Add instance update * Add instance delete * Generate docs * Fix error message * Remove unused const * Go mod tidy * Fix import paths * Simplify methods' signatures * Simplify methods' signatures * Update dependency * Fix error fields * Refactor long description * Reword command descriptions * Reword command descriptions * Fix acls not being shown in describe * Fixes to replicas and type flags * Add nil checks * Add tests * Add nil checks * Add tests * Generate docs * Move list of available instance types to utils, fix list * Fix typo * Move list of available instance types to utils * Reorganize methods * PostgreSQL version defaults to latest version available * Remove unused instance type * Reorder fields --------- Co-authored-by: Henrique Santos <[email protected]>
1 parent ec59e46 commit 95b3bda

40 files changed

+4133
-120
lines changed

docs/stackit.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ stackit [flags]
3232
* [stackit mongodbflex](./stackit_mongodbflex.md) - Provides functionality for MongoDB Flex
3333
* [stackit opensearch](./stackit_opensearch.md) - Provides functionality for OpenSearch
3434
* [stackit organization](./stackit_organization.md) - Provides functionality regarding organizations
35+
* [stackit postgresflex](./stackit_postgresflex.md) - Provides functionality for PostgreSQL Flex
3536
* [stackit project](./stackit_project.md) - Provides functionality regarding projects
3637
* [stackit service-account](./stackit_service-account.md) - Provides functionality for service accounts
3738
* [stackit ske](./stackit_ske.md) - Provides functionality for SKE

docs/stackit_config_set.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ stackit config set [flags]
3434
--membership-custom-endpoint string Membership custom endpoint
3535
--mongodbflex-custom-endpoint string MongoDB Flex custom endpoint
3636
--opensearch-custom-endpoint string OpenSearch custom endpoint
37+
--postgresflex-custom-endpoint string PostgreSQL Flex custom endpoint
3738
--resource-manager-custom-endpoint string Resource manager custom endpoint
3839
--service-account-custom-endpoint string Service Account custom endpoint
3940
--session-time-limit string Maximum time before authentication is required again. Can't be larger than 24h. Examples: 3h, 5h30m40s (BETA: currently values greater than 2h have no effect)

docs/stackit_config_unset.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ stackit config unset [flags]
3333
--mongodbflex-custom-endpoint MongoDB Flex custom endpoint
3434
--opensearch-custom-endpoint OpenSearch custom endpoint
3535
--output-format Output format
36+
--postgresflex-custom-endpoint PostgreSQL Flex custom endpoint
3637
--project-id Project ID
3738
--resource-manager-custom-endpoint Resource Manager custom endpoint
3839
--service-account-custom-endpoint SKE custom endpoint

docs/stackit_mongodbflex_instance_update.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ stackit mongodbflex instance update INSTANCE_ID [flags]
3030
-h, --help Help for "stackit mongodbflex instance update"
3131
-n, --name string Instance name
3232
--ram int Amount of RAM (in GB)
33-
--replicas int Number of replicas
3433
--storage-class string Storage class
3534
--storage-size int Storage size (in GB)
3635
--type string Instance type, one of ["Single" "Replica" "Sharded"]

docs/stackit_postgresflex.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
## stackit postgresflex
2+
3+
Provides functionality for PostgreSQL Flex
4+
5+
### Synopsis
6+
7+
Provides functionality for PostgreSQL Flex.
8+
9+
```
10+
stackit postgresflex [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit postgresflex"
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](./stackit.md) - Manage STACKIT resources using the command line
31+
* [stackit postgresflex instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances
32+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## stackit postgresflex instance
2+
3+
Provides functionality for PostgreSQL Flex instances
4+
5+
### Synopsis
6+
7+
Provides functionality for PostgreSQL Flex instances.
8+
9+
```
10+
stackit postgresflex instance [flags]
11+
```
12+
13+
### Options
14+
15+
```
16+
-h, --help Help for "stackit postgresflex instance"
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 instance create](./stackit_postgresflex_instance_create.md) - Creates a PostgreSQL Flex instance
32+
* [stackit postgresflex instance delete](./stackit_postgresflex_instance_delete.md) - Deletes a PostgreSQL Flex instance
33+
* [stackit postgresflex instance describe](./stackit_postgresflex_instance_describe.md) - Shows details of a PostgreSQL Flex instance
34+
* [stackit postgresflex instance list](./stackit_postgresflex_instance_list.md) - Lists all PostgreSQL Flex instances
35+
* [stackit postgresflex instance update](./stackit_postgresflex_instance_update.md) - Updates a PostgreSQL Flex instance
36+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
## stackit postgresflex instance create
2+
3+
Creates a PostgreSQL Flex instance
4+
5+
### Synopsis
6+
7+
Creates a PostgreSQL Flex instance.
8+
9+
```
10+
stackit postgresflex instance create [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Create a PostgreSQL Flex instance with name "my-instance", ACL 0.0.0.0/0 (open access) and specify flavor by CPU and RAM. Other parameters are set to default values
17+
$ stackit postgresflex instance create --name my-instance --cpu 1 --ram 4 --acl 0.0.0.0/0
18+
19+
Create a PostgreSQL Flex instance with name "my-instance", ACL 0.0.0.0/0 (open access) and specify flavor by ID. Other parameters are set to default values
20+
$ stackit postgresflex instance create --name my-instance --flavor-id xxx --acl 0.0.0.0/0
21+
22+
Create a PostgreSQL Flex instance with name "my-instance", allow access to a specific range of IP addresses, specify flavor by CPU and RAM and set storage size to 20 GB. Other parameters are set to default values
23+
$ stackit postgresflex instance create --name my-instance --cpu 1 --ram 4 --acl 1.2.3.0/24 --storage-size 20
24+
```
25+
26+
### Options
27+
28+
```
29+
--acl strings The access control list (ACL). Must contain at least one valid subnet, for instance '0.0.0.0/0' for open access (discouraged), '1.2.3.0/24 for a public IP range of an organization, '1.2.3.4/32' for a single IP range, etc. (default [])
30+
--backup-schedule string Backup schedule (default "0 0/6 * * *")
31+
--cpu int Number of CPUs
32+
--flavor-id string ID of the flavor
33+
-h, --help Help for "stackit postgresflex instance create"
34+
-n, --name string Instance name
35+
--ram int Amount of RAM (in GB)
36+
--storage-class string Storage class (default "premium-perf2-stackit")
37+
--storage-size int Storage size (in GB) (default 10)
38+
--type string Instance type, one of ["Single" "Replica" "Sharded"] (default "Replica")
39+
--version string Version (default "6.0")
40+
```
41+
42+
### Options inherited from parent commands
43+
44+
```
45+
-y, --assume-yes If set, skips all confirmation prompts
46+
--async If set, runs the command asynchronously
47+
-o, --output-format string Output format, one of ["json" "pretty"]
48+
-p, --project-id string Project ID
49+
```
50+
51+
### SEE ALSO
52+
53+
* [stackit postgresflex instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances
54+
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## stackit postgresflex instance delete
2+
3+
Deletes a PostgreSQL Flex instance
4+
5+
### Synopsis
6+
7+
Deletes a PostgreSQL Flex instance.
8+
9+
```
10+
stackit postgresflex instance delete INSTANCE_ID [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Delete a PostgreSQL Flex instance with ID "xxx"
17+
$ stackit postgresflex instance delete xxx
18+
```
19+
20+
### Options
21+
22+
```
23+
-h, --help Help for "stackit postgresflex instance 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"]
32+
-p, --project-id string Project ID
33+
```
34+
35+
### SEE ALSO
36+
37+
* [stackit postgresflex instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances
38+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
## stackit postgresflex instance describe
2+
3+
Shows details of a PostgreSQL Flex instance
4+
5+
### Synopsis
6+
7+
Shows details of a PostgreSQL Flex instance.
8+
9+
```
10+
stackit postgresflex instance describe INSTANCE_ID [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
Get details of a PostgreSQL Flex instance with ID "xxx"
17+
$ stackit postgresflex instance describe xxx
18+
19+
Get details of a PostgreSQL Flex instance with ID "xxx" in a table format
20+
$ stackit postgresflex instance describe xxx --output-format pretty
21+
```
22+
23+
### Options
24+
25+
```
26+
-h, --help Help for "stackit postgresflex instance describe"
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 instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances
41+
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## stackit postgresflex instance list
2+
3+
Lists all PostgreSQL Flex instances
4+
5+
### Synopsis
6+
7+
Lists all PostgreSQL Flex instances.
8+
9+
```
10+
stackit postgresflex instance list [flags]
11+
```
12+
13+
### Examples
14+
15+
```
16+
List all PostgreSQL Flex instances
17+
$ stackit postgresflex instance list
18+
19+
List all PostgreSQL Flex instances in JSON format
20+
$ stackit postgresflex instance list --output-format json
21+
22+
List up to 10 PostgreSQL Flex instances
23+
$ stackit postgresflex instance list --limit 10
24+
```
25+
26+
### Options
27+
28+
```
29+
-h, --help Help for "stackit postgresflex instance list"
30+
--limit int Maximum number of entries to list
31+
```
32+
33+
### Options inherited from parent commands
34+
35+
```
36+
-y, --assume-yes If set, skips all confirmation prompts
37+
--async If set, runs the command asynchronously
38+
-o, --output-format string Output format, one of ["json" "pretty"]
39+
-p, --project-id string Project ID
40+
```
41+
42+
### SEE ALSO
43+
44+
* [stackit postgresflex instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances
45+

0 commit comments

Comments
 (0)