From 3ca00d8e69d5151a16c35bd8a5f612e7d27412ba Mon Sep 17 00:00:00 2001 From: Darren Baldwin <68653294+DarrenBaldwin07@users.noreply.github.com> Date: Mon, 3 Feb 2025 15:18:25 -0500 Subject: [PATCH] Tembo client regen (#1142) --- .github/workflows/cargo-test.yaml | 2 +- .../temboclient => cp-client}/.gitignore | 0 .../.openapi-generator-ignore | 0 .../.openapi-generator/FILES | 0 .../.openapi-generator/VERSION | 0 .../temboclient => cp-client}/.travis.yml | 0 .../temboclient => cp-client}/Cargo.toml | 4 +- cp-client/README.md | 115 ++++ .../temboclient => cp-client}/docs/AppApi.md | 0 .../docs/AppConfig.md | 0 .../docs/AppService.md | 0 .../temboclient => cp-client}/docs/AppType.md | 0 .../docs/AppTypeOneOf.md | 0 .../docs/AppTypeOneOf1.md | 0 .../docs/AppTypeOneOf2.md | 0 .../docs/AppTypeOneOf3.md | 0 .../docs/AppTypeOneOf4.md | 0 .../docs/AppTypeOneOf5.md | 0 .../docs/ConnectionInfo.md | 0 .../docs/ConnectionPooler.md | 0 .../temboclient => cp-client}/docs/Cpu.md | 0 .../docs/CreateInstance.md | 0 .../temboclient => cp-client}/docs/EnvVar.md | 0 .../docs/EnvVarRef.md | 0 .../docs/Environment.md | 0 .../docs/ErrorResponseSchema.md | 0 .../docs/Extension.md | 0 .../docs/ExtensionInstallLocation.md | 0 .../docs/ExtensionInstallLocationStatus.md | 0 .../docs/ExtensionStatus.md | 0 .../docs/HeaderConfig.md | 0 .../docs/Infrastructure.md | 0 .../temboclient => cp-client}/docs/Ingress.md | 0 .../docs/IngressType.md | 0 .../docs/Instance.md | 0 .../docs/InstanceApi.md | 0 .../docs/InstanceEvent.md | 0 .../docs/IntOrString.md | 0 .../docs/IntOrStringOneOf.md | 0 .../docs/IntOrStringOneOf1.md | 0 .../temboclient => cp-client}/docs/Memory.md | 0 .../docs/Middleware.md | 0 .../docs/MiddlewareOneOf.md | 0 .../docs/MiddlewareOneOf1.md | 0 .../docs/MiddlewareOneOf2.md | 0 .../docs/PatchInstance.md | 0 .../docs/PgBouncer.md | 0 .../docs/PgConfig.md | 0 .../docs/PoolerPgbouncerPoolMode.md | 0 .../PoolerTemplateSpecContainersResources.md | 0 ...erTemplateSpecContainersResourcesClaims.md | 0 .../temboclient => cp-client}/docs/Probe.md | 0 .../temboclient => cp-client}/docs/Probes.md | 0 .../docs/ReplacePathRegexConfig.md | 0 .../docs/ReplacePathRegexConfigType.md | 0 .../docs/Resource.md | 0 .../docs/ResourceRequirements.md | 0 .../temboclient => cp-client}/docs/Restore.md | 0 .../docs/RestoreInstance.md | 0 .../temboclient => cp-client}/docs/Routing.md | 0 .../docs/StackApi.md | 0 .../docs/StackType.md | 0 .../temboclient => cp-client}/docs/State.md | 0 .../temboclient => cp-client}/docs/Storage.md | 0 .../docs/StorageConfig.md | 0 .../docs/StripPrefixConfig.md | 0 .../docs/TrunkInstall.md | 0 .../docs/TrunkInstallStatus.md | 0 .../docs/UpdateInstance.md | 0 .../docs/VolumeMount.md | 0 .../temboclient => cp-client}/git_push.sh | 0 cp-client/src/apis/ai_api.rs | 113 ++++ cp-client/src/apis/app_api.rs | 101 +++ .../src/apis/configuration.rs | 1 - cp-client/src/apis/dataplane_api.rs | 63 ++ cp-client/src/apis/instance_api.rs | 581 ++++++++++++++++++ .../temboclient => cp-client}/src/apis/mod.rs | 4 + cp-client/src/apis/rbac_api.rs | 275 +++++++++ cp-client/src/apis/stack_api.rs | 102 +++ cp-client/src/apis/tokens_api.rs | 58 ++ .../temboclient => cp-client}/src/lib.rs | 0 cp-client/src/models/action.rs | 33 + .../src/models/app_config.rs | 9 +- cp-client/src/models/app_metrics.rs | 28 + .../src/models/app_service.rs | 26 +- .../src/models/app_type.rs | 0 .../src/models/app_type_one_of.rs | 9 +- .../src/models/app_type_one_of_1.rs | 9 +- .../src/models/app_type_one_of_2.rs | 9 +- .../src/models/app_type_one_of_3.rs | 9 +- .../src/models/app_type_one_of_4.rs | 9 +- cp-client/src/models/app_type_one_of_5.rs | 30 + .../src/models/app_type_one_of_6.rs | 15 +- cp-client/src/models/ask_params.rs | 25 + cp-client/src/models/ask_result.rs | 36 ++ cp-client/src/models/auto_stop.rs | 27 + cp-client/src/models/autoscaling.rs | 29 + cp-client/src/models/autoscaling_storage.rs | 37 ++ .../src/models/connection_info.rs | 5 +- .../src/models/connection_pooler.rs | 8 +- cp-client/src/models/cpu.rs | 80 +++ .../src/models/create_instance.rs | 74 ++- cp-client/src/models/data_plane.rs | 48 ++ cp-client/src/models/dedicated_networking.rs | 43 ++ .../src/models/env_var.rs | 7 +- .../src/models/env_var_ref.rs | 11 +- .../src/models/environment.rs | 26 +- .../src/models/error_response_schema.rs | 5 +- cp-client/src/models/experimental.rs | 29 + .../src/models/extension.rs | 10 +- .../src/models/extension_install_location.rs | 15 +- .../extension_install_location_status.rs | 5 +- .../src/models/extension_status.rs | 9 +- .../src/models/header_config.rs | 9 +- cp-client/src/models/history_entry.rs | 30 + cp-client/src/models/history_page.rs | 33 + .../src/models/infrastructure.rs | 5 +- .../src/models/ingress.rs | 5 +- .../src/models/ingress_type.rs | 11 +- .../src/models/instance.rs | 117 +++- .../src/models/instance_event.rs | 15 +- cp-client/src/models/instance_state.rs | 24 + .../src/models/int_or_string.rs | 18 +- .../src/models/int_or_string_one_of.rs | 5 +- .../src/models/int_or_string_one_of_1.rs | 5 +- cp-client/src/models/memory.rs | 80 +++ cp-client/src/models/middleware.rs | 28 + .../src/models/middleware_one_of.rs | 9 +- .../src/models/middleware_one_of_1.rs | 9 +- .../src/models/middleware_one_of_2.rs | 9 +- .../src/models/mod.rs | 45 +- cp-client/src/models/pagination_info.rs | 35 ++ cp-client/src/models/patch_autoscaling.rs | 39 ++ .../src/models/patch_instance.rs | 63 +- .../src/models/pg_bouncer.rs | 12 +- .../src/models/pg_config.rs | 5 +- cp-client/src/models/policy_data.rs | 24 + cp-client/src/models/policy_input.rs | 35 ++ .../src/models/pooler_pgbouncer_pool_mode.rs | 12 +- ...oler_template_spec_containers_resources.rs | 12 +- ...mplate_spec_containers_resources_claims.rs | 6 +- .../src/models/probe.rs | 5 +- .../src/models/probes.rs | 12 +- .../src/models/replace_path_regex_config.rs | 12 +- .../models/replace_path_regex_config_type.rs | 5 +- .../src/models/resource.rs | 5 +- .../src/models/resource_requirements.rs | 9 +- .../src/models/restore.rs | 5 +- .../src/models/restore_instance.rs | 29 +- cp-client/src/models/role.rs | 28 + .../src/models/routing.rs | 8 +- cp-client/src/models/search_params.rs | 33 + cp-client/src/models/search_response.rs | 38 ++ .../src/models/stack_type.rs | 20 + .../src/models/state.rs | 27 +- .../src/models/storage.rs | 32 + .../src/models/storage_config.rs | 7 +- .../src/models/strip_prefix_config.rs | 5 +- .../src/models/trunk_install.rs | 15 +- .../src/models/trunk_install_status.rs | 5 +- .../src/models/volume_mount.rs | 8 +- tembo-cli/Cargo.lock | 28 +- tembo-cli/Cargo.toml | 6 +- tembo-cli/README.md | 13 +- tembo-cli/examples/minimal/tembo.toml | 2 +- tembo-cli/openapitools.json | 7 + tembo-cli/src/cmd/apply.rs | 77 ++- tembo-cli/src/cmd/delete.rs | 2 +- tembo-cli/src/cmd/logs.rs | 2 +- tembo-cli/src/cmd/top.rs | 6 +- tembo-cli/src/cmd/validate.rs | 10 +- tembo-cli/temboclient/README.md | 122 ---- tembo-cli/temboclient/src/apis/app_api.rs | 111 ---- .../temboclient/src/apis/instance_api.rs | 530 ---------------- tembo-cli/temboclient/src/apis/stack_api.rs | 113 ---- tembo-cli/temboclient/src/models/cpu.rs | 57 -- tembo-cli/temboclient/src/models/memory.rs | 48 -- .../temboclient/src/models/middleware.rs | 36 -- .../temboclient/src/models/update_instance.rs | 97 --- tembo-cli/tests/integration_tests_cloud.rs | 7 +- 180 files changed, 3010 insertions(+), 1406 deletions(-) rename {tembo-cli/temboclient => cp-client}/.gitignore (100%) rename {tembo-cli/temboclient => cp-client}/.openapi-generator-ignore (100%) rename {tembo-cli/temboclient => cp-client}/.openapi-generator/FILES (100%) rename {tembo-cli/temboclient => cp-client}/.openapi-generator/VERSION (100%) rename {tembo-cli/temboclient => cp-client}/.travis.yml (100%) rename {tembo-cli/temboclient => cp-client}/Cargo.toml (58%) create mode 100644 cp-client/README.md rename {tembo-cli/temboclient => cp-client}/docs/AppApi.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/AppConfig.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/AppService.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/AppType.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/AppTypeOneOf.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/AppTypeOneOf1.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/AppTypeOneOf2.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/AppTypeOneOf3.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/AppTypeOneOf4.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/AppTypeOneOf5.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/ConnectionInfo.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/ConnectionPooler.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Cpu.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/CreateInstance.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/EnvVar.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/EnvVarRef.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Environment.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/ErrorResponseSchema.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Extension.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/ExtensionInstallLocation.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/ExtensionInstallLocationStatus.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/ExtensionStatus.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/HeaderConfig.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Infrastructure.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Ingress.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/IngressType.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Instance.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/InstanceApi.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/InstanceEvent.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/IntOrString.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/IntOrStringOneOf.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/IntOrStringOneOf1.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Memory.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Middleware.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/MiddlewareOneOf.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/MiddlewareOneOf1.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/MiddlewareOneOf2.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/PatchInstance.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/PgBouncer.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/PgConfig.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/PoolerPgbouncerPoolMode.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/PoolerTemplateSpecContainersResources.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/PoolerTemplateSpecContainersResourcesClaims.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Probe.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Probes.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/ReplacePathRegexConfig.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/ReplacePathRegexConfigType.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Resource.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/ResourceRequirements.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Restore.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/RestoreInstance.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Routing.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/StackApi.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/StackType.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/State.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/Storage.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/StorageConfig.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/StripPrefixConfig.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/TrunkInstall.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/TrunkInstallStatus.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/UpdateInstance.md (100%) rename {tembo-cli/temboclient => cp-client}/docs/VolumeMount.md (100%) rename {tembo-cli/temboclient => cp-client}/git_push.sh (100%) create mode 100644 cp-client/src/apis/ai_api.rs create mode 100644 cp-client/src/apis/app_api.rs rename {tembo-cli/temboclient => cp-client}/src/apis/configuration.rs (95%) create mode 100644 cp-client/src/apis/dataplane_api.rs create mode 100644 cp-client/src/apis/instance_api.rs rename {tembo-cli/temboclient => cp-client}/src/apis/mod.rs (97%) create mode 100644 cp-client/src/apis/rbac_api.rs create mode 100644 cp-client/src/apis/stack_api.rs create mode 100644 cp-client/src/apis/tokens_api.rs rename {tembo-cli/temboclient => cp-client}/src/lib.rs (100%) create mode 100644 cp-client/src/models/action.rs rename {tembo-cli/temboclient => cp-client}/src/models/app_config.rs (77%) create mode 100644 cp-client/src/models/app_metrics.rs rename {tembo-cli/temboclient => cp-client}/src/models/app_service.rs (89%) rename {tembo-cli/temboclient => cp-client}/src/models/app_type.rs (100%) rename {tembo-cli/temboclient => cp-client}/src/models/app_type_one_of.rs (73%) rename {tembo-cli/temboclient => cp-client}/src/models/app_type_one_of_1.rs (73%) rename {tembo-cli/temboclient => cp-client}/src/models/app_type_one_of_2.rs (73%) rename {tembo-cli/temboclient => cp-client}/src/models/app_type_one_of_3.rs (73%) rename {tembo-cli/temboclient => cp-client}/src/models/app_type_one_of_4.rs (73%) create mode 100644 cp-client/src/models/app_type_one_of_5.rs rename tembo-cli/temboclient/src/models/app_type_one_of_5.rs => cp-client/src/models/app_type_one_of_6.rs (60%) create mode 100644 cp-client/src/models/ask_params.rs create mode 100644 cp-client/src/models/ask_result.rs create mode 100644 cp-client/src/models/auto_stop.rs create mode 100644 cp-client/src/models/autoscaling.rs create mode 100644 cp-client/src/models/autoscaling_storage.rs rename {tembo-cli/temboclient => cp-client}/src/models/connection_info.rs (88%) rename {tembo-cli/temboclient => cp-client}/src/models/connection_pooler.rs (93%) create mode 100644 cp-client/src/models/cpu.rs rename {tembo-cli/temboclient => cp-client}/src/models/create_instance.rs (55%) create mode 100644 cp-client/src/models/data_plane.rs create mode 100644 cp-client/src/models/dedicated_networking.rs rename {tembo-cli/temboclient => cp-client}/src/models/env_var.rs (83%) rename {tembo-cli/temboclient => cp-client}/src/models/env_var_ref.rs (70%) rename {tembo-cli/temboclient => cp-client}/src/models/environment.rs (52%) rename {tembo-cli/temboclient => cp-client}/src/models/error_response_schema.rs (82%) create mode 100644 cp-client/src/models/experimental.rs rename {tembo-cli/temboclient => cp-client}/src/models/extension.rs (89%) rename {tembo-cli/temboclient => cp-client}/src/models/extension_install_location.rs (82%) rename {tembo-cli/temboclient => cp-client}/src/models/extension_install_location_status.rs (93%) rename {tembo-cli/temboclient => cp-client}/src/models/extension_status.rs (78%) rename {tembo-cli/temboclient => cp-client}/src/models/header_config.rs (65%) create mode 100644 cp-client/src/models/history_entry.rs create mode 100644 cp-client/src/models/history_page.rs rename {tembo-cli/temboclient => cp-client}/src/models/infrastructure.rs (87%) rename {tembo-cli/temboclient => cp-client}/src/models/ingress.rs (86%) rename {tembo-cli/temboclient => cp-client}/src/models/ingress_type.rs (73%) rename {tembo-cli/temboclient => cp-client}/src/models/instance.rs (56%) rename {tembo-cli/temboclient => cp-client}/src/models/instance_event.rs (63%) create mode 100644 cp-client/src/models/instance_state.rs rename {tembo-cli/temboclient => cp-client}/src/models/int_or_string.rs (57%) rename {tembo-cli/temboclient => cp-client}/src/models/int_or_string_one_of.rs (81%) rename {tembo-cli/temboclient => cp-client}/src/models/int_or_string_one_of_1.rs (82%) create mode 100644 cp-client/src/models/memory.rs create mode 100644 cp-client/src/models/middleware.rs rename {tembo-cli/temboclient => cp-client}/src/models/middleware_one_of.rs (68%) rename {tembo-cli/temboclient => cp-client}/src/models/middleware_one_of_1.rs (68%) rename {tembo-cli/temboclient => cp-client}/src/models/middleware_one_of_2.rs (67%) rename {tembo-cli/temboclient => cp-client}/src/models/mod.rs (75%) create mode 100644 cp-client/src/models/pagination_info.rs create mode 100644 cp-client/src/models/patch_autoscaling.rs rename {tembo-cli/temboclient => cp-client}/src/models/patch_instance.rs (60%) rename {tembo-cli/temboclient => cp-client}/src/models/pg_bouncer.rs (78%) rename {tembo-cli/temboclient => cp-client}/src/models/pg_config.rs (82%) create mode 100644 cp-client/src/models/policy_data.rs create mode 100644 cp-client/src/models/policy_input.rs rename {tembo-cli/temboclient => cp-client}/src/models/pooler_pgbouncer_pool_mode.rs (74%) rename {tembo-cli/temboclient => cp-client}/src/models/pooler_template_spec_containers_resources.rs (85%) rename {tembo-cli/temboclient => cp-client}/src/models/pooler_template_spec_containers_resources_claims.rs (89%) rename {tembo-cli/temboclient => cp-client}/src/models/probe.rs (85%) rename {tembo-cli/temboclient => cp-client}/src/models/probes.rs (80%) rename {tembo-cli/temboclient => cp-client}/src/models/replace_path_regex_config.rs (68%) rename {tembo-cli/temboclient => cp-client}/src/models/replace_path_regex_config_type.rs (85%) rename {tembo-cli/temboclient => cp-client}/src/models/resource.rs (82%) rename {tembo-cli/temboclient => cp-client}/src/models/resource_requirements.rs (79%) rename {tembo-cli/temboclient => cp-client}/src/models/restore.rs (87%) rename {tembo-cli/temboclient => cp-client}/src/models/restore_instance.rs (71%) create mode 100644 cp-client/src/models/role.rs rename {tembo-cli/temboclient => cp-client}/src/models/routing.rs (91%) create mode 100644 cp-client/src/models/search_params.rs create mode 100644 cp-client/src/models/search_response.rs rename {tembo-cli/temboclient => cp-client}/src/models/stack_type.rs (71%) rename {tembo-cli/temboclient => cp-client}/src/models/state.rs (61%) rename {tembo-cli/temboclient => cp-client}/src/models/storage.rs (57%) rename {tembo-cli/temboclient => cp-client}/src/models/storage_config.rs (78%) rename {tembo-cli/temboclient => cp-client}/src/models/strip_prefix_config.rs (84%) rename {tembo-cli/temboclient => cp-client}/src/models/trunk_install.rs (84%) rename {tembo-cli/temboclient => cp-client}/src/models/trunk_install_status.rs (92%) rename {tembo-cli/temboclient => cp-client}/src/models/volume_mount.rs (89%) create mode 100644 tembo-cli/openapitools.json delete mode 100644 tembo-cli/temboclient/README.md delete mode 100644 tembo-cli/temboclient/src/apis/app_api.rs delete mode 100644 tembo-cli/temboclient/src/apis/instance_api.rs delete mode 100644 tembo-cli/temboclient/src/apis/stack_api.rs delete mode 100644 tembo-cli/temboclient/src/models/cpu.rs delete mode 100644 tembo-cli/temboclient/src/models/memory.rs delete mode 100644 tembo-cli/temboclient/src/models/middleware.rs delete mode 100644 tembo-cli/temboclient/src/models/update_instance.rs diff --git a/.github/workflows/cargo-test.yaml b/.github/workflows/cargo-test.yaml index afe4088ac..4ccb4d5af 100644 --- a/.github/workflows/cargo-test.yaml +++ b/.github/workflows/cargo-test.yaml @@ -25,7 +25,7 @@ jobs: with: contains_the_file: Cargo.toml changed_relative_to_ref: origin/${{ github.base_ref || 'not-a-branch' }} - ignore_dirs: ".coredb examples tembo-cli/temboclient tembo-cli/tembodataclient inference-gateway" + ignore_dirs: ".coredb examples tembo-cli/tembo_api_client tembo-cli/tembodataclient inference-gateway" lint: name: Run linters diff --git a/tembo-cli/temboclient/.gitignore b/cp-client/.gitignore similarity index 100% rename from tembo-cli/temboclient/.gitignore rename to cp-client/.gitignore diff --git a/tembo-cli/temboclient/.openapi-generator-ignore b/cp-client/.openapi-generator-ignore similarity index 100% rename from tembo-cli/temboclient/.openapi-generator-ignore rename to cp-client/.openapi-generator-ignore diff --git a/tembo-cli/temboclient/.openapi-generator/FILES b/cp-client/.openapi-generator/FILES similarity index 100% rename from tembo-cli/temboclient/.openapi-generator/FILES rename to cp-client/.openapi-generator/FILES diff --git a/tembo-cli/temboclient/.openapi-generator/VERSION b/cp-client/.openapi-generator/VERSION similarity index 100% rename from tembo-cli/temboclient/.openapi-generator/VERSION rename to cp-client/.openapi-generator/VERSION diff --git a/tembo-cli/temboclient/.travis.yml b/cp-client/.travis.yml similarity index 100% rename from tembo-cli/temboclient/.travis.yml rename to cp-client/.travis.yml diff --git a/tembo-cli/temboclient/Cargo.toml b/cp-client/Cargo.toml similarity index 58% rename from tembo-cli/temboclient/Cargo.toml rename to cp-client/Cargo.toml index 3a41073ec..a1b3bd847 100644 --- a/tembo-cli/temboclient/Cargo.toml +++ b/cp-client/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "temboclient" +name = "tembo-api-client" version = "1.0.4" 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/) " +description = "Control Plane API client 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" diff --git a/cp-client/README.md b/cp-client/README.md new file mode 100644 index 000000000..98f2663c0 --- /dev/null +++ b/cp-client/README.md @@ -0,0 +1,115 @@ +# Rust API client for tembo_api_client + +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 `tembo_api_client` and add the following to `Cargo.toml` under `[dependencies]`: + +``` +tembo_api_client = { path = "./tembo_api_client" } +``` + +## 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) +- [AppTypeOneOf3](docs/AppTypeOneOf3.md) +- [AppTypeOneOf4](docs/AppTypeOneOf4.md) +- [AppTypeOneOf5](docs/AppTypeOneOf5.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) +- [IngressType](docs/IngressType.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/cp-client/docs/AppApi.md similarity index 100% rename from tembo-cli/temboclient/docs/AppApi.md rename to cp-client/docs/AppApi.md diff --git a/tembo-cli/temboclient/docs/AppConfig.md b/cp-client/docs/AppConfig.md similarity index 100% rename from tembo-cli/temboclient/docs/AppConfig.md rename to cp-client/docs/AppConfig.md diff --git a/tembo-cli/temboclient/docs/AppService.md b/cp-client/docs/AppService.md similarity index 100% rename from tembo-cli/temboclient/docs/AppService.md rename to cp-client/docs/AppService.md diff --git a/tembo-cli/temboclient/docs/AppType.md b/cp-client/docs/AppType.md similarity index 100% rename from tembo-cli/temboclient/docs/AppType.md rename to cp-client/docs/AppType.md diff --git a/tembo-cli/temboclient/docs/AppTypeOneOf.md b/cp-client/docs/AppTypeOneOf.md similarity index 100% rename from tembo-cli/temboclient/docs/AppTypeOneOf.md rename to cp-client/docs/AppTypeOneOf.md diff --git a/tembo-cli/temboclient/docs/AppTypeOneOf1.md b/cp-client/docs/AppTypeOneOf1.md similarity index 100% rename from tembo-cli/temboclient/docs/AppTypeOneOf1.md rename to cp-client/docs/AppTypeOneOf1.md diff --git a/tembo-cli/temboclient/docs/AppTypeOneOf2.md b/cp-client/docs/AppTypeOneOf2.md similarity index 100% rename from tembo-cli/temboclient/docs/AppTypeOneOf2.md rename to cp-client/docs/AppTypeOneOf2.md diff --git a/tembo-cli/temboclient/docs/AppTypeOneOf3.md b/cp-client/docs/AppTypeOneOf3.md similarity index 100% rename from tembo-cli/temboclient/docs/AppTypeOneOf3.md rename to cp-client/docs/AppTypeOneOf3.md diff --git a/tembo-cli/temboclient/docs/AppTypeOneOf4.md b/cp-client/docs/AppTypeOneOf4.md similarity index 100% rename from tembo-cli/temboclient/docs/AppTypeOneOf4.md rename to cp-client/docs/AppTypeOneOf4.md diff --git a/tembo-cli/temboclient/docs/AppTypeOneOf5.md b/cp-client/docs/AppTypeOneOf5.md similarity index 100% rename from tembo-cli/temboclient/docs/AppTypeOneOf5.md rename to cp-client/docs/AppTypeOneOf5.md diff --git a/tembo-cli/temboclient/docs/ConnectionInfo.md b/cp-client/docs/ConnectionInfo.md similarity index 100% rename from tembo-cli/temboclient/docs/ConnectionInfo.md rename to cp-client/docs/ConnectionInfo.md diff --git a/tembo-cli/temboclient/docs/ConnectionPooler.md b/cp-client/docs/ConnectionPooler.md similarity index 100% rename from tembo-cli/temboclient/docs/ConnectionPooler.md rename to cp-client/docs/ConnectionPooler.md diff --git a/tembo-cli/temboclient/docs/Cpu.md b/cp-client/docs/Cpu.md similarity index 100% rename from tembo-cli/temboclient/docs/Cpu.md rename to cp-client/docs/Cpu.md diff --git a/tembo-cli/temboclient/docs/CreateInstance.md b/cp-client/docs/CreateInstance.md similarity index 100% rename from tembo-cli/temboclient/docs/CreateInstance.md rename to cp-client/docs/CreateInstance.md diff --git a/tembo-cli/temboclient/docs/EnvVar.md b/cp-client/docs/EnvVar.md similarity index 100% rename from tembo-cli/temboclient/docs/EnvVar.md rename to cp-client/docs/EnvVar.md diff --git a/tembo-cli/temboclient/docs/EnvVarRef.md b/cp-client/docs/EnvVarRef.md similarity index 100% rename from tembo-cli/temboclient/docs/EnvVarRef.md rename to cp-client/docs/EnvVarRef.md diff --git a/tembo-cli/temboclient/docs/Environment.md b/cp-client/docs/Environment.md similarity index 100% rename from tembo-cli/temboclient/docs/Environment.md rename to cp-client/docs/Environment.md diff --git a/tembo-cli/temboclient/docs/ErrorResponseSchema.md b/cp-client/docs/ErrorResponseSchema.md similarity index 100% rename from tembo-cli/temboclient/docs/ErrorResponseSchema.md rename to cp-client/docs/ErrorResponseSchema.md diff --git a/tembo-cli/temboclient/docs/Extension.md b/cp-client/docs/Extension.md similarity index 100% rename from tembo-cli/temboclient/docs/Extension.md rename to cp-client/docs/Extension.md diff --git a/tembo-cli/temboclient/docs/ExtensionInstallLocation.md b/cp-client/docs/ExtensionInstallLocation.md similarity index 100% rename from tembo-cli/temboclient/docs/ExtensionInstallLocation.md rename to cp-client/docs/ExtensionInstallLocation.md diff --git a/tembo-cli/temboclient/docs/ExtensionInstallLocationStatus.md b/cp-client/docs/ExtensionInstallLocationStatus.md similarity index 100% rename from tembo-cli/temboclient/docs/ExtensionInstallLocationStatus.md rename to cp-client/docs/ExtensionInstallLocationStatus.md diff --git a/tembo-cli/temboclient/docs/ExtensionStatus.md b/cp-client/docs/ExtensionStatus.md similarity index 100% rename from tembo-cli/temboclient/docs/ExtensionStatus.md rename to cp-client/docs/ExtensionStatus.md diff --git a/tembo-cli/temboclient/docs/HeaderConfig.md b/cp-client/docs/HeaderConfig.md similarity index 100% rename from tembo-cli/temboclient/docs/HeaderConfig.md rename to cp-client/docs/HeaderConfig.md diff --git a/tembo-cli/temboclient/docs/Infrastructure.md b/cp-client/docs/Infrastructure.md similarity index 100% rename from tembo-cli/temboclient/docs/Infrastructure.md rename to cp-client/docs/Infrastructure.md diff --git a/tembo-cli/temboclient/docs/Ingress.md b/cp-client/docs/Ingress.md similarity index 100% rename from tembo-cli/temboclient/docs/Ingress.md rename to cp-client/docs/Ingress.md diff --git a/tembo-cli/temboclient/docs/IngressType.md b/cp-client/docs/IngressType.md similarity index 100% rename from tembo-cli/temboclient/docs/IngressType.md rename to cp-client/docs/IngressType.md diff --git a/tembo-cli/temboclient/docs/Instance.md b/cp-client/docs/Instance.md similarity index 100% rename from tembo-cli/temboclient/docs/Instance.md rename to cp-client/docs/Instance.md diff --git a/tembo-cli/temboclient/docs/InstanceApi.md b/cp-client/docs/InstanceApi.md similarity index 100% rename from tembo-cli/temboclient/docs/InstanceApi.md rename to cp-client/docs/InstanceApi.md diff --git a/tembo-cli/temboclient/docs/InstanceEvent.md b/cp-client/docs/InstanceEvent.md similarity index 100% rename from tembo-cli/temboclient/docs/InstanceEvent.md rename to cp-client/docs/InstanceEvent.md diff --git a/tembo-cli/temboclient/docs/IntOrString.md b/cp-client/docs/IntOrString.md similarity index 100% rename from tembo-cli/temboclient/docs/IntOrString.md rename to cp-client/docs/IntOrString.md diff --git a/tembo-cli/temboclient/docs/IntOrStringOneOf.md b/cp-client/docs/IntOrStringOneOf.md similarity index 100% rename from tembo-cli/temboclient/docs/IntOrStringOneOf.md rename to cp-client/docs/IntOrStringOneOf.md diff --git a/tembo-cli/temboclient/docs/IntOrStringOneOf1.md b/cp-client/docs/IntOrStringOneOf1.md similarity index 100% rename from tembo-cli/temboclient/docs/IntOrStringOneOf1.md rename to cp-client/docs/IntOrStringOneOf1.md diff --git a/tembo-cli/temboclient/docs/Memory.md b/cp-client/docs/Memory.md similarity index 100% rename from tembo-cli/temboclient/docs/Memory.md rename to cp-client/docs/Memory.md diff --git a/tembo-cli/temboclient/docs/Middleware.md b/cp-client/docs/Middleware.md similarity index 100% rename from tembo-cli/temboclient/docs/Middleware.md rename to cp-client/docs/Middleware.md diff --git a/tembo-cli/temboclient/docs/MiddlewareOneOf.md b/cp-client/docs/MiddlewareOneOf.md similarity index 100% rename from tembo-cli/temboclient/docs/MiddlewareOneOf.md rename to cp-client/docs/MiddlewareOneOf.md diff --git a/tembo-cli/temboclient/docs/MiddlewareOneOf1.md b/cp-client/docs/MiddlewareOneOf1.md similarity index 100% rename from tembo-cli/temboclient/docs/MiddlewareOneOf1.md rename to cp-client/docs/MiddlewareOneOf1.md diff --git a/tembo-cli/temboclient/docs/MiddlewareOneOf2.md b/cp-client/docs/MiddlewareOneOf2.md similarity index 100% rename from tembo-cli/temboclient/docs/MiddlewareOneOf2.md rename to cp-client/docs/MiddlewareOneOf2.md diff --git a/tembo-cli/temboclient/docs/PatchInstance.md b/cp-client/docs/PatchInstance.md similarity index 100% rename from tembo-cli/temboclient/docs/PatchInstance.md rename to cp-client/docs/PatchInstance.md diff --git a/tembo-cli/temboclient/docs/PgBouncer.md b/cp-client/docs/PgBouncer.md similarity index 100% rename from tembo-cli/temboclient/docs/PgBouncer.md rename to cp-client/docs/PgBouncer.md diff --git a/tembo-cli/temboclient/docs/PgConfig.md b/cp-client/docs/PgConfig.md similarity index 100% rename from tembo-cli/temboclient/docs/PgConfig.md rename to cp-client/docs/PgConfig.md diff --git a/tembo-cli/temboclient/docs/PoolerPgbouncerPoolMode.md b/cp-client/docs/PoolerPgbouncerPoolMode.md similarity index 100% rename from tembo-cli/temboclient/docs/PoolerPgbouncerPoolMode.md rename to cp-client/docs/PoolerPgbouncerPoolMode.md diff --git a/tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResources.md b/cp-client/docs/PoolerTemplateSpecContainersResources.md similarity index 100% rename from tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResources.md rename to cp-client/docs/PoolerTemplateSpecContainersResources.md diff --git a/tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResourcesClaims.md b/cp-client/docs/PoolerTemplateSpecContainersResourcesClaims.md similarity index 100% rename from tembo-cli/temboclient/docs/PoolerTemplateSpecContainersResourcesClaims.md rename to cp-client/docs/PoolerTemplateSpecContainersResourcesClaims.md diff --git a/tembo-cli/temboclient/docs/Probe.md b/cp-client/docs/Probe.md similarity index 100% rename from tembo-cli/temboclient/docs/Probe.md rename to cp-client/docs/Probe.md diff --git a/tembo-cli/temboclient/docs/Probes.md b/cp-client/docs/Probes.md similarity index 100% rename from tembo-cli/temboclient/docs/Probes.md rename to cp-client/docs/Probes.md diff --git a/tembo-cli/temboclient/docs/ReplacePathRegexConfig.md b/cp-client/docs/ReplacePathRegexConfig.md similarity index 100% rename from tembo-cli/temboclient/docs/ReplacePathRegexConfig.md rename to cp-client/docs/ReplacePathRegexConfig.md diff --git a/tembo-cli/temboclient/docs/ReplacePathRegexConfigType.md b/cp-client/docs/ReplacePathRegexConfigType.md similarity index 100% rename from tembo-cli/temboclient/docs/ReplacePathRegexConfigType.md rename to cp-client/docs/ReplacePathRegexConfigType.md diff --git a/tembo-cli/temboclient/docs/Resource.md b/cp-client/docs/Resource.md similarity index 100% rename from tembo-cli/temboclient/docs/Resource.md rename to cp-client/docs/Resource.md diff --git a/tembo-cli/temboclient/docs/ResourceRequirements.md b/cp-client/docs/ResourceRequirements.md similarity index 100% rename from tembo-cli/temboclient/docs/ResourceRequirements.md rename to cp-client/docs/ResourceRequirements.md diff --git a/tembo-cli/temboclient/docs/Restore.md b/cp-client/docs/Restore.md similarity index 100% rename from tembo-cli/temboclient/docs/Restore.md rename to cp-client/docs/Restore.md diff --git a/tembo-cli/temboclient/docs/RestoreInstance.md b/cp-client/docs/RestoreInstance.md similarity index 100% rename from tembo-cli/temboclient/docs/RestoreInstance.md rename to cp-client/docs/RestoreInstance.md diff --git a/tembo-cli/temboclient/docs/Routing.md b/cp-client/docs/Routing.md similarity index 100% rename from tembo-cli/temboclient/docs/Routing.md rename to cp-client/docs/Routing.md diff --git a/tembo-cli/temboclient/docs/StackApi.md b/cp-client/docs/StackApi.md similarity index 100% rename from tembo-cli/temboclient/docs/StackApi.md rename to cp-client/docs/StackApi.md diff --git a/tembo-cli/temboclient/docs/StackType.md b/cp-client/docs/StackType.md similarity index 100% rename from tembo-cli/temboclient/docs/StackType.md rename to cp-client/docs/StackType.md diff --git a/tembo-cli/temboclient/docs/State.md b/cp-client/docs/State.md similarity index 100% rename from tembo-cli/temboclient/docs/State.md rename to cp-client/docs/State.md diff --git a/tembo-cli/temboclient/docs/Storage.md b/cp-client/docs/Storage.md similarity index 100% rename from tembo-cli/temboclient/docs/Storage.md rename to cp-client/docs/Storage.md diff --git a/tembo-cli/temboclient/docs/StorageConfig.md b/cp-client/docs/StorageConfig.md similarity index 100% rename from tembo-cli/temboclient/docs/StorageConfig.md rename to cp-client/docs/StorageConfig.md diff --git a/tembo-cli/temboclient/docs/StripPrefixConfig.md b/cp-client/docs/StripPrefixConfig.md similarity index 100% rename from tembo-cli/temboclient/docs/StripPrefixConfig.md rename to cp-client/docs/StripPrefixConfig.md diff --git a/tembo-cli/temboclient/docs/TrunkInstall.md b/cp-client/docs/TrunkInstall.md similarity index 100% rename from tembo-cli/temboclient/docs/TrunkInstall.md rename to cp-client/docs/TrunkInstall.md diff --git a/tembo-cli/temboclient/docs/TrunkInstallStatus.md b/cp-client/docs/TrunkInstallStatus.md similarity index 100% rename from tembo-cli/temboclient/docs/TrunkInstallStatus.md rename to cp-client/docs/TrunkInstallStatus.md diff --git a/tembo-cli/temboclient/docs/UpdateInstance.md b/cp-client/docs/UpdateInstance.md similarity index 100% rename from tembo-cli/temboclient/docs/UpdateInstance.md rename to cp-client/docs/UpdateInstance.md diff --git a/tembo-cli/temboclient/docs/VolumeMount.md b/cp-client/docs/VolumeMount.md similarity index 100% rename from tembo-cli/temboclient/docs/VolumeMount.md rename to cp-client/docs/VolumeMount.md diff --git a/tembo-cli/temboclient/git_push.sh b/cp-client/git_push.sh similarity index 100% rename from tembo-cli/temboclient/git_push.sh rename to cp-client/git_push.sh diff --git a/cp-client/src/apis/ai_api.rs b/cp-client/src/apis/ai_api.rs new file mode 100644 index 000000000..86681447e --- /dev/null +++ b/cp-client/src/apis/ai_api.rs @@ -0,0 +1,113 @@ +/* + * 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 super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`ask`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AskError { + Status400(serde_json::Value), + Status401(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`search`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SearchError { + Status400(serde_json::Value), + Status401(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// Ask a question to Tembo Docs +pub async fn ask( + configuration: &configuration::Configuration, + query: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query = query; + + let uri_str = format!("{}/api/v1/ask/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("query", &p_query.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Search Tembo Docs Database +pub async fn search( + configuration: &configuration::Configuration, + query: &str, + limit: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_query = query; + let p_limit = limit; + + let uri_str = format!("{}/api/v1/search/", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("query", &p_query.to_string())]); + if let Some(ref param_value) = p_limit { + req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/cp-client/src/apis/app_api.rs b/cp-client/src/apis/app_api.rs new file mode 100644 index 000000000..fb3397186 --- /dev/null +++ b/cp-client/src/apis/app_api.rs @@ -0,0 +1,101 @@ +/* + * 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 super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`get_all_apps`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAllAppsError { + Status401(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(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// Attributes for all apps +pub async fn get_all_apps( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/api/v1/apps", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get the attributes of a single App +pub async fn get_app( + configuration: &configuration::Configuration, + r#type: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_type = r#type; + + let uri_str = format!("{}/api/v1/apps/{type}", configuration.base_path, type=crate::apis::urlencode(p_type)); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/tembo-cli/temboclient/src/apis/configuration.rs b/cp-client/src/apis/configuration.rs similarity index 95% rename from tembo-cli/temboclient/src/apis/configuration.rs rename to cp-client/src/apis/configuration.rs index b3fb73692..e4f04eed1 100644 --- a/tembo-cli/temboclient/src/apis/configuration.rs +++ b/cp-client/src/apis/configuration.rs @@ -17,7 +17,6 @@ pub struct Configuration { 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); diff --git a/cp-client/src/apis/dataplane_api.rs b/cp-client/src/apis/dataplane_api.rs new file mode 100644 index 000000000..a053ce517 --- /dev/null +++ b/cp-client/src/apis/dataplane_api.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 + */ + +use super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`get_all_dataplanes`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAllDataplanesError { + Status401(models::ErrorResponseSchema), + Status403(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +pub async fn get_all_dataplanes( + configuration: &configuration::Configuration, + org_id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/dataplanes", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/cp-client/src/apis/instance_api.rs b/cp-client/src/apis/instance_api.rs new file mode 100644 index 000000000..ab60af0dd --- /dev/null +++ b/cp-client/src/apis/instance_api.rs @@ -0,0 +1,581 @@ +/* + * 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 super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`create_instance`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateInstanceError { + Status400(models::ErrorResponseSchema), + Status401(String), + Status403(models::ErrorResponseSchema), + Status409(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(models::ErrorResponseSchema), + Status401(models::ErrorResponseSchema), + Status403(models::ErrorResponseSchema), + Status409(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(models::ErrorResponseSchema), + Status401(models::ErrorResponseSchema), + Status403(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(models::ErrorResponseSchema), + Status401(models::ErrorResponseSchema), + Status403(models::ErrorResponseSchema), + Status404(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_instance_history`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetInstanceHistoryError { + Status401(models::ErrorResponseSchema), + Status403(models::ErrorResponseSchema), + Status404(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_instance_toml`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetInstanceTomlError { + Status401(models::ErrorResponseSchema), + Status403(serde_json::Value), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_schema`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSchemaError { + Status401(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(models::ErrorResponseSchema), + Status403(models::ErrorResponseSchema), + Status409(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(models::ErrorResponseSchema), + Status401(String), + Status403(models::ErrorResponseSchema), + Status409(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(models::ErrorResponseSchema), + Status401(String), + Status403(models::ErrorResponseSchema), + Status409(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// Create a new Tembo instance +pub async fn create_instance( + configuration: &configuration::Configuration, + org_id: &str, + create_instance: models::CreateInstance, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + let p_create_instance = create_instance; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/instances", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_create_instance); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Delete an existing Tembo instance +pub async fn delete_instance( + configuration: &configuration::Configuration, + org_id: &str, + instance_id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + let p_instance_id = instance_id; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/instances/{instance_id}", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id), + instance_id = crate::apis::urlencode(p_instance_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all Tembo instances in an organization +pub async fn get_all( + configuration: &configuration::Configuration, + org_id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/instances", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get an existing Tembo instance +pub async fn get_instance( + configuration: &configuration::Configuration, + org_id: &str, + instance_id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + let p_instance_id = instance_id; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/instances/{instance_id}", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id), + instance_id = crate::apis::urlencode(p_instance_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get historical information for a given instance +pub async fn get_instance_history( + configuration: &configuration::Configuration, + org_id: &str, + instance_id: &str, + field: &str, + start: Option, + end: Option, + page: Option, + limit: Option, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + let p_instance_id = instance_id; + let p_field = field; + let p_start = start; + let p_end = end; + let p_page = page; + let p_limit = limit; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/instances/{instance_id}/history/{field}", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id), + instance_id = crate::apis::urlencode(p_instance_id), + field = crate::apis::urlencode(p_field) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_start { + req_builder = req_builder.query(&[("start", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_end { + req_builder = req_builder.query(&[("end", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_limit { + req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Generate text for Tembo.toml +pub async fn get_instance_toml( + configuration: &configuration::Configuration, + org_id: &str, + instance_id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + let p_instance_id = instance_id; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/instances/{instance_id}/toml", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id), + instance_id = crate::apis::urlencode(p_instance_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get the json-schema for an instance +pub async fn get_schema( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/api/v1/orgs/instances/schema", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Lifecycle events for a Tembo instance Currently only supports restart +pub async fn instance_event( + configuration: &configuration::Configuration, + org_id: &str, + event_type: models::InstanceEvent, + instance_id: &str, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + let p_event_type = event_type; + let p_instance_id = instance_id; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/instances/{instance_id}", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id), + instance_id = crate::apis::urlencode(p_instance_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + req_builder = req_builder.query(&[("event_type", &p_event_type.to_string())]); + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Update attributes on an existing Tembo instance +pub async fn patch_instance( + configuration: &configuration::Configuration, + org_id: &str, + instance_id: &str, + patch_instance: models::PatchInstance, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + let p_instance_id = instance_id; + let p_patch_instance = patch_instance; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/instances/{instance_id}", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id), + instance_id = crate::apis::urlencode(p_instance_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::PATCH, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_patch_instance); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Restore a Tembo instance +pub async fn restore_instance( + configuration: &configuration::Configuration, + org_id: &str, + restore_instance: models::RestoreInstance, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + let p_restore_instance = restore_instance; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/restore", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_restore_instance); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/tembo-cli/temboclient/src/apis/mod.rs b/cp-client/src/apis/mod.rs similarity index 97% rename from tembo-cli/temboclient/src/apis/mod.rs rename to cp-client/src/apis/mod.rs index 76b089b30..32916468a 100644 --- a/tembo-cli/temboclient/src/apis/mod.rs +++ b/cp-client/src/apis/mod.rs @@ -92,8 +92,12 @@ pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String unimplemented!("Only objects are supported with style=deepObject") } +pub mod ai_api; pub mod app_api; +pub mod dataplane_api; pub mod instance_api; +pub mod rbac_api; pub mod stack_api; +pub mod tokens_api; pub mod configuration; diff --git a/cp-client/src/apis/rbac_api.rs b/cp-client/src/apis/rbac_api.rs new file mode 100644 index 000000000..de7e160b2 --- /dev/null +++ b/cp-client/src/apis/rbac_api.rs @@ -0,0 +1,275 @@ +/* + * 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 super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`delete_policy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeletePolicyError { + Status401(models::ErrorResponseSchema), + Status403(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_actions`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetActionsError { + Status401(models::ErrorResponseSchema), + Status403(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_policies`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetPoliciesError { + Status401(models::ErrorResponseSchema), + Status403(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_roles`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetRolesError { + Status401(models::ErrorResponseSchema), + Status403(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`set_policy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum SetPolicyError { + Status400(models::ErrorResponseSchema), + Status401(models::ErrorResponseSchema), + Status403(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// Delete a policy +pub async fn delete_policy( + configuration: &configuration::Configuration, + org_id: &str, + policy_input: models::PolicyInput, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + let p_policy_input = policy_input; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/policies", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_policy_input); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all actions +pub async fn get_actions( + configuration: &configuration::Configuration, + org_id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/actions", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all policies +pub async fn get_policies( + configuration: &configuration::Configuration, + org_id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/policies", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get all roles +pub async fn get_roles( + configuration: &configuration::Configuration, + org_id: &str, +) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/roles", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id) + ); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Create or update a policy +pub async fn set_policy( + configuration: &configuration::Configuration, + org_id: &str, + policy_input: models::PolicyInput, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_org_id = org_id; + let p_policy_input = policy_input; + + let uri_str = format!( + "{}/api/v1/orgs/{org_id}/policies", + configuration.base_path, + org_id = crate::apis::urlencode(p_org_id) + ); + let mut req_builder = configuration + .client + .request(reqwest::Method::POST, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + req_builder = req_builder.json(&p_policy_input); + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/cp-client/src/apis/stack_api.rs b/cp-client/src/apis/stack_api.rs new file mode 100644 index 000000000..f5609ec64 --- /dev/null +++ b/cp-client/src/apis/stack_api.rs @@ -0,0 +1,102 @@ +/* + * 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 super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`get_all_entities`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetAllEntitiesError { + Status401(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(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// Attributes for all stacks +pub async fn get_all_entities( + configuration: &configuration::Configuration, +) -> Result, Error> { + let uri_str = format!("{}/api/v1/stacks", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} + +/// Get the attributes of a single stack +pub async fn get_entity( + configuration: &configuration::Configuration, + r#type: models::StackType, +) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_type = r#type; + + let uri_str = + format!("{}/api/v1/stacks/{type}", configuration.base_path, type=p_type.to_string()); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/cp-client/src/apis/tokens_api.rs b/cp-client/src/apis/tokens_api.rs new file mode 100644 index 000000000..29b5b0eb7 --- /dev/null +++ b/cp-client/src/apis/tokens_api.rs @@ -0,0 +1,58 @@ +/* + * 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 super::{configuration, Error}; +use crate::{apis::ResponseContent, models}; +use reqwest; +use serde::{Deserialize, Serialize}; + +/// struct for typed errors of method [`invalidate_token`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum InvalidateTokenError { + Status401(models::ErrorResponseSchema), + Status403(models::ErrorResponseSchema), + UnknownValue(serde_json::Value), +} + +/// Invalidate the token included in the Authorization header May take a up to a minute for subsequent requests to be rejected after the invalidation has been accepted. +pub async fn invalidate_token( + configuration: &configuration::Configuration, +) -> Result> { + let uri_str = format!("{}/api/v1/tokens/invalidate", configuration.base_path); + let mut req_builder = configuration + .client + .request(reqwest::Method::DELETE, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + serde_json::from_str(&content).map_err(Error::from) + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { + status, + content, + entity, + })) + } +} diff --git a/tembo-cli/temboclient/src/lib.rs b/cp-client/src/lib.rs similarity index 100% rename from tembo-cli/temboclient/src/lib.rs rename to cp-client/src/lib.rs diff --git a/cp-client/src/models/action.rs b/cp-client/src/models/action.rs new file mode 100644 index 000000000..95e0125ec --- /dev/null +++ b/cp-client/src/models/action.rs @@ -0,0 +1,33 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Action { + #[serde(rename = "description")] + pub description: String, + /// A valid Action ID. Available Action IDs include 'CreateInstance' and 'ManagePermissions'. Find all available Actions on the Actions API. + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, +} + +impl Action { + pub fn new(description: String, id: String, name: String) -> Action { + Action { + description, + id, + name, + } + } +} diff --git a/tembo-cli/temboclient/src/models/app_config.rs b/cp-client/src/models/app_config.rs similarity index 77% rename from tembo-cli/temboclient/src/models/app_config.rs rename to cp-client/src/models/app_config.rs index aab5c013c..cfa833b20 100644 --- a/tembo-cli/temboclient/src/models/app_config.rs +++ b/cp-client/src/models/app_config.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct AppConfig { #[serde( rename = "env", @@ -16,14 +19,14 @@ pub struct AppConfig { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub env: Option>>, + pub env: Option>>, #[serde( rename = "resources", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub resources: Option>>, + pub resources: Option>>, } impl AppConfig { diff --git a/cp-client/src/models/app_metrics.rs b/cp-client/src/models/app_metrics.rs new file mode 100644 index 000000000..5fa790f4e --- /dev/null +++ b/cp-client/src/models/app_metrics.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 + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppMetrics { + /// path to scrape metrics + #[serde(rename = "path")] + pub path: String, + /// port must be also exposed in one of AppService.routing[] + #[serde(rename = "port")] + pub port: i32, +} + +impl AppMetrics { + pub fn new(path: String, port: i32) -> AppMetrics { + AppMetrics { path, port } + } +} diff --git a/tembo-cli/temboclient/src/models/app_service.rs b/cp-client/src/models/app_service.rs similarity index 89% rename from tembo-cli/temboclient/src/models/app_service.rs rename to cp-client/src/models/app_service.rs index 58d883bec..83f4ca1b6 100644 --- a/tembo-cli/temboclient/src/models/app_service.rs +++ b/cp-client/src/models/app_service.rs @@ -8,9 +8,11 @@ * Generated by: https://openapi-generator.tech */ -/// AppService : AppService significantly extends the functionality of your Tembo Postgres instance by running tools and software built by the Postgres open source community. **Example**: This will configure and install a Postgrest container along side the Postgres instance, install pg_graphql extension, and configure the ingress routing to expose the Postgrest service. ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: trunk_installs: - name: pg_graphql version: 1.2.0 extensions: - name: pg_graphql locations: - database: postgres enabled: true appServices: - name: postgrest image: postgrest/postgrest:v10.0.0 routing: # only expose /rest/v1 and /graphql/v1 - port: 3000 ingressPath: /rest/v1 middlewares: - my-headers - port: 3000 ingressPath: /graphql/v1 middlewares: - map-gql - my-headers middlewares: - customRequestHeaders: name: my-headers config: # removes auth header from request Authorization: \"\" Content-Profile: graphql Accept-Profile: graphql - stripPrefix: name: my-strip-prefix config: - /rest/v1 # reroute gql and rest requests - replacePathRegex: name: map-gql config: regex: /graphql/v1/? replacement: /rpc/resolve env: - name: PGRST_DB_URI valueFromPlatform: ReadWriteConnection - name: PGRST_DB_SCHEMA value: \"public, graphql\" - name: PGRST_DB_ANON_ROLE value: postgres - name: PGRST_LOG_LEVEL value: info ``` +use crate::models; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +/// AppService : AppService significantly extends the functionality of your Tembo Postgres instance by running tools and software built by the Postgres open source community. **Example**: This will configure and install a Postgrest container along side the Postgres instance, install pg_graphql extension, and configure the ingress routing to expose the Postgrest service. ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: trunk_installs: - name: pg_graphql version: 1.2.0 extensions: - name: pg_graphql locations: - database: postgres enabled: true appServices: - name: postgrest image: postgrest/postgrest:v10.0.0 routing: # only expose /rest/v1 and /graphql/v1 - port: 3000 ingressPath: /rest/v1 middlewares: - my-headers - port: 3000 ingressPath: /graphql/v1 middlewares: - map-gql - my-headers middlewares: - customRequestHeaders: name: my-headers config: # removes auth header from request Authorization: \"\" Content-Profile: graphql Accept-Profile: graphql - stripPrefix: name: my-strip-prefix config: - /rest/v1 # reroute gql and rest requests - replacePathRegex: name: map-gql config: regex: /graphql/v1/? replacement: /rpc/resolve env: - name: PGRST_DB_URI valueFromPlatform: ReadWriteConnection - name: PGRST_DB_SCHEMA value: \"public, graphql\" - name: PGRST_DB_ANON_ROLE value: postgres - name: PGRST_LOG_LEVEL value: info ``` +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct AppService { /// Defines the arguments to pass into the container if needed. You define this in the same manner as you would for all Kubernetes containers. See the [Kubernetes docs](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container). #[serde( @@ -35,10 +37,17 @@ pub struct AppService { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub env: Option>>, + pub env: Option>>, /// Defines the container image to use for the appService. #[serde(rename = "image")] pub image: String, + #[serde( + rename = "metrics", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub metrics: Option>>, /// Defines the ingress middeware configuration for the appService. This is specifically configured for the ingress controller Traefik. #[serde( rename = "middlewares", @@ -46,7 +55,7 @@ pub struct AppService { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub middlewares: Option>>, + pub middlewares: Option>>, /// Defines the name of the appService. #[serde(rename = "name")] pub name: String, @@ -56,9 +65,9 @@ pub struct AppService { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub probes: Option>>, + pub probes: Option>>, #[serde(rename = "resources", skip_serializing_if = "Option::is_none")] - pub resources: Option>, + pub resources: Option>, /// Defines the routing configuration for the appService. #[serde( rename = "routing", @@ -66,14 +75,14 @@ pub struct AppService { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub routing: Option>>, + pub routing: Option>>, #[serde( rename = "storage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub storage: Option>>, + pub storage: Option>>, } impl AppService { @@ -84,6 +93,7 @@ impl AppService { command: None, env: None, image, + metrics: None, middlewares: None, name, probes: None, diff --git a/tembo-cli/temboclient/src/models/app_type.rs b/cp-client/src/models/app_type.rs similarity index 100% rename from tembo-cli/temboclient/src/models/app_type.rs rename to cp-client/src/models/app_type.rs diff --git a/tembo-cli/temboclient/src/models/app_type_one_of.rs b/cp-client/src/models/app_type_one_of.rs similarity index 73% rename from tembo-cli/temboclient/src/models/app_type_one_of.rs rename to cp-client/src/models/app_type_one_of.rs index d74874e33..c0ea131d6 100644 --- a/tembo-cli/temboclient/src/models/app_type_one_of.rs +++ b/cp-client/src/models/app_type_one_of.rs @@ -8,14 +8,17 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct AppTypeOneOf { #[serde(rename = "restapi", deserialize_with = "Option::deserialize")] - pub restapi: Option>, + pub restapi: Option>, } impl AppTypeOneOf { - pub fn new(restapi: Option) -> AppTypeOneOf { + pub fn new(restapi: Option) -> AppTypeOneOf { AppTypeOneOf { restapi: if let Some(x) = restapi { Some(Box::new(x)) diff --git a/tembo-cli/temboclient/src/models/app_type_one_of_1.rs b/cp-client/src/models/app_type_one_of_1.rs similarity index 73% rename from tembo-cli/temboclient/src/models/app_type_one_of_1.rs rename to cp-client/src/models/app_type_one_of_1.rs index 129ccbf82..70578addf 100644 --- a/tembo-cli/temboclient/src/models/app_type_one_of_1.rs +++ b/cp-client/src/models/app_type_one_of_1.rs @@ -8,14 +8,17 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct AppTypeOneOf1 { #[serde(rename = "http", deserialize_with = "Option::deserialize")] - pub http: Option>, + pub http: Option>, } impl AppTypeOneOf1 { - pub fn new(http: Option) -> AppTypeOneOf1 { + pub fn new(http: Option) -> AppTypeOneOf1 { AppTypeOneOf1 { http: if let Some(x) = http { Some(Box::new(x)) diff --git a/tembo-cli/temboclient/src/models/app_type_one_of_2.rs b/cp-client/src/models/app_type_one_of_2.rs similarity index 73% rename from tembo-cli/temboclient/src/models/app_type_one_of_2.rs rename to cp-client/src/models/app_type_one_of_2.rs index 59d9fb6b5..0a5bc7f0b 100644 --- a/tembo-cli/temboclient/src/models/app_type_one_of_2.rs +++ b/cp-client/src/models/app_type_one_of_2.rs @@ -8,14 +8,17 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct AppTypeOneOf2 { #[serde(rename = "mq-api", deserialize_with = "Option::deserialize")] - pub mq_api: Option>, + pub mq_api: Option>, } impl AppTypeOneOf2 { - pub fn new(mq_api: Option) -> AppTypeOneOf2 { + pub fn new(mq_api: Option) -> AppTypeOneOf2 { AppTypeOneOf2 { mq_api: if let Some(x) = mq_api { Some(Box::new(x)) diff --git a/tembo-cli/temboclient/src/models/app_type_one_of_3.rs b/cp-client/src/models/app_type_one_of_3.rs similarity index 73% rename from tembo-cli/temboclient/src/models/app_type_one_of_3.rs rename to cp-client/src/models/app_type_one_of_3.rs index 4334e0e85..ef7c69b3b 100644 --- a/tembo-cli/temboclient/src/models/app_type_one_of_3.rs +++ b/cp-client/src/models/app_type_one_of_3.rs @@ -8,14 +8,17 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct AppTypeOneOf3 { #[serde(rename = "embeddings", deserialize_with = "Option::deserialize")] - pub embeddings: Option>, + pub embeddings: Option>, } impl AppTypeOneOf3 { - pub fn new(embeddings: Option) -> AppTypeOneOf3 { + pub fn new(embeddings: Option) -> AppTypeOneOf3 { AppTypeOneOf3 { embeddings: if let Some(x) = embeddings { Some(Box::new(x)) diff --git a/tembo-cli/temboclient/src/models/app_type_one_of_4.rs b/cp-client/src/models/app_type_one_of_4.rs similarity index 73% rename from tembo-cli/temboclient/src/models/app_type_one_of_4.rs rename to cp-client/src/models/app_type_one_of_4.rs index 17d950697..063d1da1c 100644 --- a/tembo-cli/temboclient/src/models/app_type_one_of_4.rs +++ b/cp-client/src/models/app_type_one_of_4.rs @@ -8,14 +8,17 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct AppTypeOneOf4 { #[serde(rename = "pganalyze", deserialize_with = "Option::deserialize")] - pub pganalyze: Option>, + pub pganalyze: Option>, } impl AppTypeOneOf4 { - pub fn new(pganalyze: Option) -> AppTypeOneOf4 { + pub fn new(pganalyze: Option) -> AppTypeOneOf4 { AppTypeOneOf4 { pganalyze: if let Some(x) = pganalyze { Some(Box::new(x)) diff --git a/cp-client/src/models/app_type_one_of_5.rs b/cp-client/src/models/app_type_one_of_5.rs new file mode 100644 index 000000000..55cb8e3e1 --- /dev/null +++ b/cp-client/src/models/app_type_one_of_5.rs @@ -0,0 +1,30 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppTypeOneOf5 { + #[serde(rename = "sqlrunner", deserialize_with = "Option::deserialize")] + pub sqlrunner: Option>, +} + +impl AppTypeOneOf5 { + pub fn new(sqlrunner: Option) -> AppTypeOneOf5 { + AppTypeOneOf5 { + sqlrunner: if let Some(x) = sqlrunner { + Some(Box::new(x)) + } else { + None + }, + } + } +} diff --git a/tembo-cli/temboclient/src/models/app_type_one_of_5.rs b/cp-client/src/models/app_type_one_of_6.rs similarity index 60% rename from tembo-cli/temboclient/src/models/app_type_one_of_5.rs rename to cp-client/src/models/app_type_one_of_6.rs index 77bf8eea4..3ea561a79 100644 --- a/tembo-cli/temboclient/src/models/app_type_one_of_5.rs +++ b/cp-client/src/models/app_type_one_of_6.rs @@ -8,15 +8,18 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct AppTypeOneOf5 { +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AppTypeOneOf6 { #[serde(rename = "custom")] - pub custom: Box, + pub custom: Box, } -impl AppTypeOneOf5 { - pub fn new(custom: crate::models::AppService) -> AppTypeOneOf5 { - AppTypeOneOf5 { +impl AppTypeOneOf6 { + pub fn new(custom: models::AppService) -> AppTypeOneOf6 { + AppTypeOneOf6 { custom: Box::new(custom), } } diff --git a/cp-client/src/models/ask_params.rs b/cp-client/src/models/ask_params.rs new file mode 100644 index 000000000..074ddd13d --- /dev/null +++ b/cp-client/src/models/ask_params.rs @@ -0,0 +1,25 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AskParams { + /// The ask query. For example, \"how to create a Tembo instance\" + #[serde(rename = "query")] + pub query: String, +} + +impl AskParams { + pub fn new(query: String) -> AskParams { + AskParams { query } + } +} diff --git a/cp-client/src/models/ask_result.rs b/cp-client/src/models/ask_result.rs new file mode 100644 index 000000000..1272ddea5 --- /dev/null +++ b/cp-client/src/models/ask_result.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 + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AskResult { + /// The ask query. For example, \"how to create a Tembo instance\" + #[serde(rename = "chat_response")] + pub chat_response: String, + /// an array of json objects referencing documents used to generate the response + #[serde( + rename = "context", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub context: Option>>, +} + +impl AskResult { + pub fn new(chat_response: String) -> AskResult { + AskResult { + chat_response, + context: None, + } + } +} diff --git a/cp-client/src/models/auto_stop.rs b/cp-client/src/models/auto_stop.rs new file mode 100644 index 000000000..d98a10c65 --- /dev/null +++ b/cp-client/src/models/auto_stop.rs @@ -0,0 +1,27 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +/// AutoStop : AutoStop configures automatic stopping of idle instances. An instance is considered idle if it is more than two days old, hasn't been connected to in over a day, and has not been resumed within the last day. Idle instances are stopped in the time window 9-9:30 AM ET. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutoStop { + /// Enable automatic stopping of the instance when idle. + #[serde(rename = "enabled")] + pub enabled: bool, +} + +impl AutoStop { + /// AutoStop configures automatic stopping of idle instances. An instance is considered idle if it is more than two days old, hasn't been connected to in over a day, and has not been resumed within the last day. Idle instances are stopped in the time window 9-9:30 AM ET. + pub fn new(enabled: bool) -> AutoStop { + AutoStop { enabled } + } +} diff --git a/cp-client/src/models/autoscaling.rs b/cp-client/src/models/autoscaling.rs new file mode 100644 index 000000000..b0545e260 --- /dev/null +++ b/cp-client/src/models/autoscaling.rs @@ -0,0 +1,29 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Autoscaling { + #[serde(rename = "autostop", skip_serializing_if = "Option::is_none")] + pub autostop: Option>, + #[serde(rename = "storage", skip_serializing_if = "Option::is_none")] + pub storage: Option>, +} + +impl Autoscaling { + pub fn new() -> Autoscaling { + Autoscaling { + autostop: None, + storage: None, + } + } +} diff --git a/cp-client/src/models/autoscaling_storage.rs b/cp-client/src/models/autoscaling_storage.rs new file mode 100644 index 000000000..541df3eea --- /dev/null +++ b/cp-client/src/models/autoscaling_storage.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 + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// AutoscalingStorage : AutoscalingStorage configures the automatic scaling of instance storage. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AutoscalingStorage { + /// Enable autoscaling for storage + #[serde(rename = "enabled")] + pub enabled: bool, + #[serde( + rename = "maximum", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub maximum: Option>, +} + +impl AutoscalingStorage { + /// AutoscalingStorage configures the automatic scaling of instance storage. + pub fn new(enabled: bool) -> AutoscalingStorage { + AutoscalingStorage { + enabled, + maximum: None, + } + } +} diff --git a/tembo-cli/temboclient/src/models/connection_info.rs b/cp-client/src/models/connection_info.rs similarity index 88% rename from tembo-cli/temboclient/src/models/connection_info.rs rename to cp-client/src/models/connection_info.rs index 6ad5b8612..371846530 100644 --- a/tembo-cli/temboclient/src/models/connection_info.rs +++ b/cp-client/src/models/connection_info.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectionInfo { #[serde(rename = "host")] pub host: String, diff --git a/tembo-cli/temboclient/src/models/connection_pooler.rs b/cp-client/src/models/connection_pooler.rs similarity index 93% rename from tembo-cli/temboclient/src/models/connection_pooler.rs rename to cp-client/src/models/connection_pooler.rs index 4bab345c2..d43b007b1 100644 --- a/tembo-cli/temboclient/src/models/connection_pooler.rs +++ b/cp-client/src/models/connection_pooler.rs @@ -8,15 +8,17 @@ * Generated by: https://openapi-generator.tech */ -/// ConnectionPooler : A connection pooler is a tool used to manage database connections, sitting between your application and Postgres instance. Because of the way Postgres handles connections, the server may encounter resource constraint issues when managing a few thousand connections. Using a pooler can alleviate these issues by using actual Postgres connections only when necessary **Example**: A typical connection pooler configuration ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: connectionPooler: enabled: true pooler: poolMode: transaction # Valid parameter values can be found at https://www.pgbouncer.org/config.html parameters: default_pool_size: \"50\" max_client_conn: \"5000\" resources: limits: cpu: 200m memory: 256Mi requests: cpu: 100m memory: 128Mi ``` +use crate::models; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +/// ConnectionPooler : A connection pooler is a tool used to manage database connections, sitting between your application and Postgres instance. Because of the way Postgres handles connections, the server may encounter resource constraint issues when managing a few thousand connections. Using a pooler can alleviate these issues by using actual Postgres connections only when necessary **Example**: A typical connection pooler configuration ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: connectionPooler: enabled: true pooler: poolMode: transaction # Valid parameter values can be found at https://www.pgbouncer.org/config.html parameters: default_pool_size: \"50\" max_client_conn: \"5000\" resources: limits: cpu: 200m memory: 256Mi requests: cpu: 100m memory: 128Mi ``` +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ConnectionPooler { /// Enable the connection pooler **Default**: false. #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")] pub enabled: Option, #[serde(rename = "pooler", skip_serializing_if = "Option::is_none")] - pub pooler: Option>, + pub pooler: Option>, } impl ConnectionPooler { diff --git a/cp-client/src/models/cpu.rs b/cp-client/src/models/cpu.rs new file mode 100644 index 000000000..3657aae20 --- /dev/null +++ b/cp-client/src/models/cpu.rs @@ -0,0 +1,80 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Cpu { + #[serde(rename = "0.25")] + Variant0Period25, + #[serde(rename = "0.5")] + Variant0Period5, + #[serde(rename = "1")] + Variant1, + #[serde(rename = "2")] + Variant2, + #[serde(rename = "4")] + Variant4, + #[serde(rename = "6")] + Variant6, + #[serde(rename = "8")] + Variant8, + #[serde(rename = "12")] + Variant12, + #[serde(rename = "16")] + Variant16, + #[serde(rename = "32")] + Variant32, +} + +impl std::fmt::Display for Cpu { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Variant0Period25 => write!(f, "0.25"), + Self::Variant0Period5 => write!(f, "0.5"), + Self::Variant1 => write!(f, "1"), + Self::Variant2 => write!(f, "2"), + Self::Variant4 => write!(f, "4"), + Self::Variant6 => write!(f, "6"), + Self::Variant8 => write!(f, "8"), + Self::Variant12 => write!(f, "12"), + Self::Variant16 => write!(f, "16"), + Self::Variant32 => write!(f, "32"), + } + } +} + +impl Default for Cpu { + fn default() -> Cpu { + Self::Variant0Period25 + } +} + +impl std::str::FromStr for Cpu { + type Err = String; + + fn from_str(s: &str) -> Result { + match s { + "0.25" => Ok(Self::Variant0Period25), + "0.5" => Ok(Self::Variant0Period5), + "1" => Ok(Self::Variant1), + "2" => Ok(Self::Variant2), + "4" => Ok(Self::Variant4), + "6" => Ok(Self::Variant6), + "8" => Ok(Self::Variant8), + "12" => Ok(Self::Variant12), + "16" => Ok(Self::Variant16), + "32" => Ok(Self::Variant32), + _ => Err(format!("Invalid CPU value: {}", s)), + } + } +} diff --git a/tembo-cli/temboclient/src/models/create_instance.rs b/cp-client/src/models/create_instance.rs similarity index 55% rename from tembo-cli/temboclient/src/models/create_instance.rs rename to cp-client/src/models/create_instance.rs index ce880cd55..6263ebf3a 100644 --- a/tembo-cli/temboclient/src/models/create_instance.rs +++ b/cp-client/src/models/create_instance.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct CreateInstance { #[serde( rename = "app_services", @@ -16,24 +19,46 @@ pub struct CreateInstance { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub app_services: Option>>, + pub app_services: Option>>, + #[serde( + rename = "autoscaling", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub autoscaling: Option>>, #[serde( rename = "connection_pooler", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub connection_pooler: Option>>, + pub connection_pooler: Option>>, #[serde(rename = "cpu")] - pub cpu: crate::models::Cpu, + pub cpu: models::Cpu, + #[serde( + rename = "dedicated_networking", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub dedicated_networking: Option>>, #[serde(rename = "environment")] - pub environment: crate::models::Environment, + pub environment: models::Environment, + #[serde( + rename = "experimental", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub experimental: Option>>, #[serde( rename = "extensions", default, + with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub extensions: Option>>, + pub extensions: Option>>, #[serde( rename = "extra_domains_rw", default, @@ -51,7 +76,7 @@ pub struct CreateInstance { )] pub ip_allow_list: Option>>, #[serde(rename = "memory")] - pub memory: crate::models::Memory, + pub memory: models::Memory, #[serde(rename = "pg_version", skip_serializing_if = "Option::is_none")] pub pg_version: Option, #[serde( @@ -60,36 +85,50 @@ pub struct CreateInstance { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub postgres_configs: Option>>, + pub postgres_configs: Option>>, + #[serde(rename = "provider_id", skip_serializing_if = "Option::is_none")] + pub provider_id: Option, + #[serde(rename = "region_id", skip_serializing_if = "Option::is_none")] + pub region_id: Option, #[serde(rename = "replicas", skip_serializing_if = "Option::is_none")] pub replicas: Option, + #[serde( + rename = "spot", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub spot: Option>, #[serde(rename = "stack_type")] - pub stack_type: crate::models::StackType, + pub stack_type: models::StackType, #[serde(rename = "storage")] - pub storage: crate::models::Storage, + pub storage: models::Storage, #[serde( rename = "trunk_installs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub trunk_installs: Option>>, + pub trunk_installs: Option>>, } impl CreateInstance { pub fn new( - cpu: crate::models::Cpu, - environment: crate::models::Environment, + cpu: models::Cpu, + environment: models::Environment, instance_name: String, - memory: crate::models::Memory, - stack_type: crate::models::StackType, - storage: crate::models::Storage, + memory: models::Memory, + stack_type: models::StackType, + storage: models::Storage, ) -> CreateInstance { CreateInstance { app_services: None, + autoscaling: None, connection_pooler: None, cpu, + dedicated_networking: None, environment, + experimental: None, extensions: None, extra_domains_rw: None, instance_name, @@ -97,7 +136,10 @@ impl CreateInstance { memory, pg_version: None, postgres_configs: None, + provider_id: None, + region_id: None, replicas: None, + spot: None, stack_type, storage, trunk_installs: None, diff --git a/cp-client/src/models/data_plane.rs b/cp-client/src/models/data_plane.rs new file mode 100644 index 000000000..e2a44a74d --- /dev/null +++ b/cp-client/src/models/data_plane.rs @@ -0,0 +1,48 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DataPlane { + #[serde(rename = "index")] + pub index: String, + #[serde(rename = "provider_id")] + pub provider_id: String, + #[serde(rename = "provider_name")] + pub provider_name: String, + #[serde(rename = "region")] + pub region: String, + #[serde(rename = "region_id")] + pub region_id: String, + #[serde(rename = "region_name")] + pub region_name: String, +} + +impl DataPlane { + pub fn new( + index: String, + provider_id: String, + provider_name: String, + region: String, + region_id: String, + region_name: String, + ) -> DataPlane { + DataPlane { + index, + provider_id, + provider_name, + region, + region_id, + region_name, + } + } +} diff --git a/cp-client/src/models/dedicated_networking.rs b/cp-client/src/models/dedicated_networking.rs new file mode 100644 index 000000000..f62c44385 --- /dev/null +++ b/cp-client/src/models/dedicated_networking.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 + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// DedicatedNetworking : Configuration for dedicated networking. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct DedicatedNetworking { + /// Enables or disables dedicated networking. Default is false. + #[serde( + rename = "enabled", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub enabled: Option>, + /// If true, includes the standby instance in the dedicated networking setup. Default is false. + #[serde( + rename = "includeStandby", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub include_standby: Option>, +} + +impl DedicatedNetworking { + /// Configuration for dedicated networking. + pub fn new() -> DedicatedNetworking { + DedicatedNetworking { + enabled: None, + include_standby: None, + } + } +} diff --git a/tembo-cli/temboclient/src/models/env_var.rs b/cp-client/src/models/env_var.rs similarity index 83% rename from tembo-cli/temboclient/src/models/env_var.rs rename to cp-client/src/models/env_var.rs index abb6da99d..9a77eb735 100644 --- a/tembo-cli/temboclient/src/models/env_var.rs +++ b/cp-client/src/models/env_var.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct EnvVar { #[serde(rename = "name")] pub name: String, @@ -25,7 +28,7 @@ pub struct EnvVar { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub value_from_platform: Option>, + pub value_from_platform: Option>, } impl EnvVar { diff --git a/tembo-cli/temboclient/src/models/env_var_ref.rs b/cp-client/src/models/env_var_ref.rs similarity index 70% rename from tembo-cli/temboclient/src/models/env_var_ref.rs rename to cp-client/src/models/env_var_ref.rs index f694696bd..f14a0ddbd 100644 --- a/tembo-cli/temboclient/src/models/env_var_ref.rs +++ b/cp-client/src/models/env_var_ref.rs @@ -8,6 +8,9 @@ * Generated by: https://openapi-generator.tech */ +use crate::models; +use serde::{Deserialize, Serialize}; + /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum EnvVarRef { @@ -17,11 +20,11 @@ pub enum EnvVarRef { ReadWriteConnection, } -impl ToString for EnvVarRef { - fn to_string(&self) -> String { +impl std::fmt::Display for EnvVarRef { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::ReadOnlyConnection => String::from("ReadOnlyConnection"), - Self::ReadWriteConnection => String::from("ReadWriteConnection"), + Self::ReadOnlyConnection => write!(f, "ReadOnlyConnection"), + Self::ReadWriteConnection => write!(f, "ReadWriteConnection"), } } } diff --git a/tembo-cli/temboclient/src/models/environment.rs b/cp-client/src/models/environment.rs similarity index 52% rename from tembo-cli/temboclient/src/models/environment.rs rename to cp-client/src/models/environment.rs index 751922d3b..f8e040a0a 100644 --- a/tembo-cli/temboclient/src/models/environment.rs +++ b/cp-client/src/models/environment.rs @@ -8,6 +8,9 @@ * Generated by: https://openapi-generator.tech */ +use crate::models; +use serde::{Deserialize, Serialize}; + /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Environment { @@ -19,12 +22,12 @@ pub enum Environment { Prod, } -impl ToString for Environment { - fn to_string(&self) -> String { +impl std::fmt::Display for Environment { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::Dev => String::from("dev"), - Self::Test => String::from("test"), - Self::Prod => String::from("prod"), + Self::Dev => write!(f, "dev"), + Self::Test => write!(f, "test"), + Self::Prod => write!(f, "prod"), } } } @@ -34,3 +37,16 @@ impl Default for Environment { Self::Dev } } + +impl std::str::FromStr for Environment { + type Err = String; + + fn from_str(s: &str) -> Result { + match s.to_lowercase().as_str() { + "dev" => Ok(Self::Dev), + "test" => Ok(Self::Test), + "prod" => Ok(Self::Prod), + _ => Err(format!("Invalid environment: {}", s)), + } + } +} diff --git a/tembo-cli/temboclient/src/models/error_response_schema.rs b/cp-client/src/models/error_response_schema.rs similarity index 82% rename from tembo-cli/temboclient/src/models/error_response_schema.rs rename to cp-client/src/models/error_response_schema.rs index 3d25c962c..03663d43e 100644 --- a/tembo-cli/temboclient/src/models/error_response_schema.rs +++ b/cp-client/src/models/error_response_schema.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ErrorResponseSchema { #[serde(rename = "error")] pub error: String, diff --git a/cp-client/src/models/experimental.rs b/cp-client/src/models/experimental.rs new file mode 100644 index 000000000..5488dd4cd --- /dev/null +++ b/cp-client/src/models/experimental.rs @@ -0,0 +1,29 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Experimental { + #[serde( + rename = "image", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub image: Option>, +} + +impl Experimental { + pub fn new() -> Experimental { + Experimental { image: None } + } +} diff --git a/tembo-cli/temboclient/src/models/extension.rs b/cp-client/src/models/extension.rs similarity index 89% rename from tembo-cli/temboclient/src/models/extension.rs rename to cp-client/src/models/extension.rs index 910dd350b..3354697a2 100644 --- a/tembo-cli/temboclient/src/models/extension.rs +++ b/cp-client/src/models/extension.rs @@ -8,9 +8,11 @@ * Generated by: https://openapi-generator.tech */ -/// Extension : Extension lets you define a list of extensions to enable on the instance. To enable extensions, you must specify the name of the extension and the database, schema, and version to enable it on. If the version is not specified, the latest version will be used. The extension must also be installed on the instance. To install extensions, please refer to the `TrunkInstall` resource. This example will enable the pg_stat_statements extension on the Postgres database in the public schema. ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: extensions: - name: pg_stat_statements locations: - database: postgres enabled: true schema: public version: 1.10.0 ```` +use crate::models; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +/// Extension : Extension lets you define a list of extensions to enable on the instance. To enable extensions, you must specify the name of the extension and the database, schema, and version to enable it on. If the version is not specified, the latest version will be used. The extension must also be installed on the instance. To install extensions, please refer to the `TrunkInstall` resource. This example will enable the pg_stat_statements extension on the Postgres database in the public schema. ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: extensions: - name: pg_stat_statements locations: - database: postgres enabled: true schema: public version: 1.10.0 ```` +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Extension { /// A description of the extension. (Optional) **Default**: \"No description provided\" #[serde( @@ -22,7 +24,7 @@ pub struct Extension { pub description: Option>, /// A list of locations (databases) to enabled the extension on. #[serde(rename = "locations")] - pub locations: Vec, + pub locations: Vec, /// The name of the extension to enable. #[serde(rename = "name")] pub name: String, @@ -30,7 +32,7 @@ pub struct Extension { impl Extension { /// Extension lets you define a list of extensions to enable on the instance. To enable extensions, you must specify the name of the extension and the database, schema, and version to enable it on. If the version is not specified, the latest version will be used. The extension must also be installed on the instance. To install extensions, please refer to the `TrunkInstall` resource. This example will enable the pg_stat_statements extension on the Postgres database in the public schema. ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: extensions: - name: pg_stat_statements locations: - database: postgres enabled: true schema: public version: 1.10.0 ```` - pub fn new(locations: Vec, name: String) -> Extension { + pub fn new(locations: Vec, name: String) -> Extension { Extension { description: None, locations, diff --git a/tembo-cli/temboclient/src/models/extension_install_location.rs b/cp-client/src/models/extension_install_location.rs similarity index 82% rename from tembo-cli/temboclient/src/models/extension_install_location.rs rename to cp-client/src/models/extension_install_location.rs index 4ff25d82a..d99d9600a 100644 --- a/tembo-cli/temboclient/src/models/extension_install_location.rs +++ b/cp-client/src/models/extension_install_location.rs @@ -8,9 +8,11 @@ * Generated by: https://openapi-generator.tech */ -/// ExtensionInstallLocation : ExtensionInstallLocation lets you specify the database, schema, and version to enable an extension on. +use crate::models; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +/// ExtensionInstallLocation : ExtensionInstallLocation lets you specify the database, schema, and version to enable an extension on. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ExtensionInstallLocation { /// The database to enable the extension on. **Default**: \"postgres\" #[serde(rename = "database", skip_serializing_if = "Option::is_none")] @@ -27,8 +29,13 @@ pub struct ExtensionInstallLocation { )] pub schema: Option>, /// The extension version to install. If not specified, the latest version will be used. - #[serde(rename = "version", default, skip_serializing_if = "Option::is_none")] - pub version: Option, + #[serde( + rename = "version", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub version: Option>, } impl ExtensionInstallLocation { diff --git a/tembo-cli/temboclient/src/models/extension_install_location_status.rs b/cp-client/src/models/extension_install_location_status.rs similarity index 93% rename from tembo-cli/temboclient/src/models/extension_install_location_status.rs rename to cp-client/src/models/extension_install_location_status.rs index 9f063f107..5eb3f8fd9 100644 --- a/tembo-cli/temboclient/src/models/extension_install_location_status.rs +++ b/cp-client/src/models/extension_install_location_status.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ExtensionInstallLocationStatus { #[serde(rename = "database", skip_serializing_if = "Option::is_none")] pub database: Option, diff --git a/tembo-cli/temboclient/src/models/extension_status.rs b/cp-client/src/models/extension_status.rs similarity index 78% rename from tembo-cli/temboclient/src/models/extension_status.rs rename to cp-client/src/models/extension_status.rs index f373aad06..13449c334 100644 --- a/tembo-cli/temboclient/src/models/extension_status.rs +++ b/cp-client/src/models/extension_status.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ExtensionStatus { #[serde( rename = "description", @@ -18,14 +21,14 @@ pub struct ExtensionStatus { )] pub description: Option>, #[serde(rename = "locations")] - pub locations: Vec, + pub locations: Vec, #[serde(rename = "name")] pub name: String, } impl ExtensionStatus { pub fn new( - locations: Vec, + locations: Vec, name: String, ) -> ExtensionStatus { ExtensionStatus { diff --git a/tembo-cli/temboclient/src/models/header_config.rs b/cp-client/src/models/header_config.rs similarity index 65% rename from tembo-cli/temboclient/src/models/header_config.rs rename to cp-client/src/models/header_config.rs index f291e1b4a..84a737dd8 100644 --- a/tembo-cli/temboclient/src/models/header_config.rs +++ b/cp-client/src/models/header_config.rs @@ -8,16 +8,19 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct HeaderConfig { #[serde(rename = "config")] - pub config: ::std::collections::HashMap, + pub config: std::collections::HashMap, #[serde(rename = "name")] pub name: String, } impl HeaderConfig { - pub fn new(config: ::std::collections::HashMap, name: String) -> HeaderConfig { + pub fn new(config: std::collections::HashMap, name: String) -> HeaderConfig { HeaderConfig { config, name } } } diff --git a/cp-client/src/models/history_entry.rs b/cp-client/src/models/history_entry.rs new file mode 100644 index 000000000..d9873e52f --- /dev/null +++ b/cp-client/src/models/history_entry.rs @@ -0,0 +1,30 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HistoryEntry { + #[serde(rename = "instance")] + pub instance: Box, + /// The timestamp of the entry + #[serde(rename = "timestamp")] + pub timestamp: String, +} + +impl HistoryEntry { + pub fn new(instance: models::InstanceState, timestamp: String) -> HistoryEntry { + HistoryEntry { + instance: Box::new(instance), + timestamp, + } + } +} diff --git a/cp-client/src/models/history_page.rs b/cp-client/src/models/history_page.rs new file mode 100644 index 000000000..06db8ee7a --- /dev/null +++ b/cp-client/src/models/history_page.rs @@ -0,0 +1,33 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct HistoryPage { + /// List of historical results + #[serde(rename = "history")] + pub history: Vec, + #[serde(rename = "pagination")] + pub pagination: Box, +} + +impl HistoryPage { + pub fn new( + history: Vec, + pagination: models::PaginationInfo, + ) -> HistoryPage { + HistoryPage { + history, + pagination: Box::new(pagination), + } + } +} diff --git a/tembo-cli/temboclient/src/models/infrastructure.rs b/cp-client/src/models/infrastructure.rs similarity index 87% rename from tembo-cli/temboclient/src/models/infrastructure.rs rename to cp-client/src/models/infrastructure.rs index 628f245bd..95f8ecfd2 100644 --- a/tembo-cli/temboclient/src/models/infrastructure.rs +++ b/cp-client/src/models/infrastructure.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Infrastructure { #[serde(rename = "cpu", skip_serializing_if = "Option::is_none")] pub cpu: Option, diff --git a/tembo-cli/temboclient/src/models/ingress.rs b/cp-client/src/models/ingress.rs similarity index 86% rename from tembo-cli/temboclient/src/models/ingress.rs rename to cp-client/src/models/ingress.rs index 14ec0100d..6b52c0e44 100644 --- a/tembo-cli/temboclient/src/models/ingress.rs +++ b/cp-client/src/models/ingress.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Ingress { #[serde(rename = "enabled")] pub enabled: bool, diff --git a/tembo-cli/temboclient/src/models/ingress_type.rs b/cp-client/src/models/ingress_type.rs similarity index 73% rename from tembo-cli/temboclient/src/models/ingress_type.rs rename to cp-client/src/models/ingress_type.rs index 9d950104e..7ce29cc4c 100644 --- a/tembo-cli/temboclient/src/models/ingress_type.rs +++ b/cp-client/src/models/ingress_type.rs @@ -8,6 +8,9 @@ * Generated by: https://openapi-generator.tech */ +use crate::models; +use serde::{Deserialize, Serialize}; + /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum IngressType { @@ -17,11 +20,11 @@ pub enum IngressType { Tcp, } -impl ToString for IngressType { - fn to_string(&self) -> String { +impl std::fmt::Display for IngressType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::Http => String::from("http"), - Self::Tcp => String::from("tcp"), + Self::Http => write!(f, "http"), + Self::Tcp => write!(f, "tcp"), } } } diff --git a/tembo-cli/temboclient/src/models/instance.rs b/cp-client/src/models/instance.rs similarity index 56% rename from tembo-cli/temboclient/src/models/instance.rs rename to cp-client/src/models/instance.rs index 3a25da93b..5288a9b21 100644 --- a/tembo-cli/temboclient/src/models/instance.rs +++ b/cp-client/src/models/instance.rs @@ -8,37 +8,56 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, 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 = "app_services", + // default, + // with = "::serde_with::rust::double_option", + // skip_serializing_if = "Option::is_none" + // )] + // pub app_services: Option>>, + #[serde(rename = "autoscaling")] + pub autoscaling: Box, #[serde( rename = "connection_info", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub connection_info: Option>>, + 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>>, + pub connection_pooler: Option>>, #[serde(rename = "cpu")] - pub cpu: crate::models::Cpu, + pub cpu: models::Cpu, #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")] pub created_at: Option, + #[serde(rename = "dataplane_index")] + pub dataplane_index: String, + #[serde( + rename = "dedicated_networking", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub dedicated_networking: Option>>, #[serde(rename = "environment")] - pub environment: crate::models::Environment, + pub environment: models::Environment, #[serde( rename = "extensions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub extensions: Option>>, + pub extensions: Option>>, #[serde( rename = "extra_domains_rw", default, @@ -53,6 +72,13 @@ pub struct Instance { skip_serializing_if = "Option::is_none" )] pub first_recoverability_time: Option>, + #[serde( + rename = "image", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub image: Option>, #[serde(rename = "instance_id")] pub instance_id: String, #[serde(rename = "instance_name")] @@ -66,22 +92,37 @@ pub struct Instance { pub ip_allow_list: Option>>, #[serde(rename = "last_updated_at", skip_serializing_if = "Option::is_none")] pub last_updated_at: Option, + #[serde( + rename = "last_wal_archive_status", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub last_wal_archive_status: Option>, #[serde(rename = "memory")] - pub memory: crate::models::Memory, - #[serde(rename = "organization_id")] - pub organization_id: String, + pub memory: models::Memory, #[serde(rename = "namespace")] pub namespace: String, + #[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>>, - /// Major Postgres version this instance is using. Currently: 14, 15 or 16 + pub postgres_configs: Option>>, + /// Major Postgres version this instance is using. Currently: 14, 15, 16 and 17 #[serde(rename = "postgres_version")] pub postgres_version: i32, + #[serde(rename = "provider_id")] + pub provider_id: String, + #[serde(rename = "region_id")] + pub region_id: String, + #[serde(rename = "region_name")] + pub region_name: String, #[serde(rename = "replicas")] pub replicas: i32, #[serde( @@ -90,58 +131,80 @@ pub struct Instance { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub runtime_config: Option>>, + pub runtime_config: Option>>, + #[serde( + rename = "spot", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub spot: Option>, #[serde(rename = "stack_type")] - pub stack_type: crate::models::StackType, + pub stack_type: models::StackType, #[serde(rename = "state")] - pub state: crate::models::State, + pub state: models::State, #[serde(rename = "storage")] - pub storage: crate::models::Storage, + pub storage: models::Storage, #[serde( rename = "trunk_installs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub trunk_installs: Option>>, + pub trunk_installs: Option>>, } impl Instance { pub fn new( - cpu: crate::models::Cpu, - environment: crate::models::Environment, + autoscaling: models::Autoscaling, + cpu: models::Cpu, + dataplane_index: String, + environment: models::Environment, instance_id: String, instance_name: String, - memory: crate::models::Memory, - organization_id: String, + memory: models::Memory, namespace: String, + organization_id: String, + organization_name: String, postgres_version: i32, + provider_id: String, + region_id: String, + region_name: String, replicas: i32, - stack_type: crate::models::StackType, - state: crate::models::State, - storage: crate::models::Storage, + stack_type: models::StackType, + state: models::State, + storage: models::Storage, ) -> Instance { Instance { - //app_services: None, + autoscaling: Box::new(autoscaling), connection_info: None, connection_pooler: None, cpu, created_at: None, + dataplane_index, + dedicated_networking: None, environment, extensions: None, extra_domains_rw: None, first_recoverability_time: None, + image: None, instance_id, instance_name, ip_allow_list: None, last_updated_at: None, + last_wal_archive_status: None, memory, - organization_id, namespace, + organization_id, + organization_name, postgres_configs: None, postgres_version, + provider_id, + region_id, + region_name, replicas, runtime_config: None, + spot: None, stack_type, state, storage, diff --git a/tembo-cli/temboclient/src/models/instance_event.rs b/cp-client/src/models/instance_event.rs similarity index 63% rename from tembo-cli/temboclient/src/models/instance_event.rs rename to cp-client/src/models/instance_event.rs index 74393c566..efc223500 100644 --- a/tembo-cli/temboclient/src/models/instance_event.rs +++ b/cp-client/src/models/instance_event.rs @@ -8,17 +8,26 @@ * Generated by: https://openapi-generator.tech */ +use crate::models; +use serde::{Deserialize, Serialize}; + /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum InstanceEvent { #[serde(rename = "restart")] Restart, + #[serde(rename = "stop")] + Stop, + #[serde(rename = "start")] + Start, } -impl ToString for InstanceEvent { - fn to_string(&self) -> String { +impl std::fmt::Display for InstanceEvent { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::Restart => String::from("restart"), + Self::Restart => write!(f, "restart"), + Self::Stop => write!(f, "stop"), + Self::Start => write!(f, "start"), } } } diff --git a/cp-client/src/models/instance_state.rs b/cp-client/src/models/instance_state.rs new file mode 100644 index 000000000..3419d8671 --- /dev/null +++ b/cp-client/src/models/instance_state.rs @@ -0,0 +1,24 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct InstanceState { + #[serde(rename = "state")] + pub state: models::State, +} + +impl InstanceState { + pub fn new(state: models::State) -> InstanceState { + InstanceState { state } + } +} diff --git a/tembo-cli/temboclient/src/models/int_or_string.rs b/cp-client/src/models/int_or_string.rs similarity index 57% rename from tembo-cli/temboclient/src/models/int_or_string.rs rename to cp-client/src/models/int_or_string.rs index d88b0194c..3a0b8d4af 100644 --- a/tembo-cli/temboclient/src/models/int_or_string.rs +++ b/cp-client/src/models/int_or_string.rs @@ -8,16 +8,18 @@ * Generated by: https://openapi-generator.tech */ +use crate::models; +use serde::{Deserialize, Serialize}; + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -pub struct IntOrString { - #[serde(rename = "Int")] - pub int: i32, - #[serde(rename = "String")] - pub string: String, +#[serde(untagged)] +pub enum IntOrString { + IntOrStringOneOf(Box), + IntOrStringOneOf1(Box), } -impl IntOrString { - pub fn new(int: i32, string: String) -> IntOrString { - IntOrString { int, string } +impl Default for IntOrString { + fn default() -> Self { + Self::IntOrStringOneOf(Default::default()) } } diff --git a/tembo-cli/temboclient/src/models/int_or_string_one_of.rs b/cp-client/src/models/int_or_string_one_of.rs similarity index 81% rename from tembo-cli/temboclient/src/models/int_or_string_one_of.rs rename to cp-client/src/models/int_or_string_one_of.rs index c38529a49..a589a5ee7 100644 --- a/tembo-cli/temboclient/src/models/int_or_string_one_of.rs +++ b/cp-client/src/models/int_or_string_one_of.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct IntOrStringOneOf { #[serde(rename = "Int")] pub int: i32, diff --git a/tembo-cli/temboclient/src/models/int_or_string_one_of_1.rs b/cp-client/src/models/int_or_string_one_of_1.rs similarity index 82% rename from tembo-cli/temboclient/src/models/int_or_string_one_of_1.rs rename to cp-client/src/models/int_or_string_one_of_1.rs index 80a16b209..3888abb17 100644 --- a/tembo-cli/temboclient/src/models/int_or_string_one_of_1.rs +++ b/cp-client/src/models/int_or_string_one_of_1.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct IntOrStringOneOf1 { #[serde(rename = "String")] pub string: String, diff --git a/cp-client/src/models/memory.rs b/cp-client/src/models/memory.rs new file mode 100644 index 000000000..507f1b1e5 --- /dev/null +++ b/cp-client/src/models/memory.rs @@ -0,0 +1,80 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Memory { + #[serde(rename = "512Mi")] + Variant512Mi, + #[serde(rename = "1Gi")] + Variant1Gi, + #[serde(rename = "2Gi")] + Variant2Gi, + #[serde(rename = "4Gi")] + Variant4Gi, + #[serde(rename = "8Gi")] + Variant8Gi, + #[serde(rename = "12Gi")] + Variant12Gi, + #[serde(rename = "16Gi")] + Variant16Gi, + #[serde(rename = "24Gi")] + Variant24Gi, + #[serde(rename = "32Gi")] + Variant32Gi, + #[serde(rename = "64Gi")] + Variant64Gi, +} + +impl std::fmt::Display for Memory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Variant512Mi => write!(f, "512Mi"), + Self::Variant1Gi => write!(f, "1Gi"), + Self::Variant2Gi => write!(f, "2Gi"), + Self::Variant4Gi => write!(f, "4Gi"), + Self::Variant8Gi => write!(f, "8Gi"), + Self::Variant12Gi => write!(f, "12Gi"), + Self::Variant16Gi => write!(f, "16Gi"), + Self::Variant24Gi => write!(f, "24Gi"), + Self::Variant32Gi => write!(f, "32Gi"), + Self::Variant64Gi => write!(f, "64Gi"), + } + } +} + +impl Default for Memory { + fn default() -> Memory { + Self::Variant512Mi + } +} + +impl std::str::FromStr for Memory { + type Err = String; + + fn from_str(s: &str) -> Result { + match s { + "512Mi" => Ok(Self::Variant512Mi), + "1Gi" => Ok(Self::Variant1Gi), + "2Gi" => Ok(Self::Variant2Gi), + "4Gi" => Ok(Self::Variant4Gi), + "8Gi" => Ok(Self::Variant8Gi), + "12Gi" => Ok(Self::Variant12Gi), + "16Gi" => Ok(Self::Variant16Gi), + "24Gi" => Ok(Self::Variant24Gi), + "32Gi" => Ok(Self::Variant32Gi), + "64Gi" => Ok(Self::Variant64Gi), + _ => Err(format!("Invalid memory value: {}", s)), + } + } +} diff --git a/cp-client/src/models/middleware.rs b/cp-client/src/models/middleware.rs new file mode 100644 index 000000000..b9f617365 --- /dev/null +++ b/cp-client/src/models/middleware.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 + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// Middleware : Midddleware is used to configure the middleware for the appService. This is specifically configured for the ingress controller Traefik. Please refer to the example in the `AppService` documentation. +/// Midddleware is used to configure the middleware for the appService. This is specifically configured for the ingress controller Traefik. Please refer to the example in the `AppService` documentation. +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum Middleware { + MiddlewareOneOf(Box), + MiddlewareOneOf1(Box), + MiddlewareOneOf2(Box), +} + +impl Default for Middleware { + fn default() -> Self { + Self::MiddlewareOneOf(Default::default()) + } +} diff --git a/tembo-cli/temboclient/src/models/middleware_one_of.rs b/cp-client/src/models/middleware_one_of.rs similarity index 68% rename from tembo-cli/temboclient/src/models/middleware_one_of.rs rename to cp-client/src/models/middleware_one_of.rs index eac1f353c..108e05415 100644 --- a/tembo-cli/temboclient/src/models/middleware_one_of.rs +++ b/cp-client/src/models/middleware_one_of.rs @@ -8,14 +8,17 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct MiddlewareOneOf { #[serde(rename = "customRequestHeaders")] - pub custom_request_headers: Box, + pub custom_request_headers: Box, } impl MiddlewareOneOf { - pub fn new(custom_request_headers: crate::models::HeaderConfig) -> MiddlewareOneOf { + pub fn new(custom_request_headers: 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/cp-client/src/models/middleware_one_of_1.rs similarity index 68% rename from tembo-cli/temboclient/src/models/middleware_one_of_1.rs rename to cp-client/src/models/middleware_one_of_1.rs index cba725935..a75e25fd9 100644 --- a/tembo-cli/temboclient/src/models/middleware_one_of_1.rs +++ b/cp-client/src/models/middleware_one_of_1.rs @@ -8,14 +8,17 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct MiddlewareOneOf1 { #[serde(rename = "stripPrefix")] - pub strip_prefix: Box, + pub strip_prefix: Box, } impl MiddlewareOneOf1 { - pub fn new(strip_prefix: crate::models::StripPrefixConfig) -> MiddlewareOneOf1 { + pub fn new(strip_prefix: models::StripPrefixConfig) -> MiddlewareOneOf1 { MiddlewareOneOf1 { strip_prefix: Box::new(strip_prefix), } diff --git a/tembo-cli/temboclient/src/models/middleware_one_of_2.rs b/cp-client/src/models/middleware_one_of_2.rs similarity index 67% rename from tembo-cli/temboclient/src/models/middleware_one_of_2.rs rename to cp-client/src/models/middleware_one_of_2.rs index c71a97442..378c0064e 100644 --- a/tembo-cli/temboclient/src/models/middleware_one_of_2.rs +++ b/cp-client/src/models/middleware_one_of_2.rs @@ -8,14 +8,17 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct MiddlewareOneOf2 { #[serde(rename = "replacePathRegex")] - pub replace_path_regex: Box, + pub replace_path_regex: Box, } impl MiddlewareOneOf2 { - pub fn new(replace_path_regex: crate::models::ReplacePathRegexConfig) -> MiddlewareOneOf2 { + pub fn new(replace_path_regex: models::ReplacePathRegexConfig) -> MiddlewareOneOf2 { MiddlewareOneOf2 { replace_path_regex: Box::new(replace_path_regex), } diff --git a/tembo-cli/temboclient/src/models/mod.rs b/cp-client/src/models/mod.rs similarity index 75% rename from tembo-cli/temboclient/src/models/mod.rs rename to cp-client/src/models/mod.rs index 082677901..f3a256852 100644 --- a/tembo-cli/temboclient/src/models/mod.rs +++ b/cp-client/src/models/mod.rs @@ -1,5 +1,9 @@ +pub mod action; +pub use self::action::Action; pub mod app_config; pub use self::app_config::AppConfig; +pub mod app_metrics; +pub use self::app_metrics::AppMetrics; pub mod app_service; pub use self::app_service::AppService; pub mod app_type; @@ -16,6 +20,18 @@ pub mod app_type_one_of_4; pub use self::app_type_one_of_4::AppTypeOneOf4; pub mod app_type_one_of_5; pub use self::app_type_one_of_5::AppTypeOneOf5; +pub mod app_type_one_of_6; +pub use self::app_type_one_of_6::AppTypeOneOf6; +pub mod ask_params; +pub use self::ask_params::AskParams; +pub mod ask_result; +pub use self::ask_result::AskResult; +pub mod auto_stop; +pub use self::auto_stop::AutoStop; +pub mod autoscaling; +pub use self::autoscaling::Autoscaling; +pub mod autoscaling_storage; +pub use self::autoscaling_storage::AutoscalingStorage; pub mod connection_info; pub use self::connection_info::ConnectionInfo; pub mod connection_pooler; @@ -24,6 +40,10 @@ pub mod cpu; pub use self::cpu::Cpu; pub mod create_instance; pub use self::create_instance::CreateInstance; +pub mod data_plane; +pub use self::data_plane::DataPlane; +pub mod dedicated_networking; +pub use self::dedicated_networking::DedicatedNetworking; pub mod env_var; pub use self::env_var::EnvVar; pub mod env_var_ref; @@ -32,6 +52,8 @@ pub mod environment; pub use self::environment::Environment; pub mod error_response_schema; pub use self::error_response_schema::ErrorResponseSchema; +pub mod experimental; +pub use self::experimental::Experimental; pub mod extension; pub use self::extension::Extension; pub mod extension_install_location; @@ -42,6 +64,10 @@ pub mod extension_status; pub use self::extension_status::ExtensionStatus; pub mod header_config; pub use self::header_config::HeaderConfig; +pub mod history_entry; +pub use self::history_entry::HistoryEntry; +pub mod history_page; +pub use self::history_page::HistoryPage; pub mod infrastructure; pub use self::infrastructure::Infrastructure; pub mod ingress; @@ -52,6 +78,8 @@ pub mod instance; pub use self::instance::Instance; pub mod instance_event; pub use self::instance_event::InstanceEvent; +pub mod instance_state; +pub use self::instance_state::InstanceState; pub mod int_or_string; pub use self::int_or_string::IntOrString; pub mod int_or_string_one_of; @@ -68,12 +96,20 @@ 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 pagination_info; +pub use self::pagination_info::PaginationInfo; +pub mod patch_autoscaling; +pub use self::patch_autoscaling::PatchAutoscaling; 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 policy_data; +pub use self::policy_data::PolicyData; +pub mod policy_input; +pub use self::policy_input::PolicyInput; pub mod pooler_pgbouncer_pool_mode; pub use self::pooler_pgbouncer_pool_mode::PoolerPgbouncerPoolMode; pub mod pooler_template_spec_containers_resources; @@ -96,8 +132,14 @@ pub mod restore; pub use self::restore::Restore; pub mod restore_instance; pub use self::restore_instance::RestoreInstance; +pub mod role; +pub use self::role::Role; pub mod routing; pub use self::routing::Routing; +pub mod search_params; +pub use self::search_params::SearchParams; +pub mod search_response; +pub use self::search_response::SearchResponse; pub mod stack_type; pub use self::stack_type::StackType; pub mod state; @@ -112,8 +154,5 @@ 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/cp-client/src/models/pagination_info.rs b/cp-client/src/models/pagination_info.rs new file mode 100644 index 000000000..0a2c7a6f6 --- /dev/null +++ b/cp-client/src/models/pagination_info.rs @@ -0,0 +1,35 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PaginationInfo { + /// The page returned + #[serde(rename = "currentPage")] + pub current_page: i32, + /// True if more results are available on the next page + #[serde(rename = "hasMore")] + pub has_more: bool, + /// The maximum number of results returned + #[serde(rename = "limit")] + pub limit: i32, +} + +impl PaginationInfo { + pub fn new(current_page: i32, has_more: bool, limit: i32) -> PaginationInfo { + PaginationInfo { + current_page, + has_more, + limit, + } + } +} diff --git a/cp-client/src/models/patch_autoscaling.rs b/cp-client/src/models/patch_autoscaling.rs new file mode 100644 index 000000000..4e8f555ea --- /dev/null +++ b/cp-client/src/models/patch_autoscaling.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 + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PatchAutoscaling { + #[serde( + rename = "autostop", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub autostop: Option>>, + #[serde( + rename = "storage", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub storage: Option>>, +} + +impl PatchAutoscaling { + pub fn new() -> PatchAutoscaling { + PatchAutoscaling { + autostop: None, + storage: None, + } + } +} diff --git a/tembo-cli/temboclient/src/models/patch_instance.rs b/cp-client/src/models/patch_instance.rs similarity index 60% rename from tembo-cli/temboclient/src/models/patch_instance.rs rename to cp-client/src/models/patch_instance.rs index 7d5fb7982..a0bf7138a 100644 --- a/tembo-cli/temboclient/src/models/patch_instance.rs +++ b/cp-client/src/models/patch_instance.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PatchInstance { #[serde( rename = "app_services", @@ -16,35 +19,56 @@ pub struct PatchInstance { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub app_services: Option>>, + pub app_services: Option>>, + #[serde( + rename = "autoscaling", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub autoscaling: Option>>, #[serde( rename = "connection_pooler", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub connection_pooler: Option>>, + pub connection_pooler: Option>>, #[serde( rename = "cpu", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub cpu: Option>, + pub cpu: Option>, + #[serde( + rename = "dedicated_networking", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub dedicated_networking: Option>>, #[serde( rename = "environment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub environment: Option>, + pub environment: Option>, + #[serde( + rename = "experimental", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub experimental: Option>>, #[serde( rename = "extensions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub extensions: Option>>, + pub extensions: Option>>, #[serde( rename = "extra_domains_rw", default, @@ -52,6 +76,13 @@ pub struct PatchInstance { skip_serializing_if = "Option::is_none" )] pub extra_domains_rw: Option>>, + #[serde( + rename = "instance_name", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub instance_name: Option>, #[serde( rename = "ip_allow_list", default, @@ -65,14 +96,14 @@ pub struct PatchInstance { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub memory: Option>, + pub memory: Option>, #[serde( rename = "postgres_configs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub postgres_configs: Option>>, + pub postgres_configs: Option>>, #[serde( rename = "replicas", default, @@ -80,35 +111,47 @@ pub struct PatchInstance { skip_serializing_if = "Option::is_none" )] pub replicas: Option>, + #[serde( + rename = "spot", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub spot: Option>, #[serde( rename = "storage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub storage: Option>, + pub storage: Option>, #[serde( rename = "trunk_installs", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub trunk_installs: Option>>, + pub trunk_installs: Option>>, } impl PatchInstance { pub fn new() -> PatchInstance { PatchInstance { app_services: None, + autoscaling: None, connection_pooler: None, cpu: None, + dedicated_networking: None, environment: None, + experimental: None, extensions: None, extra_domains_rw: None, + instance_name: None, ip_allow_list: None, memory: None, postgres_configs: None, replicas: None, + spot: None, storage: None, trunk_installs: None, } diff --git a/tembo-cli/temboclient/src/models/pg_bouncer.rs b/cp-client/src/models/pg_bouncer.rs similarity index 78% rename from tembo-cli/temboclient/src/models/pg_bouncer.rs rename to cp-client/src/models/pg_bouncer.rs index 341d1ac32..13d3348f3 100644 --- a/tembo-cli/temboclient/src/models/pg_bouncer.rs +++ b/cp-client/src/models/pg_bouncer.rs @@ -8,9 +8,11 @@ * Generated by: https://openapi-generator.tech */ -/// PgBouncer : PgBouncer is the type for the PGBouncer configuration +use crate::models; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +/// PgBouncer : PgBouncer is the type for the PGBouncer configuration +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PgBouncer { /// Valid pgbouncer parameter values can be found at [https://www.pgbouncer.org/config.html](https://www.pgbouncer.org/config.html) #[serde( @@ -19,16 +21,16 @@ pub struct PgBouncer { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub parameters: Option>>, + pub parameters: Option>>, #[serde(rename = "poolMode", skip_serializing_if = "Option::is_none")] - pub pool_mode: Option, + pub pool_mode: Option, #[serde( rename = "resources", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub resources: Option>>, + pub resources: Option>>, } impl PgBouncer { diff --git a/tembo-cli/temboclient/src/models/pg_config.rs b/cp-client/src/models/pg_config.rs similarity index 82% rename from tembo-cli/temboclient/src/models/pg_config.rs rename to cp-client/src/models/pg_config.rs index 521b1c613..97d0de525 100644 --- a/tembo-cli/temboclient/src/models/pg_config.rs +++ b/cp-client/src/models/pg_config.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PgConfig { #[serde(rename = "name")] pub name: String, diff --git a/cp-client/src/models/policy_data.rs b/cp-client/src/models/policy_data.rs new file mode 100644 index 000000000..cc97ab9ec --- /dev/null +++ b/cp-client/src/models/policy_data.rs @@ -0,0 +1,24 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PolicyData { + #[serde(rename = "policies")] + pub policies: Vec, +} + +impl PolicyData { + pub fn new(policies: Vec) -> PolicyData { + PolicyData { policies } + } +} diff --git a/cp-client/src/models/policy_input.rs b/cp-client/src/models/policy_input.rs new file mode 100644 index 000000000..768e41047 --- /dev/null +++ b/cp-client/src/models/policy_input.rs @@ -0,0 +1,35 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct PolicyInput { + /// A valid Action ID. Available Action IDs include 'CreateInstance' and 'ManagePermissions'. Find all available Actions on the Actions API. + #[serde(rename = "action")] + pub action: String, + /// Whether the Action is allowed or not for the Role + #[serde(rename = "allowed")] + pub allowed: bool, + /// A valid Role ID. Available Role IDs include 'admin' and 'basic_member'. + #[serde(rename = "role")] + pub role: String, +} + +impl PolicyInput { + pub fn new(action: String, allowed: bool, role: String) -> PolicyInput { + PolicyInput { + action, + allowed, + role, + } + } +} diff --git a/tembo-cli/temboclient/src/models/pooler_pgbouncer_pool_mode.rs b/cp-client/src/models/pooler_pgbouncer_pool_mode.rs similarity index 74% rename from tembo-cli/temboclient/src/models/pooler_pgbouncer_pool_mode.rs rename to cp-client/src/models/pooler_pgbouncer_pool_mode.rs index 024861cff..abb517dca 100644 --- a/tembo-cli/temboclient/src/models/pooler_pgbouncer_pool_mode.rs +++ b/cp-client/src/models/pooler_pgbouncer_pool_mode.rs @@ -8,8 +8,10 @@ * Generated by: https://openapi-generator.tech */ -/// PoolerPgbouncerPoolMode : The PgBouncer configuration +use crate::models; +use serde::{Deserialize, Serialize}; +/// PoolerPgbouncerPoolMode : The PgBouncer configuration /// The PgBouncer configuration #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum PoolerPgbouncerPoolMode { @@ -19,11 +21,11 @@ pub enum PoolerPgbouncerPoolMode { Transaction, } -impl ToString for PoolerPgbouncerPoolMode { - fn to_string(&self) -> String { +impl std::fmt::Display for PoolerPgbouncerPoolMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { - Self::Session => String::from("session"), - Self::Transaction => String::from("transaction"), + Self::Session => write!(f, "session"), + Self::Transaction => write!(f, "transaction"), } } } diff --git a/tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources.rs b/cp-client/src/models/pooler_template_spec_containers_resources.rs similarity index 85% rename from tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources.rs rename to cp-client/src/models/pooler_template_spec_containers_resources.rs index 35dcd5178..322ca2f59 100644 --- a/tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources.rs +++ b/cp-client/src/models/pooler_template_spec_containers_resources.rs @@ -8,9 +8,11 @@ * Generated by: https://openapi-generator.tech */ -/// PoolerTemplateSpecContainersResources : Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +use crate::models; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +/// PoolerTemplateSpecContainersResources : Compute Resources required by this container. Cannot be updated. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PoolerTemplateSpecContainersResources { /// Claims lists the names of resources, defined in spec.resourceClaims, that are used by this container. This is an alpha field and requires enabling the DynamicResourceAllocation feature gate. This field is immutable. It can only be set for containers. #[serde( @@ -19,7 +21,7 @@ pub struct PoolerTemplateSpecContainersResources { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub claims: Option>>, + pub claims: Option>>, /// Limits describes the maximum amount of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ #[serde( rename = "limits", @@ -27,7 +29,7 @@ pub struct PoolerTemplateSpecContainersResources { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub limits: Option>>, + pub limits: Option>>, /// Requests describes the minimum amount of compute resources required. If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, otherwise to an implementation-defined value. Requests cannot exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ #[serde( rename = "requests", @@ -35,7 +37,7 @@ pub struct PoolerTemplateSpecContainersResources { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub requests: Option>>, + pub requests: Option>>, } impl PoolerTemplateSpecContainersResources { diff --git a/tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources_claims.rs b/cp-client/src/models/pooler_template_spec_containers_resources_claims.rs similarity index 89% rename from tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources_claims.rs rename to cp-client/src/models/pooler_template_spec_containers_resources_claims.rs index edd8ec922..a7be18d30 100644 --- a/tembo-cli/temboclient/src/models/pooler_template_spec_containers_resources_claims.rs +++ b/cp-client/src/models/pooler_template_spec_containers_resources_claims.rs @@ -8,9 +8,11 @@ * Generated by: https://openapi-generator.tech */ -/// PoolerTemplateSpecContainersResourcesClaims : ResourceClaim references one entry in PodSpec.ResourceClaims. +use crate::models; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +/// PoolerTemplateSpecContainersResourcesClaims : ResourceClaim references one entry in PodSpec.ResourceClaims. +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct PoolerTemplateSpecContainersResourcesClaims { /// Name must match the name of one entry in pod.spec.resourceClaims of the Pod where this field is used. It makes that resource available inside a container. #[serde(rename = "name")] diff --git a/tembo-cli/temboclient/src/models/probe.rs b/cp-client/src/models/probe.rs similarity index 85% rename from tembo-cli/temboclient/src/models/probe.rs rename to cp-client/src/models/probe.rs index df52f5d92..65fe25b08 100644 --- a/tembo-cli/temboclient/src/models/probe.rs +++ b/cp-client/src/models/probe.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Probe { #[serde(rename = "initialDelaySeconds")] pub initial_delay_seconds: i32, diff --git a/tembo-cli/temboclient/src/models/probes.rs b/cp-client/src/models/probes.rs similarity index 80% rename from tembo-cli/temboclient/src/models/probes.rs rename to cp-client/src/models/probes.rs index 357129a3a..926f98202 100644 --- a/tembo-cli/temboclient/src/models/probes.rs +++ b/cp-client/src/models/probes.rs @@ -8,19 +8,21 @@ * Generated by: https://openapi-generator.tech */ -/// Probes : Probes are used to determine the health of a container. You define this in the same manner as you would for all Kubernetes containers. See the [Kubernetes docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/). +use crate::models; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +/// Probes : Probes are used to determine the health of a container. You define this in the same manner as you would for all Kubernetes containers. See the [Kubernetes docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/). +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Probes { #[serde(rename = "liveness")] - pub liveness: Box, + pub liveness: Box, #[serde(rename = "readiness")] - pub readiness: Box, + pub readiness: Box, } impl Probes { /// Probes are used to determine the health of a container. You define this in the same manner as you would for all Kubernetes containers. See the [Kubernetes docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/). - pub fn new(liveness: crate::models::Probe, readiness: crate::models::Probe) -> Probes { + pub fn new(liveness: models::Probe, readiness: 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/cp-client/src/models/replace_path_regex_config.rs similarity index 68% rename from tembo-cli/temboclient/src/models/replace_path_regex_config.rs rename to cp-client/src/models/replace_path_regex_config.rs index 7ce59f731..ee5733d15 100644 --- a/tembo-cli/temboclient/src/models/replace_path_regex_config.rs +++ b/cp-client/src/models/replace_path_regex_config.rs @@ -8,19 +8,19 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplacePathRegexConfig { #[serde(rename = "config")] - pub config: Box, + pub config: Box, #[serde(rename = "name")] pub name: String, } impl ReplacePathRegexConfig { - pub fn new( - config: crate::models::ReplacePathRegexConfigType, - name: String, - ) -> ReplacePathRegexConfig { + pub fn new(config: 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/cp-client/src/models/replace_path_regex_config_type.rs similarity index 85% rename from tembo-cli/temboclient/src/models/replace_path_regex_config_type.rs rename to cp-client/src/models/replace_path_regex_config_type.rs index 19e53c869..ecfd428e5 100644 --- a/tembo-cli/temboclient/src/models/replace_path_regex_config_type.rs +++ b/cp-client/src/models/replace_path_regex_config_type.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ReplacePathRegexConfigType { #[serde(rename = "regex")] pub regex: String, diff --git a/tembo-cli/temboclient/src/models/resource.rs b/cp-client/src/models/resource.rs similarity index 82% rename from tembo-cli/temboclient/src/models/resource.rs rename to cp-client/src/models/resource.rs index 10ec577ef..313039259 100644 --- a/tembo-cli/temboclient/src/models/resource.rs +++ b/cp-client/src/models/resource.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Resource { #[serde(rename = "cpu")] pub cpu: String, diff --git a/tembo-cli/temboclient/src/models/resource_requirements.rs b/cp-client/src/models/resource_requirements.rs similarity index 79% rename from tembo-cli/temboclient/src/models/resource_requirements.rs rename to cp-client/src/models/resource_requirements.rs index b47f2bfab..b4ecbf441 100644 --- a/tembo-cli/temboclient/src/models/resource_requirements.rs +++ b/cp-client/src/models/resource_requirements.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct ResourceRequirements { #[serde( rename = "limits", @@ -16,14 +19,14 @@ pub struct ResourceRequirements { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub limits: Option>>, + pub limits: Option>>, #[serde( rename = "requests", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub requests: Option>>, + pub requests: Option>>, } impl ResourceRequirements { diff --git a/tembo-cli/temboclient/src/models/restore.rs b/cp-client/src/models/restore.rs similarity index 87% rename from tembo-cli/temboclient/src/models/restore.rs rename to cp-client/src/models/restore.rs index de7d1b1ca..6cb9758eb 100644 --- a/tembo-cli/temboclient/src/models/restore.rs +++ b/cp-client/src/models/restore.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Restore { #[serde(rename = "instance_id")] pub instance_id: String, diff --git a/tembo-cli/temboclient/src/models/restore_instance.rs b/cp-client/src/models/restore_instance.rs similarity index 71% rename from tembo-cli/temboclient/src/models/restore_instance.rs rename to cp-client/src/models/restore_instance.rs index f08c6d77e..6e5d8b8d3 100644 --- a/tembo-cli/temboclient/src/models/restore_instance.rs +++ b/cp-client/src/models/restore_instance.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct RestoreInstance { #[serde( rename = "app_services", @@ -16,28 +19,35 @@ pub struct RestoreInstance { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub app_services: Option>>, + pub app_services: Option>>, + #[serde( + rename = "autoscaling", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub autoscaling: Option>>, #[serde( rename = "connection_pooler", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub connection_pooler: Option>>, + pub connection_pooler: Option>>, #[serde( rename = "cpu", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub cpu: Option>, + pub cpu: Option>, #[serde( rename = "environment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub environment: Option>, + pub environment: Option>, #[serde( rename = "extra_domains_rw", default, @@ -53,22 +63,23 @@ pub struct RestoreInstance { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub memory: Option>, + pub memory: Option>, #[serde(rename = "restore")] - pub restore: Box, + pub restore: Box, #[serde( rename = "storage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub storage: Option>, + pub storage: Option>, } impl RestoreInstance { - pub fn new(instance_name: String, restore: crate::models::Restore) -> RestoreInstance { + pub fn new(instance_name: String, restore: models::Restore) -> RestoreInstance { RestoreInstance { app_services: None, + autoscaling: None, connection_pooler: None, cpu: None, environment: None, diff --git a/cp-client/src/models/role.rs b/cp-client/src/models/role.rs new file mode 100644 index 000000000..e2f74cf52 --- /dev/null +++ b/cp-client/src/models/role.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 + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct Role { + /// A valid Role ID. Available Role IDs include 'admin' and 'basic_member'. + #[serde(rename = "id")] + pub id: String, + /// The name of the Role. + #[serde(rename = "name")] + pub name: String, +} + +impl Role { + pub fn new(id: String, name: String) -> Role { + Role { id, name } + } +} diff --git a/tembo-cli/temboclient/src/models/routing.rs b/cp-client/src/models/routing.rs similarity index 91% rename from tembo-cli/temboclient/src/models/routing.rs rename to cp-client/src/models/routing.rs index acb4413bb..582469aac 100644 --- a/tembo-cli/temboclient/src/models/routing.rs +++ b/cp-client/src/models/routing.rs @@ -8,9 +8,11 @@ * Generated by: https://openapi-generator.tech */ -/// Routing : Routing is used if there is a routing port, then a service is created using that Port when ingress_path is present, an ingress is created. Otherwise, no ingress is created +use crate::models; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +/// Routing : Routing is used if there is a routing port, then a service is created using that Port when ingress_path is present, an ingress is created. Otherwise, no ingress is created +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Routing { #[serde( rename = "entryPoints", @@ -32,7 +34,7 @@ pub struct Routing { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub ingress_type: Option>, + pub ingress_type: Option>, /// provide name of the middleware resources to apply to this route #[serde( rename = "middlewares", diff --git a/cp-client/src/models/search_params.rs b/cp-client/src/models/search_params.rs new file mode 100644 index 000000000..56f013508 --- /dev/null +++ b/cp-client/src/models/search_params.rs @@ -0,0 +1,33 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SearchParams { + /// The number of results to return. Default is 10, max is 20. + #[serde( + rename = "limit", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub limit: Option>, + /// The search query. For example, \"how to create a Tembo instance\" + #[serde(rename = "query")] + pub query: String, +} + +impl SearchParams { + pub fn new(query: String) -> SearchParams { + SearchParams { limit: None, query } + } +} diff --git a/cp-client/src/models/search_response.rs b/cp-client/src/models/search_response.rs new file mode 100644 index 000000000..3bf4302ec --- /dev/null +++ b/cp-client/src/models/search_response.rs @@ -0,0 +1,38 @@ +/* + * 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 crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SearchResponse { + /// The file path (in Tembo website repo) to the Tembo document + #[serde(rename = "file_path")] + pub file_path: String, + #[serde( + rename = "front_matter", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub front_matter: Option>, + #[serde(rename = "similarity_score")] + pub similarity_score: f64, +} + +impl SearchResponse { + pub fn new(file_path: String, similarity_score: f64) -> SearchResponse { + SearchResponse { + file_path, + front_matter: None, + similarity_score, + } + } +} diff --git a/tembo-cli/temboclient/src/models/stack_type.rs b/cp-client/src/models/stack_type.rs similarity index 71% rename from tembo-cli/temboclient/src/models/stack_type.rs rename to cp-client/src/models/stack_type.rs index f2de76d0a..9f2c13ded 100644 --- a/tembo-cli/temboclient/src/models/stack_type.rs +++ b/cp-client/src/models/stack_type.rs @@ -55,3 +55,23 @@ impl Default for StackType { Self::Standard } } + +impl std::str::FromStr for StackType { + type Err = String; + + fn from_str(s: &str) -> Result { + match s { + "Standard" => Ok(Self::Standard), + "MessageQueue" => Ok(Self::MessageQueue), + "MachineLearning" => Ok(Self::MachineLearning), + "OLTP" => Ok(Self::Oltp), + "Analytics" => Ok(Self::Analytics), + "VectorDB" => Ok(Self::VectorDb), + "Geospatial" => Ok(Self::Geospatial), + "MongoAlternative" => Ok(Self::MongoAlternative), + "Timeseries" => Ok(Self::Timeseries), + "ParadeDB" => Ok(Self::ParadeDB), + _ => Err(format!("Invalid StackType: {}", s)), + } + } +} diff --git a/tembo-cli/temboclient/src/models/state.rs b/cp-client/src/models/state.rs similarity index 61% rename from tembo-cli/temboclient/src/models/state.rs rename to cp-client/src/models/state.rs index d751ba03c..a44e69652 100644 --- a/tembo-cli/temboclient/src/models/state.rs +++ b/cp-client/src/models/state.rs @@ -8,6 +8,9 @@ * Generated by: https://openapi-generator.tech */ +use crate::models; +use serde::{Deserialize, Serialize}; + /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum State { @@ -33,19 +36,19 @@ pub enum State { Deleted, } -impl ToString for State { - fn to_string(&self) -> String { +impl std::fmt::Display for State { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 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"), + Self::Submitted => write!(f, "Submitted"), + Self::Up => write!(f, "Up"), + Self::Configuring => write!(f, "Configuring"), + Self::Error => write!(f, "Error"), + Self::Restarting => write!(f, "Restarting"), + Self::Starting => write!(f, "Starting"), + Self::Stopping => write!(f, "Stopping"), + Self::Stopped => write!(f, "Stopped"), + Self::Deleting => write!(f, "Deleting"), + Self::Deleted => write!(f, "Deleted"), } } } diff --git a/tembo-cli/temboclient/src/models/storage.rs b/cp-client/src/models/storage.rs similarity index 57% rename from tembo-cli/temboclient/src/models/storage.rs rename to cp-client/src/models/storage.rs index b19943d5b..d901c0833 100644 --- a/tembo-cli/temboclient/src/models/storage.rs +++ b/cp-client/src/models/storage.rs @@ -8,6 +8,9 @@ * Generated by: https://openapi-generator.tech */ +use crate::models; +use serde::{Deserialize, Serialize}; + /// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Storage { @@ -25,6 +28,12 @@ pub enum Storage { Variant400Gi, #[serde(rename = "500Gi")] Variant500Gi, + #[serde(rename = "1Ti")] + Variant1Ti, + #[serde(rename = "1.5Ti")] + Variant1Period5Ti, + #[serde(rename = "2Ti")] + Variant2Ti, } impl ToString for Storage { @@ -37,6 +46,9 @@ impl ToString for Storage { Self::Variant300Gi => String::from("300Gi"), Self::Variant400Gi => String::from("400Gi"), Self::Variant500Gi => String::from("500Gi"), + Self::Variant1Ti => String::from("1Ti"), + Self::Variant1Period5Ti => String::from("1.5Ti"), + Self::Variant2Ti => String::from("2Ti"), } } } @@ -46,3 +58,23 @@ impl Default for Storage { Self::Variant10Gi } } + +impl std::str::FromStr for Storage { + type Err = String; + + fn from_str(s: &str) -> Result { + match s { + "10Gi" => Ok(Self::Variant10Gi), + "50Gi" => Ok(Self::Variant50Gi), + "100Gi" => Ok(Self::Variant100Gi), + "200Gi" => Ok(Self::Variant200Gi), + "300Gi" => Ok(Self::Variant300Gi), + "400Gi" => Ok(Self::Variant400Gi), + "500Gi" => Ok(Self::Variant500Gi), + "1Ti" => Ok(Self::Variant1Ti), + "1.5Ti" => Ok(Self::Variant1Period5Ti), + "2Ti" => Ok(Self::Variant2Ti), + _ => Err(format!("Invalid storage size: {}", s)), + } + } +} diff --git a/tembo-cli/temboclient/src/models/storage_config.rs b/cp-client/src/models/storage_config.rs similarity index 78% rename from tembo-cli/temboclient/src/models/storage_config.rs rename to cp-client/src/models/storage_config.rs index 2e7b8eb1c..cc516bcbf 100644 --- a/tembo-cli/temboclient/src/models/storage_config.rs +++ b/cp-client/src/models/storage_config.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct StorageConfig { #[serde( rename = "volumeMounts", @@ -16,7 +19,7 @@ pub struct StorageConfig { with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none" )] - pub volume_mounts: Option>>, + pub volume_mounts: Option>>, } impl StorageConfig { diff --git a/tembo-cli/temboclient/src/models/strip_prefix_config.rs b/cp-client/src/models/strip_prefix_config.rs similarity index 84% rename from tembo-cli/temboclient/src/models/strip_prefix_config.rs rename to cp-client/src/models/strip_prefix_config.rs index 1dce15d4e..8c2f5c29d 100644 --- a/tembo-cli/temboclient/src/models/strip_prefix_config.rs +++ b/cp-client/src/models/strip_prefix_config.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct StripPrefixConfig { #[serde(rename = "config")] pub config: Vec, diff --git a/tembo-cli/temboclient/src/models/trunk_install.rs b/cp-client/src/models/trunk_install.rs similarity index 84% rename from tembo-cli/temboclient/src/models/trunk_install.rs rename to cp-client/src/models/trunk_install.rs index 27dfa7e49..2378b24f8 100644 --- a/tembo-cli/temboclient/src/models/trunk_install.rs +++ b/cp-client/src/models/trunk_install.rs @@ -8,16 +8,23 @@ * Generated by: https://openapi-generator.tech */ -/// TrunkInstall : TrunkInstall allows installation of extensions from the [pgtrunk](https://pgt.dev) registry. This list should be a list of extension names and versions that you wish to install at runtime using the pgtrunk API. This example will install the pg_stat_statements extension at version 1.10.0. ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: trunk_installs: - name: pg_stat_statements version: 1.10.0 ``` +use crate::models; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +/// TrunkInstall : TrunkInstall allows installation of extensions from the [pgtrunk](https://pgt.dev) registry. This list should be a list of extension names and versions that you wish to install at runtime using the pgtrunk API. This example will install the pg_stat_statements extension at version 1.10.0. ```yaml apiVersion: coredb.io/v1alpha1 kind: CoreDB metadata: name: test-db spec: trunk_installs: - name: pg_stat_statements version: 1.10.0 ``` +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TrunkInstall { /// The name of the extension to install. This must be the name of the extension as it appears in the [pgtrunk](https://pgt.dev) registry. #[serde(rename = "name")] pub name: String, /// The version of the extension to install. If not specified, the latest version will be used. (Optional) - #[serde(rename = "version", default, skip_serializing_if = "Option::is_none")] - pub version: Option, + #[serde( + rename = "version", + default, + with = "::serde_with::rust::double_option", + skip_serializing_if = "Option::is_none" + )] + pub version: Option>, } impl TrunkInstall { diff --git a/tembo-cli/temboclient/src/models/trunk_install_status.rs b/cp-client/src/models/trunk_install_status.rs similarity index 92% rename from tembo-cli/temboclient/src/models/trunk_install_status.rs rename to cp-client/src/models/trunk_install_status.rs index ebd050c50..1d3823792 100644 --- a/tembo-cli/temboclient/src/models/trunk_install_status.rs +++ b/cp-client/src/models/trunk_install_status.rs @@ -8,7 +8,10 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct TrunkInstallStatus { #[serde(rename = "error")] pub error: bool, diff --git a/tembo-cli/temboclient/src/models/volume_mount.rs b/cp-client/src/models/volume_mount.rs similarity index 89% rename from tembo-cli/temboclient/src/models/volume_mount.rs rename to cp-client/src/models/volume_mount.rs index 428a341dc..97c7d4ddb 100644 --- a/tembo-cli/temboclient/src/models/volume_mount.rs +++ b/cp-client/src/models/volume_mount.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct VolumeMount { #[serde(rename = "mount_path")] - pub mount_path: String, + pub mount_path: Option, #[serde( rename = "mount_propagation", default, @@ -47,7 +49,7 @@ pub struct VolumeMount { impl VolumeMount { pub fn new(mount_path: String, name: String) -> VolumeMount { VolumeMount { - mount_path, + mount_path: Some(mount_path), mount_propagation: None, name, read_only: None, diff --git a/tembo-cli/Cargo.lock b/tembo-cli/Cargo.lock index 8d2a0d174..f388419c0 100644 --- a/tembo-cli/Cargo.lock +++ b/tembo-cli/Cargo.lock @@ -4340,6 +4340,19 @@ dependencies = [ "libc", ] +[[package]] +name = "tembo-api-client" +version = "1.0.4" +dependencies = [ + "reqwest", + "serde", + "serde_derive", + "serde_json", + "serde_with", + "url", + "uuid", +] + [[package]] name = "tembo-cli" version = "0.21.1" @@ -4388,8 +4401,8 @@ dependencies = [ "spinoff", "sqlx", "sqlx-cli", + "tembo-api-client", "tembo-stacks", - "temboclient", "tembodataclient", "tera", "test-case", @@ -4425,19 +4438,6 @@ dependencies = [ "utoipa", ] -[[package]] -name = "temboclient" -version = "1.0.4" -dependencies = [ - "reqwest", - "serde", - "serde_derive", - "serde_json", - "serde_with", - "url", - "uuid", -] - [[package]] name = "tembodataclient" version = "0.0.2" diff --git a/tembo-cli/Cargo.toml b/tembo-cli/Cargo.toml index ce2dd0359..6b9fbb5f1 100644 --- a/tembo-cli/Cargo.toml +++ b/tembo-cli/Cargo.toml @@ -1,4 +1,4 @@ -workspace = { members = ["temboclient", "tembodataclient"] } +workspace = { members = ["tembodataclient"] } [package] name = "tembo-cli" version = "0.21.1" @@ -54,7 +54,7 @@ dateparser = "0.2.0" log = "0.4.20" tera = "1.18.1" curl = "0.4.44" -temboclient = { version = "1.0.4", path = "temboclient" } +tembo-api-client = { version = "1.0.4", path = "../cp-client" } tembodataclient = { version = "0.0.2", path = "tembodataclient" } tokio = { version = "1.26.0", features = [ "rt", @@ -99,4 +99,4 @@ openssl = { version = "0.10", features = ["vendored"] } [dev-dependencies] assert_cmd = "2.0.8" predicates = "2.1.5" -rstest = "0.18" \ No newline at end of file +rstest = "0.18" diff --git a/tembo-cli/README.md b/tembo-cli/README.md index 12ced976e..0f1381831 100644 --- a/tembo-cli/README.md +++ b/tembo-cli/README.md @@ -22,6 +22,7 @@ cargo install tembo-cli ``` ### Commands + Discover a wide range of commands and subcommands, along with their respective options, by exploring our comprehensive [Command Reference](https://tembo.io/docs/development/cli/command-reference). ## Developing Tembo CLI @@ -58,7 +59,7 @@ Delete the contents of the directory first and then run following command to re- openapi-generator generate -i https://api.data-1.use1.tembo.io/api-docs/openapi.json -g rust -o . --additional-properties=packageName=tembodataclient ``` -* Go to `tembodataclient/src/lib.rs` & add following line at the top to disable clippy for the generated code +- Go to `tembodataclient/src/lib.rs` & add following line at the top to disable clippy for the generated code ``` rs #![allow(clippy::all)] @@ -66,21 +67,21 @@ openapi-generator generate -i https://api.data-1.use1.tembo.io/api-docs/openapi. #### Control plane API client -Go to `temboclient` directory in your terminal. +Go to `tembo_api_client` 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. ```bash -openapi-generator generate -i https://api.tembo.io/api-docs/openapi.json -g rust -o . --additional-properties=packageName=temboclient +openapi-generator generate -i https://api.tembo.io/api-docs/openapi.json -g rust -o . --additional-properties=packageName=tembo_api_client ``` -* Go to `temboclient/src/lib.rs` & add following line at the top to disable clippy for the generated code +- Go to `tembo_api_client/src/lib.rs` & add following line at the top to disable clippy for the generated code ``` rs #![allow(clippy::all)] ``` -* Create `temboclient/src/models/impls.rs` file & add following code to it: +- Create `tembo_api_client/src/models/impls.rs` file & add following code to it: ```rs use std::str::FromStr; @@ -172,7 +173,7 @@ impl FromStr for StackType { } ``` -* Add following line towards the end of `temboclient/src/models/mod.rs` +- Add following line towards the end of `tembo_api_client/src/models/mod.rs` ``` rs pub mod impls; diff --git a/tembo-cli/examples/minimal/tembo.toml b/tembo-cli/examples/minimal/tembo.toml index 2badbc05f..ff6f45cb5 100644 --- a/tembo-cli/examples/minimal/tembo.toml +++ b/tembo-cli/examples/minimal/tembo.toml @@ -1,4 +1,4 @@ -[minimal] +[e2e-cli-fhnbcutzie] environment = "prod" instance_name = "minimal" pg_version = 15 diff --git a/tembo-cli/openapitools.json b/tembo-cli/openapitools.json new file mode 100644 index 000000000..973a005ea --- /dev/null +++ b/tembo-cli/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.11.0" + } +} diff --git a/tembo-cli/src/cmd/apply.rs b/tembo-cli/src/cmd/apply.rs index 218d974a0..993d1b482 100644 --- a/tembo-cli/src/cmd/apply.rs +++ b/tembo-cli/src/cmd/apply.rs @@ -25,17 +25,11 @@ use std::{ thread::sleep, time::Duration, }; -use tembo_stacks::apps::app::merge_app_reqs; -use tembo_stacks::apps::app::merge_options; -use tembo_stacks::apps::types::MergedConfigs; -use tembo_stacks::stacks::get_stack; -use tembo_stacks::stacks::types::Stack; -use tembo_stacks::stacks::types::StackType as ControllerStackType; -use temboclient::apis::instance_api::patch_instance; -use temboclient::models::ExtensionStatus; -use temboclient::models::Instance; -use temboclient::models::PatchInstance; -use temboclient::{ +use tembo_api_client::apis::instance_api::patch_instance; +use tembo_api_client::models::ExtensionStatus; +use tembo_api_client::models::Instance; +use tembo_api_client::models::PatchInstance; +use tembo_api_client::{ apis::{ configuration::Configuration, instance_api::{create_instance, get_all, get_instance}, @@ -45,6 +39,12 @@ use temboclient::{ StackType, State, Storage, TrunkInstall, }, }; +use tembo_stacks::apps::app::merge_app_reqs; +use tembo_stacks::apps::app::merge_options; +use tembo_stacks::apps::types::MergedConfigs; +use tembo_stacks::stacks::get_stack; +use tembo_stacks::stacks::types::Stack; +use tembo_stacks::stacks::types::StackType as ControllerStackType; use tembodataclient::apis::secrets_api::get_secret_v1; use tokio::runtime::Runtime; use toml::Value; @@ -643,7 +643,7 @@ fn create_new_instance( } Err(e) => { let error_message = match e { - temboclient::apis::Error::ResponseError(resp_err) => { + tembo_api_client::apis::Error::ResponseError(resp_err) => { let status = resp_err.status; let content = resp_err.content; @@ -679,7 +679,7 @@ fn get_create_instance( Ok(CreateInstance { cpu: Cpu::from_str(instance_settings.cpu.as_str()).unwrap(), memory: Memory::from_str(instance_settings.memory.as_str()).unwrap(), - environment: temboclient::models::Environment::from_str( + environment: tembo_api_client::models::Environment::from_str( instance_settings.environment.as_str(), ) .unwrap(), @@ -700,19 +700,25 @@ fn get_create_instance( ))), postgres_configs: Some(Some(get_postgres_config_cloud(instance_settings)?)), pg_version: Some(instance_settings.pg_version.into()), + autoscaling: None, + dedicated_networking: None, + experimental: None, + provider_id: None, + region_id: None, + spot: None, }) } fn get_app_services( maybe_app_services: Option>, -) -> Result>>, anyhow::Error> { - let mut vec_app_types: Vec = vec![]; +) -> Result>>, anyhow::Error> { + let mut vec_app_types: Vec = vec![]; if let Some(app_services) = maybe_app_services { for app_type in app_services.iter() { match app_type { tembo_stacks::apps::types::AppType::AIProxy(maybe_app_config) => vec_app_types - .push(temboclient::models::AppType::new( + .push(tembo_api_client::models::AppType::new( get_final_app_config(maybe_app_config)?, None, None, @@ -722,7 +728,7 @@ fn get_app_services( None, )), tembo_stacks::apps::types::AppType::RestAPI(maybe_app_config) => vec_app_types - .push(temboclient::models::AppType::new( + .push(tembo_api_client::models::AppType::new( get_final_app_config(maybe_app_config)?, None, None, @@ -732,7 +738,7 @@ fn get_app_services( None, )), tembo_stacks::apps::types::AppType::HTTP(maybe_app_config) => { - vec_app_types.push(temboclient::models::AppType::new( + vec_app_types.push(tembo_api_client::models::AppType::new( None, None, get_final_app_config(maybe_app_config)?, @@ -743,7 +749,7 @@ fn get_app_services( )) } tembo_stacks::apps::types::AppType::MQ(maybe_app_config) => { - vec_app_types.push(temboclient::models::AppType::new( + vec_app_types.push(tembo_api_client::models::AppType::new( None, None, None, @@ -754,7 +760,7 @@ fn get_app_services( )) } tembo_stacks::apps::types::AppType::Embeddings(maybe_app_config) => vec_app_types - .push(temboclient::models::AppType::new( + .push(tembo_api_client::models::AppType::new( None, None, None, @@ -764,7 +770,7 @@ fn get_app_services( None, )), tembo_stacks::apps::types::AppType::PgAnalyze(maybe_app_config) => vec_app_types - .push(temboclient::models::AppType::new( + .push(tembo_api_client::models::AppType::new( None, None, None, @@ -773,9 +779,11 @@ fn get_app_services( get_final_app_config(maybe_app_config)?, None, )), - tembo_stacks::apps::types::AppType::Custom(_) => vec_app_types.push( - temboclient::models::AppType::new(None, None, None, None, None, None, None), - ), + tembo_stacks::apps::types::AppType::Custom(_) => { + vec_app_types.push(tembo_api_client::models::AppType::new( + None, None, None, None, None, None, None, + )) + } } } } @@ -785,13 +793,13 @@ fn get_app_services( fn get_final_app_config( maybe_app_config: &Option, -) -> Result, anyhow::Error> { - let mut final_env_vars: Vec = vec![]; +) -> Result, anyhow::Error> { + let mut final_env_vars: Vec = vec![]; if let Some(a_config) = maybe_app_config { if let Some(env_vars) = a_config.env.clone() { for env_var in env_vars { - final_env_vars.push(temboclient::models::EnvVar { + final_env_vars.push(tembo_api_client::models::EnvVar { name: env_var.name, value: Some(env_var.value), value_from_platform: None, @@ -804,13 +812,13 @@ fn get_final_app_config( // TODO: Find a better way to handle this. // It is done so that other app_types are skipped in the request // We use #[serde(skip_serializing_if = "Option::is_none")] to skip app_types - final_env_vars.push(temboclient::models::EnvVar { + final_env_vars.push(tembo_api_client::models::EnvVar { name: "test".to_string(), value: Some(Some("test".to_string())), value_from_platform: None, }); } - Ok(Some(temboclient::models::AppConfig { + Ok(Some(tembo_api_client::models::AppConfig { env: Some(Some(final_env_vars.clone())), resources: None, })) @@ -826,7 +834,7 @@ fn get_patch_instance( Memory::from_str(instance_settings.memory.as_str()).unwrap(), )), environment: Some(Some( - temboclient::models::Environment::from_str(instance_settings.environment.as_str()) + tembo_api_client::models::Environment::from_str(instance_settings.environment.as_str()) .unwrap(), )), storage: Some(Some( @@ -845,6 +853,11 @@ fn get_patch_instance( instance_settings.extensions.clone(), ))), postgres_configs: Some(Some(get_postgres_config_cloud(instance_settings)?)), + autoscaling: None, + dedicated_networking: None, + experimental: None, + spot: None, + instance_name: None, }) } @@ -958,7 +971,7 @@ fn get_extensions( vec![ExtensionInstallLocation { database: Some("postgres".to_string()), schema: None, - version, + version: Some(version), enabled: extension.enabled.unwrap_or(false), }]; @@ -1016,7 +1029,7 @@ fn get_trunk_installs( if extension.trunk_project.is_some() { vec_trunk_installs.push(TrunkInstall { name: extension.trunk_project.unwrap(), - version, + version: Some(version), }); } } diff --git a/tembo-cli/src/cmd/delete.rs b/tembo-cli/src/cmd/delete.rs index 02de5a7b1..b354ceb3f 100644 --- a/tembo-cli/src/cmd/delete.rs +++ b/tembo-cli/src/cmd/delete.rs @@ -4,7 +4,7 @@ use crate::tui; use crate::tui::confirmation; use clap::Args; use core::result::Result::Ok; -use temboclient::apis::{configuration::Configuration, instance_api::delete_instance}; +use tembo_api_client::apis::{configuration::Configuration, instance_api::delete_instance}; use tokio::runtime::Runtime; use super::apply::{get_instance_id, get_instance_settings}; diff --git a/tembo-cli/src/cmd/logs.rs b/tembo-cli/src/cmd/logs.rs index 5da51aeef..e603b5214 100644 --- a/tembo-cli/src/cmd/logs.rs +++ b/tembo-cli/src/cmd/logs.rs @@ -12,7 +12,7 @@ use reqwest::header::HeaderMap; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; use std::process::{Command, Output}; -use temboclient::apis::configuration::Configuration; +use tembo_api_client::apis::configuration::Configuration; use tokio_tungstenite::tungstenite::protocol::Message; use tungstenite::http::header::{ HeaderName as TungsteniteHeaderName, HeaderValue as TungsteniteHeaderValue, diff --git a/tembo-cli/src/cmd/top.rs b/tembo-cli/src/cmd/top.rs index 4334114f2..cf9905450 100644 --- a/tembo-cli/src/cmd/top.rs +++ b/tembo-cli/src/cmd/top.rs @@ -13,9 +13,9 @@ use reqwest::header::HeaderMap; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::io::{stdout, Write}; -use temboclient::apis::configuration::Configuration; -use temboclient::apis::instance_api::get_all; -use temboclient::apis::instance_api::get_instance; +use tembo_api_client::apis::configuration::Configuration; +use tembo_api_client::apis::instance_api::get_all; +use tembo_api_client::apis::instance_api::get_instance; use tokio::runtime::Runtime; use tokio::time::Duration; diff --git a/tembo-cli/src/cmd/validate.rs b/tembo-cli/src/cmd/validate.rs index 6dfb627b2..a658ffed9 100644 --- a/tembo-cli/src/cmd/validate.rs +++ b/tembo-cli/src/cmd/validate.rs @@ -173,7 +173,7 @@ pub fn validate_config( } fn validate_environment(env: &str, section: &str, verbose: bool) -> Result<(), anyhow::Error> { - match temboclient::models::Environment::from_str(env) { + match tembo_api_client::models::Environment::from_str(env) { std::result::Result::Ok(_) => { if verbose { white_confirmation(&format!( @@ -191,7 +191,7 @@ fn validate_environment(env: &str, section: &str, verbose: bool) -> Result<(), a } fn validate_cpu(cpu: &str, section: &str, verbose: bool) -> Result<(), anyhow::Error> { - match temboclient::models::Cpu::from_str(cpu) { + match tembo_api_client::models::Cpu::from_str(cpu) { std::result::Result::Ok(_) => { if verbose { info(&format!("Cpu '{}' in section '{}' is valid", cpu, section)); @@ -206,7 +206,7 @@ fn validate_cpu(cpu: &str, section: &str, verbose: bool) -> Result<(), anyhow::E } fn validate_memory(memory: &str, section: &str, verbose: bool) -> Result<(), anyhow::Error> { - match temboclient::models::Memory::from_str(memory) { + match tembo_api_client::models::Memory::from_str(memory) { std::result::Result::Ok(_) => { if verbose { info(&format!( @@ -224,7 +224,7 @@ fn validate_memory(memory: &str, section: &str, verbose: bool) -> Result<(), any } fn validate_storage(storage: &str, section: &str, verbose: bool) -> Result<(), anyhow::Error> { - match temboclient::models::Storage::from_str(storage) { + match tembo_api_client::models::Storage::from_str(storage) { std::result::Result::Ok(_) => { if verbose { info(&format!( @@ -271,7 +271,7 @@ fn validate_stack_type( section: &str, verbose: bool, ) -> Result<(), anyhow::Error> { - match temboclient::models::StackType::from_str(stack_types) { + match tembo_api_client::models::StackType::from_str(stack_types) { std::result::Result::Ok(_) => { if verbose { info(&format!( diff --git a/tembo-cli/temboclient/README.md b/tembo-cli/temboclient/README.md deleted file mode 100644 index be3d261c4..000000000 --- a/tembo-cli/temboclient/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# 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) - - [AppTypeOneOf3](docs/AppTypeOneOf3.md) - - [AppTypeOneOf4](docs/AppTypeOneOf4.md) - - [AppTypeOneOf5](docs/AppTypeOneOf5.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) - - [IngressType](docs/IngressType.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/src/apis/app_api.rs b/tembo-cli/temboclient/src/apis/app_api.rs deleted file mode 100644 index a8bee2628..000000000 --- a/tembo-cli/temboclient/src/apis/app_api.rs +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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 super::{configuration, Error}; -use crate::apis::ResponseContent; - -/// 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/instance_api.rs b/tembo-cli/temboclient/src/apis/instance_api.rs deleted file mode 100644 index d49096d96..000000000 --- a/tembo-cli/temboclient/src/apis/instance_api.rs +++ /dev/null @@ -1,530 +0,0 @@ -/* - * 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 super::{configuration, Error}; -use crate::apis::ResponseContent; -use crate::models::InstanceEvent; - -/// 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/stack_api.rs b/tembo-cli/temboclient/src/apis/stack_api.rs deleted file mode 100644 index 056432e32..000000000 --- a/tembo-cli/temboclient/src/apis/stack_api.rs +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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 super::{configuration, Error}; -use crate::apis::ResponseContent; -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.to_string()); - 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/models/cpu.rs b/tembo-cli/temboclient/src/models/cpu.rs deleted file mode 100644 index 14131897b..000000000 --- a/tembo-cli/temboclient/src/models/cpu.rs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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 = "0.25")] - Variant0Period25, - #[serde(rename = "0.5")] - Variant0Period5, - #[serde(rename = "1")] - Variant1, - #[serde(rename = "2")] - Variant2, - #[serde(rename = "4")] - Variant4, - #[serde(rename = "6")] - Variant6, - #[serde(rename = "8")] - Variant8, - #[serde(rename = "12")] - Variant12, - #[serde(rename = "16")] - Variant16, - #[serde(rename = "32")] - Variant32, -} - -impl ToString for Cpu { - fn to_string(&self) -> String { - match self { - Self::Variant0Period25 => String::from("0.25"), - Self::Variant0Period5 => String::from("0.5"), - Self::Variant1 => String::from("1"), - Self::Variant2 => String::from("2"), - Self::Variant4 => String::from("4"), - Self::Variant6 => String::from("6"), - Self::Variant8 => String::from("8"), - Self::Variant12 => String::from("12"), - Self::Variant16 => String::from("16"), - Self::Variant32 => String::from("32"), - } - } -} - -impl Default for Cpu { - fn default() -> Cpu { - Self::Variant0Period25 - } -} diff --git a/tembo-cli/temboclient/src/models/memory.rs b/tembo-cli/temboclient/src/models/memory.rs deleted file mode 100644 index 933fb0237..000000000 --- a/tembo-cli/temboclient/src/models/memory.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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, - #[serde(rename = "64Gi")] - Variant64Gi, -} - -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"), - Self::Variant64Gi => String::from("64Gi"), - } - } -} - -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 deleted file mode 100644 index 4d6a3d84d..000000000 --- a/tembo-cli/temboclient/src/models/middleware.rs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 - */ - -/// Middleware : Midddleware is used to configure the middleware for the appService. This is specifically configured for the ingress controller Traefik. Please refer to the example in the `AppService` documentation. - -#[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 { - /// Midddleware is used to configure the middleware for the appService. This is specifically configured for the ingress controller Traefik. Please refer to the example in the `AppService` documentation. - 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/update_instance.rs b/tembo-cli/temboclient/src/models/update_instance.rs deleted file mode 100644 index 107ca765a..000000000 --- a/tembo-cli/temboclient/src/models/update_instance.rs +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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/tests/integration_tests_cloud.rs b/tembo-cli/tests/integration_tests_cloud.rs index 889a5eebd..696c5c502 100644 --- a/tembo-cli/tests/integration_tests_cloud.rs +++ b/tembo-cli/tests/integration_tests_cloud.rs @@ -10,9 +10,9 @@ use tembo::cli::context::{ get_current_context, tembo_context_file_path, tembo_credentials_file_path, Environment, CONTEXT_EXAMPLE_TEXT, CREDENTIALS_EXAMPLE_TEXT, }; -use temboclient::apis::configuration::Configuration; -use temboclient::apis::instance_api::get_all; -use temboclient::models::{Instance, State}; +use tembo_api_client::apis::configuration::Configuration; +use tembo_api_client::apis::instance_api::get_all; +use tembo_api_client::models::{Instance, State}; const CARGO_BIN: &str = "tembo"; @@ -192,7 +192,6 @@ pub async fn get_instance( env: &Environment, ) -> Result, anyhow::Error> { let v = get_all(config, env.org_id.clone().unwrap().as_str()).await; - println!("OrgID: {}", env.org_id.clone().unwrap().as_str()); match v {