From 0baf096840982d7180e307e723ec419a1f392048 Mon Sep 17 00:00:00 2001 From: Adarsh Shah Date: Tue, 5 Dec 2023 18:13:22 -0500 Subject: [PATCH] adds initial support for tembo apply resource level settings (target: tembo-cloud) (#395) --- tembo-cli/Cargo.lock | 39 +- tembo-cli/Cargo.toml | 10 +- tembo-cli/README.md | 165 ++++++-- tembo-cli/rustfmt.toml | 1 + tembo-cli/src/cli/context.rs | 122 +++++- tembo-cli/src/cli/tembo_config.rs | 4 +- tembo-cli/src/cmd/apply.rs | 74 +++- tembo-cli/src/cmd/context/list.rs | 23 +- tembo-cli/temboclient/.gitignore | 3 + .../temboclient/.openapi-generator-ignore | 23 + .../temboclient/.openapi-generator/FILES | 126 ++++++ .../temboclient/.openapi-generator/VERSION | 1 + tembo-cli/temboclient/.travis.yml | 1 + tembo-cli/temboclient/Cargo.toml | 19 + tembo-cli/temboclient/README.md | 118 ++++++ tembo-cli/temboclient/docs/AppApi.md | 67 +++ tembo-cli/temboclient/docs/AppConfig.md | 11 + tembo-cli/temboclient/docs/AppService.md | 20 + tembo-cli/temboclient/docs/AppType.md | 13 + tembo-cli/temboclient/docs/AppTypeOneOf.md | 11 + tembo-cli/temboclient/docs/AppTypeOneOf1.md | 11 + tembo-cli/temboclient/docs/AppTypeOneOf2.md | 11 + tembo-cli/temboclient/docs/ConnectionInfo.md | 15 + .../temboclient/docs/ConnectionPooler.md | 12 + tembo-cli/temboclient/docs/Cpu.md | 10 + tembo-cli/temboclient/docs/CreateInstance.md | 24 ++ tembo-cli/temboclient/docs/EnvVar.md | 13 + tembo-cli/temboclient/docs/EnvVarRef.md | 10 + tembo-cli/temboclient/docs/Environment.md | 10 + .../temboclient/docs/ErrorResponseSchema.md | 11 + tembo-cli/temboclient/docs/Extension.md | 13 + .../docs/ExtensionInstallLocation.md | 14 + .../docs/ExtensionInstallLocationStatus.md | 16 + tembo-cli/temboclient/docs/ExtensionStatus.md | 13 + tembo-cli/temboclient/docs/HeaderConfig.md | 12 + tembo-cli/temboclient/docs/Infrastructure.md | 13 + tembo-cli/temboclient/docs/Ingress.md | 12 + tembo-cli/temboclient/docs/Instance.md | 33 ++ tembo-cli/temboclient/docs/InstanceApi.md | 294 +++++++++++++ tembo-cli/temboclient/docs/InstanceEvent.md | 10 + tembo-cli/temboclient/docs/IntOrString.md | 12 + .../temboclient/docs/IntOrStringOneOf.md | 11 + .../temboclient/docs/IntOrStringOneOf1.md | 11 + tembo-cli/temboclient/docs/Memory.md | 10 + tembo-cli/temboclient/docs/Middleware.md | 13 + tembo-cli/temboclient/docs/MiddlewareOneOf.md | 11 + .../temboclient/docs/MiddlewareOneOf1.md | 11 + .../temboclient/docs/MiddlewareOneOf2.md | 11 + tembo-cli/temboclient/docs/PatchInstance.md | 22 + tembo-cli/temboclient/docs/PgBouncer.md | 13 + tembo-cli/temboclient/docs/PgConfig.md | 12 + .../docs/PoolerPgbouncerPoolMode.md | 10 + .../PoolerTemplateSpecContainersResources.md | 13 + ...erTemplateSpecContainersResourcesClaims.md | 11 + tembo-cli/temboclient/docs/Probe.md | 13 + tembo-cli/temboclient/docs/Probes.md | 12 + .../docs/ReplacePathRegexConfig.md | 12 + .../docs/ReplacePathRegexConfigType.md | 12 + tembo-cli/temboclient/docs/Resource.md | 12 + .../temboclient/docs/ResourceRequirements.md | 12 + tembo-cli/temboclient/docs/Restore.md | 12 + tembo-cli/temboclient/docs/RestoreInstance.md | 19 + tembo-cli/temboclient/docs/Routing.md | 13 + tembo-cli/temboclient/docs/StackApi.md | 67 +++ tembo-cli/temboclient/docs/StackType.md | 10 + tembo-cli/temboclient/docs/State.md | 10 + tembo-cli/temboclient/docs/Storage.md | 10 + tembo-cli/temboclient/docs/StorageConfig.md | 11 + .../temboclient/docs/StripPrefixConfig.md | 12 + tembo-cli/temboclient/docs/TrunkInstall.md | 12 + .../temboclient/docs/TrunkInstallStatus.md | 16 + tembo-cli/temboclient/docs/UpdateInstance.md | 22 + tembo-cli/temboclient/docs/VolumeMount.md | 16 + tembo-cli/temboclient/git_push.sh | 57 +++ tembo-cli/temboclient/src/apis/app_api.rs | 97 +++++ .../temboclient/src/apis/configuration.rs | 53 +++ .../temboclient/src/apis/instance_api.rs | 395 ++++++++++++++++++ tembo-cli/temboclient/src/apis/mod.rs | 97 +++++ tembo-cli/temboclient/src/apis/stack_api.rs | 97 +++++ tembo-cli/temboclient/src/lib.rs | 11 + .../temboclient/src/models/app_config.rs | 28 ++ .../temboclient/src/models/app_service.rs | 55 +++ tembo-cli/temboclient/src/models/app_type.rs | 34 ++ .../temboclient/src/models/app_type_one_of.rs | 28 ++ .../src/models/app_type_one_of_1.rs | 28 ++ .../src/models/app_type_one_of_2.rs | 28 ++ .../temboclient/src/models/connection_info.rs | 40 ++ .../src/models/connection_pooler.rs | 31 ++ tembo-cli/temboclient/src/models/cpu.rs | 47 +++ .../temboclient/src/models/create_instance.rs | 67 +++ tembo-cli/temboclient/src/models/env_var.rs | 34 ++ .../temboclient/src/models/env_var_ref.rs | 39 ++ .../temboclient/src/models/environment.rs | 42 ++ .../src/models/error_response_schema.rs | 28 ++ tembo-cli/temboclient/src/models/extension.rs | 34 ++ .../src/models/extension_install_location.rs | 37 ++ .../extension_install_location_status.rs | 43 ++ .../src/models/extension_status.rs | 34 ++ .../temboclient/src/models/header_config.rs | 31 ++ tembo-cli/temboclient/src/models/impls.rs | 79 ++++ .../temboclient/src/models/infrastructure.rs | 34 ++ tembo-cli/temboclient/src/models/ingress.rs | 31 ++ tembo-cli/temboclient/src/models/instance.rs | 94 +++++ .../temboclient/src/models/instance_event.rs | 36 ++ .../temboclient/src/models/int_or_string.rs | 31 ++ .../src/models/int_or_string_one_of.rs | 28 ++ .../src/models/int_or_string_one_of_1.rs | 28 ++ tembo-cli/temboclient/src/models/memory.rs | 51 +++ .../temboclient/src/models/middleware.rs | 34 ++ .../src/models/middleware_one_of.rs | 28 ++ .../src/models/middleware_one_of_1.rs | 28 ++ .../src/models/middleware_one_of_2.rs | 28 ++ tembo-cli/temboclient/src/models/mod.rs | 111 +++++ .../temboclient/src/models/patch_instance.rs | 61 +++ .../temboclient/src/models/pg_bouncer.rs | 34 ++ tembo-cli/temboclient/src/models/pg_config.rs | 31 ++ .../src/models/pooler_pgbouncer_pool_mode.rs | 39 ++ ...oler_template_spec_containers_resources.rs | 34 ++ ...mplate_spec_containers_resources_claims.rs | 28 ++ tembo-cli/temboclient/src/models/probe.rs | 34 ++ tembo-cli/temboclient/src/models/probes.rs | 31 ++ .../src/models/replace_path_regex_config.rs | 31 ++ .../models/replace_path_regex_config_type.rs | 31 ++ tembo-cli/temboclient/src/models/resource.rs | 31 ++ .../src/models/resource_requirements.rs | 31 ++ tembo-cli/temboclient/src/models/restore.rs | 31 ++ .../src/models/restore_instance.rs | 52 +++ tembo-cli/temboclient/src/models/routing.rs | 34 ++ .../temboclient/src/models/stack_type.rs | 40 ++ tembo-cli/temboclient/src/models/state.rs | 63 +++ tembo-cli/temboclient/src/models/storage.rs | 54 +++ .../temboclient/src/models/storage_config.rs | 28 ++ .../src/models/strip_prefix_config.rs | 31 ++ .../temboclient/src/models/trunk_install.rs | 31 ++ .../src/models/trunk_install_status.rs | 43 ++ .../temboclient/src/models/update_instance.rs | 61 +++ .../temboclient/src/models/volume_mount.rs | 43 ++ 137 files changed, 4889 insertions(+), 76 deletions(-) create mode 100644 tembo-cli/rustfmt.toml create mode 100644 tembo-cli/temboclient/.gitignore create mode 100644 tembo-cli/temboclient/.openapi-generator-ignore create mode 100644 tembo-cli/temboclient/.openapi-generator/FILES create mode 100644 tembo-cli/temboclient/.openapi-generator/VERSION create mode 100644 tembo-cli/temboclient/.travis.yml create mode 100644 tembo-cli/temboclient/Cargo.toml create mode 100644 tembo-cli/temboclient/README.md create mode 100644 tembo-cli/temboclient/docs/AppApi.md create mode 100644 tembo-cli/temboclient/docs/AppConfig.md create mode 100644 tembo-cli/temboclient/docs/AppService.md create mode 100644 tembo-cli/temboclient/docs/AppType.md create mode 100644 tembo-cli/temboclient/docs/AppTypeOneOf.md create mode 100644 tembo-cli/temboclient/docs/AppTypeOneOf1.md create mode 100644 tembo-cli/temboclient/docs/AppTypeOneOf2.md create mode 100644 tembo-cli/temboclient/docs/ConnectionInfo.md create mode 100644 tembo-cli/temboclient/docs/ConnectionPooler.md create mode 100644 tembo-cli/temboclient/docs/Cpu.md create mode 100644 tembo-cli/temboclient/docs/CreateInstance.md create mode 100644 tembo-cli/temboclient/docs/EnvVar.md create mode 100644 tembo-cli/temboclient/docs/EnvVarRef.md create mode 100644 tembo-cli/temboclient/docs/Environment.md create mode 100644 tembo-cli/temboclient/docs/ErrorResponseSchema.md create mode 100644 tembo-cli/temboclient/docs/Extension.md create mode 100644 tembo-cli/temboclient/docs/ExtensionInstallLocation.md create mode 100644 tembo-cli/temboclient/docs/ExtensionInstallLocationStatus.md create mode 100644 tembo-cli/temboclient/docs/ExtensionStatus.md create mode 100644 tembo-cli/temboclient/docs/HeaderConfig.md create mode 100644 tembo-cli/temboclient/docs/Infrastructure.md create mode 100644 tembo-cli/temboclient/docs/Ingress.md create mode 100644 tembo-cli/temboclient/docs/Instance.md create mode 100644 tembo-cli/temboclient/docs/InstanceApi.md create mode 100644 tembo-cli/temboclient/docs/InstanceEvent.md create mode 100644 tembo-cli/temboclient/docs/IntOrString.md create mode 100644 tembo-cli/temboclient/docs/IntOrStringOneOf.md create mode 100644 tembo-cli/temboclient/docs/IntOrStringOneOf1.md create mode 100644 tembo-cli/temboclient/docs/Memory.md create mode 100644 tembo-cli/temboclient/docs/Middleware.md create mode 100644 tembo-cli/temboclient/docs/MiddlewareOneOf.md create mode 100644 tembo-cli/temboclient/docs/MiddlewareOneOf1.md create mode 100644 tembo-cli/temboclient/docs/MiddlewareOneOf2.md create mode 100644 tembo-cli/temboclient/docs/PatchInstance.md create mode 100644 tembo-cli/temboclient/docs/PgBouncer.md create mode 100644 tembo-cli/temboclient/docs/PgConfig.md create mode 100644 tembo-cli/temboclient/docs/PoolerPgbouncerPoolMode.md create mode 100644 tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResources.md create mode 100644 tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResourcesClaims.md create mode 100644 tembo-cli/temboclient/docs/Probe.md create mode 100644 tembo-cli/temboclient/docs/Probes.md create mode 100644 tembo-cli/temboclient/docs/ReplacePathRegexConfig.md create mode 100644 tembo-cli/temboclient/docs/ReplacePathRegexConfigType.md create mode 100644 tembo-cli/temboclient/docs/Resource.md create mode 100644 tembo-cli/temboclient/docs/ResourceRequirements.md create mode 100644 tembo-cli/temboclient/docs/Restore.md create mode 100644 tembo-cli/temboclient/docs/RestoreInstance.md create mode 100644 tembo-cli/temboclient/docs/Routing.md create mode 100644 tembo-cli/temboclient/docs/StackApi.md create mode 100644 tembo-cli/temboclient/docs/StackType.md create mode 100644 tembo-cli/temboclient/docs/State.md create mode 100644 tembo-cli/temboclient/docs/Storage.md create mode 100644 tembo-cli/temboclient/docs/StorageConfig.md create mode 100644 tembo-cli/temboclient/docs/StripPrefixConfig.md create mode 100644 tembo-cli/temboclient/docs/TrunkInstall.md create mode 100644 tembo-cli/temboclient/docs/TrunkInstallStatus.md create mode 100644 tembo-cli/temboclient/docs/UpdateInstance.md create mode 100644 tembo-cli/temboclient/docs/VolumeMount.md create mode 100644 tembo-cli/temboclient/git_push.sh create mode 100644 tembo-cli/temboclient/src/apis/app_api.rs create mode 100644 tembo-cli/temboclient/src/apis/configuration.rs create mode 100644 tembo-cli/temboclient/src/apis/instance_api.rs create mode 100644 tembo-cli/temboclient/src/apis/mod.rs create mode 100644 tembo-cli/temboclient/src/apis/stack_api.rs create mode 100644 tembo-cli/temboclient/src/lib.rs create mode 100644 tembo-cli/temboclient/src/models/app_config.rs create mode 100644 tembo-cli/temboclient/src/models/app_service.rs create mode 100644 tembo-cli/temboclient/src/models/app_type.rs create mode 100644 tembo-cli/temboclient/src/models/app_type_one_of.rs create mode 100644 tembo-cli/temboclient/src/models/app_type_one_of_1.rs create mode 100644 tembo-cli/temboclient/src/models/app_type_one_of_2.rs create mode 100644 tembo-cli/temboclient/src/models/connection_info.rs create mode 100644 tembo-cli/temboclient/src/models/connection_pooler.rs create mode 100644 tembo-cli/temboclient/src/models/cpu.rs create mode 100644 tembo-cli/temboclient/src/models/create_instance.rs create mode 100644 tembo-cli/temboclient/src/models/env_var.rs create mode 100644 tembo-cli/temboclient/src/models/env_var_ref.rs create mode 100644 tembo-cli/temboclient/src/models/environment.rs create mode 100644 tembo-cli/temboclient/src/models/error_response_schema.rs create mode 100644 tembo-cli/temboclient/src/models/extension.rs create mode 100644 tembo-cli/temboclient/src/models/extension_install_location.rs create mode 100644 tembo-cli/temboclient/src/models/extension_install_location_status.rs create mode 100644 tembo-cli/temboclient/src/models/extension_status.rs create mode 100644 tembo-cli/temboclient/src/models/header_config.rs create mode 100644 tembo-cli/temboclient/src/models/impls.rs create mode 100644 tembo-cli/temboclient/src/models/infrastructure.rs create mode 100644 tembo-cli/temboclient/src/models/ingress.rs create mode 100644 tembo-cli/temboclient/src/models/instance.rs create mode 100644 tembo-cli/temboclient/src/models/instance_event.rs create mode 100644 tembo-cli/temboclient/src/models/int_or_string.rs create mode 100644 tembo-cli/temboclient/src/models/int_or_string_one_of.rs create mode 100644 tembo-cli/temboclient/src/models/int_or_string_one_of_1.rs create mode 100644 tembo-cli/temboclient/src/models/memory.rs create mode 100644 tembo-cli/temboclient/src/models/middleware.rs create mode 100644 tembo-cli/temboclient/src/models/middleware_one_of.rs create mode 100644 tembo-cli/temboclient/src/models/middleware_one_of_1.rs create mode 100644 tembo-cli/temboclient/src/models/middleware_one_of_2.rs create mode 100644 tembo-cli/temboclient/src/models/mod.rs create mode 100644 tembo-cli/temboclient/src/models/patch_instance.rs create mode 100644 tembo-cli/temboclient/src/models/pg_bouncer.rs create mode 100644 tembo-cli/temboclient/src/models/pg_config.rs create mode 100644 tembo-cli/temboclient/src/models/pooler_pgbouncer_pool_mode.rs create mode 100644 tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources.rs create mode 100644 tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources_claims.rs create mode 100644 tembo-cli/temboclient/src/models/probe.rs create mode 100644 tembo-cli/temboclient/src/models/probes.rs create mode 100644 tembo-cli/temboclient/src/models/replace_path_regex_config.rs create mode 100644 tembo-cli/temboclient/src/models/replace_path_regex_config_type.rs create mode 100644 tembo-cli/temboclient/src/models/resource.rs create mode 100644 tembo-cli/temboclient/src/models/resource_requirements.rs create mode 100644 tembo-cli/temboclient/src/models/restore.rs create mode 100644 tembo-cli/temboclient/src/models/restore_instance.rs create mode 100644 tembo-cli/temboclient/src/models/routing.rs create mode 100644 tembo-cli/temboclient/src/models/stack_type.rs create mode 100644 tembo-cli/temboclient/src/models/state.rs create mode 100644 tembo-cli/temboclient/src/models/storage.rs create mode 100644 tembo-cli/temboclient/src/models/storage_config.rs create mode 100644 tembo-cli/temboclient/src/models/strip_prefix_config.rs create mode 100644 tembo-cli/temboclient/src/models/trunk_install.rs create mode 100644 tembo-cli/temboclient/src/models/trunk_install_status.rs create mode 100644 tembo-cli/temboclient/src/models/update_instance.rs create mode 100644 tembo-cli/temboclient/src/models/volume_mount.rs diff --git a/tembo-cli/Cargo.lock b/tembo-cli/Cargo.lock index 8ce6aae6b..41fe2af6b 100644 --- a/tembo-cli/Cargo.lock +++ b/tembo-cli/Cargo.lock @@ -2387,7 +2387,7 @@ dependencies = [ [[package]] name = "tembo" -version = "0.7.2" +version = "0.8.0" dependencies = [ "anyhow", "assert_cmd", @@ -2412,10 +2412,25 @@ dependencies = [ "serde_yaml", "simplelog", "spinners", + "temboclient", "tera", + "tokio", "toml", ] +[[package]] +name = "temboclient" +version = "1.0.0" +dependencies = [ + "reqwest", + "serde", + "serde_derive", + "serde_json", + "serde_with", + "url", + "uuid", +] + [[package]] name = "tempfile" version = "3.8.0" @@ -2556,9 +2571,21 @@ dependencies = [ "pin-project-lite", "signal-hook-registry", "socket2 0.5.4", + "tokio-macros", "windows-sys", ] +[[package]] +name = "tokio-macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "tokio-native-tls" version = "0.3.1" @@ -2771,6 +2798,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "uuid" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +dependencies = [ + "getrandom", + "serde", +] + [[package]] name = "vcpkg" version = "0.2.15" diff --git a/tembo-cli/Cargo.toml b/tembo-cli/Cargo.toml index a71e303cf..9abedf945 100644 --- a/tembo-cli/Cargo.toml +++ b/tembo-cli/Cargo.toml @@ -1,6 +1,7 @@ +workspace = { members = ["temboclient"] } [package] name = "tembo" -version = "0.7.2" +version = "0.8.0" edition = "2021" authors = ["Tembo.io"] description = "The CLI for Tembo" @@ -39,6 +40,13 @@ dateparser = "0.2.0" log = "0.4.20" tera = "1.0" curl = "0.4.44" +temboclient = { version = "1.0.0", path = "temboclient" } +tokio = { version = "1.26.0", features = [ + "rt", + "rt-multi-thread", + "macros", + "sync", +] } [dev-dependencies] assert_cmd = "2.0.8" diff --git a/tembo-cli/README.md b/tembo-cli/README.md index d0e9cb023..625763ba3 100644 --- a/tembo-cli/README.md +++ b/tembo-cli/README.md @@ -16,60 +16,145 @@ If the install path is in your shell path, you can then run `tembo help` and oth ## `tembo init` -The `init` command initializes your environment and can be used to generate configuration files. It will -also alert you to any missing requirements. Currently, the only requirement is Docker be running. After -ensuring the requirements are met, the command will pull the Tembo Docker image. +The `tembo init` command initializes your environment with following files: -The default configuration file path is $HOME/.config/tembo. +* `tembo.toml` configuration file +* `migrations` directory for sql migrations +* `~/.tembo/context` file with various contexts user can connect to For more information: `tembo init --help` -## `tembo instance create` +## `tembo context list/set` -The `instance create` command creates an instance of a Tembo stack locally. It includes the Tembo flavored -version of Postgres and an additional items like extensions. You can specify the -type of instance you want to create. You'll also need to provide a name and port number. +tembo context works like [kubectl context](https://www.notion.so/abee0b15119343e4947692feb740e892?pvs=21). User can set context for local docker environment or tembo cloud (dev/qa/prod) with org_id. When they run any of the other commands it will run in the context selected. Default context will be local. -Currently supported types include: +## `tembo apply` -* standard -* data-warehouse +Validates Tembo.toml (same as `tembo validate`) and applies the changes to the context selected. -More stack types will be added shortly. +* applies changes and runs migration for all dbs + * **local docker:** wraps docker build/run + sqlx migration + * **tembo-cloud:** calls the api in appropriate environment -## `tembo instance list` +## `tembo delete` -The `instance list` command simply lists all of the instances that have been created. It lists key attributes such as name, type and port. +- **local docker:** runs `docker stop & rm` command +- **tembo-cloud:** calls delete tembo api endpoint -## `tembo instance start` +## Generating Rust Client from API -The `instance start` command allows users to start their instances. It requires the name as a parameter and Docker to be running. No two -instances can be started that share a port number. +[OpenAPI Generator](https://openapi-generator.tech/) tool is used to generate Rust Client. -Each instance runs as a Docker container. +Install OpenAPI Generator if not already by following steps [here](https://openapi-generator.tech/docs/installation) + +### Control plane API client + +Go to `temboclient` directory in your terminal. + +Delete the contents of the directory first and then run following command to re-generate the rust client code for the API. -## `tembo auth login` - -The `auth login` command allows users to authenticate as a service user and obtain an API token that can be used on future authenticated requests. - -## `tembo auth info` - -The `auth info` command allows users to see if they have authenticated and when their authentication token expires. - -## `tembo extension install` - -The `extension install` command allows users to install extensions on existing instances. Users will be prompted for the -name and version of the extension. Note this doesn't enable the extension. That is done via the `extension enable` command (WIP). - -List of supported extensions can be found on [Trunk](https://pgt.dev). - -## `tembo db create` - -The `db create` command allows users to create databases, by name, for a given existing instance. - -## `tembo schema create` - -The `schema create` command allows users to create schemas, by name, for existing databases on existing isntances. +```bash +openapi-generator generate -i https://api.tembo.io/api-docs/openapi.json -g rust -o . --additional-properties=packageName=temboclient +``` + +* Go to `temboclient/src/lib.rs` & add followng line at the top to disable clippy for the generated code + +``` +#![allow(clippy::all)] +``` + +* Create `/temboclient/src/models/impls.rs` file & add following code to it: + +**TODO:** Find a better way to do this. + +``` + +use std::str::FromStr; + +use super::{Cpu, Storage, StackType, Memory, Environment}; + +impl FromStr for Cpu { + type Err = (); + + fn from_str(input: &str) -> core::result::Result { + match input { + "1" => Ok(Cpu::Variant1), + "2" => Ok(Cpu::Variant2), + "4" => Ok(Cpu::Variant4), + "8" => Ok(Cpu::Variant8), + "16" => Ok(Cpu::Variant16), + "32" => Ok(Cpu::Variant32), + _ => Err(()), + } + } +} + +impl FromStr for Memory { + type Err = (); + + fn from_str(input: &str) -> core::result::Result { + match input { + "1Gi" => Ok(Memory::Variant1Gi), + "2Gi" => Ok(Memory::Variant2Gi), + "4Gi" => Ok(Memory::Variant4Gi), + "8Gi" => Ok(Memory::Variant8Gi), + "16Gi" => Ok(Memory::Variant16Gi), + "32Gi" => Ok(Memory::Variant32Gi), + _ => Err(()), + } + } +} + +impl FromStr for Environment { + type Err = (); + + fn from_str(input: &str) -> core::result::Result { + match input { + "dev" => Ok(Environment::Dev), + "test" => Ok(Environment::Test), + "prod" => Ok(Environment::Prod), + _ => Err(()), + } + } +} + +impl FromStr for Storage { + type Err = (); + + fn from_str(input: &str) -> core::result::Result { + match input { + "10Gi" => Ok(Storage::Variant10Gi), + "50Gi" => Ok(Storage::Variant50Gi), + "100Gi" => Ok(Storage::Variant100Gi), + "200Gi" => Ok(Storage::Variant200Gi), + "300Gi" => Ok(Storage::Variant300Gi), + "400Gi" => Ok(Storage::Variant400Gi), + "500Gi" => Ok(Self::Variant500Gi), + _ => Err(()), + } + } +} + +impl ToString for StackType { + fn to_string(&self) -> String { + match self { + Self::Standard => String::from("Standard"), + Self::MessageQueue => String::from("MessageQueue"), + Self::MachineLearning => String::from("MachineLearning"), + Self::Olap => String::from("OLAP"), + Self::Oltp => String::from("OLTP"), + Self::VectorDb => String::from("VectorDB"), + Self::DataWarehouse => String::from("DataWarehouse"), + } + } +} +``` + +* Add following line towards the end of `/temboclient/src/models/mod.rs` + +``` +pub mod impls; +``` # Contributing diff --git a/tembo-cli/rustfmt.toml b/tembo-cli/rustfmt.toml new file mode 100644 index 000000000..3303cef88 --- /dev/null +++ b/tembo-cli/rustfmt.toml @@ -0,0 +1 @@ +ignore = ["temboclient"] \ No newline at end of file diff --git a/tembo-cli/src/cli/context.rs b/tembo-cli/src/cli/context.rs index cabd9fe11..75c79b381 100644 --- a/tembo-cli/src/cli/context.rs +++ b/tembo-cli/src/cli/context.rs @@ -1,6 +1,12 @@ +use std::fs; + +use crate::Result; +use anyhow::bail; +use anyhow::Ok; use serde::Deserialize; use serde::Serialize; +// TODO: Move this to a template file pub const CONTEXT_DEFAULT_TEXT: &str = "version = \"1.0\" [[environment]] @@ -15,6 +21,7 @@ org_id = 'ORG_ID' profile = 'prod' "; +// TODO: Move this to a template file pub const CREDENTIALS_DEFAULT_TEXT: &str = "version = \"1.0\" [[environment]] @@ -23,6 +30,50 @@ tembo_access_token = 'ACCESS_TOKEN' tembo_host = 'https://api.coredb.io' "; +#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] +pub struct Context { + pub version: String, + pub environment: Vec, +} + +// Config struct holds to data from the `[config]` section. +#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] +pub struct Environment { + pub name: String, + pub target: String, + pub org_id: Option, + pub profile: Option, + pub set: Option, + pub selected_profile: Option, +} + +#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] +pub struct Credential { + pub version: String, + pub profile: Vec, +} + +#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] +pub struct Profile { + pub name: String, + pub tembo_access_token: String, + pub tembo_host: String, +} + +pub enum Target { + Docker, + TemboCloud, +} + +impl ToString for Target { + fn to_string(&self) -> String { + match self { + Self::Docker => String::from("docker"), + Self::TemboCloud => String::from("tembo-cloud"), + } + } +} + pub fn tembo_home_dir() -> String { let mut tembo_home = home::home_dir().unwrap().as_path().display().to_string(); tembo_home.push_str("/.tembo"); @@ -37,18 +88,65 @@ pub fn tembo_credentials_file_path() -> String { tembo_home_dir() + "/credentials" } -#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] -pub struct Context { - pub version: String, - pub environment: Vec, +pub fn list_context() -> Result { + let filename = tembo_context_file_path(); + + let contents = match fs::read_to_string(filename.clone()) { + std::result::Result::Ok(c) => c, + Err(e) => { + bail!("Error reading file {filename}: {e}") + } + }; + + let context: Context = match toml::from_str(&contents) { + std::result::Result::Ok(c) => c, + Err(e) => { + bail!("Issue with format of toml file {filename}: {e}") + } + }; + + Ok(context) } -// Config struct holds to data from the `[config]` section. -#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] -pub struct Environment { - pub name: String, - pub target: String, - pub org_id: Option, - pub profile: Option, - pub set: Option, +pub fn get_current_context() -> Result { + let context = list_context()?; + + let profiles = list_credentail_profiles()?; + + for mut e in context.environment { + if e.set.is_some() && e.set.unwrap() { + if e.profile != None { + let credential = profiles + .iter() + .filter(|c| &c.name == e.profile.as_ref().unwrap()) + .last() + .unwrap(); + + e.selected_profile = Some(credential.to_owned()); + } + return Ok(e); + } + } + + bail!("Tembo context not set"); +} + +pub fn list_credentail_profiles() -> Result> { + let filename = tembo_credentials_file_path(); + + let contents = match fs::read_to_string(filename.clone()) { + std::result::Result::Ok(c) => c, + Err(e) => { + bail!("Error reading file {filename}: {e}") + } + }; + + let credential: Credential = match toml::from_str(&contents) { + std::result::Result::Ok(c) => c, + Err(e) => { + bail!("Issue with format of toml file {filename}: {e}") + } + }; + + Ok(credential.profile) } diff --git a/tembo-cli/src/cli/tembo_config.rs b/tembo-cli/src/cli/tembo_config.rs index c005d88d7..be435146b 100644 --- a/tembo-cli/src/cli/tembo_config.rs +++ b/tembo-cli/src/cli/tembo_config.rs @@ -11,10 +11,12 @@ pub struct TemboConfig { // Config struct holds to data from the `[config]` section. #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] pub struct InstanceSettings { + pub environment: String, + pub instance_name: String, pub cpu: String, pub memory: String, pub storage: String, - pub replicas: u32, + pub replicas: i32, pub postgres_configurations: HashMap, pub extensions: HashMap, } diff --git a/tembo-cli/src/cmd/apply.rs b/tembo-cli/src/cmd/apply.rs index f759c51c4..61e897685 100644 --- a/tembo-cli/src/cmd/apply.rs +++ b/tembo-cli/src/cmd/apply.rs @@ -1,9 +1,18 @@ -use crate::Result; +use crate::{ + cli::context::{get_current_context, Environment, Target}, + Result, +}; use clap::{ArgMatches, Command}; use std::{ collections::HashMap, fs::{self}, + str::FromStr, +}; +use temboclient::{ + apis::{configuration::Configuration, instance_api::create_instance}, + models::{Cpu, CreateInstance, Memory, Storage}, }; +use tokio::runtime::Runtime; use crate::cli::{docker::Docker, file_utils::FileUtils, tembo_config::InstanceSettings}; use tera::Tera; @@ -17,6 +26,18 @@ pub fn make_subcommand() -> Command { } pub fn execute(_args: &ArgMatches) -> Result<()> { + let env = get_current_context()?; + + if env.target == Target::Docker.to_string() { + return execute_docker(); + } else if env.target == Target::TemboCloud.to_string() { + return execute_tembo_cloud(env); + } + + Ok(()) +} + +fn execute_docker() -> Result<()> { Docker::installed_and_running()?; let instance_settings: HashMap = get_instance_settings()?; @@ -53,6 +74,57 @@ pub fn execute(_args: &ArgMatches) -> Result<()> { Ok(()) } +pub fn execute_tembo_cloud(env: Environment) -> Result<()> { + let instance_settings: HashMap = get_instance_settings()?; + + let profile = env.selected_profile.unwrap(); + let config = Configuration { + base_path: profile.tembo_host, + bearer_access_token: Some(profile.tembo_access_token), + ..Default::default() + }; + + let mut instance: CreateInstance; + + for (_key, value) in instance_settings.iter() { + instance = CreateInstance { + cpu: Cpu::from_str(value.cpu.as_str()).unwrap(), + memory: Memory::from_str(value.memory.as_str()).unwrap(), + environment: temboclient::models::Environment::from_str(value.environment.as_str()) + .unwrap(), + instance_name: value.instance_name.clone(), + stack_type: temboclient::models::StackType::Standard, + storage: Storage::from_str(value.storage.as_str()).unwrap(), + replicas: Some(value.replicas), + app_services: None, + connection_pooler: None, + extensions: None, + extra_domains_rw: None, + ip_allow_list: None, + trunk_installs: None, + postgres_configs: None, + }; + + let v = Runtime::new().unwrap().block_on(create_instance( + &config, + env.org_id.clone().unwrap().as_str(), + instance, + )); + + match v { + Ok(result) => { + println!( + "Instance creation started for Instance Name: {}", + result.instance_name + ) + } + Err(error) => eprintln!("Error creating instance: {}", error), + }; + } + + Ok(()) +} + pub fn get_instance_settings() -> Result> { let mut file_path = FileUtils::get_current_working_dir(); file_path.push_str("/tembo.toml"); diff --git a/tembo-cli/src/cmd/context/list.rs b/tembo-cli/src/cmd/context/list.rs index 10d2b2607..e833135f5 100644 --- a/tembo-cli/src/cmd/context/list.rs +++ b/tembo-cli/src/cmd/context/list.rs @@ -1,35 +1,18 @@ -use crate::Result; +use crate::{cli::context::list_context, Result}; use clap::{ArgMatches, Command}; -use std::fs; - -use crate::cli::context::{tembo_context_file_path, Context}; pub fn make_subcommand() -> Command { Command::new("list").about("Command used to list context") } pub fn execute(_args: &ArgMatches) -> Result<()> { - let filename = tembo_context_file_path(); - - let contents = match fs::read_to_string(&filename) { - Ok(c) => c, - Err(e) => { - panic!("Couldn't read context file {}: {}", filename, e); - } - }; - - let data: Context = match toml::from_str(&contents) { - Ok(d) => d, - Err(e) => { - panic!("Unable to load data. Error: `{}`", e); - } - }; + let context = list_context()?; // TODO: Improve formatting println!("Name Target Org ID Profile Set"); println!("-------------- -------------- -------------- -------------- --------------"); - for e in data.environment { + for e in context.environment { let mut org_id = String::from(" "); let mut profile = String::from(" "); let mut set = false; diff --git a/tembo-cli/temboclient/.gitignore b/tembo-cli/temboclient/.gitignore new file mode 100644 index 000000000..6aa106405 --- /dev/null +++ b/tembo-cli/temboclient/.gitignore @@ -0,0 +1,3 @@ +/target/ +**/*.rs.bk +Cargo.lock diff --git a/tembo-cli/temboclient/.openapi-generator-ignore b/tembo-cli/temboclient/.openapi-generator-ignore new file mode 100644 index 000000000..7484ee590 --- /dev/null +++ b/tembo-cli/temboclient/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/tembo-cli/temboclient/.openapi-generator/FILES b/tembo-cli/temboclient/.openapi-generator/FILES new file mode 100644 index 000000000..8bff6328c --- /dev/null +++ b/tembo-cli/temboclient/.openapi-generator/FILES @@ -0,0 +1,126 @@ +.gitignore +.openapi-generator-ignore +.travis.yml +Cargo.toml +README.md +docs/AppApi.md +docs/AppConfig.md +docs/AppService.md +docs/AppType.md +docs/AppTypeOneOf.md +docs/AppTypeOneOf1.md +docs/AppTypeOneOf2.md +docs/ConnectionInfo.md +docs/ConnectionPooler.md +docs/Cpu.md +docs/CreateInstance.md +docs/EnvVar.md +docs/EnvVarRef.md +docs/Environment.md +docs/ErrorResponseSchema.md +docs/Extension.md +docs/ExtensionInstallLocation.md +docs/ExtensionInstallLocationStatus.md +docs/ExtensionStatus.md +docs/HeaderConfig.md +docs/Infrastructure.md +docs/Ingress.md +docs/Instance.md +docs/InstanceApi.md +docs/InstanceEvent.md +docs/IntOrString.md +docs/IntOrStringOneOf.md +docs/IntOrStringOneOf1.md +docs/Memory.md +docs/Middleware.md +docs/MiddlewareOneOf.md +docs/MiddlewareOneOf1.md +docs/MiddlewareOneOf2.md +docs/PatchInstance.md +docs/PgBouncer.md +docs/PgConfig.md +docs/PoolerPgbouncerPoolMode.md +docs/PoolerTemplateSpecContainersResources.md +docs/PoolerTemplateSpecContainersResourcesClaims.md +docs/Probe.md +docs/Probes.md +docs/ReplacePathRegexConfig.md +docs/ReplacePathRegexConfigType.md +docs/Resource.md +docs/ResourceRequirements.md +docs/Restore.md +docs/RestoreInstance.md +docs/Routing.md +docs/StackApi.md +docs/StackType.md +docs/State.md +docs/Storage.md +docs/StorageConfig.md +docs/StripPrefixConfig.md +docs/TrunkInstall.md +docs/TrunkInstallStatus.md +docs/UpdateInstance.md +docs/VolumeMount.md +git_push.sh +src/apis/app_api.rs +src/apis/configuration.rs +src/apis/instance_api.rs +src/apis/mod.rs +src/apis/stack_api.rs +src/lib.rs +src/models/app_config.rs +src/models/app_service.rs +src/models/app_type.rs +src/models/app_type_one_of.rs +src/models/app_type_one_of_1.rs +src/models/app_type_one_of_2.rs +src/models/connection_info.rs +src/models/connection_pooler.rs +src/models/cpu.rs +src/models/create_instance.rs +src/models/env_var.rs +src/models/env_var_ref.rs +src/models/environment.rs +src/models/error_response_schema.rs +src/models/extension.rs +src/models/extension_install_location.rs +src/models/extension_install_location_status.rs +src/models/extension_status.rs +src/models/header_config.rs +src/models/infrastructure.rs +src/models/ingress.rs +src/models/instance.rs +src/models/instance_event.rs +src/models/int_or_string.rs +src/models/int_or_string_one_of.rs +src/models/int_or_string_one_of_1.rs +src/models/memory.rs +src/models/middleware.rs +src/models/middleware_one_of.rs +src/models/middleware_one_of_1.rs +src/models/middleware_one_of_2.rs +src/models/mod.rs +src/models/patch_instance.rs +src/models/pg_bouncer.rs +src/models/pg_config.rs +src/models/pooler_pgbouncer_pool_mode.rs +src/models/pooler_template_spec_containers_resources.rs +src/models/pooler_template_spec_containers_resources_claims.rs +src/models/probe.rs +src/models/probes.rs +src/models/replace_path_regex_config.rs +src/models/replace_path_regex_config_type.rs +src/models/resource.rs +src/models/resource_requirements.rs +src/models/restore.rs +src/models/restore_instance.rs +src/models/routing.rs +src/models/stack_type.rs +src/models/state.rs +src/models/storage.rs +src/models/storage_config.rs +src/models/strip_prefix_config.rs +src/models/trunk_install.rs +src/models/trunk_install_status.rs +src/models/update_instance.rs +src/models/volume_mount.rs diff --git a/tembo-cli/temboclient/.openapi-generator/VERSION b/tembo-cli/temboclient/.openapi-generator/VERSION new file mode 100644 index 000000000..3769235d3 --- /dev/null +++ b/tembo-cli/temboclient/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.1.0 \ No newline at end of file diff --git a/tembo-cli/temboclient/.travis.yml b/tembo-cli/temboclient/.travis.yml new file mode 100644 index 000000000..22761ba7e --- /dev/null +++ b/tembo-cli/temboclient/.travis.yml @@ -0,0 +1 @@ +language: rust diff --git a/tembo-cli/temboclient/Cargo.toml b/tembo-cli/temboclient/Cargo.toml new file mode 100644 index 000000000..abd88d09f --- /dev/null +++ b/tembo-cli/temboclient/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "temboclient" +version = "1.0.0" +authors = ["OpenAPI Generator team and contributors"] +description = "Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) " +# Override this license by providing a License Object in the OpenAPI. +license = "Unlicense" +edition = "2018" + +[dependencies] +serde = "^1.0" +serde_derive = "^1.0" +serde_with = "^2.0" +serde_json = "^1.0" +url = "^2.2" +uuid = { version = "^1.0", features = ["serde", "v4"] } +[dependencies.reqwest] +version = "^0.11" +features = ["json", "multipart"] diff --git a/tembo-cli/temboclient/README.md b/tembo-cli/temboclient/README.md new file mode 100644 index 000000000..ed908232c --- /dev/null +++ b/tembo-cli/temboclient/README.md @@ -0,0 +1,118 @@ +# Rust API client for temboclient + +Platform API for Tembo Cloud +
+
+ To find a Tembo Data API, please find it here: +
+
+ [AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + + + +## Overview + +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. + +- API version: v1.0.0 +- Package version: v1.0.0 +- Build package: `org.openapitools.codegen.languages.RustClientCodegen` + +## Installation + +Put the package under your project folder in a directory named `temboclient` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +temboclient = { path = "./temboclient" } +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AppApi* | [**get_all_apps**](docs/AppApi.md#get_all_apps) | **GET** /api/v1/apps | Attributes for all apps +*AppApi* | [**get_app**](docs/AppApi.md#get_app) | **GET** /api/v1/apps/{type} | Get the attributes of a single App +*InstanceApi* | [**create_instance**](docs/InstanceApi.md#create_instance) | **POST** /api/v1/orgs/{org_id}/instances | Create a new Tembo instance +*InstanceApi* | [**delete_instance**](docs/InstanceApi.md#delete_instance) | **DELETE** /api/v1/orgs/{org_id}/instances/{instance_id} | Delete an existing Tembo instance +*InstanceApi* | [**get_all**](docs/InstanceApi.md#get_all) | **GET** /api/v1/orgs/{org_id}/instances | Get all Tembo instances in an organization +*InstanceApi* | [**get_instance**](docs/InstanceApi.md#get_instance) | **GET** /api/v1/orgs/{org_id}/instances/{instance_id} | Get an existing Tembo instance +*InstanceApi* | [**get_schema**](docs/InstanceApi.md#get_schema) | **GET** /api/v1/orgs/instances/schema | Get the json-schema for an instance +*InstanceApi* | [**instance_event**](docs/InstanceApi.md#instance_event) | **POST** /api/v1/orgs/{org_id}/instances/{instance_id} | Lifecycle events for a Tembo instance +*InstanceApi* | [**patch_instance**](docs/InstanceApi.md#patch_instance) | **PATCH** /api/v1/orgs/{org_id}/instances/{instance_id} | Update attributes on an existing Tembo instance +*InstanceApi* | [**put_instance**](docs/InstanceApi.md#put_instance) | **PUT** /api/v1/orgs/{org_id}/instances/{instance_id} | Replace all attributes of an existing Tembo instance +*InstanceApi* | [**restore_instance**](docs/InstanceApi.md#restore_instance) | **POST** /api/v1/orgs/{org_id}/restore | Restore a Tembo instance +*StackApi* | [**get_all_entities**](docs/StackApi.md#get_all_entities) | **GET** /api/v1/stacks | Attributes for all stacks +*StackApi* | [**get_entity**](docs/StackApi.md#get_entity) | **GET** /api/v1/stacks/{type} | Get the attributes of a single stack + + +## Documentation For Models + + - [AppConfig](docs/AppConfig.md) + - [AppService](docs/AppService.md) + - [AppType](docs/AppType.md) + - [AppTypeOneOf](docs/AppTypeOneOf.md) + - [AppTypeOneOf1](docs/AppTypeOneOf1.md) + - [AppTypeOneOf2](docs/AppTypeOneOf2.md) + - [ConnectionInfo](docs/ConnectionInfo.md) + - [ConnectionPooler](docs/ConnectionPooler.md) + - [Cpu](docs/Cpu.md) + - [CreateInstance](docs/CreateInstance.md) + - [EnvVar](docs/EnvVar.md) + - [EnvVarRef](docs/EnvVarRef.md) + - [Environment](docs/Environment.md) + - [ErrorResponseSchema](docs/ErrorResponseSchema.md) + - [Extension](docs/Extension.md) + - [ExtensionInstallLocation](docs/ExtensionInstallLocation.md) + - [ExtensionInstallLocationStatus](docs/ExtensionInstallLocationStatus.md) + - [ExtensionStatus](docs/ExtensionStatus.md) + - [HeaderConfig](docs/HeaderConfig.md) + - [Infrastructure](docs/Infrastructure.md) + - [Ingress](docs/Ingress.md) + - [Instance](docs/Instance.md) + - [InstanceEvent](docs/InstanceEvent.md) + - [IntOrString](docs/IntOrString.md) + - [IntOrStringOneOf](docs/IntOrStringOneOf.md) + - [IntOrStringOneOf1](docs/IntOrStringOneOf1.md) + - [Memory](docs/Memory.md) + - [Middleware](docs/Middleware.md) + - [MiddlewareOneOf](docs/MiddlewareOneOf.md) + - [MiddlewareOneOf1](docs/MiddlewareOneOf1.md) + - [MiddlewareOneOf2](docs/MiddlewareOneOf2.md) + - [PatchInstance](docs/PatchInstance.md) + - [PgBouncer](docs/PgBouncer.md) + - [PgConfig](docs/PgConfig.md) + - [PoolerPgbouncerPoolMode](docs/PoolerPgbouncerPoolMode.md) + - [PoolerTemplateSpecContainersResources](docs/PoolerTemplateSpecContainersResources.md) + - [PoolerTemplateSpecContainersResourcesClaims](docs/PoolerTemplateSpecContainersResourcesClaims.md) + - [Probe](docs/Probe.md) + - [Probes](docs/Probes.md) + - [ReplacePathRegexConfig](docs/ReplacePathRegexConfig.md) + - [ReplacePathRegexConfigType](docs/ReplacePathRegexConfigType.md) + - [Resource](docs/Resource.md) + - [ResourceRequirements](docs/ResourceRequirements.md) + - [Restore](docs/Restore.md) + - [RestoreInstance](docs/RestoreInstance.md) + - [Routing](docs/Routing.md) + - [StackType](docs/StackType.md) + - [State](docs/State.md) + - [Storage](docs/Storage.md) + - [StorageConfig](docs/StorageConfig.md) + - [StripPrefixConfig](docs/StripPrefixConfig.md) + - [TrunkInstall](docs/TrunkInstall.md) + - [TrunkInstallStatus](docs/TrunkInstallStatus.md) + - [UpdateInstance](docs/UpdateInstance.md) + - [VolumeMount](docs/VolumeMount.md) + + +To get access to the crate's generated documentation, use: + +``` +cargo doc --open +``` + +## Author + + + diff --git a/tembo-cli/temboclient/docs/AppApi.md b/tembo-cli/temboclient/docs/AppApi.md new file mode 100644 index 000000000..d4b24e9aa --- /dev/null +++ b/tembo-cli/temboclient/docs/AppApi.md @@ -0,0 +1,67 @@ +# \AppApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_all_apps**](AppApi.md#get_all_apps) | **GET** /api/v1/apps | Attributes for all apps +[**get_app**](AppApi.md#get_app) | **GET** /api/v1/apps/{type} | Get the attributes of a single App + + + +## get_all_apps + +> Vec get_all_apps() +Attributes for all apps + +Attributes for all apps + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec**](serde_json::Value.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_app + +> serde_json::Value get_app(r#type) +Get the attributes of a single App + +Get the attributes of a single App + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**r#type** | **String** | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/tembo-cli/temboclient/docs/AppConfig.md b/tembo-cli/temboclient/docs/AppConfig.md new file mode 100644 index 000000000..0e93eebf5 --- /dev/null +++ b/tembo-cli/temboclient/docs/AppConfig.md @@ -0,0 +1,11 @@ +# AppConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**env** | Option<[**Vec**](EnvVar.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/AppService.md b/tembo-cli/temboclient/docs/AppService.md new file mode 100644 index 000000000..a199d1e33 --- /dev/null +++ b/tembo-cli/temboclient/docs/AppService.md @@ -0,0 +1,20 @@ +# AppService + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**args** | Option<**Vec**> | | [optional] +**command** | Option<**Vec**> | | [optional] +**env** | Option<[**Vec**](EnvVar.md)> | | [optional] +**image** | **String** | | +**middlewares** | Option<[**Vec**](Middleware.md)> | | [optional] +**name** | **String** | | +**probes** | Option<[**crate::models::Probes**](Probes.md)> | | [optional] +**resources** | Option<[**crate::models::ResourceRequirements**](ResourceRequirements.md)> | | [optional] +**routing** | Option<[**Vec**](Routing.md)> | | [optional] +**storage** | Option<[**crate::models::StorageConfig**](StorageConfig.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/AppType.md b/tembo-cli/temboclient/docs/AppType.md new file mode 100644 index 000000000..46875945e --- /dev/null +++ b/tembo-cli/temboclient/docs/AppType.md @@ -0,0 +1,13 @@ +# AppType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**restapi** | Option<[**crate::models::AppConfig**](AppConfig.md)> | | +**http** | Option<[**crate::models::AppConfig**](AppConfig.md)> | | +**custom** | [**crate::models::AppService**](AppService.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/AppTypeOneOf.md b/tembo-cli/temboclient/docs/AppTypeOneOf.md new file mode 100644 index 000000000..d6210d972 --- /dev/null +++ b/tembo-cli/temboclient/docs/AppTypeOneOf.md @@ -0,0 +1,11 @@ +# AppTypeOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**restapi** | Option<[**crate::models::AppConfig**](AppConfig.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/AppTypeOneOf1.md b/tembo-cli/temboclient/docs/AppTypeOneOf1.md new file mode 100644 index 000000000..c5980f03a --- /dev/null +++ b/tembo-cli/temboclient/docs/AppTypeOneOf1.md @@ -0,0 +1,11 @@ +# AppTypeOneOf1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**http** | Option<[**crate::models::AppConfig**](AppConfig.md)> | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/AppTypeOneOf2.md b/tembo-cli/temboclient/docs/AppTypeOneOf2.md new file mode 100644 index 000000000..752df555b --- /dev/null +++ b/tembo-cli/temboclient/docs/AppTypeOneOf2.md @@ -0,0 +1,11 @@ +# AppTypeOneOf2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom** | [**crate::models::AppService**](AppService.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/ConnectionInfo.md b/tembo-cli/temboclient/docs/ConnectionInfo.md new file mode 100644 index 000000000..b235745bd --- /dev/null +++ b/tembo-cli/temboclient/docs/ConnectionInfo.md @@ -0,0 +1,15 @@ +# ConnectionInfo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**host** | **String** | | +**password** | **String** | | +**pooler_host** | Option<**String**> | | [optional] +**port** | **i32** | | +**user** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/ConnectionPooler.md b/tembo-cli/temboclient/docs/ConnectionPooler.md new file mode 100644 index 000000000..b391b1f13 --- /dev/null +++ b/tembo-cli/temboclient/docs/ConnectionPooler.md @@ -0,0 +1,12 @@ +# ConnectionPooler + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | Option<**bool**> | | [optional] +**pooler** | Option<[**crate::models::PgBouncer**](PgBouncer.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Cpu.md b/tembo-cli/temboclient/docs/Cpu.md new file mode 100644 index 000000000..f68a103c2 --- /dev/null +++ b/tembo-cli/temboclient/docs/Cpu.md @@ -0,0 +1,10 @@ +# Cpu + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/CreateInstance.md b/tembo-cli/temboclient/docs/CreateInstance.md new file mode 100644 index 000000000..834ec83cc --- /dev/null +++ b/tembo-cli/temboclient/docs/CreateInstance.md @@ -0,0 +1,24 @@ +# CreateInstance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_services** | Option<[**Vec**](AppType.md)> | | [optional] +**connection_pooler** | Option<[**crate::models::ConnectionPooler**](ConnectionPooler.md)> | | [optional] +**cpu** | [**crate::models::Cpu**](Cpu.md) | | +**environment** | [**crate::models::Environment**](Environment.md) | | +**extensions** | Option<[**Vec**](Extension.md)> | | [optional] +**extra_domains_rw** | Option<**Vec**> | | [optional] +**instance_name** | **String** | | +**ip_allow_list** | Option<**Vec**> | | [optional] +**memory** | [**crate::models::Memory**](Memory.md) | | +**postgres_configs** | Option<[**Vec**](PgConfig.md)> | | [optional] +**replicas** | Option<**i32**> | | [optional] +**stack_type** | [**crate::models::StackType**](StackType.md) | | +**storage** | [**crate::models::Storage**](Storage.md) | | +**trunk_installs** | Option<[**Vec**](TrunkInstall.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/EnvVar.md b/tembo-cli/temboclient/docs/EnvVar.md new file mode 100644 index 000000000..478dfebd5 --- /dev/null +++ b/tembo-cli/temboclient/docs/EnvVar.md @@ -0,0 +1,13 @@ +# EnvVar + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**value** | Option<**String**> | | [optional] +**value_from_platform** | Option<[**crate::models::EnvVarRef**](EnvVarRef.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/EnvVarRef.md b/tembo-cli/temboclient/docs/EnvVarRef.md new file mode 100644 index 000000000..cf51bd089 --- /dev/null +++ b/tembo-cli/temboclient/docs/EnvVarRef.md @@ -0,0 +1,10 @@ +# EnvVarRef + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Environment.md b/tembo-cli/temboclient/docs/Environment.md new file mode 100644 index 000000000..eb0c9def4 --- /dev/null +++ b/tembo-cli/temboclient/docs/Environment.md @@ -0,0 +1,10 @@ +# Environment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/ErrorResponseSchema.md b/tembo-cli/temboclient/docs/ErrorResponseSchema.md new file mode 100644 index 000000000..b39e37250 --- /dev/null +++ b/tembo-cli/temboclient/docs/ErrorResponseSchema.md @@ -0,0 +1,11 @@ +# ErrorResponseSchema + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Extension.md b/tembo-cli/temboclient/docs/Extension.md new file mode 100644 index 000000000..38c28115c --- /dev/null +++ b/tembo-cli/temboclient/docs/Extension.md @@ -0,0 +1,13 @@ +# Extension + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | | [optional] +**locations** | [**Vec**](ExtensionInstallLocation.md) | | +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/ExtensionInstallLocation.md b/tembo-cli/temboclient/docs/ExtensionInstallLocation.md new file mode 100644 index 000000000..ceed1955c --- /dev/null +++ b/tembo-cli/temboclient/docs/ExtensionInstallLocation.md @@ -0,0 +1,14 @@ +# ExtensionInstallLocation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**database** | Option<**String**> | | [optional] +**enabled** | **bool** | | +**schema** | Option<**String**> | | [optional] +**version** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/ExtensionInstallLocationStatus.md b/tembo-cli/temboclient/docs/ExtensionInstallLocationStatus.md new file mode 100644 index 000000000..ef9987712 --- /dev/null +++ b/tembo-cli/temboclient/docs/ExtensionInstallLocationStatus.md @@ -0,0 +1,16 @@ +# ExtensionInstallLocationStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**database** | Option<**String**> | | [optional] +**enabled** | Option<**bool**> | | [optional] +**error** | Option<**bool**> | | [optional] +**error_message** | Option<**String**> | | [optional] +**schema** | Option<**String**> | | [optional] +**version** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/ExtensionStatus.md b/tembo-cli/temboclient/docs/ExtensionStatus.md new file mode 100644 index 000000000..b42ff21e3 --- /dev/null +++ b/tembo-cli/temboclient/docs/ExtensionStatus.md @@ -0,0 +1,13 @@ +# ExtensionStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**description** | Option<**String**> | | [optional] +**locations** | [**Vec**](ExtensionInstallLocationStatus.md) | | +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/HeaderConfig.md b/tembo-cli/temboclient/docs/HeaderConfig.md new file mode 100644 index 000000000..a9b3f9050 --- /dev/null +++ b/tembo-cli/temboclient/docs/HeaderConfig.md @@ -0,0 +1,12 @@ +# HeaderConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | **::std::collections::HashMap** | | +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Infrastructure.md b/tembo-cli/temboclient/docs/Infrastructure.md new file mode 100644 index 000000000..f8331a029 --- /dev/null +++ b/tembo-cli/temboclient/docs/Infrastructure.md @@ -0,0 +1,13 @@ +# Infrastructure + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cpu** | Option<**String**> | | [optional] +**memory** | Option<**String**> | | [optional] +**storage** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Ingress.md b/tembo-cli/temboclient/docs/Ingress.md new file mode 100644 index 000000000..e6249fdad --- /dev/null +++ b/tembo-cli/temboclient/docs/Ingress.md @@ -0,0 +1,12 @@ +# Ingress + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **bool** | | +**path** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Instance.md b/tembo-cli/temboclient/docs/Instance.md new file mode 100644 index 000000000..aca55ec15 --- /dev/null +++ b/tembo-cli/temboclient/docs/Instance.md @@ -0,0 +1,33 @@ +# Instance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_services** | Option<[**Vec**](AppType.md)> | | [optional] +**connection_info** | Option<[**crate::models::ConnectionInfo**](ConnectionInfo.md)> | | [optional] +**connection_pooler** | Option<[**crate::models::ConnectionPooler**](ConnectionPooler.md)> | | [optional] +**cpu** | [**crate::models::Cpu**](Cpu.md) | | +**created_at** | Option<**String**> | | [optional] +**environment** | [**crate::models::Environment**](Environment.md) | | +**extensions** | Option<[**Vec**](ExtensionStatus.md)> | | [optional] +**extra_domains_rw** | Option<**Vec**> | | [optional] +**first_recoverability_time** | Option<**String**> | | [optional] +**instance_id** | **String** | | +**instance_name** | **String** | | +**ip_allow_list** | Option<**Vec**> | | [optional] +**last_updated_at** | Option<**String**> | | [optional] +**memory** | [**crate::models::Memory**](Memory.md) | | +**organization_id** | **String** | | +**organization_name** | **String** | | +**postgres_configs** | Option<[**Vec**](PgConfig.md)> | | [optional] +**replicas** | **i32** | | +**runtime_config** | Option<[**Vec**](PgConfig.md)> | | [optional] +**stack_type** | [**crate::models::StackType**](StackType.md) | | +**state** | [**crate::models::State**](State.md) | | +**storage** | [**crate::models::Storage**](Storage.md) | | +**trunk_installs** | Option<[**Vec**](TrunkInstallStatus.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/InstanceApi.md b/tembo-cli/temboclient/docs/InstanceApi.md new file mode 100644 index 000000000..9122b09ca --- /dev/null +++ b/tembo-cli/temboclient/docs/InstanceApi.md @@ -0,0 +1,294 @@ +# \InstanceApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_instance**](InstanceApi.md#create_instance) | **POST** /api/v1/orgs/{org_id}/instances | Create a new Tembo instance +[**delete_instance**](InstanceApi.md#delete_instance) | **DELETE** /api/v1/orgs/{org_id}/instances/{instance_id} | Delete an existing Tembo instance +[**get_all**](InstanceApi.md#get_all) | **GET** /api/v1/orgs/{org_id}/instances | Get all Tembo instances in an organization +[**get_instance**](InstanceApi.md#get_instance) | **GET** /api/v1/orgs/{org_id}/instances/{instance_id} | Get an existing Tembo instance +[**get_schema**](InstanceApi.md#get_schema) | **GET** /api/v1/orgs/instances/schema | Get the json-schema for an instance +[**instance_event**](InstanceApi.md#instance_event) | **POST** /api/v1/orgs/{org_id}/instances/{instance_id} | Lifecycle events for a Tembo instance +[**patch_instance**](InstanceApi.md#patch_instance) | **PATCH** /api/v1/orgs/{org_id}/instances/{instance_id} | Update attributes on an existing Tembo instance +[**put_instance**](InstanceApi.md#put_instance) | **PUT** /api/v1/orgs/{org_id}/instances/{instance_id} | Replace all attributes of an existing Tembo instance +[**restore_instance**](InstanceApi.md#restore_instance) | **POST** /api/v1/orgs/{org_id}/restore | Restore a Tembo instance + + + +## create_instance + +> crate::models::Instance create_instance(org_id, create_instance) +Create a new Tembo instance + +Create a new Tembo instance + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org_id** | **String** | Organization ID that owns the Tembo instance | [required] | +**create_instance** | [**CreateInstance**](CreateInstance.md) | | [required] | + +### Return type + +[**crate::models::Instance**](Instance.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## delete_instance + +> crate::models::Instance delete_instance(org_id, instance_id) +Delete an existing Tembo instance + +Delete an existing Tembo instance + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org_id** | **String** | Organization id of the instance to delete | [required] | +**instance_id** | **String** | Delete this instance id | [required] | + +### Return type + +[**crate::models::Instance**](Instance.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_all + +> Vec get_all(org_id) +Get all Tembo instances in an organization + +Get all Tembo instances in an organization + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org_id** | **String** | organization id for the request | [required] | + +### Return type + +[**Vec**](Instance.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_instance + +> crate::models::Instance get_instance(org_id, instance_id) +Get an existing Tembo instance + +Get an existing Tembo instance + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org_id** | **String** | Organization ID that owns the instance | [required] | +**instance_id** | **String** | | [required] | + +### Return type + +[**crate::models::Instance**](Instance.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_schema + +> crate::models::ErrorResponseSchema get_schema() +Get the json-schema for an instance + +Get the json-schema for an instance + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::ErrorResponseSchema**](ErrorResponseSchema.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## instance_event + +> crate::models::Instance instance_event(org_id, event_type, instance_id) +Lifecycle events for a Tembo instance + +Lifecycle events for a Tembo instance Currently only supports restart + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org_id** | **String** | Organization ID that owns the Tembo instance | [required] | +**event_type** | [**InstanceEvent**](.md) | | [required] | +**instance_id** | **String** | | [required] | + +### Return type + +[**crate::models::Instance**](Instance.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## patch_instance + +> crate::models::Instance patch_instance(org_id, instance_id, patch_instance) +Update attributes on an existing Tembo instance + +Update attributes on an existing Tembo instance + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org_id** | **String** | Organization ID that owns the instance | [required] | +**instance_id** | **String** | | [required] | +**patch_instance** | [**PatchInstance**](PatchInstance.md) | | [required] | + +### Return type + +[**crate::models::Instance**](Instance.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## put_instance + +> crate::models::Instance put_instance(org_id, instance_id, update_instance) +Replace all attributes of an existing Tembo instance + +Replace all attributes of an existing Tembo instance + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org_id** | **String** | Organization ID that owns the Tembo instance | [required] | +**instance_id** | **String** | | [required] | +**update_instance** | [**UpdateInstance**](UpdateInstance.md) | | [required] | + +### Return type + +[**crate::models::Instance**](Instance.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## restore_instance + +> crate::models::Instance restore_instance(org_id, restore_instance) +Restore a Tembo instance + +Restore a Tembo instance + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**org_id** | **String** | Organization ID that owns the Tembo instance | [required] | +**restore_instance** | [**RestoreInstance**](RestoreInstance.md) | | [required] | + +### Return type + +[**crate::models::Instance**](Instance.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/tembo-cli/temboclient/docs/InstanceEvent.md b/tembo-cli/temboclient/docs/InstanceEvent.md new file mode 100644 index 000000000..a625a6f96 --- /dev/null +++ b/tembo-cli/temboclient/docs/InstanceEvent.md @@ -0,0 +1,10 @@ +# InstanceEvent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/IntOrString.md b/tembo-cli/temboclient/docs/IntOrString.md new file mode 100644 index 000000000..ee718d850 --- /dev/null +++ b/tembo-cli/temboclient/docs/IntOrString.md @@ -0,0 +1,12 @@ +# IntOrString + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**int** | **i32** | | +**string** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/IntOrStringOneOf.md b/tembo-cli/temboclient/docs/IntOrStringOneOf.md new file mode 100644 index 000000000..e0ef4164a --- /dev/null +++ b/tembo-cli/temboclient/docs/IntOrStringOneOf.md @@ -0,0 +1,11 @@ +# IntOrStringOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**int** | **i32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/IntOrStringOneOf1.md b/tembo-cli/temboclient/docs/IntOrStringOneOf1.md new file mode 100644 index 000000000..0a461812b --- /dev/null +++ b/tembo-cli/temboclient/docs/IntOrStringOneOf1.md @@ -0,0 +1,11 @@ +# IntOrStringOneOf1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Memory.md b/tembo-cli/temboclient/docs/Memory.md new file mode 100644 index 000000000..75efcf827 --- /dev/null +++ b/tembo-cli/temboclient/docs/Memory.md @@ -0,0 +1,10 @@ +# Memory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Middleware.md b/tembo-cli/temboclient/docs/Middleware.md new file mode 100644 index 000000000..8117cc981 --- /dev/null +++ b/tembo-cli/temboclient/docs/Middleware.md @@ -0,0 +1,13 @@ +# Middleware + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_request_headers** | [**crate::models::HeaderConfig**](HeaderConfig.md) | | +**strip_prefix** | [**crate::models::StripPrefixConfig**](StripPrefixConfig.md) | | +**replace_path_regex** | [**crate::models::ReplacePathRegexConfig**](ReplacePathRegexConfig.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/MiddlewareOneOf.md b/tembo-cli/temboclient/docs/MiddlewareOneOf.md new file mode 100644 index 000000000..9844ae9ae --- /dev/null +++ b/tembo-cli/temboclient/docs/MiddlewareOneOf.md @@ -0,0 +1,11 @@ +# MiddlewareOneOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_request_headers** | [**crate::models::HeaderConfig**](HeaderConfig.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/MiddlewareOneOf1.md b/tembo-cli/temboclient/docs/MiddlewareOneOf1.md new file mode 100644 index 000000000..37e64b6fb --- /dev/null +++ b/tembo-cli/temboclient/docs/MiddlewareOneOf1.md @@ -0,0 +1,11 @@ +# MiddlewareOneOf1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**strip_prefix** | [**crate::models::StripPrefixConfig**](StripPrefixConfig.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/MiddlewareOneOf2.md b/tembo-cli/temboclient/docs/MiddlewareOneOf2.md new file mode 100644 index 000000000..13823af82 --- /dev/null +++ b/tembo-cli/temboclient/docs/MiddlewareOneOf2.md @@ -0,0 +1,11 @@ +# MiddlewareOneOf2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**replace_path_regex** | [**crate::models::ReplacePathRegexConfig**](ReplacePathRegexConfig.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/PatchInstance.md b/tembo-cli/temboclient/docs/PatchInstance.md new file mode 100644 index 000000000..7bd30494a --- /dev/null +++ b/tembo-cli/temboclient/docs/PatchInstance.md @@ -0,0 +1,22 @@ +# PatchInstance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_services** | Option<[**Vec**](AppType.md)> | | [optional] +**connection_pooler** | Option<[**crate::models::ConnectionPooler**](ConnectionPooler.md)> | | [optional] +**cpu** | Option<[**crate::models::Cpu**](Cpu.md)> | | [optional] +**environment** | Option<[**crate::models::Environment**](Environment.md)> | | [optional] +**extensions** | Option<[**Vec**](Extension.md)> | | [optional] +**extra_domains_rw** | Option<**Vec**> | | [optional] +**ip_allow_list** | Option<**Vec**> | | [optional] +**memory** | Option<[**crate::models::Memory**](Memory.md)> | | [optional] +**postgres_configs** | Option<[**Vec**](PgConfig.md)> | | [optional] +**replicas** | Option<**i32**> | | [optional] +**storage** | Option<[**crate::models::Storage**](Storage.md)> | | [optional] +**trunk_installs** | Option<[**Vec**](TrunkInstall.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/PgBouncer.md b/tembo-cli/temboclient/docs/PgBouncer.md new file mode 100644 index 000000000..0dffcc7d9 --- /dev/null +++ b/tembo-cli/temboclient/docs/PgBouncer.md @@ -0,0 +1,13 @@ +# PgBouncer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**parameters** | Option<**::std::collections::HashMap**> | | [optional] +**pool_mode** | Option<[**crate::models::PoolerPgbouncerPoolMode**](PoolerPgbouncerPoolMode.md)> | | [optional] +**resources** | Option<[**crate::models::PoolerTemplateSpecContainersResources**](PoolerTemplateSpecContainersResources.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/PgConfig.md b/tembo-cli/temboclient/docs/PgConfig.md new file mode 100644 index 000000000..3fe31af67 --- /dev/null +++ b/tembo-cli/temboclient/docs/PgConfig.md @@ -0,0 +1,12 @@ +# PgConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**value** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/PoolerPgbouncerPoolMode.md b/tembo-cli/temboclient/docs/PoolerPgbouncerPoolMode.md new file mode 100644 index 000000000..9147d3bc1 --- /dev/null +++ b/tembo-cli/temboclient/docs/PoolerPgbouncerPoolMode.md @@ -0,0 +1,10 @@ +# PoolerPgbouncerPoolMode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResources.md b/tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResources.md new file mode 100644 index 000000000..b13609c68 --- /dev/null +++ b/tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResources.md @@ -0,0 +1,13 @@ +# PoolerTemplateSpecContainersResources + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**claims** | Option<[**Vec**](PoolerTemplateSpecContainersResourcesClaims.md)> | | [optional] +**limits** | Option<[**::std::collections::HashMap**](IntOrString.md)> | | [optional] +**requests** | Option<[**::std::collections::HashMap**](IntOrString.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResourcesClaims.md b/tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResourcesClaims.md new file mode 100644 index 000000000..795c68a45 --- /dev/null +++ b/tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResourcesClaims.md @@ -0,0 +1,11 @@ +# PoolerTemplateSpecContainersResourcesClaims + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Probe.md b/tembo-cli/temboclient/docs/Probe.md new file mode 100644 index 000000000..cf40e191f --- /dev/null +++ b/tembo-cli/temboclient/docs/Probe.md @@ -0,0 +1,13 @@ +# Probe + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**initial_delay_seconds** | **i32** | | +**path** | **String** | | +**port** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Probes.md b/tembo-cli/temboclient/docs/Probes.md new file mode 100644 index 000000000..de6fdcb5e --- /dev/null +++ b/tembo-cli/temboclient/docs/Probes.md @@ -0,0 +1,12 @@ +# Probes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**liveness** | [**crate::models::Probe**](Probe.md) | | +**readiness** | [**crate::models::Probe**](Probe.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/ReplacePathRegexConfig.md b/tembo-cli/temboclient/docs/ReplacePathRegexConfig.md new file mode 100644 index 000000000..69118baff --- /dev/null +++ b/tembo-cli/temboclient/docs/ReplacePathRegexConfig.md @@ -0,0 +1,12 @@ +# ReplacePathRegexConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | [**crate::models::ReplacePathRegexConfigType**](ReplacePathRegexConfigType.md) | | +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/ReplacePathRegexConfigType.md b/tembo-cli/temboclient/docs/ReplacePathRegexConfigType.md new file mode 100644 index 000000000..98520c9a9 --- /dev/null +++ b/tembo-cli/temboclient/docs/ReplacePathRegexConfigType.md @@ -0,0 +1,12 @@ +# ReplacePathRegexConfigType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**regex** | **String** | | +**replacement** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Resource.md b/tembo-cli/temboclient/docs/Resource.md new file mode 100644 index 000000000..7f8c4498d --- /dev/null +++ b/tembo-cli/temboclient/docs/Resource.md @@ -0,0 +1,12 @@ +# Resource + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cpu** | **String** | | +**memory** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/ResourceRequirements.md b/tembo-cli/temboclient/docs/ResourceRequirements.md new file mode 100644 index 000000000..54ca02006 --- /dev/null +++ b/tembo-cli/temboclient/docs/ResourceRequirements.md @@ -0,0 +1,12 @@ +# ResourceRequirements + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**limits** | Option<[**crate::models::Resource**](Resource.md)> | | [optional] +**requests** | Option<[**crate::models::Resource**](Resource.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Restore.md b/tembo-cli/temboclient/docs/Restore.md new file mode 100644 index 000000000..37cc642ab --- /dev/null +++ b/tembo-cli/temboclient/docs/Restore.md @@ -0,0 +1,12 @@ +# Restore + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instance_id** | **String** | | +**recovery_target_time** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/RestoreInstance.md b/tembo-cli/temboclient/docs/RestoreInstance.md new file mode 100644 index 000000000..19e5650f4 --- /dev/null +++ b/tembo-cli/temboclient/docs/RestoreInstance.md @@ -0,0 +1,19 @@ +# RestoreInstance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_services** | Option<[**Vec**](AppType.md)> | | [optional] +**connection_pooler** | Option<[**crate::models::ConnectionPooler**](ConnectionPooler.md)> | | [optional] +**cpu** | Option<[**crate::models::Cpu**](Cpu.md)> | | [optional] +**environment** | Option<[**crate::models::Environment**](Environment.md)> | | [optional] +**extra_domains_rw** | Option<**Vec**> | | [optional] +**instance_name** | **String** | | +**memory** | Option<[**crate::models::Memory**](Memory.md)> | | [optional] +**restore** | [**crate::models::Restore**](Restore.md) | | +**storage** | Option<[**crate::models::Storage**](Storage.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Routing.md b/tembo-cli/temboclient/docs/Routing.md new file mode 100644 index 000000000..51adbf4a4 --- /dev/null +++ b/tembo-cli/temboclient/docs/Routing.md @@ -0,0 +1,13 @@ +# Routing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ingress_path** | Option<**String**> | | [optional] +**middlewares** | Option<**Vec**> | | [optional] +**port** | **i32** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/StackApi.md b/tembo-cli/temboclient/docs/StackApi.md new file mode 100644 index 000000000..80f301aba --- /dev/null +++ b/tembo-cli/temboclient/docs/StackApi.md @@ -0,0 +1,67 @@ +# \StackApi + +All URIs are relative to *http://localhost* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_all_entities**](StackApi.md#get_all_entities) | **GET** /api/v1/stacks | Attributes for all stacks +[**get_entity**](StackApi.md#get_entity) | **GET** /api/v1/stacks/{type} | Get the attributes of a single stack + + + +## get_all_entities + +> Vec get_all_entities() +Attributes for all stacks + +Attributes for all stacks + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec**](serde_json::Value.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_entity + +> serde_json::Value get_entity(r#type) +Get the attributes of a single stack + +Get the attributes of a single stack + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**r#type** | [**StackType**](.md) | the type of entity | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +[jwt_token](../README.md#jwt_token) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/tembo-cli/temboclient/docs/StackType.md b/tembo-cli/temboclient/docs/StackType.md new file mode 100644 index 000000000..11a2217b4 --- /dev/null +++ b/tembo-cli/temboclient/docs/StackType.md @@ -0,0 +1,10 @@ +# StackType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/State.md b/tembo-cli/temboclient/docs/State.md new file mode 100644 index 000000000..fbb82fc2f --- /dev/null +++ b/tembo-cli/temboclient/docs/State.md @@ -0,0 +1,10 @@ +# State + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/Storage.md b/tembo-cli/temboclient/docs/Storage.md new file mode 100644 index 000000000..752c41584 --- /dev/null +++ b/tembo-cli/temboclient/docs/Storage.md @@ -0,0 +1,10 @@ +# Storage + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/StorageConfig.md b/tembo-cli/temboclient/docs/StorageConfig.md new file mode 100644 index 000000000..0ca6d006b --- /dev/null +++ b/tembo-cli/temboclient/docs/StorageConfig.md @@ -0,0 +1,11 @@ +# StorageConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**volume_mounts** | Option<[**Vec**](VolumeMount.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/StripPrefixConfig.md b/tembo-cli/temboclient/docs/StripPrefixConfig.md new file mode 100644 index 000000000..a8e885021 --- /dev/null +++ b/tembo-cli/temboclient/docs/StripPrefixConfig.md @@ -0,0 +1,12 @@ +# StripPrefixConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**config** | **Vec** | | +**name** | **String** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/TrunkInstall.md b/tembo-cli/temboclient/docs/TrunkInstall.md new file mode 100644 index 000000000..fa84d094f --- /dev/null +++ b/tembo-cli/temboclient/docs/TrunkInstall.md @@ -0,0 +1,12 @@ +# TrunkInstall + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | | +**version** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/TrunkInstallStatus.md b/tembo-cli/temboclient/docs/TrunkInstallStatus.md new file mode 100644 index 000000000..8d588be52 --- /dev/null +++ b/tembo-cli/temboclient/docs/TrunkInstallStatus.md @@ -0,0 +1,16 @@ +# TrunkInstallStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **bool** | | +**error_message** | Option<**String**> | | [optional] +**installed_to_pods** | Option<**Vec**> | | [optional] +**loading** | Option<**bool**> | | [optional] +**name** | **String** | | +**version** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/UpdateInstance.md b/tembo-cli/temboclient/docs/UpdateInstance.md new file mode 100644 index 000000000..74ca5c432 --- /dev/null +++ b/tembo-cli/temboclient/docs/UpdateInstance.md @@ -0,0 +1,22 @@ +# UpdateInstance + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**app_services** | Option<[**Vec**](AppType.md)> | | [optional] +**connection_pooler** | Option<[**crate::models::ConnectionPooler**](ConnectionPooler.md)> | | [optional] +**cpu** | [**crate::models::Cpu**](Cpu.md) | | +**environment** | [**crate::models::Environment**](Environment.md) | | +**extensions** | Option<[**Vec**](Extension.md)> | | [optional] +**extra_domains_rw** | Option<**Vec**> | | [optional] +**ip_allow_list** | Option<**Vec**> | | [optional] +**memory** | [**crate::models::Memory**](Memory.md) | | +**postgres_configs** | Option<[**Vec**](PgConfig.md)> | | [optional] +**replicas** | **i32** | | +**storage** | [**crate::models::Storage**](Storage.md) | | +**trunk_installs** | Option<[**Vec**](TrunkInstall.md)> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/docs/VolumeMount.md b/tembo-cli/temboclient/docs/VolumeMount.md new file mode 100644 index 000000000..09f90625f --- /dev/null +++ b/tembo-cli/temboclient/docs/VolumeMount.md @@ -0,0 +1,16 @@ +# VolumeMount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mount_path** | **String** | | +**mount_propagation** | Option<**String**> | | [optional] +**name** | **String** | | +**read_only** | Option<**bool**> | | [optional] +**sub_path** | Option<**String**> | | [optional] +**sub_path_expr** | Option<**String**> | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/tembo-cli/temboclient/git_push.sh b/tembo-cli/temboclient/git_push.sh new file mode 100644 index 000000000..f53a75d4f --- /dev/null +++ b/tembo-cli/temboclient/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/tembo-cli/temboclient/src/apis/app_api.rs b/tembo-cli/temboclient/src/apis/app_api.rs new file mode 100644 index 000000000..89fca1d02 --- /dev/null +++ b/tembo-cli/temboclient/src/apis/app_api.rs @@ -0,0 +1,97 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`get_all_apps`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAllAppsError { + Status401(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_app`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAppError { + Status400(serde_json::Value), + Status401(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + + +/// Attributes for all apps +pub async fn get_all_apps(configuration: &configuration::Configuration, ) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/apps", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get the attributes of a single App +pub async fn get_app(configuration: &configuration::Configuration, r#type: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/apps/{type}", local_var_configuration.base_path, type=crate::apis::urlencode(r#type)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/tembo-cli/temboclient/src/apis/configuration.rs b/tembo-cli/temboclient/src/apis/configuration.rs new file mode 100644 index 000000000..0fa0a96b4 --- /dev/null +++ b/tembo-cli/temboclient/src/apis/configuration.rs @@ -0,0 +1,53 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + +#[derive(Debug, Clone)] +pub struct Configuration { + pub base_path: String, + pub user_agent: Option, + pub client: reqwest::Client, + pub basic_auth: Option, + pub oauth_access_token: Option, + pub bearer_access_token: Option, + pub api_key: Option, + // TODO: take an oauth2 token source, similar to the go one +} + +pub type BasicAuth = (String, Option); + +#[derive(Debug, Clone)] +pub struct ApiKey { + pub prefix: Option, + pub key: String, +} + + +impl Configuration { + pub fn new() -> Configuration { + Configuration::default() + } +} + +impl Default for Configuration { + fn default() -> Self { + Configuration { + base_path: "http://localhost".to_owned(), + user_agent: Some("OpenAPI-Generator/v1.0.0/rust".to_owned()), + client: reqwest::Client::new(), + basic_auth: None, + oauth_access_token: None, + bearer_access_token: None, + api_key: None, + + } + } +} diff --git a/tembo-cli/temboclient/src/apis/instance_api.rs b/tembo-cli/temboclient/src/apis/instance_api.rs new file mode 100644 index 000000000..e80bf8846 --- /dev/null +++ b/tembo-cli/temboclient/src/apis/instance_api.rs @@ -0,0 +1,395 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::{apis::ResponseContent, models::InstanceEvent}; +use super::{Error, configuration}; + + +/// struct for typed errors of method [`create_instance`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateInstanceError { + Status400(crate::models::ErrorResponseSchema), + Status401(String), + Status403(crate::models::ErrorResponseSchema), + Status409(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`delete_instance`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteInstanceError { + Status400(crate::models::ErrorResponseSchema), + Status401(crate::models::ErrorResponseSchema), + Status403(crate::models::ErrorResponseSchema), + Status409(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_all`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAllError { + Status400(crate::models::ErrorResponseSchema), + Status401(crate::models::ErrorResponseSchema), + Status403(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_instance`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetInstanceError { + Status400(crate::models::ErrorResponseSchema), + Status401(crate::models::ErrorResponseSchema), + Status403(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_schema`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSchemaError { + Status401(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`instance_event`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InstanceEventError { + Status401(crate::models::ErrorResponseSchema), + Status403(crate::models::ErrorResponseSchema), + Status409(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`patch_instance`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PatchInstanceError { + Status400(crate::models::ErrorResponseSchema), + Status401(String), + Status403(crate::models::ErrorResponseSchema), + Status409(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`put_instance`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum PutInstanceError { + Status400(crate::models::ErrorResponseSchema), + Status401(crate::models::ErrorResponseSchema), + Status403(crate::models::ErrorResponseSchema), + Status409(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`restore_instance`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RestoreInstanceError { + Status400(crate::models::ErrorResponseSchema), + Status401(String), + Status403(crate::models::ErrorResponseSchema), + Status409(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + + +/// Create a new Tembo instance +pub async fn create_instance(configuration: &configuration::Configuration, org_id: &str, create_instance: crate::models::CreateInstance) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/orgs/{org_id}/instances", local_var_configuration.base_path, org_id=crate::apis::urlencode(org_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&create_instance); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Delete an existing Tembo instance +pub async fn delete_instance(configuration: &configuration::Configuration, org_id: &str, instance_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/orgs/{org_id}/instances/{instance_id}", local_var_configuration.base_path, org_id=crate::apis::urlencode(org_id), instance_id=crate::apis::urlencode(instance_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get all Tembo instances in an organization +pub async fn get_all(configuration: &configuration::Configuration, org_id: &str) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/orgs/{org_id}/instances", local_var_configuration.base_path, org_id=crate::apis::urlencode(org_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get an existing Tembo instance +pub async fn get_instance(configuration: &configuration::Configuration, org_id: &str, instance_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/orgs/{org_id}/instances/{instance_id}", local_var_configuration.base_path, org_id=crate::apis::urlencode(org_id), instance_id=crate::apis::urlencode(instance_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get the json-schema for an instance +pub async fn get_schema(configuration: &configuration::Configuration, ) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/orgs/instances/schema", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Lifecycle events for a Tembo instance Currently only supports restart +pub async fn instance_event(configuration: &configuration::Configuration, org_id: &str, event_type: InstanceEvent, instance_id: &str) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/orgs/{org_id}/instances/{instance_id}", local_var_configuration.base_path, org_id=crate::apis::urlencode(org_id), instance_id=crate::apis::urlencode(instance_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + local_var_req_builder = local_var_req_builder.query(&[("event_type", &event_type.to_string())]); + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Update attributes on an existing Tembo instance +pub async fn patch_instance(configuration: &configuration::Configuration, org_id: &str, instance_id: &str, patch_instance: crate::models::PatchInstance) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/orgs/{org_id}/instances/{instance_id}", local_var_configuration.base_path, org_id=crate::apis::urlencode(org_id), instance_id=crate::apis::urlencode(instance_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&patch_instance); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Replace all attributes of an existing Tembo instance +pub async fn put_instance(configuration: &configuration::Configuration, org_id: &str, instance_id: &str, update_instance: crate::models::UpdateInstance) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/orgs/{org_id}/instances/{instance_id}", local_var_configuration.base_path, org_id=crate::apis::urlencode(org_id), instance_id=crate::apis::urlencode(instance_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&update_instance); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Restore a Tembo instance +pub async fn restore_instance(configuration: &configuration::Configuration, org_id: &str, restore_instance: crate::models::RestoreInstance) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/orgs/{org_id}/restore", local_var_configuration.base_path, org_id=crate::apis::urlencode(org_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + local_var_req_builder = local_var_req_builder.json(&restore_instance); + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/tembo-cli/temboclient/src/apis/mod.rs b/tembo-cli/temboclient/src/apis/mod.rs new file mode 100644 index 000000000..d2524dd97 --- /dev/null +++ b/tembo-cli/temboclient/src/apis/mod.rs @@ -0,0 +1,97 @@ +use std::error; +use std::fmt; + +#[derive(Debug, Clone)] +pub struct ResponseContent { + pub status: reqwest::StatusCode, + pub content: String, + pub entity: Option, +} + +#[derive(Debug)] +pub enum Error { + Reqwest(reqwest::Error), + Serde(serde_json::Error), + Io(std::io::Error), + ResponseError(ResponseContent), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let (module, e) = match self { + Error::Reqwest(e) => ("reqwest", e.to_string()), + Error::Serde(e) => ("serde", e.to_string()), + Error::Io(e) => ("IO", e.to_string()), + Error::ResponseError(e) => ("response", format!("status code {}", e.status)), + }; + write!(f, "error in {}: {}", module, e) + } +} + +impl error::Error for Error { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { + Some(match self { + Error::Reqwest(e) => e, + Error::Serde(e) => e, + Error::Io(e) => e, + Error::ResponseError(_) => return None, + }) + } +} + +impl From for Error { + fn from(e: reqwest::Error) -> Self { + Error::Reqwest(e) + } +} + +impl From for Error { + fn from(e: serde_json::Error) -> Self { + Error::Serde(e) + } +} + +impl From for Error { + fn from(e: std::io::Error) -> Self { + Error::Io(e) + } +} + +pub fn urlencode>(s: T) -> String { + ::url::form_urlencoded::byte_serialize(s.as_ref().as_bytes()).collect() +} + +pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String, String)> { + if let serde_json::Value::Object(object) = value { + let mut params = vec![]; + + for (key, value) in object { + match value { + serde_json::Value::Object(_) => params.append(&mut parse_deep_object( + &format!("{}[{}]", prefix, key), + value, + )), + serde_json::Value::Array(array) => { + for (i, value) in array.iter().enumerate() { + params.append(&mut parse_deep_object( + &format!("{}[{}][{}]", prefix, key, i), + value, + )); + } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), + _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), + } + } + + return params; + } + + unimplemented!("Only objects are supported with style=deepObject") +} + +pub mod app_api; +pub mod instance_api; +pub mod stack_api; + +pub mod configuration; diff --git a/tembo-cli/temboclient/src/apis/stack_api.rs b/tembo-cli/temboclient/src/apis/stack_api.rs new file mode 100644 index 000000000..a083a00cc --- /dev/null +++ b/tembo-cli/temboclient/src/apis/stack_api.rs @@ -0,0 +1,97 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; + +use crate::apis::ResponseContent; +use super::{Error, configuration}; +use crate::models::StackType; + +/// struct for typed errors of method [`get_all_entities`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAllEntitiesError { + Status401(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_entity`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetEntityError { + Status400(serde_json::Value), + Status401(crate::models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + + +/// Attributes for all stacks +pub async fn get_all_entities(configuration: &configuration::Configuration, ) -> Result, Error> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/stacks", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + +/// Get the attributes of a single stack +pub async fn get_entity(configuration: &configuration::Configuration, r#type: StackType) -> Result> { + let local_var_configuration = configuration; + + let local_var_client = &local_var_configuration.client; + + let local_var_uri_str = format!("{}/api/v1/stacks/{type:?}", local_var_configuration.base_path, type=r#type); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + + if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + } + if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { + local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); + }; + + let local_var_req = local_var_req_builder.build()?; + let local_var_resp = local_var_client.execute(local_var_req).await?; + + let local_var_status = local_var_resp.status(); + let local_var_content = local_var_resp.text().await?; + + if !local_var_status.is_client_error() && !local_var_status.is_server_error() { + serde_json::from_str(&local_var_content).map_err(Error::from) + } else { + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; + Err(Error::ResponseError(local_var_error)) + } +} + diff --git a/tembo-cli/temboclient/src/lib.rs b/tembo-cli/temboclient/src/lib.rs new file mode 100644 index 000000000..feea56ed9 --- /dev/null +++ b/tembo-cli/temboclient/src/lib.rs @@ -0,0 +1,11 @@ +#![allow(clippy::all)] +#[macro_use] +extern crate serde_derive; + +extern crate serde; +extern crate serde_json; +extern crate url; +extern crate reqwest; + +pub mod apis; +pub mod models; diff --git a/tembo-cli/temboclient/src/models/app_config.rs b/tembo-cli/temboclient/src/models/app_config.rs new file mode 100644 index 000000000..31689e2b3 --- /dev/null +++ b/tembo-cli/temboclient/src/models/app_config.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppConfig { + #[serde(rename = "env", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub env: Option>>, +} + +impl AppConfig { + pub fn new() -> AppConfig { + AppConfig { + env: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/app_service.rs b/tembo-cli/temboclient/src/models/app_service.rs new file mode 100644 index 000000000..bcd9bb4c0 --- /dev/null +++ b/tembo-cli/temboclient/src/models/app_service.rs @@ -0,0 +1,55 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppService { + #[serde(rename = "args", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub args: Option>>, + #[serde(rename = "command", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub command: Option>>, + #[serde(rename = "env", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub env: Option>>, + #[serde(rename = "image")] + pub image: String, + #[serde(rename = "middlewares", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub middlewares: Option>>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "probes", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub probes: Option>>, + #[serde(rename = "resources", skip_serializing_if = "Option::is_none")] + pub resources: Option>, + #[serde(rename = "routing", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub routing: Option>>, + #[serde(rename = "storage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub storage: Option>>, +} + +impl AppService { + pub fn new(image: String, name: String) -> AppService { + AppService { + args: None, + command: None, + env: None, + image, + middlewares: None, + name, + probes: None, + resources: None, + routing: None, + storage: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/app_type.rs b/tembo-cli/temboclient/src/models/app_type.rs new file mode 100644 index 000000000..54c2c9984 --- /dev/null +++ b/tembo-cli/temboclient/src/models/app_type.rs @@ -0,0 +1,34 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppType { + #[serde(rename = "restapi", deserialize_with = "Option::deserialize")] + pub restapi: Option>, + #[serde(rename = "http", deserialize_with = "Option::deserialize")] + pub http: Option>, + #[serde(rename = "custom")] + pub custom: Box, +} + +impl AppType { + pub fn new(restapi: Option, http: Option, custom: crate::models::AppService) -> AppType { + AppType { + restapi: if let Some(x) = restapi {Some(Box::new(x))} else {None}, + http: if let Some(x) = http {Some(Box::new(x))} else {None}, + custom: Box::new(custom), + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/app_type_one_of.rs b/tembo-cli/temboclient/src/models/app_type_one_of.rs new file mode 100644 index 000000000..51555cfa6 --- /dev/null +++ b/tembo-cli/temboclient/src/models/app_type_one_of.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppTypeOneOf { + #[serde(rename = "restapi", deserialize_with = "Option::deserialize")] + pub restapi: Option>, +} + +impl AppTypeOneOf { + pub fn new(restapi: Option) -> AppTypeOneOf { + AppTypeOneOf { + restapi: if let Some(x) = restapi {Some(Box::new(x))} else {None}, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/app_type_one_of_1.rs b/tembo-cli/temboclient/src/models/app_type_one_of_1.rs new file mode 100644 index 000000000..3a90a6e31 --- /dev/null +++ b/tembo-cli/temboclient/src/models/app_type_one_of_1.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppTypeOneOf1 { + #[serde(rename = "http", deserialize_with = "Option::deserialize")] + pub http: Option>, +} + +impl AppTypeOneOf1 { + pub fn new(http: Option) -> AppTypeOneOf1 { + AppTypeOneOf1 { + http: if let Some(x) = http {Some(Box::new(x))} else {None}, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/app_type_one_of_2.rs b/tembo-cli/temboclient/src/models/app_type_one_of_2.rs new file mode 100644 index 000000000..f07628d56 --- /dev/null +++ b/tembo-cli/temboclient/src/models/app_type_one_of_2.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppTypeOneOf2 { + #[serde(rename = "custom")] + pub custom: Box, +} + +impl AppTypeOneOf2 { + pub fn new(custom: crate::models::AppService) -> AppTypeOneOf2 { + AppTypeOneOf2 { + custom: Box::new(custom), + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/connection_info.rs b/tembo-cli/temboclient/src/models/connection_info.rs new file mode 100644 index 000000000..dfe951bf8 --- /dev/null +++ b/tembo-cli/temboclient/src/models/connection_info.rs @@ -0,0 +1,40 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionInfo { + #[serde(rename = "host")] + pub host: String, + #[serde(rename = "password")] + pub password: String, + #[serde(rename = "pooler_host", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub pooler_host: Option>, + #[serde(rename = "port")] + pub port: i32, + #[serde(rename = "user")] + pub user: String, +} + +impl ConnectionInfo { + pub fn new(host: String, password: String, port: i32, user: String) -> ConnectionInfo { + ConnectionInfo { + host, + password, + pooler_host: None, + port, + user, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/connection_pooler.rs b/tembo-cli/temboclient/src/models/connection_pooler.rs new file mode 100644 index 000000000..d1ca5947e --- /dev/null +++ b/tembo-cli/temboclient/src/models/connection_pooler.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ConnectionPooler { + #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] + pub enabled: Option, + #[serde(rename = "pooler", skip_serializing_if = "Option::is_none")] + pub pooler: Option>, +} + +impl ConnectionPooler { + pub fn new() -> ConnectionPooler { + ConnectionPooler { + enabled: None, + pooler: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/cpu.rs b/tembo-cli/temboclient/src/models/cpu.rs new file mode 100644 index 000000000..c95c3f386 --- /dev/null +++ b/tembo-cli/temboclient/src/models/cpu.rs @@ -0,0 +1,47 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Cpu { + #[serde(rename = "1")] + Variant1, + #[serde(rename = "2")] + Variant2, + #[serde(rename = "4")] + Variant4, + #[serde(rename = "8")] + Variant8, + #[serde(rename = "16")] + Variant16, + #[serde(rename = "32")] + Variant32, + +} + +impl ToString for Cpu { + fn to_string(&self) -> String { + match self { + Self::Variant1 => String::from("1"), + Self::Variant2 => String::from("2"), + Self::Variant4 => String::from("4"), + Self::Variant8 => String::from("8"), + Self::Variant16 => String::from("16"), + Self::Variant32 => String::from("32"), + } + } +} + +impl Default for Cpu { + fn default() -> Cpu { + Self::Variant1 + } +} diff --git a/tembo-cli/temboclient/src/models/create_instance.rs b/tembo-cli/temboclient/src/models/create_instance.rs new file mode 100644 index 000000000..d3ef9d29b --- /dev/null +++ b/tembo-cli/temboclient/src/models/create_instance.rs @@ -0,0 +1,67 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateInstance { + #[serde(rename = "app_services", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub app_services: Option>>, + #[serde(rename = "connection_pooler", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub connection_pooler: Option>>, + #[serde(rename = "cpu")] + pub cpu: crate::models::Cpu, + #[serde(rename = "environment")] + pub environment: crate::models::Environment, + #[serde(rename = "extensions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub extensions: Option>>, + #[serde(rename = "extra_domains_rw", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub extra_domains_rw: Option>>, + #[serde(rename = "instance_name")] + pub instance_name: String, + #[serde(rename = "ip_allow_list", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub ip_allow_list: Option>>, + #[serde(rename = "memory")] + pub memory: crate::models::Memory, + #[serde(rename = "postgres_configs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub postgres_configs: Option>>, + #[serde(rename = "replicas", skip_serializing_if = "Option::is_none")] + pub replicas: Option, + #[serde(rename = "stack_type")] + pub stack_type: crate::models::StackType, + #[serde(rename = "storage")] + pub storage: crate::models::Storage, + #[serde(rename = "trunk_installs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub trunk_installs: Option>>, +} + +impl CreateInstance { + pub fn new(cpu: crate::models::Cpu, environment: crate::models::Environment, instance_name: String, memory: crate::models::Memory, stack_type: crate::models::StackType, storage: crate::models::Storage) -> CreateInstance { + CreateInstance { + app_services: None, + connection_pooler: None, + cpu, + environment, + extensions: None, + extra_domains_rw: None, + instance_name, + ip_allow_list: None, + memory, + postgres_configs: None, + replicas: None, + stack_type, + storage, + trunk_installs: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/env_var.rs b/tembo-cli/temboclient/src/models/env_var.rs new file mode 100644 index 000000000..6f4154bcb --- /dev/null +++ b/tembo-cli/temboclient/src/models/env_var.rs @@ -0,0 +1,34 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct EnvVar { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub value: Option>, + #[serde(rename = "valueFromPlatform", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub value_from_platform: Option>, +} + +impl EnvVar { + pub fn new(name: String) -> EnvVar { + EnvVar { + name, + value: None, + value_from_platform: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/env_var_ref.rs b/tembo-cli/temboclient/src/models/env_var_ref.rs new file mode 100644 index 000000000..5e559c56a --- /dev/null +++ b/tembo-cli/temboclient/src/models/env_var_ref.rs @@ -0,0 +1,39 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum EnvVarRef { + #[serde(rename = "ReadOnlyConnection")] + ReadOnlyConnection, + #[serde(rename = "ReadWriteConnection")] + ReadWriteConnection, + +} + +impl ToString for EnvVarRef { + fn to_string(&self) -> String { + match self { + Self::ReadOnlyConnection => String::from("ReadOnlyConnection"), + Self::ReadWriteConnection => String::from("ReadWriteConnection"), + } + } +} + +impl Default for EnvVarRef { + fn default() -> EnvVarRef { + Self::ReadOnlyConnection + } +} + + + + diff --git a/tembo-cli/temboclient/src/models/environment.rs b/tembo-cli/temboclient/src/models/environment.rs new file mode 100644 index 000000000..5abdcf2b8 --- /dev/null +++ b/tembo-cli/temboclient/src/models/environment.rs @@ -0,0 +1,42 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Environment { + #[serde(rename = "dev")] + Dev, + #[serde(rename = "test")] + Test, + #[serde(rename = "prod")] + Prod, + +} + +impl ToString for Environment { + fn to_string(&self) -> String { + match self { + Self::Dev => String::from("dev"), + Self::Test => String::from("test"), + Self::Prod => String::from("prod"), + } + } +} + +impl Default for Environment { + fn default() -> Environment { + Self::Dev + } +} + + + + diff --git a/tembo-cli/temboclient/src/models/error_response_schema.rs b/tembo-cli/temboclient/src/models/error_response_schema.rs new file mode 100644 index 000000000..3cb56cc05 --- /dev/null +++ b/tembo-cli/temboclient/src/models/error_response_schema.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ErrorResponseSchema { + #[serde(rename = "error")] + pub error: String, +} + +impl ErrorResponseSchema { + pub fn new(error: String) -> ErrorResponseSchema { + ErrorResponseSchema { + error, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/extension.rs b/tembo-cli/temboclient/src/models/extension.rs new file mode 100644 index 000000000..96be7eebd --- /dev/null +++ b/tembo-cli/temboclient/src/models/extension.rs @@ -0,0 +1,34 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Extension { + #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub description: Option>, + #[serde(rename = "locations")] + pub locations: Vec, + #[serde(rename = "name")] + pub name: String, +} + +impl Extension { + pub fn new(locations: Vec, name: String) -> Extension { + Extension { + description: None, + locations, + name, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/extension_install_location.rs b/tembo-cli/temboclient/src/models/extension_install_location.rs new file mode 100644 index 000000000..1c85bb33c --- /dev/null +++ b/tembo-cli/temboclient/src/models/extension_install_location.rs @@ -0,0 +1,37 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExtensionInstallLocation { + #[serde(rename = "database", skip_serializing_if = "Option::is_none")] + pub database: Option, + #[serde(rename = "enabled")] + pub enabled: bool, + #[serde(rename = "schema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub schema: Option>, + #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub version: Option>, +} + +impl ExtensionInstallLocation { + pub fn new(enabled: bool) -> ExtensionInstallLocation { + ExtensionInstallLocation { + database: None, + enabled, + schema: None, + version: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/extension_install_location_status.rs b/tembo-cli/temboclient/src/models/extension_install_location_status.rs new file mode 100644 index 000000000..057585665 --- /dev/null +++ b/tembo-cli/temboclient/src/models/extension_install_location_status.rs @@ -0,0 +1,43 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExtensionInstallLocationStatus { + #[serde(rename = "database", skip_serializing_if = "Option::is_none")] + pub database: Option, + #[serde(rename = "enabled", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub enabled: Option>, + #[serde(rename = "error", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub error: Option>, + #[serde(rename = "error_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub error_message: Option>, + #[serde(rename = "schema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub schema: Option>, + #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub version: Option>, +} + +impl ExtensionInstallLocationStatus { + pub fn new() -> ExtensionInstallLocationStatus { + ExtensionInstallLocationStatus { + database: None, + enabled: None, + error: None, + error_message: None, + schema: None, + version: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/extension_status.rs b/tembo-cli/temboclient/src/models/extension_status.rs new file mode 100644 index 000000000..e4e7c0ce4 --- /dev/null +++ b/tembo-cli/temboclient/src/models/extension_status.rs @@ -0,0 +1,34 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ExtensionStatus { + #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub description: Option>, + #[serde(rename = "locations")] + pub locations: Vec, + #[serde(rename = "name")] + pub name: String, +} + +impl ExtensionStatus { + pub fn new(locations: Vec, name: String) -> ExtensionStatus { + ExtensionStatus { + description: None, + locations, + name, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/header_config.rs b/tembo-cli/temboclient/src/models/header_config.rs new file mode 100644 index 000000000..df97d51f4 --- /dev/null +++ b/tembo-cli/temboclient/src/models/header_config.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct HeaderConfig { + #[serde(rename = "config")] + pub config: ::std::collections::HashMap, + #[serde(rename = "name")] + pub name: String, +} + +impl HeaderConfig { + pub fn new(config: ::std::collections::HashMap, name: String) -> HeaderConfig { + HeaderConfig { + config, + name, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/impls.rs b/tembo-cli/temboclient/src/models/impls.rs new file mode 100644 index 000000000..41afddccb --- /dev/null +++ b/tembo-cli/temboclient/src/models/impls.rs @@ -0,0 +1,79 @@ +use std::str::FromStr; + +use super::{Cpu, Storage, StackType, Memory, Environment}; + +impl FromStr for Cpu { + type Err = (); + + fn from_str(input: &str) -> core::result::Result { + match input { + "1" => Ok(Cpu::Variant1), + "2" => Ok(Cpu::Variant2), + "4" => Ok(Cpu::Variant4), + "8" => Ok(Cpu::Variant8), + "16" => Ok(Cpu::Variant16), + "32" => Ok(Cpu::Variant32), + _ => Err(()), + } + } +} + +impl FromStr for Memory { + type Err = (); + + fn from_str(input: &str) -> core::result::Result { + match input { + "1Gi" => Ok(Memory::Variant1Gi), + "2Gi" => Ok(Memory::Variant2Gi), + "4Gi" => Ok(Memory::Variant4Gi), + "8Gi" => Ok(Memory::Variant8Gi), + "16Gi" => Ok(Memory::Variant16Gi), + "32Gi" => Ok(Memory::Variant32Gi), + _ => Err(()), + } + } +} + +impl FromStr for Environment { + type Err = (); + + fn from_str(input: &str) -> core::result::Result { + match input { + "dev" => Ok(Environment::Dev), + "test" => Ok(Environment::Test), + "prod" => Ok(Environment::Prod), + _ => Err(()), + } + } +} + +impl FromStr for Storage { + type Err = (); + + fn from_str(input: &str) -> core::result::Result { + match input { + "10Gi" => Ok(Storage::Variant10Gi), + "50Gi" => Ok(Storage::Variant50Gi), + "100Gi" => Ok(Storage::Variant100Gi), + "200Gi" => Ok(Storage::Variant200Gi), + "300Gi" => Ok(Storage::Variant300Gi), + "400Gi" => Ok(Storage::Variant400Gi), + "500Gi" => Ok(Self::Variant500Gi), + _ => Err(()), + } + } +} + +impl ToString for StackType { + fn to_string(&self) -> String { + match self { + Self::Standard => String::from("Standard"), + Self::MessageQueue => String::from("MessageQueue"), + Self::MachineLearning => String::from("MachineLearning"), + Self::Olap => String::from("OLAP"), + Self::Oltp => String::from("OLTP"), + Self::VectorDb => String::from("VectorDB"), + Self::DataWarehouse => String::from("DataWarehouse"), + } + } +} \ No newline at end of file diff --git a/tembo-cli/temboclient/src/models/infrastructure.rs b/tembo-cli/temboclient/src/models/infrastructure.rs new file mode 100644 index 000000000..9afe93e55 --- /dev/null +++ b/tembo-cli/temboclient/src/models/infrastructure.rs @@ -0,0 +1,34 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Infrastructure { + #[serde(rename = "cpu", skip_serializing_if = "Option::is_none")] + pub cpu: Option, + #[serde(rename = "memory", skip_serializing_if = "Option::is_none")] + pub memory: Option, + #[serde(rename = "storage", skip_serializing_if = "Option::is_none")] + pub storage: Option, +} + +impl Infrastructure { + pub fn new() -> Infrastructure { + Infrastructure { + cpu: None, + memory: None, + storage: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/ingress.rs b/tembo-cli/temboclient/src/models/ingress.rs new file mode 100644 index 000000000..7abaee445 --- /dev/null +++ b/tembo-cli/temboclient/src/models/ingress.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Ingress { + #[serde(rename = "enabled")] + pub enabled: bool, + #[serde(rename = "path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub path: Option>, +} + +impl Ingress { + pub fn new(enabled: bool) -> Ingress { + Ingress { + enabled, + path: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/instance.rs b/tembo-cli/temboclient/src/models/instance.rs new file mode 100644 index 000000000..37bc4d056 --- /dev/null +++ b/tembo-cli/temboclient/src/models/instance.rs @@ -0,0 +1,94 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Instance { + #[serde(rename = "app_services", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub app_services: Option>>, + #[serde(rename = "connection_info", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub connection_info: Option>>, + #[serde(rename = "connection_pooler", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub connection_pooler: Option>>, + #[serde(rename = "cpu")] + pub cpu: crate::models::Cpu, + #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] + pub created_at: Option, + #[serde(rename = "environment")] + pub environment: crate::models::Environment, + #[serde(rename = "extensions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub extensions: Option>>, + #[serde(rename = "extra_domains_rw", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub extra_domains_rw: Option>>, + #[serde(rename = "first_recoverability_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub first_recoverability_time: Option>, + #[serde(rename = "instance_id")] + pub instance_id: String, + #[serde(rename = "instance_name")] + pub instance_name: String, + #[serde(rename = "ip_allow_list", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub ip_allow_list: Option>>, + #[serde(rename = "last_updated_at", skip_serializing_if = "Option::is_none")] + pub last_updated_at: Option, + #[serde(rename = "memory")] + pub memory: crate::models::Memory, + #[serde(rename = "organization_id")] + pub organization_id: String, + #[serde(rename = "organization_name")] + pub organization_name: String, + #[serde(rename = "postgres_configs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub postgres_configs: Option>>, + #[serde(rename = "replicas")] + pub replicas: i32, + #[serde(rename = "runtime_config", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub runtime_config: Option>>, + #[serde(rename = "stack_type")] + pub stack_type: crate::models::StackType, + #[serde(rename = "state")] + pub state: crate::models::State, + #[serde(rename = "storage")] + pub storage: crate::models::Storage, + #[serde(rename = "trunk_installs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub trunk_installs: Option>>, +} + +impl Instance { + pub fn new(cpu: crate::models::Cpu, environment: crate::models::Environment, instance_id: String, instance_name: String, memory: crate::models::Memory, organization_id: String, organization_name: String, replicas: i32, stack_type: crate::models::StackType, state: crate::models::State, storage: crate::models::Storage) -> Instance { + Instance { + app_services: None, + connection_info: None, + connection_pooler: None, + cpu, + created_at: None, + environment, + extensions: None, + extra_domains_rw: None, + first_recoverability_time: None, + instance_id, + instance_name, + ip_allow_list: None, + last_updated_at: None, + memory, + organization_id, + organization_name, + postgres_configs: None, + replicas, + runtime_config: None, + stack_type, + state, + storage, + trunk_installs: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/instance_event.rs b/tembo-cli/temboclient/src/models/instance_event.rs new file mode 100644 index 000000000..d6d7199de --- /dev/null +++ b/tembo-cli/temboclient/src/models/instance_event.rs @@ -0,0 +1,36 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum InstanceEvent { + #[serde(rename = "restart")] + Restart, + +} + +impl ToString for InstanceEvent { + fn to_string(&self) -> String { + match self { + Self::Restart => String::from("restart"), + } + } +} + +impl Default for InstanceEvent { + fn default() -> InstanceEvent { + Self::Restart + } +} + + + + diff --git a/tembo-cli/temboclient/src/models/int_or_string.rs b/tembo-cli/temboclient/src/models/int_or_string.rs new file mode 100644 index 000000000..3e7ea6d03 --- /dev/null +++ b/tembo-cli/temboclient/src/models/int_or_string.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IntOrString { + #[serde(rename = "Int")] + pub int: i32, + #[serde(rename = "String")] + pub string: String, +} + +impl IntOrString { + pub fn new(int: i32, string: String) -> IntOrString { + IntOrString { + int, + string, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/int_or_string_one_of.rs b/tembo-cli/temboclient/src/models/int_or_string_one_of.rs new file mode 100644 index 000000000..52656966a --- /dev/null +++ b/tembo-cli/temboclient/src/models/int_or_string_one_of.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IntOrStringOneOf { + #[serde(rename = "Int")] + pub int: i32, +} + +impl IntOrStringOneOf { + pub fn new(int: i32) -> IntOrStringOneOf { + IntOrStringOneOf { + int, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/int_or_string_one_of_1.rs b/tembo-cli/temboclient/src/models/int_or_string_one_of_1.rs new file mode 100644 index 000000000..7c103a88b --- /dev/null +++ b/tembo-cli/temboclient/src/models/int_or_string_one_of_1.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct IntOrStringOneOf1 { + #[serde(rename = "String")] + pub string: String, +} + +impl IntOrStringOneOf1 { + pub fn new(string: String) -> IntOrStringOneOf1 { + IntOrStringOneOf1 { + string, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/memory.rs b/tembo-cli/temboclient/src/models/memory.rs new file mode 100644 index 000000000..df942ea86 --- /dev/null +++ b/tembo-cli/temboclient/src/models/memory.rs @@ -0,0 +1,51 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Memory { + #[serde(rename = "1Gi")] + Variant1Gi, + #[serde(rename = "2Gi")] + Variant2Gi, + #[serde(rename = "4Gi")] + Variant4Gi, + #[serde(rename = "8Gi")] + Variant8Gi, + #[serde(rename = "16Gi")] + Variant16Gi, + #[serde(rename = "32Gi")] + Variant32Gi, + +} + +impl ToString for Memory { + fn to_string(&self) -> String { + match self { + Self::Variant1Gi => String::from("1Gi"), + Self::Variant2Gi => String::from("2Gi"), + Self::Variant4Gi => String::from("4Gi"), + Self::Variant8Gi => String::from("8Gi"), + Self::Variant16Gi => String::from("16Gi"), + Self::Variant32Gi => String::from("32Gi"), + } + } +} + +impl Default for Memory { + fn default() -> Memory { + Self::Variant1Gi + } +} + + + + diff --git a/tembo-cli/temboclient/src/models/middleware.rs b/tembo-cli/temboclient/src/models/middleware.rs new file mode 100644 index 000000000..6012898ff --- /dev/null +++ b/tembo-cli/temboclient/src/models/middleware.rs @@ -0,0 +1,34 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Middleware { + #[serde(rename = "customRequestHeaders")] + pub custom_request_headers: Box, + #[serde(rename = "stripPrefix")] + pub strip_prefix: Box, + #[serde(rename = "replacePathRegex")] + pub replace_path_regex: Box, +} + +impl Middleware { + pub fn new(custom_request_headers: crate::models::HeaderConfig, strip_prefix: crate::models::StripPrefixConfig, replace_path_regex: crate::models::ReplacePathRegexConfig) -> Middleware { + Middleware { + custom_request_headers: Box::new(custom_request_headers), + strip_prefix: Box::new(strip_prefix), + replace_path_regex: Box::new(replace_path_regex), + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/middleware_one_of.rs b/tembo-cli/temboclient/src/models/middleware_one_of.rs new file mode 100644 index 000000000..5be9696cc --- /dev/null +++ b/tembo-cli/temboclient/src/models/middleware_one_of.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MiddlewareOneOf { + #[serde(rename = "customRequestHeaders")] + pub custom_request_headers: Box, +} + +impl MiddlewareOneOf { + pub fn new(custom_request_headers: crate::models::HeaderConfig) -> MiddlewareOneOf { + MiddlewareOneOf { + custom_request_headers: Box::new(custom_request_headers), + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/middleware_one_of_1.rs b/tembo-cli/temboclient/src/models/middleware_one_of_1.rs new file mode 100644 index 000000000..d8d8433aa --- /dev/null +++ b/tembo-cli/temboclient/src/models/middleware_one_of_1.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MiddlewareOneOf1 { + #[serde(rename = "stripPrefix")] + pub strip_prefix: Box, +} + +impl MiddlewareOneOf1 { + pub fn new(strip_prefix: crate::models::StripPrefixConfig) -> MiddlewareOneOf1 { + MiddlewareOneOf1 { + strip_prefix: Box::new(strip_prefix), + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/middleware_one_of_2.rs b/tembo-cli/temboclient/src/models/middleware_one_of_2.rs new file mode 100644 index 000000000..3480582f9 --- /dev/null +++ b/tembo-cli/temboclient/src/models/middleware_one_of_2.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MiddlewareOneOf2 { + #[serde(rename = "replacePathRegex")] + pub replace_path_regex: Box, +} + +impl MiddlewareOneOf2 { + pub fn new(replace_path_regex: crate::models::ReplacePathRegexConfig) -> MiddlewareOneOf2 { + MiddlewareOneOf2 { + replace_path_regex: Box::new(replace_path_regex), + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/mod.rs b/tembo-cli/temboclient/src/models/mod.rs new file mode 100644 index 000000000..60b407a9e --- /dev/null +++ b/tembo-cli/temboclient/src/models/mod.rs @@ -0,0 +1,111 @@ +pub mod app_config; +pub use self::app_config::AppConfig; +pub mod app_service; +pub use self::app_service::AppService; +pub mod app_type; +pub use self::app_type::AppType; +pub mod app_type_one_of; +pub use self::app_type_one_of::AppTypeOneOf; +pub mod app_type_one_of_1; +pub use self::app_type_one_of_1::AppTypeOneOf1; +pub mod app_type_one_of_2; +pub use self::app_type_one_of_2::AppTypeOneOf2; +pub mod connection_info; +pub use self::connection_info::ConnectionInfo; +pub mod connection_pooler; +pub use self::connection_pooler::ConnectionPooler; +pub mod cpu; +pub use self::cpu::Cpu; +pub mod create_instance; +pub use self::create_instance::CreateInstance; +pub mod env_var; +pub use self::env_var::EnvVar; +pub mod env_var_ref; +pub use self::env_var_ref::EnvVarRef; +pub mod environment; +pub use self::environment::Environment; +pub mod error_response_schema; +pub use self::error_response_schema::ErrorResponseSchema; +pub mod extension; +pub use self::extension::Extension; +pub mod extension_install_location; +pub use self::extension_install_location::ExtensionInstallLocation; +pub mod extension_install_location_status; +pub use self::extension_install_location_status::ExtensionInstallLocationStatus; +pub mod extension_status; +pub use self::extension_status::ExtensionStatus; +pub mod header_config; +pub use self::header_config::HeaderConfig; +pub mod infrastructure; +pub use self::infrastructure::Infrastructure; +pub mod ingress; +pub use self::ingress::Ingress; +pub mod instance; +pub use self::instance::Instance; +pub mod instance_event; +pub use self::instance_event::InstanceEvent; +pub mod int_or_string; +pub use self::int_or_string::IntOrString; +pub mod int_or_string_one_of; +pub use self::int_or_string_one_of::IntOrStringOneOf; +pub mod int_or_string_one_of_1; +pub use self::int_or_string_one_of_1::IntOrStringOneOf1; +pub mod memory; +pub use self::memory::Memory; +pub mod middleware; +pub use self::middleware::Middleware; +pub mod middleware_one_of; +pub use self::middleware_one_of::MiddlewareOneOf; +pub mod middleware_one_of_1; +pub use self::middleware_one_of_1::MiddlewareOneOf1; +pub mod middleware_one_of_2; +pub use self::middleware_one_of_2::MiddlewareOneOf2; +pub mod patch_instance; +pub use self::patch_instance::PatchInstance; +pub mod pg_bouncer; +pub use self::pg_bouncer::PgBouncer; +pub mod pg_config; +pub use self::pg_config::PgConfig; +pub mod pooler_pgbouncer_pool_mode; +pub use self::pooler_pgbouncer_pool_mode::PoolerPgbouncerPoolMode; +pub mod pooler_template_spec_containers_resources; +pub use self::pooler_template_spec_containers_resources::PoolerTemplateSpecContainersResources; +pub mod pooler_template_spec_containers_resources_claims; +pub use self::pooler_template_spec_containers_resources_claims::PoolerTemplateSpecContainersResourcesClaims; +pub mod probe; +pub use self::probe::Probe; +pub mod probes; +pub use self::probes::Probes; +pub mod replace_path_regex_config; +pub use self::replace_path_regex_config::ReplacePathRegexConfig; +pub mod replace_path_regex_config_type; +pub use self::replace_path_regex_config_type::ReplacePathRegexConfigType; +pub mod resource; +pub use self::resource::Resource; +pub mod resource_requirements; +pub use self::resource_requirements::ResourceRequirements; +pub mod restore; +pub use self::restore::Restore; +pub mod restore_instance; +pub use self::restore_instance::RestoreInstance; +pub mod routing; +pub use self::routing::Routing; +pub mod stack_type; +pub use self::stack_type::StackType; +pub mod state; +pub use self::state::State; +pub mod storage; +pub use self::storage::Storage; +pub mod storage_config; +pub use self::storage_config::StorageConfig; +pub mod strip_prefix_config; +pub use self::strip_prefix_config::StripPrefixConfig; +pub mod trunk_install; +pub use self::trunk_install::TrunkInstall; +pub mod trunk_install_status; +pub use self::trunk_install_status::TrunkInstallStatus; +pub mod update_instance; +pub use self::update_instance::UpdateInstance; +pub mod volume_mount; +pub use self::volume_mount::VolumeMount; +pub mod impls; diff --git a/tembo-cli/temboclient/src/models/patch_instance.rs b/tembo-cli/temboclient/src/models/patch_instance.rs new file mode 100644 index 000000000..9006c3d00 --- /dev/null +++ b/tembo-cli/temboclient/src/models/patch_instance.rs @@ -0,0 +1,61 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchInstance { + #[serde(rename = "app_services", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub app_services: Option>>, + #[serde(rename = "connection_pooler", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub connection_pooler: Option>>, + #[serde(rename = "cpu", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub cpu: Option>, + #[serde(rename = "environment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub environment: Option>, + #[serde(rename = "extensions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub extensions: Option>>, + #[serde(rename = "extra_domains_rw", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub extra_domains_rw: Option>>, + #[serde(rename = "ip_allow_list", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub ip_allow_list: Option>>, + #[serde(rename = "memory", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub memory: Option>, + #[serde(rename = "postgres_configs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub postgres_configs: Option>>, + #[serde(rename = "replicas", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub replicas: Option>, + #[serde(rename = "storage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub storage: Option>, + #[serde(rename = "trunk_installs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub trunk_installs: Option>>, +} + +impl PatchInstance { + pub fn new() -> PatchInstance { + PatchInstance { + app_services: None, + connection_pooler: None, + cpu: None, + environment: None, + extensions: None, + extra_domains_rw: None, + ip_allow_list: None, + memory: None, + postgres_configs: None, + replicas: None, + storage: None, + trunk_installs: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/pg_bouncer.rs b/tembo-cli/temboclient/src/models/pg_bouncer.rs new file mode 100644 index 000000000..e9eb538b3 --- /dev/null +++ b/tembo-cli/temboclient/src/models/pg_bouncer.rs @@ -0,0 +1,34 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PgBouncer { + #[serde(rename = "parameters", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub parameters: Option>>, + #[serde(rename = "poolMode", skip_serializing_if = "Option::is_none")] + pub pool_mode: Option, + #[serde(rename = "resources", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub resources: Option>>, +} + +impl PgBouncer { + pub fn new() -> PgBouncer { + PgBouncer { + parameters: None, + pool_mode: None, + resources: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/pg_config.rs b/tembo-cli/temboclient/src/models/pg_config.rs new file mode 100644 index 000000000..cfd1d32cd --- /dev/null +++ b/tembo-cli/temboclient/src/models/pg_config.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PgConfig { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "value")] + pub value: String, +} + +impl PgConfig { + pub fn new(name: String, value: String) -> PgConfig { + PgConfig { + name, + value, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/pooler_pgbouncer_pool_mode.rs b/tembo-cli/temboclient/src/models/pooler_pgbouncer_pool_mode.rs new file mode 100644 index 000000000..4f6a4357d --- /dev/null +++ b/tembo-cli/temboclient/src/models/pooler_pgbouncer_pool_mode.rs @@ -0,0 +1,39 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum PoolerPgbouncerPoolMode { + #[serde(rename = "session")] + Session, + #[serde(rename = "transaction")] + Transaction, + +} + +impl ToString for PoolerPgbouncerPoolMode { + fn to_string(&self) -> String { + match self { + Self::Session => String::from("session"), + Self::Transaction => String::from("transaction"), + } + } +} + +impl Default for PoolerPgbouncerPoolMode { + fn default() -> PoolerPgbouncerPoolMode { + Self::Session + } +} + + + + diff --git a/tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources.rs b/tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources.rs new file mode 100644 index 000000000..585c68c3f --- /dev/null +++ b/tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources.rs @@ -0,0 +1,34 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PoolerTemplateSpecContainersResources { + #[serde(rename = "claims", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub claims: Option>>, + #[serde(rename = "limits", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub limits: Option>>, + #[serde(rename = "requests", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub requests: Option>>, +} + +impl PoolerTemplateSpecContainersResources { + pub fn new() -> PoolerTemplateSpecContainersResources { + PoolerTemplateSpecContainersResources { + claims: None, + limits: None, + requests: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources_claims.rs b/tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources_claims.rs new file mode 100644 index 000000000..d629774ad --- /dev/null +++ b/tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources_claims.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct PoolerTemplateSpecContainersResourcesClaims { + #[serde(rename = "name")] + pub name: String, +} + +impl PoolerTemplateSpecContainersResourcesClaims { + pub fn new(name: String) -> PoolerTemplateSpecContainersResourcesClaims { + PoolerTemplateSpecContainersResourcesClaims { + name, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/probe.rs b/tembo-cli/temboclient/src/models/probe.rs new file mode 100644 index 000000000..d6d69cf7f --- /dev/null +++ b/tembo-cli/temboclient/src/models/probe.rs @@ -0,0 +1,34 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Probe { + #[serde(rename = "initialDelaySeconds")] + pub initial_delay_seconds: i32, + #[serde(rename = "path")] + pub path: String, + #[serde(rename = "port")] + pub port: String, +} + +impl Probe { + pub fn new(initial_delay_seconds: i32, path: String, port: String) -> Probe { + Probe { + initial_delay_seconds, + path, + port, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/probes.rs b/tembo-cli/temboclient/src/models/probes.rs new file mode 100644 index 000000000..cf7bb310e --- /dev/null +++ b/tembo-cli/temboclient/src/models/probes.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Probes { + #[serde(rename = "liveness")] + pub liveness: Box, + #[serde(rename = "readiness")] + pub readiness: Box, +} + +impl Probes { + pub fn new(liveness: crate::models::Probe, readiness: crate::models::Probe) -> Probes { + Probes { + liveness: Box::new(liveness), + readiness: Box::new(readiness), + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/replace_path_regex_config.rs b/tembo-cli/temboclient/src/models/replace_path_regex_config.rs new file mode 100644 index 000000000..eb3ca6ee1 --- /dev/null +++ b/tembo-cli/temboclient/src/models/replace_path_regex_config.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReplacePathRegexConfig { + #[serde(rename = "config")] + pub config: Box, + #[serde(rename = "name")] + pub name: String, +} + +impl ReplacePathRegexConfig { + pub fn new(config: crate::models::ReplacePathRegexConfigType, name: String) -> ReplacePathRegexConfig { + ReplacePathRegexConfig { + config: Box::new(config), + name, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/replace_path_regex_config_type.rs b/tembo-cli/temboclient/src/models/replace_path_regex_config_type.rs new file mode 100644 index 000000000..6edb43994 --- /dev/null +++ b/tembo-cli/temboclient/src/models/replace_path_regex_config_type.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ReplacePathRegexConfigType { + #[serde(rename = "regex")] + pub regex: String, + #[serde(rename = "replacement")] + pub replacement: String, +} + +impl ReplacePathRegexConfigType { + pub fn new(regex: String, replacement: String) -> ReplacePathRegexConfigType { + ReplacePathRegexConfigType { + regex, + replacement, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/resource.rs b/tembo-cli/temboclient/src/models/resource.rs new file mode 100644 index 000000000..dd8aeb68d --- /dev/null +++ b/tembo-cli/temboclient/src/models/resource.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Resource { + #[serde(rename = "cpu")] + pub cpu: String, + #[serde(rename = "memory")] + pub memory: String, +} + +impl Resource { + pub fn new(cpu: String, memory: String) -> Resource { + Resource { + cpu, + memory, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/resource_requirements.rs b/tembo-cli/temboclient/src/models/resource_requirements.rs new file mode 100644 index 000000000..785d70ae2 --- /dev/null +++ b/tembo-cli/temboclient/src/models/resource_requirements.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ResourceRequirements { + #[serde(rename = "limits", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub limits: Option>>, + #[serde(rename = "requests", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub requests: Option>>, +} + +impl ResourceRequirements { + pub fn new() -> ResourceRequirements { + ResourceRequirements { + limits: None, + requests: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/restore.rs b/tembo-cli/temboclient/src/models/restore.rs new file mode 100644 index 000000000..a51eb9041 --- /dev/null +++ b/tembo-cli/temboclient/src/models/restore.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Restore { + #[serde(rename = "instance_id")] + pub instance_id: String, + #[serde(rename = "recovery_target_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub recovery_target_time: Option>, +} + +impl Restore { + pub fn new(instance_id: String) -> Restore { + Restore { + instance_id, + recovery_target_time: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/restore_instance.rs b/tembo-cli/temboclient/src/models/restore_instance.rs new file mode 100644 index 000000000..1bb49c18a --- /dev/null +++ b/tembo-cli/temboclient/src/models/restore_instance.rs @@ -0,0 +1,52 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct RestoreInstance { + #[serde(rename = "app_services", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub app_services: Option>>, + #[serde(rename = "connection_pooler", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub connection_pooler: Option>>, + #[serde(rename = "cpu", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub cpu: Option>, + #[serde(rename = "environment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub environment: Option>, + #[serde(rename = "extra_domains_rw", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub extra_domains_rw: Option>>, + #[serde(rename = "instance_name")] + pub instance_name: String, + #[serde(rename = "memory", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub memory: Option>, + #[serde(rename = "restore")] + pub restore: Box, + #[serde(rename = "storage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub storage: Option>, +} + +impl RestoreInstance { + pub fn new(instance_name: String, restore: crate::models::Restore) -> RestoreInstance { + RestoreInstance { + app_services: None, + connection_pooler: None, + cpu: None, + environment: None, + extra_domains_rw: None, + instance_name, + memory: None, + restore: Box::new(restore), + storage: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/routing.rs b/tembo-cli/temboclient/src/models/routing.rs new file mode 100644 index 000000000..84d90dcd7 --- /dev/null +++ b/tembo-cli/temboclient/src/models/routing.rs @@ -0,0 +1,34 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Routing { + #[serde(rename = "ingressPath", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub ingress_path: Option>, + #[serde(rename = "middlewares", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub middlewares: Option>>, + #[serde(rename = "port")] + pub port: i32, +} + +impl Routing { + pub fn new(port: i32) -> Routing { + Routing { + ingress_path: None, + middlewares: None, + port, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/stack_type.rs b/tembo-cli/temboclient/src/models/stack_type.rs new file mode 100644 index 000000000..ed4f2303a --- /dev/null +++ b/tembo-cli/temboclient/src/models/stack_type.rs @@ -0,0 +1,40 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum StackType { + #[serde(rename = "Standard")] + Standard, + #[serde(rename = "MessageQueue")] + MessageQueue, + #[serde(rename = "MachineLearning")] + MachineLearning, + #[serde(rename = "OLAP")] + Olap, + #[serde(rename = "OLTP")] + Oltp, + #[serde(rename = "VectorDB")] + VectorDb, + #[serde(rename = "DataWarehouse")] + DataWarehouse, + +} + +impl Default for StackType { + fn default() -> StackType { + Self::Standard + } +} + + + + diff --git a/tembo-cli/temboclient/src/models/state.rs b/tembo-cli/temboclient/src/models/state.rs new file mode 100644 index 000000000..7d3b1945e --- /dev/null +++ b/tembo-cli/temboclient/src/models/state.rs @@ -0,0 +1,63 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum State { + #[serde(rename = "Submitted")] + Submitted, + #[serde(rename = "Up")] + Up, + #[serde(rename = "Configuring")] + Configuring, + #[serde(rename = "Error")] + Error, + #[serde(rename = "Restarting")] + Restarting, + #[serde(rename = "Starting")] + Starting, + #[serde(rename = "Stopping")] + Stopping, + #[serde(rename = "Stopped")] + Stopped, + #[serde(rename = "Deleting")] + Deleting, + #[serde(rename = "Deleted")] + Deleted, + +} + +impl ToString for State { + fn to_string(&self) -> String { + match self { + Self::Submitted => String::from("Submitted"), + Self::Up => String::from("Up"), + Self::Configuring => String::from("Configuring"), + Self::Error => String::from("Error"), + Self::Restarting => String::from("Restarting"), + Self::Starting => String::from("Starting"), + Self::Stopping => String::from("Stopping"), + Self::Stopped => String::from("Stopped"), + Self::Deleting => String::from("Deleting"), + Self::Deleted => String::from("Deleted"), + } + } +} + +impl Default for State { + fn default() -> State { + Self::Submitted + } +} + + + + diff --git a/tembo-cli/temboclient/src/models/storage.rs b/tembo-cli/temboclient/src/models/storage.rs new file mode 100644 index 000000000..85d723fcf --- /dev/null +++ b/tembo-cli/temboclient/src/models/storage.rs @@ -0,0 +1,54 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Storage { + #[serde(rename = "10Gi")] + Variant10Gi, + #[serde(rename = "50Gi")] + Variant50Gi, + #[serde(rename = "100Gi")] + Variant100Gi, + #[serde(rename = "200Gi")] + Variant200Gi, + #[serde(rename = "300Gi")] + Variant300Gi, + #[serde(rename = "400Gi")] + Variant400Gi, + #[serde(rename = "500Gi")] + Variant500Gi, + +} + +impl ToString for Storage { + fn to_string(&self) -> String { + match self { + Self::Variant10Gi => String::from("10Gi"), + Self::Variant50Gi => String::from("50Gi"), + Self::Variant100Gi => String::from("100Gi"), + Self::Variant200Gi => String::from("200Gi"), + Self::Variant300Gi => String::from("300Gi"), + Self::Variant400Gi => String::from("400Gi"), + Self::Variant500Gi => String::from("500Gi"), + } + } +} + +impl Default for Storage { + fn default() -> Storage { + Self::Variant10Gi + } +} + + + + diff --git a/tembo-cli/temboclient/src/models/storage_config.rs b/tembo-cli/temboclient/src/models/storage_config.rs new file mode 100644 index 000000000..29dd533a6 --- /dev/null +++ b/tembo-cli/temboclient/src/models/storage_config.rs @@ -0,0 +1,28 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StorageConfig { + #[serde(rename = "volumeMounts", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub volume_mounts: Option>>, +} + +impl StorageConfig { + pub fn new() -> StorageConfig { + StorageConfig { + volume_mounts: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/strip_prefix_config.rs b/tembo-cli/temboclient/src/models/strip_prefix_config.rs new file mode 100644 index 000000000..857dde478 --- /dev/null +++ b/tembo-cli/temboclient/src/models/strip_prefix_config.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StripPrefixConfig { + #[serde(rename = "config")] + pub config: Vec, + #[serde(rename = "name")] + pub name: String, +} + +impl StripPrefixConfig { + pub fn new(config: Vec, name: String) -> StripPrefixConfig { + StripPrefixConfig { + config, + name, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/trunk_install.rs b/tembo-cli/temboclient/src/models/trunk_install.rs new file mode 100644 index 000000000..a617a9bce --- /dev/null +++ b/tembo-cli/temboclient/src/models/trunk_install.rs @@ -0,0 +1,31 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrunkInstall { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub version: Option>, +} + +impl TrunkInstall { + pub fn new(name: String) -> TrunkInstall { + TrunkInstall { + name, + version: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/trunk_install_status.rs b/tembo-cli/temboclient/src/models/trunk_install_status.rs new file mode 100644 index 000000000..b789a423c --- /dev/null +++ b/tembo-cli/temboclient/src/models/trunk_install_status.rs @@ -0,0 +1,43 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct TrunkInstallStatus { + #[serde(rename = "error")] + pub error: bool, + #[serde(rename = "error_message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub error_message: Option>, + #[serde(rename = "installed_to_pods", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub installed_to_pods: Option>>, + #[serde(rename = "loading", skip_serializing_if = "Option::is_none")] + pub loading: Option, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "version", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub version: Option>, +} + +impl TrunkInstallStatus { + pub fn new(error: bool, name: String) -> TrunkInstallStatus { + TrunkInstallStatus { + error, + error_message: None, + installed_to_pods: None, + loading: None, + name, + version: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/update_instance.rs b/tembo-cli/temboclient/src/models/update_instance.rs new file mode 100644 index 000000000..6df7e3296 --- /dev/null +++ b/tembo-cli/temboclient/src/models/update_instance.rs @@ -0,0 +1,61 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct UpdateInstance { + #[serde(rename = "app_services", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub app_services: Option>>, + #[serde(rename = "connection_pooler", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub connection_pooler: Option>>, + #[serde(rename = "cpu")] + pub cpu: crate::models::Cpu, + #[serde(rename = "environment")] + pub environment: crate::models::Environment, + #[serde(rename = "extensions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub extensions: Option>>, + #[serde(rename = "extra_domains_rw", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub extra_domains_rw: Option>>, + #[serde(rename = "ip_allow_list", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub ip_allow_list: Option>>, + #[serde(rename = "memory")] + pub memory: crate::models::Memory, + #[serde(rename = "postgres_configs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub postgres_configs: Option>>, + #[serde(rename = "replicas")] + pub replicas: i32, + #[serde(rename = "storage")] + pub storage: crate::models::Storage, + #[serde(rename = "trunk_installs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub trunk_installs: Option>>, +} + +impl UpdateInstance { + pub fn new(cpu: crate::models::Cpu, environment: crate::models::Environment, memory: crate::models::Memory, replicas: i32, storage: crate::models::Storage) -> UpdateInstance { + UpdateInstance { + app_services: None, + connection_pooler: None, + cpu, + environment, + extensions: None, + extra_domains_rw: None, + ip_allow_list: None, + memory, + postgres_configs: None, + replicas, + storage, + trunk_installs: None, + } + } +} + + diff --git a/tembo-cli/temboclient/src/models/volume_mount.rs b/tembo-cli/temboclient/src/models/volume_mount.rs new file mode 100644 index 000000000..647a033a8 --- /dev/null +++ b/tembo-cli/temboclient/src/models/volume_mount.rs @@ -0,0 +1,43 @@ +/* + * Tembo Cloud + * + * Platform API for Tembo Cloud

To find a Tembo Data API, please find it here:

[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) + * + * The version of the OpenAPI document: v1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + + + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct VolumeMount { + #[serde(rename = "mount_path")] + pub mount_path: String, + #[serde(rename = "mount_propagation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub mount_propagation: Option>, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "read_only", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub read_only: Option>, + #[serde(rename = "sub_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sub_path: Option>, + #[serde(rename = "sub_path_expr", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")] + pub sub_path_expr: Option>, +} + +impl VolumeMount { + pub fn new(mount_path: String, name: String) -> VolumeMount { + VolumeMount { + mount_path, + mount_propagation: None, + name, + read_only: None, + sub_path: None, + sub_path_expr: None, + } + } +} + +