diff --git a/docs/stackit.md b/docs/stackit.md index 6755cafa3..ea8633670 100644 --- a/docs/stackit.md +++ b/docs/stackit.md @@ -34,6 +34,7 @@ stackit [flags] * [stackit mongodbflex](./stackit_mongodbflex.md) - Provides functionality for MongoDB Flex * [stackit opensearch](./stackit_opensearch.md) - Provides functionality for OpenSearch * [stackit organization](./stackit_organization.md) - Provides functionality regarding organizations +* [stackit postgresflex](./stackit_postgresflex.md) - Provides functionality for PostgreSQL Flex * [stackit project](./stackit_project.md) - Provides functionality regarding projects * [stackit rabbitmq](./stackit_rabbitmq.md) - Provides functionality for RabbitMQ * [stackit redis](./stackit_redis.md) - Provides functionality for Redis diff --git a/docs/stackit_postgresflex.md b/docs/stackit_postgresflex.md new file mode 100644 index 000000000..f97789144 --- /dev/null +++ b/docs/stackit_postgresflex.md @@ -0,0 +1,34 @@ +## stackit postgresflex + +Provides functionality for PostgreSQL Flex + +### Synopsis + +Provides functionality for PostgreSQL Flex. + +``` +stackit postgresflex [flags] +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex" +``` + +### 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit](./stackit.md) - Manage STACKIT resources using the command line +* [stackit postgresflex instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances +* [stackit postgresflex options](./stackit_postgresflex_options.md) - Lists PostgreSQL Flex options +* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users + diff --git a/docs/stackit_postgresflex_instance.md b/docs/stackit_postgresflex_instance.md new file mode 100644 index 000000000..b5471c5e9 --- /dev/null +++ b/docs/stackit_postgresflex_instance.md @@ -0,0 +1,36 @@ +## stackit postgresflex instance + +Provides functionality for PostgreSQL Flex instances + +### Synopsis + +Provides functionality for PostgreSQL Flex instances. + +``` +stackit postgresflex instance [flags] +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex](./stackit_postgresflex.md) - Provides functionality for PostgreSQL Flex +* [stackit postgresflex instance create](./stackit_postgresflex_instance_create.md) - Creates a PostgreSQL Flex instance +* [stackit postgresflex instance delete](./stackit_postgresflex_instance_delete.md) - Deletes a PostgreSQL Flex instance +* [stackit postgresflex instance describe](./stackit_postgresflex_instance_describe.md) - Shows details of a PostgreSQL Flex instance +* [stackit postgresflex instance list](./stackit_postgresflex_instance_list.md) - Lists all PostgreSQL Flex instances +* [stackit postgresflex instance update](./stackit_postgresflex_instance_update.md) - Updates a PostgreSQL Flex instance + diff --git a/docs/stackit_postgresflex_instance_create.md b/docs/stackit_postgresflex_instance_create.md new file mode 100644 index 000000000..0078f9e11 --- /dev/null +++ b/docs/stackit_postgresflex_instance_create.md @@ -0,0 +1,54 @@ +## stackit postgresflex instance create + +Creates a PostgreSQL Flex instance + +### Synopsis + +Creates a PostgreSQL Flex instance. + +``` +stackit postgresflex instance create [flags] +``` + +### Examples + +``` + 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 + $ stackit postgresflex instance create --name my-instance --cpu 1 --ram 4 --acl 0.0.0.0/0 + + 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 + $ stackit postgresflex instance create --name my-instance --flavor-id xxx --acl 0.0.0.0/0 + + 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 + $ stackit postgresflex instance create --name my-instance --cpu 1 --ram 4 --acl 1.2.3.0/24 --storage-size 20 +``` + +### Options + +``` + --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 []) + --backup-schedule string Backup schedule (default "0 0 * * *") + --cpu int Number of CPUs + --flavor-id string ID of the flavor + -h, --help Help for "stackit postgresflex instance create" + -n, --name string Instance name + --ram int Amount of RAM (in GB) + --storage-class string Storage class (default "premium-perf2-stackit") + --storage-size int Storage size (in GB) (default 10) + --type string Instance type, one of ["Replica" "Single"] (default "Replica") + --version string PostgreSQL version. Defaults to the latest version available +``` + +### 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances + diff --git a/docs/stackit_postgresflex_instance_delete.md b/docs/stackit_postgresflex_instance_delete.md new file mode 100644 index 000000000..ad64987a5 --- /dev/null +++ b/docs/stackit_postgresflex_instance_delete.md @@ -0,0 +1,38 @@ +## stackit postgresflex instance delete + +Deletes a PostgreSQL Flex instance + +### Synopsis + +Deletes a PostgreSQL Flex instance. + +``` +stackit postgresflex instance delete INSTANCE_ID [flags] +``` + +### Examples + +``` + Delete a PostgreSQL Flex instance with ID "xxx" + $ stackit postgresflex instance delete xxx +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex instance delete" +``` + +### 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances + diff --git a/docs/stackit_postgresflex_instance_describe.md b/docs/stackit_postgresflex_instance_describe.md new file mode 100644 index 000000000..fba871537 --- /dev/null +++ b/docs/stackit_postgresflex_instance_describe.md @@ -0,0 +1,41 @@ +## stackit postgresflex instance describe + +Shows details of a PostgreSQL Flex instance + +### Synopsis + +Shows details of a PostgreSQL Flex instance. + +``` +stackit postgresflex instance describe INSTANCE_ID [flags] +``` + +### Examples + +``` + Get details of a PostgreSQL Flex instance with ID "xxx" + $ stackit postgresflex instance describe xxx + + Get details of a PostgreSQL Flex instance with ID "xxx" in a table format + $ stackit postgresflex instance describe xxx --output-format pretty +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex instance describe" +``` + +### 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances + diff --git a/docs/stackit_postgresflex_instance_list.md b/docs/stackit_postgresflex_instance_list.md new file mode 100644 index 000000000..684eb447b --- /dev/null +++ b/docs/stackit_postgresflex_instance_list.md @@ -0,0 +1,45 @@ +## stackit postgresflex instance list + +Lists all PostgreSQL Flex instances + +### Synopsis + +Lists all PostgreSQL Flex instances. + +``` +stackit postgresflex instance list [flags] +``` + +### Examples + +``` + List all PostgreSQL Flex instances + $ stackit postgresflex instance list + + List all PostgreSQL Flex instances in JSON format + $ stackit postgresflex instance list --output-format json + + List up to 10 PostgreSQL Flex instances + $ stackit postgresflex instance list --limit 10 +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex instance 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances + diff --git a/docs/stackit_postgresflex_instance_update.md b/docs/stackit_postgresflex_instance_update.md new file mode 100644 index 000000000..e924673e1 --- /dev/null +++ b/docs/stackit_postgresflex_instance_update.md @@ -0,0 +1,51 @@ +## stackit postgresflex instance update + +Updates a PostgreSQL Flex instance + +### Synopsis + +Updates a PostgreSQL Flex instance. + +``` +stackit postgresflex instance update INSTANCE_ID [flags] +``` + +### Examples + +``` + Update the name of a PostgreSQL Flex instance + $ stackit postgresflex instance update xxx --name my-new-name + + Update the version of a PostgreSQL Flex instance + $ stackit postgresflex instance update xxx --version 6.0 +``` + +### Options + +``` + --acl strings List of IP networks in CIDR notation which are allowed to access this instance (default []) + --backup-schedule string Backup schedule + --cpu int Number of CPUs + --flavor-id string ID of the flavor + -h, --help Help for "stackit postgresflex instance update" + -n, --name string Instance name + --ram int Amount of RAM (in GB) + --storage-class string Storage class + --storage-size int Storage size (in GB) + --type string Instance type, one of ["Replica" "Single"] + --version string Version +``` + +### 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex instance](./stackit_postgresflex_instance.md) - Provides functionality for PostgreSQL Flex instances + diff --git a/docs/stackit_postgresflex_options.md b/docs/stackit_postgresflex_options.md new file mode 100644 index 000000000..29ff16ede --- /dev/null +++ b/docs/stackit_postgresflex_options.md @@ -0,0 +1,49 @@ +## stackit postgresflex options + +Lists PostgreSQL Flex options + +### Synopsis + +Lists PostgreSQL Flex options (flavors, versions and storages for a given flavor) +Pass one or more flags to filter what categories are shown. + +``` +stackit postgresflex options [flags] +``` + +### Examples + +``` + List PostgreSQL Flex flavors options + $ stackit postgresflex options --flavors + + List PostgreSQL Flex available versions + $ stackit postgresflex options --versions + + List PostgreSQL Flex storage options for a given flavor. The flavor ID can be retrieved by running "$ stackit postgresflex options --flavors" + $ stackit postgresflex options --storages --flavor-id +``` + +### Options + +``` + --flavor-id string The flavor ID to show storages for. Only relevant when "--storages" is passed + --flavors Lists supported flavors + -h, --help Help for "stackit postgresflex options" + --storages Lists supported storages for a given flavor + --versions Lists supported versions +``` + +### 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex](./stackit_postgresflex.md) - Provides functionality for PostgreSQL Flex + diff --git a/docs/stackit_postgresflex_user.md b/docs/stackit_postgresflex_user.md new file mode 100644 index 000000000..e23ef514b --- /dev/null +++ b/docs/stackit_postgresflex_user.md @@ -0,0 +1,37 @@ +## stackit postgresflex user + +Provides functionality for PostgreSQL Flex users + +### Synopsis + +Provides functionality for PostgreSQL Flex users. + +``` +stackit postgresflex user [flags] +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex user" +``` + +### 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex](./stackit_postgresflex.md) - Provides functionality for PostgreSQL Flex +* [stackit postgresflex user create](./stackit_postgresflex_user_create.md) - Creates a PostgreSQL Flex user +* [stackit postgresflex user delete](./stackit_postgresflex_user_delete.md) - Deletes a PostgreSQL Flex user +* [stackit postgresflex user describe](./stackit_postgresflex_user_describe.md) - Shows details of a PostgreSQL Flex user +* [stackit postgresflex user list](./stackit_postgresflex_user_list.md) - Lists all PostgreSQL Flex users of an instance +* [stackit postgresflex user reset-password](./stackit_postgresflex_user_reset-password.md) - Resets the password of a PostgreSQL Flex user +* [stackit postgresflex user update](./stackit_postgresflex_user_update.md) - Updates a PostgreSQL Flex user + diff --git a/docs/stackit_postgresflex_user_create.md b/docs/stackit_postgresflex_user_create.md new file mode 100644 index 000000000..b47e65efa --- /dev/null +++ b/docs/stackit_postgresflex_user_create.md @@ -0,0 +1,47 @@ +## stackit postgresflex user create + +Creates a PostgreSQL Flex user + +### Synopsis + +Creates a PostgreSQL Flex user. +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 postgresflex user reset-password USER_ID --instance-id INSTANCE_ID + +``` +stackit postgresflex user create [flags] +``` + +### Examples + +``` + Create a PostgreSQL Flex user for instance with ID "xxx" + $ stackit postgresflex user create --instance-id xxx --username johndoe + + Create a PostgreSQL Flex user for instance with ID "xxx" and permission "createdb" + $ stackit postgresflex user create --instance-id xxx --username johndoe --role createdb +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex user create" + --instance-id string ID of the instance + --role strings Roles of the user, possible values are ["login" "createdb"] (default [login]) + --username string Username of the user +``` + +### 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users + diff --git a/docs/stackit_postgresflex_user_delete.md b/docs/stackit_postgresflex_user_delete.md new file mode 100644 index 000000000..d505538cb --- /dev/null +++ b/docs/stackit_postgresflex_user_delete.md @@ -0,0 +1,41 @@ +## stackit postgresflex user delete + +Deletes a PostgreSQL Flex user + +### Synopsis + +Deletes a PostgreSQL Flex user by ID. +You can get the IDs of users for an instance by running: + $ stackit postgresflex user list --instance-id + +``` +stackit postgresflex user delete USER_ID [flags] +``` + +### Examples + +``` + Delete a PostgreSQL Flex user with ID "xxx" for instance with ID "yyy" + $ stackit postgresflex user delete xxx --instance-id yyy +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users + diff --git a/docs/stackit_postgresflex_user_describe.md b/docs/stackit_postgresflex_user_describe.md new file mode 100644 index 000000000..573bc9f57 --- /dev/null +++ b/docs/stackit_postgresflex_user_describe.md @@ -0,0 +1,44 @@ +## stackit postgresflex user describe + +Shows details of a PostgreSQL Flex user + +### Synopsis + +Shows details of a PostgreSQL Flex user. +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: + $ stackit postgresflex user reset-password USER_ID --instance-id INSTANCE_ID + +``` +stackit postgresflex user describe USER_ID [flags] +``` + +### Examples + +``` + Get details of a PostgreSQL Flex user with ID "xxx" of instance with ID "yyy" + $ stackit postgresflex user list xxx --instance-id yyy + + Get details of a PostgreSQL Flex user with ID "xxx" of instance with ID "yyy" in table format + $ stackit postgresflex user list xxx --instance-id yyy --output-format pretty +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users + diff --git a/docs/stackit_postgresflex_user_list.md b/docs/stackit_postgresflex_user_list.md new file mode 100644 index 000000000..e1ee8a156 --- /dev/null +++ b/docs/stackit_postgresflex_user_list.md @@ -0,0 +1,46 @@ +## stackit postgresflex user list + +Lists all PostgreSQL Flex users of an instance + +### Synopsis + +Lists all PostgreSQL Flex users of an instance. + +``` +stackit postgresflex user list [flags] +``` + +### Examples + +``` + List all PostgreSQL Flex users of instance with ID "xxx" + $ stackit postgresflex user list --instance-id xxx + + List all PostgreSQL Flex users of instance with ID "xxx" in JSON format + $ stackit postgresflex user list --instance-id xxx --output-format json + + List up to 10 PostgreSQL Flex users of instance with ID "xxx" + $ stackit postgresflex user list --instance-id xxx --limit 10 +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users + diff --git a/docs/stackit_postgresflex_user_reset-password.md b/docs/stackit_postgresflex_user_reset-password.md new file mode 100644 index 000000000..58796eb49 --- /dev/null +++ b/docs/stackit_postgresflex_user_reset-password.md @@ -0,0 +1,39 @@ +## stackit postgresflex user reset-password + +Resets the password of a PostgreSQL Flex user + +### Synopsis + +Resets the password of a PostgreSQL Flex user. The new password is returned in the response. + +``` +stackit postgresflex user reset-password USER_ID [flags] +``` + +### Examples + +``` + Reset the password of a PostgreSQL Flex user with ID "xxx" of instance with ID "yyy" + $ stackit postgresflex user reset-password xxx --instance-id yyy +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex user reset-password" + --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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users + diff --git a/docs/stackit_postgresflex_user_update.md b/docs/stackit_postgresflex_user_update.md new file mode 100644 index 000000000..5f323978d --- /dev/null +++ b/docs/stackit_postgresflex_user_update.md @@ -0,0 +1,40 @@ +## stackit postgresflex user update + +Updates a PostgreSQL Flex user + +### Synopsis + +Updates a PostgreSQL Flex user. + +``` +stackit postgresflex user update USER_ID [flags] +``` + +### Examples + +``` + Update the roles of a PostgreSQL Flex user with ID "xxx" of instance with ID "yyy" + $ stackit postgresflex user update xxx --instance-id yyy --role login +``` + +### Options + +``` + -h, --help Help for "stackit postgresflex user update" + --instance-id string ID of the instance + --role strings Roles of the user, possible values are ["login" "createdb"] (default []) +``` + +### 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"] + -p, --project-id string Project ID +``` + +### SEE ALSO + +* [stackit postgresflex user](./stackit_postgresflex_user.md) - Provides functionality for PostgreSQL Flex users + diff --git a/internal/cmd/root.go b/internal/cmd/root.go index a78e7bc12..d8fafa454 100644 --- a/internal/cmd/root.go +++ b/internal/cmd/root.go @@ -15,6 +15,7 @@ import ( "github.com/stackitcloud/stackit-cli/internal/cmd/mongodbflex" "github.com/stackitcloud/stackit-cli/internal/cmd/opensearch" "github.com/stackitcloud/stackit-cli/internal/cmd/organization" + "github.com/stackitcloud/stackit-cli/internal/cmd/postgresflex" "github.com/stackitcloud/stackit-cli/internal/cmd/project" "github.com/stackitcloud/stackit-cli/internal/cmd/rabbitmq" "github.com/stackitcloud/stackit-cli/internal/cmd/redis" @@ -90,6 +91,7 @@ func addSubcommands(cmd *cobra.Command) { cmd.AddCommand(mongodbflex.NewCmd()) cmd.AddCommand(opensearch.NewCmd()) cmd.AddCommand(organization.NewCmd()) + cmd.AddCommand(postgresflex.NewCmd()) cmd.AddCommand(project.NewCmd()) cmd.AddCommand(rabbitmq.NewCmd()) cmd.AddCommand(redis.NewCmd())