From 7ab3eb38573f3d41053d70afe73babf2dece9426 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Thu, 26 Mar 2026 21:41:09 +0000 Subject: [PATCH] ## Python SDK Changes: * `latitudesh.kubernetes_clusters.update_kubernetes_cluster()`: **Added** * `latitudesh.kubernetes_clusters.get_kubernetes_cluster()`: `response.data.attributes.worker_status` **Added** --- .speakeasy/gen.lock | 189 ++++++++++++-- .speakeasy/gen.yaml | 2 +- .speakeasy/workflow.lock | 10 +- README-PYPI.md | 3 +- README.md | 3 +- RELEASES.md | 12 +- .../models/kubernetesclusterdataattributes.md | 53 ++-- .../models/kubernetesclusterupdateresponse.md | 8 + ...bernetesclusterupdateresponseattributes.md | 10 + .../kubernetesclusterupdateresponsedata.md | 10 + .../kubernetesclusterupdateresponsestatus.md | 19 ++ .../kubernetesclusterupdateresponsetype.md | 16 ++ docs/models/updatekubernetescluster.md | 8 + .../updatekubernetesclusterattributes.md | 9 + docs/models/updatekubernetesclusterdata.md | 9 + docs/models/updatekubernetesclusterrequest.md | 9 + docs/models/updatekubernetesclustertype.md | 16 ++ docs/models/workerstatus.md | 21 ++ docs/sdks/kubernetesclusterssdk/README.md | 202 +++++++++++++++ pyproject.toml | 2 +- src/latitudesh_python_sdk/_version.py | 4 +- .../kubernetes_clusters_sdk.py | 234 ++++++++++++++++++ src/latitudesh_python_sdk/models/__init__.py | 60 +++++ .../models/kubernetes_cluster_data.py | 16 ++ .../kubernetes_cluster_update_response.py | 111 +++++++++ .../models/update_kubernetes_cluster.py | 76 ++++++ .../models/update_kubernetes_clusterop.py | 32 +++ 27 files changed, 1083 insertions(+), 61 deletions(-) create mode 100644 docs/models/kubernetesclusterupdateresponse.md create mode 100644 docs/models/kubernetesclusterupdateresponseattributes.md create mode 100644 docs/models/kubernetesclusterupdateresponsedata.md create mode 100644 docs/models/kubernetesclusterupdateresponsestatus.md create mode 100644 docs/models/kubernetesclusterupdateresponsetype.md create mode 100644 docs/models/updatekubernetescluster.md create mode 100644 docs/models/updatekubernetesclusterattributes.md create mode 100644 docs/models/updatekubernetesclusterdata.md create mode 100644 docs/models/updatekubernetesclusterrequest.md create mode 100644 docs/models/updatekubernetesclustertype.md create mode 100644 docs/models/workerstatus.md create mode 100644 src/latitudesh_python_sdk/models/kubernetes_cluster_update_response.py create mode 100644 src/latitudesh_python_sdk/models/update_kubernetes_cluster.py create mode 100644 src/latitudesh_python_sdk/models/update_kubernetes_clusterop.py diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 03e7e4b..dca0dd1 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 97e9fd40-98a0-465e-9d1a-259beac76207 management: - docChecksum: 3404b60e194d6b75271b4ce9a1842078 + docChecksum: 0dd2511cc09a9936242b34a1eb15b8da docVersion: "2023-06-01" speakeasyVersion: 1.759.3 generationVersion: 2.869.25 - releaseVersion: 3.0.0 - configChecksum: 6263c7876c27d4c899c234b9b8600ef4 + releaseVersion: 3.0.1 + configChecksum: 63ab1037b38ffb76c6d5873e86175b4b repoURL: https://github.com/latitudesh/latitudesh-python-sdk.git installationURL: https://github.com/latitudesh/latitudesh-python-sdk.git published: true persistentEdits: - generation_id: 65d2f58b-8ba9-40ac-a5dd-31133df90e81 - pristine_commit_hash: 9b8a55bf7af25e4597f48745a7638ebb1964ad65 - pristine_tree_hash: 3c793324c01cdbe5a0b8c46d94d46d140779734d + generation_id: 4744fe79-9f3e-464f-8757-53003139354e + pristine_commit_hash: f329b28c4ea0405a2c8d1934a94a0b4a79ee1b2d + pristine_tree_hash: 63d60d086d62de450e9150a847b3d65258763c00 features: python: additionalDependencies: 1.0.0 @@ -1185,8 +1185,8 @@ trackedFiles: pristine_git_object: 32bb9e100a604e833c5e773c56bf031496fdd6b7 docs/models/kubernetesclusterdataattributes.md: id: 476ffdb69ddc - last_write_checksum: sha1:8104e1db2bc050678d798bb54effe0cfd094f177 - pristine_git_object: 12703d475da2d7396e22634d0456b063c07048f7 + last_write_checksum: sha1:f9da5645158bf85f91e7475f09dd46732eeeba11 + pristine_git_object: cea3e34b0b9c796ed138f156f859a93b51c3df5e docs/models/kubernetesclusterdataattributesstatus.md: id: 08b7319aa496 last_write_checksum: sha1:047f12634039164316f3c7f9107dce0e5c7c99f3 @@ -1243,6 +1243,26 @@ trackedFiles: id: ac09af88da64 last_write_checksum: sha1:89f6f60781864e06e98912c5239d89327797b4c4 pristine_git_object: d3725b8ec697881eb29ac1596936c353c6f1faed + docs/models/kubernetesclusterupdateresponse.md: + id: 83d219a740d2 + last_write_checksum: sha1:d4887e3f59cbebf24e8a3838bb451f97cd7cec8b + pristine_git_object: 8e0fc13d5223473a1c8722a2c1de0a7d697a514a + docs/models/kubernetesclusterupdateresponseattributes.md: + id: 42b7ca98ecf3 + last_write_checksum: sha1:fce57552c30308de17cbd8ef5484661e2a538dc4 + pristine_git_object: 331c46d9e2828b6c1070e0ce8f4d8c6a38de0b9b + docs/models/kubernetesclusterupdateresponsedata.md: + id: 83d56ce8a5b2 + last_write_checksum: sha1:8ce043be80cf75e6a38de902cfda6d10c9734efb + pristine_git_object: 7bd1cd15d21e86de77cf8c6becb2a6c89fcc9009 + docs/models/kubernetesclusterupdateresponsestatus.md: + id: cbe0769dfde3 + last_write_checksum: sha1:0608576caa90fc0145768b6b98cd826afe1e8ba6 + pristine_git_object: e465fd833c1ee51edc817e4acebc7082ca99df0a + docs/models/kubernetesclusterupdateresponsetype.md: + id: d7c29f0fae92 + last_write_checksum: sha1:bb1ebc7434f2a762eba5e548f686f458e8f0d884 + pristine_git_object: 70c666a06b63aba83365f5e1422ddc2a27ec93ac docs/models/listelasticipsrequest.md: id: cda27b1db137 last_write_checksum: sha1:dc4fcb8419631e41fa1fa277b2b9b8d9a29a35eb @@ -2323,6 +2343,26 @@ trackedFiles: id: 6460d7c11c2f last_write_checksum: sha1:28b1f36f001b1905839aeefeaee9c9eba20dbc16 pristine_git_object: 16f831bba379825bda300bdac5d6390e53e40c53 + docs/models/updatekubernetescluster.md: + id: d74e4268663a + last_write_checksum: sha1:f661d49b2f70625e31b7038136ea0e8065903e28 + pristine_git_object: 195d71e2d3933fbb8f4c4bb0c388a16a907ae4d6 + docs/models/updatekubernetesclusterattributes.md: + id: 0d64a8af979f + last_write_checksum: sha1:19ee0af8c6ac2c716c417e2b1a563d9683de2300 + pristine_git_object: 487c9de72aab0f3aaf017acc2619701842c7a64c + docs/models/updatekubernetesclusterdata.md: + id: 9c0e4a598432 + last_write_checksum: sha1:2db12ff3f1a7a63e29a62abb7df755fa42edc9eb + pristine_git_object: 3b6d39d495f0ff9a6ffcc7ec031df421e151a5e3 + docs/models/updatekubernetesclusterrequest.md: + id: b4e7cf18dfd5 + last_write_checksum: sha1:489637b2f7d89538d5d3f9c11dbb207c03496dfd + pristine_git_object: c12bf98db6362fb2c80edb1e8791161e1322bb70 + docs/models/updatekubernetesclustertype.md: + id: cff04e8415fa + last_write_checksum: sha1:4dc82f9de2a788c066876f4ac77d58e817f37a95 + pristine_git_object: 185bd163df16f5fd396691c7160bab03cb3acdd4 docs/models/updateplansbandwidthplansattributes.md: id: db68fbe596da last_write_checksum: sha1:6667fa482ec6add94de642248c5372617d8e29e7 @@ -2799,6 +2839,10 @@ trackedFiles: id: e1c419105efc last_write_checksum: sha1:20d7352577488fda6aa9ca713c3d8a87a6d10678 pristine_git_object: 3084bf1ef2cf3203678bb0acce6f90a775b4d30a + docs/models/workerstatus.md: + id: 571aceff5d27 + last_write_checksum: sha1:e2f433d978087c6537c16c7b24bef213b9db908b + pristine_git_object: b16a0b37e387bcfae18e6274ffd3d9ea83894b32 docs/sdks/apikeyssdk/README.md: id: 41baa8640d8a last_write_checksum: sha1:07512923a97b8fa3ea8197c04452987b007dd03b @@ -2825,8 +2869,8 @@ trackedFiles: pristine_git_object: 495af181eae515a187c909b4220d2e4acb64d71d docs/sdks/kubernetesclusterssdk/README.md: id: 146c991cc428 - last_write_checksum: sha1:9c4b8383304cade4ce04dcfa990c707b90ff4b23 - pristine_git_object: 8566152d70a23ebe70e16e1c695e1b5fc1bc75d2 + last_write_checksum: sha1:75d89b7920e9bd693afd94aacae30f04878f7b3a + pristine_git_object: f31f205ab427f0a96131904f9609bd42dd1d3b6f docs/sdks/operatingsystemssdk/README.md: id: 7ec5e73ce22f last_write_checksum: sha1:4aba6b170e8ed0b43d13fe735ec6980ed367f05e @@ -2909,8 +2953,8 @@ trackedFiles: pristine_git_object: 250e4a286482ffcc3629575515a40adcb44a2702 pyproject.toml: id: 5d07e7d72637 - last_write_checksum: sha1:7c848a8e13ed99e59c8499f9fbe0150d972fceb7 - pristine_git_object: 540a2e3c206f3c3971b59fe2c53ec894f31a4e37 + last_write_checksum: sha1:4cd8b15dc95d2652f16eefe9ad0f6330603145af + pristine_git_object: 140f6be573a61e2677ef791a1c93544ee306e3d4 scripts/prepare_readme.py: id: e0c5957a6035 last_write_checksum: sha1:5354f07fd2821a42340f1573b7f3e029b8a852e1 @@ -2937,8 +2981,8 @@ trackedFiles: pristine_git_object: 403c936eb3b6407be163aeedfcdce9c4d83072d7 src/latitudesh_python_sdk/_version.py: id: 65dde1ef31c9 - last_write_checksum: sha1:c890add9866e2c2ef047c5fc3fe314cdd2495951 - pristine_git_object: cf36e0ae27f4337b954780831a0899f364454692 + last_write_checksum: sha1:880ee85be236a4b36eb07f2399122c3de9271e15 + pristine_git_object: 08a74a266cbd3e13c072f3b925015a71f779ce53 src/latitudesh_python_sdk/apikeys_sdk.py: id: 633cbc9c65bd last_write_checksum: sha1:fc62d31144c7c0aeeb5a1ea1d84b3f36b42b94ec @@ -2973,12 +3017,12 @@ trackedFiles: pristine_git_object: 5e37cc2428e0080be627cc3f21c744b7ec37aef7 src/latitudesh_python_sdk/kubernetes_clusters_sdk.py: id: 9ab3b75263fa - last_write_checksum: sha1:6d77d941eeb767f8461f1b9bcd85172b4a960f46 - pristine_git_object: 178b858024bbad814c63c44716c38a6a150ed10b + last_write_checksum: sha1:87f3b5555c4a793f7b16f9fae0a62a57326f3614 + pristine_git_object: 4102b39776a615b072e7496fb964ad852f3c0c8e src/latitudesh_python_sdk/models/__init__.py: id: 7f64ed71d43c - last_write_checksum: sha1:5ae6b463e39b05192368b43d1de2d69676fc4e4e - pristine_git_object: 2591308ce6dd57809b5919b53da9f6f0f145e34c + last_write_checksum: sha1:b8a0fd234020d2a10bdda253ea5292e755a143f9 + pristine_git_object: e4cb2dd3c2a882602d3dfb87241d9b5b9f4fbd8f src/latitudesh_python_sdk/models/api_key.py: id: c61bf1d38797 last_write_checksum: sha1:7f2a209ff9e0d3a9a8d928690d7b302c03a4f069 @@ -3421,8 +3465,8 @@ trackedFiles: pristine_git_object: 32047e9fdf1e31d82d9bb43b885ba940e0e26ab1 src/latitudesh_python_sdk/models/kubernetes_cluster_data.py: id: b946331359c8 - last_write_checksum: sha1:25033bdddce36751f3a73d19c6c1446195c2524c - pristine_git_object: f872d9dcaaa49c348cd3fc3aefda061c49d71c01 + last_write_checksum: sha1:ca042a1bdb5738e301520971e4b8f6db6def6ec9 + pristine_git_object: 27a3b313419fcbe0cfada5a3f409c25af57f109e src/latitudesh_python_sdk/models/kubernetes_cluster_kubeconfig.py: id: 0570f1cedd22 last_write_checksum: sha1:396a6626c2d79d1f51c2f264e99954145402b974 @@ -3431,6 +3475,10 @@ trackedFiles: id: abaca11e2aa6 last_write_checksum: sha1:8b5d380c837fe8162372602df685b55f10d4c935 pristine_git_object: 639a44c033e7467eaefd96164079adc72565bd4d + src/latitudesh_python_sdk/models/kubernetes_cluster_update_response.py: + id: 3331fb252cee + last_write_checksum: sha1:ffdd6ff5dbac6d01aaf99ed8ecb9c57780d9a04b + pristine_git_object: c4a7d29a2d06a37a0075ff8ca24aaabe23c07401 src/latitudesh_python_sdk/models/kubernetes_clusters.py: id: 41344adf0a95 last_write_checksum: sha1:81aabd4b49e95c2405163627e0d83b9ed68208ca @@ -3727,6 +3775,14 @@ trackedFiles: id: 0a4ece4943a3 last_write_checksum: sha1:7953f08aad90ee676357d0b8aed00728e2c1e7ef pristine_git_object: 25e9221cb21918da7303b7eba1e7575d11351b0e + src/latitudesh_python_sdk/models/update_kubernetes_cluster.py: + id: 5ed99f13faf7 + last_write_checksum: sha1:b38728243d7965e93de16dc1ad110b4d8fd57b3e + pristine_git_object: b177953cf3873a538ae515f7e6cfb79f91aa5502 + src/latitudesh_python_sdk/models/update_kubernetes_clusterop.py: + id: 800b1421f7dc + last_write_checksum: sha1:a36c2477017f1f71408c2765cbeb6ba6aa1be7cd + pristine_git_object: 2a1172d1a92d582345ada750b1a512f08b8578d2 src/latitudesh_python_sdk/models/update_plans_bandwidthop.py: id: 6c94d7ac4ffa last_write_checksum: sha1:39b492bcf5d52c78e807aa3ec045003ea0491bb1 @@ -6969,14 +7025,14 @@ examples: kubernetes_cluster_id: "" responses: "200": - application/vnd.api+json: {"data": {"id": "kc_pRMLydp0dQKr1", "type": "kubernetes_clusters", "attributes": {"name": "my-cluster", "phase": "Provisioned", "ready": true, "control_plane_endpoint": "https://api.my-cluster.example.com:6443", "kubeconfig_url": "/kubernetes_clusters/kc_pRMLydp0dQKr1/kubeconfig", "location": "SAN3", "load_balancer_ips": ["10.0.0.1"], "kubernetes_version": "v1.34.3+rke2r1", "created_at": "2026-01-15T10:30:00Z", "plan": "c3-small-x86", "worker_plan": "c3-medium-x86", "control_plane_count": 1, "worker_count": 1, "control_plane": {"ready": true, "replicas": 1, "ready_replicas": 1}, "workers": {"replicas": 1, "ready_replicas": 1, "available_replicas": 1}, "infrastructure_ready": true, "control_plane_ready": true, "message": "Cluster is ready", "steps": [{"name": "infrastructure", "status": "completed"}, {"name": "control_plane", "status": "completed"}, {"name": "workers", "status": "completed"}], "last_status_change": "2026-01-15T10:35:00Z", "failure_message": null, "failure_reason": null, "nodes": [{"id": "my-cluster-control-plane-abc12", "name": "my-cluster-control-plane-abc12", "hostname": "my-cluster-control-plane-abc12", "server_id": "sv_RLYV8DZ2D5QoE", "type": "control_plane", "status": "ready", "ip": "203.0.113.10", "internal_ip": "10.0.0.10", "external_ip": "203.0.113.10"}, {"id": "my-cluster-md-0-def34", "name": "my-cluster-md-0-def34", "hostname": "my-cluster-md-0-def34", "server_id": "sv_7KP2Xm9nYwR3Q", "type": "worker", "status": "ready", "ip": "203.0.113.20", "internal_ip": "10.0.0.20", "external_ip": "203.0.113.20"}], "project": {"id": "proj_6059EqYkOQj8p", "name": "My Project", "slug": "my-project"}}}} + application/vnd.api+json: {"data": {"id": "kc_pRMLydp0dQKr1", "type": "kubernetes_clusters", "attributes": {"name": "my-cluster", "phase": "Provisioned", "ready": true, "control_plane_endpoint": "https://api.my-cluster.example.com:6443", "kubeconfig_url": "/kubernetes_clusters/kc_pRMLydp0dQKr1/kubeconfig", "location": "SAN3", "load_balancer_ips": ["10.0.0.1"], "kubernetes_version": "v1.34.3+rke2r1", "created_at": "2026-01-15T10:30:00Z", "plan": "c3-small-x86", "worker_plan": "c3-medium-x86", "control_plane_count": 1, "worker_count": 1, "control_plane": {"ready": true, "replicas": 1, "ready_replicas": 1}, "workers": {"replicas": 1, "ready_replicas": 1, "available_replicas": 1}, "worker_status": "ready", "infrastructure_ready": true, "control_plane_ready": true, "message": "Cluster is ready", "steps": [{"name": "infrastructure", "status": "completed"}, {"name": "control_plane", "status": "completed"}, {"name": "workers", "status": "completed"}], "last_status_change": "2026-01-15T10:35:00Z", "failure_message": null, "failure_reason": null, "nodes": [{"id": "my-cluster-control-plane-abc12", "name": "my-cluster-control-plane-abc12", "hostname": "my-cluster-control-plane-abc12", "server_id": "sv_RLYV8DZ2D5QoE", "type": "control_plane", "status": "ready", "ip": "203.0.113.10", "internal_ip": "10.0.0.10", "external_ip": "203.0.113.10"}, {"id": "my-cluster-md-0-def34", "name": "my-cluster-md-0-def34", "hostname": "my-cluster-md-0-def34", "server_id": "sv_7KP2Xm9nYwR3Q", "type": "worker", "status": "ready", "ip": "203.0.113.20", "internal_ip": "10.0.0.20", "external_ip": "203.0.113.20"}], "project": {"id": "proj_6059EqYkOQj8p", "name": "My Project", "slug": "my-project"}}}} Provisioning: parameters: path: kubernetes_cluster_id: "" responses: "200": - application/vnd.api+json: {"data": {"id": "kc_pRMLydp0dQKr1", "type": "kubernetes_clusters", "attributes": {"name": "my-cluster", "phase": "Provisioning", "ready": false, "control_plane_endpoint": null, "kubeconfig_url": null, "location": "SAN3", "load_balancer_ips": [], "kubernetes_version": "v1.34.3+rke2r1", "created_at": "2026-01-15T10:30:00Z", "plan": "c3-small-x86", "worker_plan": "c3-medium-x86", "control_plane_count": 1, "worker_count": 0, "control_plane": {"ready": false, "replicas": 1, "ready_replicas": 0}, "workers": null, "infrastructure_ready": false, "control_plane_ready": false, "message": "Setting up cluster infrastructure", "steps": [{"name": "infrastructure", "status": "in_progress"}, {"name": "control_plane", "status": "pending"}, {"name": "workers", "status": "pending"}], "last_status_change": "2026-01-15T10:32:00Z", "failure_message": null, "failure_reason": null, "nodes": [{"id": "my-cluster-control-plane-xyz78", "name": "my-cluster-control-plane-xyz78", "hostname": null, "server_id": null, "type": "control_plane", "status": "pending", "ip": null, "internal_ip": null, "external_ip": null}], "project": {"id": "proj_6059EqYkOQj8p", "name": "My Project", "slug": "my-project"}}}} + application/vnd.api+json: {"data": {"id": "kc_pRMLydp0dQKr1", "type": "kubernetes_clusters", "attributes": {"name": "my-cluster", "phase": "Provisioning", "ready": false, "control_plane_endpoint": null, "kubeconfig_url": null, "location": "SAN3", "load_balancer_ips": [], "kubernetes_version": "v1.34.3+rke2r1", "created_at": "2026-01-15T10:30:00Z", "plan": "c3-small-x86", "worker_plan": "c3-medium-x86", "control_plane_count": 1, "worker_count": 0, "control_plane": {"ready": false, "replicas": 1, "ready_replicas": 0}, "workers": null, "worker_status": null, "infrastructure_ready": false, "control_plane_ready": false, "message": "Setting up cluster infrastructure", "steps": [{"name": "infrastructure", "status": "in_progress"}, {"name": "control_plane", "status": "pending"}, {"name": "workers", "status": "pending"}], "last_status_change": "2026-01-15T10:32:00Z", "failure_message": null, "failure_reason": null, "nodes": [{"id": "my-cluster-control-plane-xyz78", "name": "my-cluster-control-plane-xyz78", "hostname": null, "server_id": null, "type": "control_plane", "status": "pending", "ip": null, "internal_ip": null, "external_ip": null}], "project": {"id": "proj_6059EqYkOQj8p", "name": "My Project", "slug": "my-project"}}}} InvalidToken: parameters: path: @@ -7120,9 +7176,96 @@ examples: responses: "200": application/vnd.api+json: {"data": {"id": "vm_7vYAZqGBdMQ94", "type": "virtual_machines", "attributes": {"name": "my-updated-vm", "created_at": "2026-01-14T15:57:15+00:00", "status": "Running", "primary_ipv4": "10.0.0.25", "operating_system": null, "plan": {"id": "plan_VE1Wd3VQOXnZJ", "name": "c3.small.x86-143"}, "specs": {"vcpu": 16, "ram": "128 GB", "storage": "100 GB", "nic": "1 x 1 Gbps", "gpu": "1 x NVIDIA H100 Tensor Core GPU"}, "team": {"id": "team_GpZboxNev1U2pxpmKwWAc8e01vpp", "name": "702 Team", "slug": "702-team", "description": "702 Team", "address": "Suite 729 8171 Albina Forges, Eldridgeberg, CA 26345-3293", "currency": {}, "status": "verified"}, "project": {"id": "proj_W6Q2D9ZQOKLpr", "name": "Aerodynamic Wool Watch", "slug": "aerodynamic-wool-watch", "description": "Intelligent Paper Shirt", "billing_type": "Normal", "billing_method": "Normal", "bandwidth_alert": false, "environment": null, "billing": {"subscription_id": null, "type": "Normal", "method": "Normal"}, "stats": {"ip_addresses": 0, "prefixes": 0, "servers": 0, "vlans": 0}}}}} + update-kubernetes-cluster: + ScaleUp: + parameters: + path: + kubernetes_cluster_id: "" + requestBody: + application/vnd.api+json: {"data": {"type": "kubernetes_clusters", "attributes": {"worker_count": 5}}} + responses: + "200": + application/vnd.api+json: {} + "400": + application/vnd.api+json: {} + "503": + application/vnd.api+json: {} + ScaleDown: + parameters: + path: + kubernetes_cluster_id: "" + requestBody: + application/vnd.api+json: {"data": {"type": "kubernetes_clusters", "attributes": {"worker_count": 2}}} + responses: + "200": + application/vnd.api+json: {} + "400": + application/vnd.api+json: {} + "503": + application/vnd.api+json: {} + ScaleFromZero: + parameters: + path: + kubernetes_cluster_id: "" + requestBody: + application/vnd.api+json: {"data": {"type": "kubernetes_clusters", "attributes": {"worker_count": 3, "worker_plan": "c3-small-x86"}}} + responses: + "200": + application/vnd.api+json: {} + "400": + application/vnd.api+json: {} + "503": + application/vnd.api+json: {} + ScaleToZero: + parameters: + path: + kubernetes_cluster_id: "" + requestBody: + application/vnd.api+json: {"data": {"type": "kubernetes_clusters", "attributes": {"worker_count": 0}}} + responses: + "200": + application/vnd.api+json: {} + "400": + application/vnd.api+json: {} + "503": + application/vnd.api+json: {} + Unchanged: + parameters: + path: + kubernetes_cluster_id: "" + requestBody: + application/vnd.api+json: {"data": {"type": "kubernetes_clusters", "attributes": {"worker_count": 204185}}} + responses: + "200": + application/vnd.api+json: {"data": {"type": "kubernetes_clusters", "id": "kc_pRMLydp0dQKr1", "attributes": {"name": "my-cluster", "status": "unchanged", "worker_count": 3}}} + MissingWorkerCount: + parameters: + path: + kubernetes_cluster_id: "" + requestBody: + application/vnd.api+json: {"data": {"type": "kubernetes_clusters", "attributes": {"worker_count": 204185}}} + responses: + "400": + application/vnd.api+json: {"errors": [{"code": "VALIDATION_ERROR"}]} + "503": + application/vnd.api+json: {"errors": [{"code": "VALIDATION_ERROR"}]} + InvalidWorkerCountType: + parameters: + path: + kubernetes_cluster_id: "" + requestBody: + application/vnd.api+json: {"data": {"type": "kubernetes_clusters", "attributes": {"worker_count": 204185}}} + responses: + "400": + application/vnd.api+json: {"errors": [{"code": "VALIDATION_ERROR"}]} + "503": + application/vnd.api+json: {"errors": [{"code": "VALIDATION_ERROR"}]} examplesVersion: 1.0.2 generatedTests: {} -releaseNotes: "## Python SDK Changes:\n* `latitudesh.plans.list_vm_plans()`: `response.data[].attributes` **Changed** (Breaking ⚠️)\n* `latitudesh.private_networks.get()`: `response` **Changed** (Breaking ⚠️)\n* `latitudesh.virtual_machines.create()`: \n * `request.data.attributes.operating_system` **Added**\n * `response.data.attributes` **Changed** (Breaking ⚠️)\n* `latitudesh.servers.unlock()`: `response.data.attributes` **Changed** (Breaking ⚠️)\n* `latitudesh.servers.lock()`: `response.data.attributes` **Changed** (Breaking ⚠️)\n* `latitudesh.servers.update()`: `response.data.attributes` **Changed** (Breaking ⚠️)\n* `latitudesh.servers.get()`: `response.data.attributes` **Changed** (Breaking ⚠️)\n* `latitudesh.servers.create()`: `response.data.attributes` **Changed** (Breaking ⚠️)\n* `latitudesh.servers.list()`: `response.data[].attributes` **Changed** (Breaking ⚠️)\n* `latitudesh.storage.get_storage_objects()`: **Added**\n* `latitudesh.firewalls.update()`: \n * `request.data.attributes.rules[].description` **Added**\n * `response.data.attributes.rules[].description` **Added**\n* `latitudesh.storage.post_storage_objects()`: **Added**\n* `latitudesh.storage.get_storage_object()`: **Added**\n* `latitudesh.storage.delete_storage_objects()`: **Added**\n* `latitudesh.virtual_machines.update_virtual_machine()`: **Added**\n* `latitudesh.plans.get_containers_plan()`: **Removed** (Breaking ⚠️)\n* `latitudesh.api_keys.list()`: `response` **Changed**\n* `latitudesh.api_keys.create()`: `response.data.attributes.token` **Added**\n* `latitudesh.api_keys.regenerate()`: `response.data.attributes.token` **Added**\n* `latitudesh.api_keys.update_api_key()`: `response.data.attributes.token` **Added**\n* `latitudesh.events.list()`: `response.data[].data[].attributes.properties` **Added**\n* `latitudesh.firewalls.list()`: `response.data[].attributes.rules[].description` **Added**\n* `latitudesh.firewalls.create()`: \n * `request.data.attributes.rules[].description` **Added**\n * `response.data.attributes.rules[].description` **Added**\n* `latitudesh.firewalls.get()`: `response.data.attributes.rules[].description` **Added**\n* `latitudesh.elastic_ips.list_elastic_ips()`: **Added**\n* `latitudesh.kubernetes_clusters.get_kubernetes_cluster_kubeconfig()`: **Added**\n* `latitudesh.kubernetes_clusters.delete_kubernetes_cluster()`: **Added**\n* `latitudesh.kubernetes_clusters.get_kubernetes_cluster()`: **Added**\n* `latitudesh.kubernetes_clusters.create_kubernetes_cluster()`: **Added**\n* `latitudesh.kubernetes_clusters.list_kubernetes_clusters()`: **Added**\n* `latitudesh.elastic_ips.update_elastic_ip()`: **Added**\n* `latitudesh.elastic_ips.delete_elastic_ip()`: **Added**\n* `latitudesh.storage.create_filesystem()`: `error.status[503]` **Added**\n* `latitudesh.storage.post_storage_volumes()`: `error.status[503]` **Added**\n* `latitudesh.tags.create()`: `error.status[422]` **Added**\n* `latitudesh.tags.update()`: `error.status[422]` **Added**\n* `latitudesh.virtual_machines.list()`: `response.status[200].content[application/vnd.api+json` **Added**\n* `latitudesh.elastic_ips.get_elastic_ip()`: **Added**\n* `latitudesh.virtual_machines.get()`: `response.status[200].content[application/vnd.api+json` **Added**\n* `latitudesh.elastic_ips.create_elastic_ip()`: **Added**\n" +releaseNotes: | + ## Python SDK Changes: + * `latitudesh.kubernetes_clusters.update_kubernetes_cluster()`: **Added** + * `latitudesh.kubernetes_clusters.get_kubernetes_cluster()`: `response.data.attributes.worker_status` **Added** generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 831c2df..a29f3a6 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false python: - version: 3.0.0 + version: 3.0.1 additionalDependencies: dev: {} main: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index c5be331..de60581 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.759.3 sources: Latitude.sh API: sourceNamespace: latitude-sh-api - sourceRevisionDigest: sha256:5783f783695f97f4b1e4831ec8cfe1b53d666afedeeac30966d7e2f54457c20b - sourceBlobDigest: sha256:1deb5d8b3e69a3633e3fea3484adca23edee0fd204bc69afa2aeccf3c080741d + sourceRevisionDigest: sha256:968e4c399c0a971a248292ca786581ac46a56c8ca4b06a57b13e40ad23bb690a + sourceBlobDigest: sha256:f985985d1a086695f64c87f138ff7592af4b6b2721fbc8fa6e8f8b027f2c07bc tags: - latest - "2023-06-01" @@ -11,10 +11,10 @@ targets: latitudesh: source: Latitude.sh API sourceNamespace: latitude-sh-api - sourceRevisionDigest: sha256:5783f783695f97f4b1e4831ec8cfe1b53d666afedeeac30966d7e2f54457c20b - sourceBlobDigest: sha256:1deb5d8b3e69a3633e3fea3484adca23edee0fd204bc69afa2aeccf3c080741d + sourceRevisionDigest: sha256:968e4c399c0a971a248292ca786581ac46a56c8ca4b06a57b13e40ad23bb690a + sourceBlobDigest: sha256:f985985d1a086695f64c87f138ff7592af4b6b2721fbc8fa6e8f8b027f2c07bc codeSamplesNamespace: latitude-sh-api-python-code-samples - codeSamplesRevisionDigest: sha256:d9d8aa10f442a43e6e8bc88b3bff37ffa757e5a3c0177bd4b798a71836a029f8 + codeSamplesRevisionDigest: sha256:f8faea9d7ea0bbb52b1401dad96ad2b71a9d00444cb48ce564eaca97f11d73e5 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README-PYPI.md b/README-PYPI.md index dfa7f26..607acf1 100644 --- a/README-PYPI.md +++ b/README-PYPI.md @@ -297,6 +297,7 @@ with Latitudesh( * [create_kubernetes_cluster](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/kubernetesclusterssdk/README.md#create_kubernetes_cluster) - Create a Kubernetes Cluster * [get_kubernetes_cluster](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/kubernetesclusterssdk/README.md#get_kubernetes_cluster) - Get a Kubernetes Cluster * [delete_kubernetes_cluster](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/kubernetesclusterssdk/README.md#delete_kubernetes_cluster) - Delete a Kubernetes Cluster +* [update_kubernetes_cluster](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/kubernetesclusterssdk/README.md#update_kubernetes_cluster) - Scale Kubernetes Cluster Workers * [get_kubernetes_cluster_kubeconfig](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/kubernetesclusterssdk/README.md#get_kubernetes_cluster_kubeconfig) - Get Kubernetes Cluster Kubeconfig ### [OperatingSystems](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/docs/sdks/operatingsystemssdk/README.md) @@ -590,7 +591,7 @@ with Latitudesh( **Inherit from [`LatitudeshError`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/latitudesherror.py)**: -* [`ErrorObject`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/errorobject.py): Applicable to 17 of 127 methods.* +* [`ErrorObject`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/errorobject.py): Applicable to 18 of 128 methods.* * [`ResponseValidationError`](https://github.com/latitudesh/latitudesh-python-sdk/blob/master/./src/latitudesh_python_sdk/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute. diff --git a/README.md b/README.md index 55269be..62d20a5 100644 --- a/README.md +++ b/README.md @@ -297,6 +297,7 @@ with Latitudesh( * [create_kubernetes_cluster](docs/sdks/kubernetesclusterssdk/README.md#create_kubernetes_cluster) - Create a Kubernetes Cluster * [get_kubernetes_cluster](docs/sdks/kubernetesclusterssdk/README.md#get_kubernetes_cluster) - Get a Kubernetes Cluster * [delete_kubernetes_cluster](docs/sdks/kubernetesclusterssdk/README.md#delete_kubernetes_cluster) - Delete a Kubernetes Cluster +* [update_kubernetes_cluster](docs/sdks/kubernetesclusterssdk/README.md#update_kubernetes_cluster) - Scale Kubernetes Cluster Workers * [get_kubernetes_cluster_kubeconfig](docs/sdks/kubernetesclusterssdk/README.md#get_kubernetes_cluster_kubeconfig) - Get Kubernetes Cluster Kubeconfig ### [OperatingSystems](docs/sdks/operatingsystemssdk/README.md) @@ -590,7 +591,7 @@ with Latitudesh( **Inherit from [`LatitudeshError`](./src/latitudesh_python_sdk/models/latitudesherror.py)**: -* [`ErrorObject`](./src/latitudesh_python_sdk/models/errorobject.py): Applicable to 17 of 127 methods.* +* [`ErrorObject`](./src/latitudesh_python_sdk/models/errorobject.py): Applicable to 18 of 128 methods.* * [`ResponseValidationError`](./src/latitudesh_python_sdk/models/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute. diff --git a/RELEASES.md b/RELEASES.md index b849952..350f025 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -116,4 +116,14 @@ Based on: ### Generated - [python v3.0.0] . ### Releases -- [PyPI v3.0.0] https://pypi.org/project/latitudesh-python-sdk/3.0.0 - . \ No newline at end of file +- [PyPI v3.0.0] https://pypi.org/project/latitudesh-python-sdk/3.0.0 - . + +## 2026-03-26 21:39:36 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.759.3 (2.869.25) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v3.0.1] . +### Releases +- [PyPI v3.0.1] https://pypi.org/project/latitudesh-python-sdk/3.0.1 - . \ No newline at end of file diff --git a/docs/models/kubernetesclusterdataattributes.md b/docs/models/kubernetesclusterdataattributes.md index 12703d4..cea3e34 100644 --- a/docs/models/kubernetesclusterdataattributes.md +++ b/docs/models/kubernetesclusterdataattributes.md @@ -3,29 +3,30 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `name` | *Optional[str]* | :heavy_minus_sign: | The cluster name | -| `phase` | [Optional[models.KubernetesClusterDataPhase]](../models/kubernetesclusterdataphase.md) | :heavy_minus_sign: | The current phase of the cluster lifecycle | -| `ready` | *Optional[bool]* | :heavy_minus_sign: | Whether the cluster is ready to accept workloads | -| `control_plane_endpoint` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL endpoint for the Kubernetes API server | -| `kubeconfig_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL to retrieve the kubeconfig file | -| `location` | *Optional[str]* | :heavy_minus_sign: | The site/region where the cluster is deployed | -| `load_balancer_ips` | List[*str*] | :heavy_minus_sign: | IP addresses assigned to the cluster's load balancer | -| `kubernetes_version` | *Optional[str]* | :heavy_minus_sign: | The Kubernetes version running on the cluster | -| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the cluster was created | -| `plan` | *Optional[str]* | :heavy_minus_sign: | The machine plan slug for control plane nodes | -| `worker_plan` | *OptionalNullable[str]* | :heavy_minus_sign: | The machine plan slug for worker nodes. Null if no workers exist. | -| `control_plane_count` | *Optional[int]* | :heavy_minus_sign: | Number of control plane node replicas | -| `worker_count` | *Optional[int]* | :heavy_minus_sign: | Number of worker node replicas. Returns 0 if no workers exist. | -| `control_plane` | [OptionalNullable[models.ControlPlane]](../models/controlplane.md) | :heavy_minus_sign: | Control plane status information | -| `workers` | [OptionalNullable[models.Workers]](../models/workers.md) | :heavy_minus_sign: | Worker nodes status information | -| `infrastructure_ready` | *Optional[bool]* | :heavy_minus_sign: | Whether the underlying infrastructure is ready | -| `control_plane_ready` | *Optional[bool]* | :heavy_minus_sign: | Whether the control plane is ready | -| `message` | *Optional[str]* | :heavy_minus_sign: | Human-readable status message describing the current provisioning state | -| `steps` | List[[models.KubernetesClusterDataSteps](../models/kubernetesclusterdatasteps.md)] | :heavy_minus_sign: | Provisioning progress steps for dashboard display | -| `last_status_change` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Timestamp of the most recent status condition change | -| `failure_message` | *OptionalNullable[str]* | :heavy_minus_sign: | Error message if the cluster has failed | -| `failure_reason` | *OptionalNullable[str]* | :heavy_minus_sign: | Reason code for cluster failure | -| `nodes` | List[[models.Nodes](../models/nodes.md)] | :heavy_minus_sign: | List of nodes (servers) in the cluster | -| `project` | [Optional[models.KubernetesClusterDataProject]](../models/kubernetesclusterdataproject.md) | :heavy_minus_sign: | The project this cluster belongs to | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *Optional[str]* | :heavy_minus_sign: | The cluster name | +| `phase` | [Optional[models.KubernetesClusterDataPhase]](../models/kubernetesclusterdataphase.md) | :heavy_minus_sign: | The current phase of the cluster lifecycle | +| `ready` | *Optional[bool]* | :heavy_minus_sign: | Whether the cluster is ready to accept workloads | +| `control_plane_endpoint` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL endpoint for the Kubernetes API server | +| `kubeconfig_url` | *OptionalNullable[str]* | :heavy_minus_sign: | The URL to retrieve the kubeconfig file | +| `location` | *Optional[str]* | :heavy_minus_sign: | The site/region where the cluster is deployed | +| `load_balancer_ips` | List[*str*] | :heavy_minus_sign: | IP addresses assigned to the cluster's load balancer | +| `kubernetes_version` | *Optional[str]* | :heavy_minus_sign: | The Kubernetes version running on the cluster | +| `created_at` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | When the cluster was created | +| `plan` | *Optional[str]* | :heavy_minus_sign: | The machine plan slug for control plane nodes | +| `worker_plan` | *OptionalNullable[str]* | :heavy_minus_sign: | The machine plan slug for worker nodes. Null if no workers exist. | +| `control_plane_count` | *Optional[int]* | :heavy_minus_sign: | Number of control plane node replicas | +| `worker_count` | *Optional[int]* | :heavy_minus_sign: | Number of worker node replicas. Returns 0 if no workers exist. | +| `control_plane` | [OptionalNullable[models.ControlPlane]](../models/controlplane.md) | :heavy_minus_sign: | Control plane status information | +| `workers` | [OptionalNullable[models.Workers]](../models/workers.md) | :heavy_minus_sign: | Worker nodes status information | +| `worker_status` | [OptionalNullable[models.WorkerStatus]](../models/workerstatus.md) | :heavy_minus_sign: | Current status of worker nodes. 'idle' when 0 workers, 'ready' when all workers are ready, 'scaling' when workers are being provisioned/removed, 'error' when a worker has failed. | +| `infrastructure_ready` | *Optional[bool]* | :heavy_minus_sign: | Whether the underlying infrastructure is ready | +| `control_plane_ready` | *Optional[bool]* | :heavy_minus_sign: | Whether the control plane is ready | +| `message` | *Optional[str]* | :heavy_minus_sign: | Human-readable status message describing the current provisioning state | +| `steps` | List[[models.KubernetesClusterDataSteps](../models/kubernetesclusterdatasteps.md)] | :heavy_minus_sign: | Provisioning progress steps for dashboard display | +| `last_status_change` | [date](https://docs.python.org/3/library/datetime.html#date-objects) | :heavy_minus_sign: | Timestamp of the most recent status condition change | +| `failure_message` | *OptionalNullable[str]* | :heavy_minus_sign: | Error message if the cluster has failed | +| `failure_reason` | *OptionalNullable[str]* | :heavy_minus_sign: | Reason code for cluster failure | +| `nodes` | List[[models.Nodes](../models/nodes.md)] | :heavy_minus_sign: | List of nodes (servers) in the cluster | +| `project` | [Optional[models.KubernetesClusterDataProject]](../models/kubernetesclusterdataproject.md) | :heavy_minus_sign: | The project this cluster belongs to | \ No newline at end of file diff --git a/docs/models/kubernetesclusterupdateresponse.md b/docs/models/kubernetesclusterupdateresponse.md new file mode 100644 index 0000000..8e0fc13 --- /dev/null +++ b/docs/models/kubernetesclusterupdateresponse.md @@ -0,0 +1,8 @@ +# KubernetesClusterUpdateResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `data` | [Optional[models.KubernetesClusterUpdateResponseData]](../models/kubernetesclusterupdateresponsedata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/kubernetesclusterupdateresponseattributes.md b/docs/models/kubernetesclusterupdateresponseattributes.md new file mode 100644 index 0000000..331c46d --- /dev/null +++ b/docs/models/kubernetesclusterupdateresponseattributes.md @@ -0,0 +1,10 @@ +# KubernetesClusterUpdateResponseAttributes + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *Optional[str]* | :heavy_minus_sign: | The cluster name | +| `status` | [Optional[models.KubernetesClusterUpdateResponseStatus]](../models/kubernetesclusterupdateresponsestatus.md) | :heavy_minus_sign: | The update status. 'scaling' indicates worker nodes are being added or removed. 'unchanged' indicates the requested worker_count matches the current count. | +| `worker_count` | *Optional[int]* | :heavy_minus_sign: | The requested number of worker nodes | \ No newline at end of file diff --git a/docs/models/kubernetesclusterupdateresponsedata.md b/docs/models/kubernetesclusterupdateresponsedata.md new file mode 100644 index 0000000..7bd1cd1 --- /dev/null +++ b/docs/models/kubernetesclusterupdateresponsedata.md @@ -0,0 +1,10 @@ +# KubernetesClusterUpdateResponseData + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | +| `type` | [Optional[models.KubernetesClusterUpdateResponseType]](../models/kubernetesclusterupdateresponsetype.md) | :heavy_minus_sign: | N/A | +| `id` | *Optional[str]* | :heavy_minus_sign: | The cluster ID (format: kc_) | +| `attributes` | [Optional[models.KubernetesClusterUpdateResponseAttributes]](../models/kubernetesclusterupdateresponseattributes.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/kubernetesclusterupdateresponsestatus.md b/docs/models/kubernetesclusterupdateresponsestatus.md new file mode 100644 index 0000000..e465fd8 --- /dev/null +++ b/docs/models/kubernetesclusterupdateresponsestatus.md @@ -0,0 +1,19 @@ +# KubernetesClusterUpdateResponseStatus + +The update status. 'scaling' indicates worker nodes are being added or removed. 'unchanged' indicates the requested worker_count matches the current count. + +## Example Usage + +```python +from latitudesh_python_sdk.models import KubernetesClusterUpdateResponseStatus + +value = KubernetesClusterUpdateResponseStatus.SCALING +``` + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `SCALING` | scaling | +| `UNCHANGED` | unchanged | \ No newline at end of file diff --git a/docs/models/kubernetesclusterupdateresponsetype.md b/docs/models/kubernetesclusterupdateresponsetype.md new file mode 100644 index 0000000..70c666a --- /dev/null +++ b/docs/models/kubernetesclusterupdateresponsetype.md @@ -0,0 +1,16 @@ +# KubernetesClusterUpdateResponseType + +## Example Usage + +```python +from latitudesh_python_sdk.models import KubernetesClusterUpdateResponseType + +value = KubernetesClusterUpdateResponseType.KUBERNETES_CLUSTERS +``` + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `KUBERNETES_CLUSTERS` | kubernetes_clusters | \ No newline at end of file diff --git a/docs/models/updatekubernetescluster.md b/docs/models/updatekubernetescluster.md new file mode 100644 index 0000000..195d71e --- /dev/null +++ b/docs/models/updatekubernetescluster.md @@ -0,0 +1,8 @@ +# UpdateKubernetesCluster + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `data` | [models.UpdateKubernetesClusterData](../models/updatekubernetesclusterdata.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatekubernetesclusterattributes.md b/docs/models/updatekubernetesclusterattributes.md new file mode 100644 index 0000000..487c9de --- /dev/null +++ b/docs/models/updatekubernetesclusterattributes.md @@ -0,0 +1,9 @@ +# UpdateKubernetesClusterAttributes + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `worker_count` | *int* | :heavy_check_mark: | Desired number of worker nodes. Must be between 0 and 10. | +| `worker_plan` | *OptionalNullable[str]* | :heavy_minus_sign: | Plan slug for worker nodes. Required when scaling from 0 workers. Ignored when scaling an existing deployment. | \ No newline at end of file diff --git a/docs/models/updatekubernetesclusterdata.md b/docs/models/updatekubernetesclusterdata.md new file mode 100644 index 0000000..3b6d39d --- /dev/null +++ b/docs/models/updatekubernetesclusterdata.md @@ -0,0 +1,9 @@ +# UpdateKubernetesClusterData + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `type` | [models.UpdateKubernetesClusterType](../models/updatekubernetesclustertype.md) | :heavy_check_mark: | N/A | +| `attributes` | [models.UpdateKubernetesClusterAttributes](../models/updatekubernetesclusterattributes.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatekubernetesclusterrequest.md b/docs/models/updatekubernetesclusterrequest.md new file mode 100644 index 0000000..c12bf98 --- /dev/null +++ b/docs/models/updatekubernetesclusterrequest.md @@ -0,0 +1,9 @@ +# UpdateKubernetesClusterRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `kubernetes_cluster_id` | *str* | :heavy_check_mark: | The cluster ID (format: kc_) or cluster name. Both formats are accepted for backward compatibility. | +| `update_kubernetes_cluster` | [models.UpdateKubernetesCluster](../models/updatekubernetescluster.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/updatekubernetesclustertype.md b/docs/models/updatekubernetesclustertype.md new file mode 100644 index 0000000..185bd16 --- /dev/null +++ b/docs/models/updatekubernetesclustertype.md @@ -0,0 +1,16 @@ +# UpdateKubernetesClusterType + +## Example Usage + +```python +from latitudesh_python_sdk.models import UpdateKubernetesClusterType + +value = UpdateKubernetesClusterType.KUBERNETES_CLUSTERS +``` + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `KUBERNETES_CLUSTERS` | kubernetes_clusters | \ No newline at end of file diff --git a/docs/models/workerstatus.md b/docs/models/workerstatus.md new file mode 100644 index 0000000..b16a0b3 --- /dev/null +++ b/docs/models/workerstatus.md @@ -0,0 +1,21 @@ +# WorkerStatus + +Current status of worker nodes. 'idle' when 0 workers, 'ready' when all workers are ready, 'scaling' when workers are being provisioned/removed, 'error' when a worker has failed. + +## Example Usage + +```python +from latitudesh_python_sdk.models import WorkerStatus + +value = WorkerStatus.IDLE +``` + + +## Values + +| Name | Value | +| --------- | --------- | +| `IDLE` | idle | +| `READY` | ready | +| `SCALING` | scaling | +| `ERROR` | error | \ No newline at end of file diff --git a/docs/sdks/kubernetesclusterssdk/README.md b/docs/sdks/kubernetesclusterssdk/README.md index 8566152..f31f205 100644 --- a/docs/sdks/kubernetesclusterssdk/README.md +++ b/docs/sdks/kubernetesclusterssdk/README.md @@ -8,6 +8,7 @@ * [create_kubernetes_cluster](#create_kubernetes_cluster) - Create a Kubernetes Cluster * [get_kubernetes_cluster](#get_kubernetes_cluster) - Get a Kubernetes Cluster * [delete_kubernetes_cluster](#delete_kubernetes_cluster) - Delete a Kubernetes Cluster +* [update_kubernetes_cluster](#update_kubernetes_cluster) - Scale Kubernetes Cluster Workers * [get_kubernetes_cluster_kubeconfig](#get_kubernetes_cluster_kubeconfig) - Get Kubernetes Cluster Kubeconfig ## list_kubernetes_clusters @@ -276,6 +277,207 @@ with Latitudesh( | models.ErrorObject | 401, 403, 404, 422 | application/vnd.api+json | | models.APIError | 4XX, 5XX | \*/\* | +## update_kubernetes_cluster + +Scales the worker nodes of a Kubernetes cluster. The cluster must be in `Provisioned` phase to accept updates. + +When scaling up, the API validates that sufficient server stock is available for the requested delta (e.g., scaling from 2 to 5 workers checks for 3 available servers). + +When scaling from 0 workers, you must provide a `worker_plan` since there is no existing configuration to inherit the plan from. + +Returns 202 Accepted when a scaling operation is triggered. Poll the GET endpoint to monitor progress. Returns 200 OK if the requested worker count matches the current count (no-op). + + +### Example Usage: InvalidWorkerCountType + + +```python +import latitudesh_python_sdk +from latitudesh_python_sdk import Latitudesh +import os + + +with Latitudesh( + bearer=os.getenv("LATITUDESH_BEARER", ""), +) as latitudesh: + + res = latitudesh.kubernetes_clusters.update_kubernetes_cluster(kubernetes_cluster_id="", data={ + "type": latitudesh_python_sdk.UpdateKubernetesClusterType.KUBERNETES_CLUSTERS, + "attributes": { + "worker_count": 204185, + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: MissingWorkerCount + + +```python +import latitudesh_python_sdk +from latitudesh_python_sdk import Latitudesh +import os + + +with Latitudesh( + bearer=os.getenv("LATITUDESH_BEARER", ""), +) as latitudesh: + + res = latitudesh.kubernetes_clusters.update_kubernetes_cluster(kubernetes_cluster_id="", data={ + "type": latitudesh_python_sdk.UpdateKubernetesClusterType.KUBERNETES_CLUSTERS, + "attributes": { + "worker_count": 204185, + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: ScaleDown + + +```python +import latitudesh_python_sdk +from latitudesh_python_sdk import Latitudesh +import os + + +with Latitudesh( + bearer=os.getenv("LATITUDESH_BEARER", ""), +) as latitudesh: + + res = latitudesh.kubernetes_clusters.update_kubernetes_cluster(kubernetes_cluster_id="", data={ + "type": latitudesh_python_sdk.UpdateKubernetesClusterType.KUBERNETES_CLUSTERS, + "attributes": { + "worker_count": 2, + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: ScaleFromZero + + +```python +import latitudesh_python_sdk +from latitudesh_python_sdk import Latitudesh +import os + + +with Latitudesh( + bearer=os.getenv("LATITUDESH_BEARER", ""), +) as latitudesh: + + res = latitudesh.kubernetes_clusters.update_kubernetes_cluster(kubernetes_cluster_id="", data={ + "type": latitudesh_python_sdk.UpdateKubernetesClusterType.KUBERNETES_CLUSTERS, + "attributes": { + "worker_count": 3, + "worker_plan": "c3-small-x86", + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: ScaleToZero + + +```python +import latitudesh_python_sdk +from latitudesh_python_sdk import Latitudesh +import os + + +with Latitudesh( + bearer=os.getenv("LATITUDESH_BEARER", ""), +) as latitudesh: + + res = latitudesh.kubernetes_clusters.update_kubernetes_cluster(kubernetes_cluster_id="", data={ + "type": latitudesh_python_sdk.UpdateKubernetesClusterType.KUBERNETES_CLUSTERS, + "attributes": { + "worker_count": 0, + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: ScaleUp + + +```python +import latitudesh_python_sdk +from latitudesh_python_sdk import Latitudesh +import os + + +with Latitudesh( + bearer=os.getenv("LATITUDESH_BEARER", ""), +) as latitudesh: + + res = latitudesh.kubernetes_clusters.update_kubernetes_cluster(kubernetes_cluster_id="", data={ + "type": latitudesh_python_sdk.UpdateKubernetesClusterType.KUBERNETES_CLUSTERS, + "attributes": { + "worker_count": 5, + }, + }) + + # Handle response + print(res) + +``` +### Example Usage: Unchanged + + +```python +import latitudesh_python_sdk +from latitudesh_python_sdk import Latitudesh +import os + + +with Latitudesh( + bearer=os.getenv("LATITUDESH_BEARER", ""), +) as latitudesh: + + res = latitudesh.kubernetes_clusters.update_kubernetes_cluster(kubernetes_cluster_id="", data={ + "type": latitudesh_python_sdk.UpdateKubernetesClusterType.KUBERNETES_CLUSTERS, + "attributes": { + "worker_count": 204185, + }, + }) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `kubernetes_cluster_id` | *str* | :heavy_check_mark: | The cluster ID (format: kc_) or cluster name. Both formats are accepted for backward compatibility. | +| `data` | [models.UpdateKubernetesClusterData](../../models/updatekubernetesclusterdata.md) | :heavy_check_mark: | N/A | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.KubernetesClusterUpdateResponse](../../models/kubernetesclusterupdateresponse.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------ | ------------------------ | ------------------------ | +| models.ErrorObject | 400, 403, 404, 422 | application/vnd.api+json | +| models.ErrorObject | 503 | application/vnd.api+json | +| models.APIError | 4XX, 5XX | \*/\* | + ## get_kubernetes_cluster_kubeconfig Retrieves the kubeconfig file for a Kubernetes cluster. The kubeconfig is only available once the cluster is fully provisioned. diff --git a/pyproject.toml b/pyproject.toml index 540a2e3..140f6be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [project] name = "latitudesh-python-sdk" -version = "3.0.0" +version = "3.0.1" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Speakeasy" },] readme = "README-PYPI.md" diff --git a/src/latitudesh_python_sdk/_version.py b/src/latitudesh_python_sdk/_version.py index cf36e0a..08a74a2 100644 --- a/src/latitudesh_python_sdk/_version.py +++ b/src/latitudesh_python_sdk/_version.py @@ -3,11 +3,11 @@ import importlib.metadata __title__: str = "latitudesh-python-sdk" -__version__: str = "3.0.0" +__version__: str = "3.0.1" __openapi_doc_version__: str = "2023-06-01" __gen_version__: str = "2.869.25" __user_agent__: str = ( - "speakeasy-sdk/python 3.0.0 2.869.25 2023-06-01 latitudesh-python-sdk" + "speakeasy-sdk/python 3.0.1 2.869.25 2023-06-01 latitudesh-python-sdk" ) try: diff --git a/src/latitudesh_python_sdk/kubernetes_clusters_sdk.py b/src/latitudesh_python_sdk/kubernetes_clusters_sdk.py index 178b858..4102b39 100644 --- a/src/latitudesh_python_sdk/kubernetes_clusters_sdk.py +++ b/src/latitudesh_python_sdk/kubernetes_clusters_sdk.py @@ -764,6 +764,240 @@ async def delete_kubernetes_cluster_async( raise models.APIError("Unexpected response received", http_res) + def update_kubernetes_cluster( + self, + *, + kubernetes_cluster_id: str, + data: Union[ + models.UpdateKubernetesClusterData, + models.UpdateKubernetesClusterDataTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.KubernetesClusterUpdateResponse: + r"""Scale Kubernetes Cluster Workers + + Scales the worker nodes of a Kubernetes cluster. The cluster must be in `Provisioned` phase to accept updates. + + When scaling up, the API validates that sufficient server stock is available for the requested delta (e.g., scaling from 2 to 5 workers checks for 3 available servers). + + When scaling from 0 workers, you must provide a `worker_plan` since there is no existing configuration to inherit the plan from. + + Returns 202 Accepted when a scaling operation is triggered. Poll the GET endpoint to monitor progress. Returns 200 OK if the requested worker count matches the current count (no-op). + + + :param kubernetes_cluster_id: The cluster ID (format: kc_) or cluster name. Both formats are accepted for backward compatibility. + :param data: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateKubernetesClusterRequest( + kubernetes_cluster_id=kubernetes_cluster_id, + update_kubernetes_cluster=models.UpdateKubernetesCluster( + data=utils.get_pydantic_model(data, models.UpdateKubernetesClusterData), + ), + ) + + req = self._build_request( + method="PATCH", + path="/kubernetes_clusters/{kubernetes_cluster_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/vnd.api+json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_kubernetes_cluster, + False, + False, + "json", + models.UpdateKubernetesCluster, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update-kubernetes-cluster", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "403", "404", "422", "4XX", "503", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, ["200", "202"], "application/vnd.api+json"): + return unmarshal_json_response( + models.KubernetesClusterUpdateResponse, http_res + ) + if utils.match_response( + http_res, ["400", "403", "404", "422"], "application/vnd.api+json" + ): + response_data = unmarshal_json_response(models.ErrorObjectData, http_res) + raise models.ErrorObject(response_data, http_res) + if utils.match_response(http_res, "503", "application/vnd.api+json"): + response_data = unmarshal_json_response(models.ErrorObjectData, http_res) + raise models.ErrorObject(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + + raise models.APIError("Unexpected response received", http_res) + + async def update_kubernetes_cluster_async( + self, + *, + kubernetes_cluster_id: str, + data: Union[ + models.UpdateKubernetesClusterData, + models.UpdateKubernetesClusterDataTypedDict, + ], + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.KubernetesClusterUpdateResponse: + r"""Scale Kubernetes Cluster Workers + + Scales the worker nodes of a Kubernetes cluster. The cluster must be in `Provisioned` phase to accept updates. + + When scaling up, the API validates that sufficient server stock is available for the requested delta (e.g., scaling from 2 to 5 workers checks for 3 available servers). + + When scaling from 0 workers, you must provide a `worker_plan` since there is no existing configuration to inherit the plan from. + + Returns 202 Accepted when a scaling operation is triggered. Poll the GET endpoint to monitor progress. Returns 200 OK if the requested worker count matches the current count (no-op). + + + :param kubernetes_cluster_id: The cluster ID (format: kc_) or cluster name. Both formats are accepted for backward compatibility. + :param data: + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.UpdateKubernetesClusterRequest( + kubernetes_cluster_id=kubernetes_cluster_id, + update_kubernetes_cluster=models.UpdateKubernetesCluster( + data=utils.get_pydantic_model(data, models.UpdateKubernetesClusterData), + ), + ) + + req = self._build_request_async( + method="PATCH", + path="/kubernetes_clusters/{kubernetes_cluster_id}", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/vnd.api+json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.update_kubernetes_cluster, + False, + False, + "json", + models.UpdateKubernetesCluster, + ), + allow_empty_value=None, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + config=self.sdk_configuration, + base_url=base_url or "", + operation_id="update-kubernetes-cluster", + oauth2_scopes=None, + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["400", "403", "404", "422", "4XX", "503", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, ["200", "202"], "application/vnd.api+json"): + return unmarshal_json_response( + models.KubernetesClusterUpdateResponse, http_res + ) + if utils.match_response( + http_res, ["400", "403", "404", "422"], "application/vnd.api+json" + ): + response_data = unmarshal_json_response(models.ErrorObjectData, http_res) + raise models.ErrorObject(response_data, http_res) + if utils.match_response(http_res, "503", "application/vnd.api+json"): + response_data = unmarshal_json_response(models.ErrorObjectData, http_res) + raise models.ErrorObject(response_data, http_res) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError("API error occurred", http_res, http_res_text) + + raise models.APIError("Unexpected response received", http_res) + def get_kubernetes_cluster_kubeconfig( self, *, diff --git a/src/latitudesh_python_sdk/models/__init__.py b/src/latitudesh_python_sdk/models/__init__.py index 2591308..e4cb2dd 100644 --- a/src/latitudesh_python_sdk/models/__init__.py +++ b/src/latitudesh_python_sdk/models/__init__.py @@ -684,6 +684,7 @@ KubernetesClusterDataTypedDict, Nodes, NodesTypedDict, + WorkerStatus, Workers, WorkersTypedDict, ) @@ -706,6 +707,16 @@ Steps, StepsTypedDict, ) + from .kubernetes_cluster_update_response import ( + KubernetesClusterUpdateResponse, + KubernetesClusterUpdateResponseAttributes, + KubernetesClusterUpdateResponseAttributesTypedDict, + KubernetesClusterUpdateResponseData, + KubernetesClusterUpdateResponseDataTypedDict, + KubernetesClusterUpdateResponseStatus, + KubernetesClusterUpdateResponseType, + KubernetesClusterUpdateResponseTypedDict, + ) from .kubernetes_clusters import KubernetesClusters, KubernetesClustersTypedDict from .list_elastic_ipsop import ( FilterStatus, @@ -1276,6 +1287,19 @@ UpdateFirewallRequest, UpdateFirewallRequestTypedDict, ) + from .update_kubernetes_cluster import ( + UpdateKubernetesCluster, + UpdateKubernetesClusterAttributes, + UpdateKubernetesClusterAttributesTypedDict, + UpdateKubernetesClusterData, + UpdateKubernetesClusterDataTypedDict, + UpdateKubernetesClusterType, + UpdateKubernetesClusterTypedDict, + ) + from .update_kubernetes_clusterop import ( + UpdateKubernetesClusterRequest, + UpdateKubernetesClusterRequestTypedDict, + ) from .update_plans_bandwidthop import ( UpdatePlansBandwidthPlansAttributes, UpdatePlansBandwidthPlansAttributesTypedDict, @@ -2087,6 +2111,14 @@ "KubernetesClusterSummaryDataStatus", "KubernetesClusterSummaryDataTypedDict", "KubernetesClusterTypedDict", + "KubernetesClusterUpdateResponse", + "KubernetesClusterUpdateResponseAttributes", + "KubernetesClusterUpdateResponseAttributesTypedDict", + "KubernetesClusterUpdateResponseData", + "KubernetesClusterUpdateResponseDataTypedDict", + "KubernetesClusterUpdateResponseStatus", + "KubernetesClusterUpdateResponseType", + "KubernetesClusterUpdateResponseTypedDict", "KubernetesClusters", "KubernetesClustersTypedDict", "LatitudeshError", @@ -2583,6 +2615,15 @@ "UpdateFirewallFirewallsType", "UpdateFirewallRequest", "UpdateFirewallRequestTypedDict", + "UpdateKubernetesCluster", + "UpdateKubernetesClusterAttributes", + "UpdateKubernetesClusterAttributesTypedDict", + "UpdateKubernetesClusterData", + "UpdateKubernetesClusterDataTypedDict", + "UpdateKubernetesClusterRequest", + "UpdateKubernetesClusterRequestTypedDict", + "UpdateKubernetesClusterType", + "UpdateKubernetesClusterTypedDict", "UpdatePlansBandwidthPlansAttributes", "UpdatePlansBandwidthPlansAttributesTypedDict", "UpdatePlansBandwidthPlansData", @@ -2792,6 +2833,7 @@ "VpnSessionDataWithPasswordTypedDict", "VpnSessionWithPassword", "VpnSessionWithPasswordTypedDict", + "WorkerStatus", "Workers", "WorkersTypedDict", ] @@ -3323,6 +3365,7 @@ "KubernetesClusterDataTypedDict": ".kubernetes_cluster_data", "Nodes": ".kubernetes_cluster_data", "NodesTypedDict": ".kubernetes_cluster_data", + "WorkerStatus": ".kubernetes_cluster_data", "Workers": ".kubernetes_cluster_data", "WorkersTypedDict": ".kubernetes_cluster_data", "KubernetesClusterKubeconfig": ".kubernetes_cluster_kubeconfig", @@ -3340,6 +3383,14 @@ "Phase": ".kubernetes_cluster_summary_data", "Steps": ".kubernetes_cluster_summary_data", "StepsTypedDict": ".kubernetes_cluster_summary_data", + "KubernetesClusterUpdateResponse": ".kubernetes_cluster_update_response", + "KubernetesClusterUpdateResponseAttributes": ".kubernetes_cluster_update_response", + "KubernetesClusterUpdateResponseAttributesTypedDict": ".kubernetes_cluster_update_response", + "KubernetesClusterUpdateResponseData": ".kubernetes_cluster_update_response", + "KubernetesClusterUpdateResponseDataTypedDict": ".kubernetes_cluster_update_response", + "KubernetesClusterUpdateResponseStatus": ".kubernetes_cluster_update_response", + "KubernetesClusterUpdateResponseType": ".kubernetes_cluster_update_response", + "KubernetesClusterUpdateResponseTypedDict": ".kubernetes_cluster_update_response", "KubernetesClusters": ".kubernetes_clusters", "KubernetesClustersTypedDict": ".kubernetes_clusters", "FilterStatus": ".list_elastic_ipsop", @@ -3820,6 +3871,15 @@ "UpdateFirewallFirewallsType": ".update_firewallop", "UpdateFirewallRequest": ".update_firewallop", "UpdateFirewallRequestTypedDict": ".update_firewallop", + "UpdateKubernetesCluster": ".update_kubernetes_cluster", + "UpdateKubernetesClusterAttributes": ".update_kubernetes_cluster", + "UpdateKubernetesClusterAttributesTypedDict": ".update_kubernetes_cluster", + "UpdateKubernetesClusterData": ".update_kubernetes_cluster", + "UpdateKubernetesClusterDataTypedDict": ".update_kubernetes_cluster", + "UpdateKubernetesClusterType": ".update_kubernetes_cluster", + "UpdateKubernetesClusterTypedDict": ".update_kubernetes_cluster", + "UpdateKubernetesClusterRequest": ".update_kubernetes_clusterop", + "UpdateKubernetesClusterRequestTypedDict": ".update_kubernetes_clusterop", "UpdatePlansBandwidthPlansAttributes": ".update_plans_bandwidthop", "UpdatePlansBandwidthPlansAttributesTypedDict": ".update_plans_bandwidthop", "UpdatePlansBandwidthPlansData": ".update_plans_bandwidthop", diff --git a/src/latitudesh_python_sdk/models/kubernetes_cluster_data.py b/src/latitudesh_python_sdk/models/kubernetes_cluster_data.py index f872d9d..27a3b31 100644 --- a/src/latitudesh_python_sdk/models/kubernetes_cluster_data.py +++ b/src/latitudesh_python_sdk/models/kubernetes_cluster_data.py @@ -93,6 +93,15 @@ def serialize_model(self, handler): return m +class WorkerStatus(str, Enum): + r"""Current status of worker nodes. 'idle' when 0 workers, 'ready' when all workers are ready, 'scaling' when workers are being provisioned/removed, 'error' when a worker has failed.""" + + IDLE = "idle" + READY = "ready" + SCALING = "scaling" + ERROR = "error" + + class KubernetesClusterDataName(str, Enum): r"""Step identifier""" @@ -316,6 +325,8 @@ class KubernetesClusterDataAttributesTypedDict(TypedDict): r"""Control plane status information""" workers: NotRequired[Nullable[WorkersTypedDict]] r"""Worker nodes status information""" + worker_status: NotRequired[Nullable[WorkerStatus]] + r"""Current status of worker nodes. 'idle' when 0 workers, 'ready' when all workers are ready, 'scaling' when workers are being provisioned/removed, 'error' when a worker has failed.""" infrastructure_ready: NotRequired[bool] r"""Whether the underlying infrastructure is ready""" control_plane_ready: NotRequired[bool] @@ -382,6 +393,9 @@ class KubernetesClusterDataAttributes(BaseModel): workers: OptionalNullable[Workers] = UNSET r"""Worker nodes status information""" + worker_status: OptionalNullable[WorkerStatus] = UNSET + r"""Current status of worker nodes. 'idle' when 0 workers, 'ready' when all workers are ready, 'scaling' when workers are being provisioned/removed, 'error' when a worker has failed.""" + infrastructure_ready: Optional[bool] = None r"""Whether the underlying infrastructure is ready""" @@ -428,6 +442,7 @@ def serialize_model(self, handler): "worker_count", "control_plane", "workers", + "worker_status", "infrastructure_ready", "control_plane_ready", "message", @@ -446,6 +461,7 @@ def serialize_model(self, handler): "worker_plan", "control_plane", "workers", + "worker_status", "last_status_change", "failure_message", "failure_reason", diff --git a/src/latitudesh_python_sdk/models/kubernetes_cluster_update_response.py b/src/latitudesh_python_sdk/models/kubernetes_cluster_update_response.py new file mode 100644 index 0000000..c4a7d29 --- /dev/null +++ b/src/latitudesh_python_sdk/models/kubernetes_cluster_update_response.py @@ -0,0 +1,111 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from latitudesh_python_sdk.types import BaseModel, UNSET_SENTINEL +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class KubernetesClusterUpdateResponseType(str, Enum): + KUBERNETES_CLUSTERS = "kubernetes_clusters" + + +class KubernetesClusterUpdateResponseStatus(str, Enum): + r"""The update status. 'scaling' indicates worker nodes are being added or removed. 'unchanged' indicates the requested worker_count matches the current count.""" + + SCALING = "scaling" + UNCHANGED = "unchanged" + + +class KubernetesClusterUpdateResponseAttributesTypedDict(TypedDict): + name: NotRequired[str] + r"""The cluster name""" + status: NotRequired[KubernetesClusterUpdateResponseStatus] + r"""The update status. 'scaling' indicates worker nodes are being added or removed. 'unchanged' indicates the requested worker_count matches the current count.""" + worker_count: NotRequired[int] + r"""The requested number of worker nodes""" + + +class KubernetesClusterUpdateResponseAttributes(BaseModel): + name: Optional[str] = None + r"""The cluster name""" + + status: Optional[KubernetesClusterUpdateResponseStatus] = None + r"""The update status. 'scaling' indicates worker nodes are being added or removed. 'unchanged' indicates the requested worker_count matches the current count.""" + + worker_count: Optional[int] = None + r"""The requested number of worker nodes""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["name", "status", "worker_count"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +class KubernetesClusterUpdateResponseDataTypedDict(TypedDict): + type: NotRequired[KubernetesClusterUpdateResponseType] + id: NotRequired[str] + r"""The cluster ID (format: kc_)""" + attributes: NotRequired[KubernetesClusterUpdateResponseAttributesTypedDict] + + +class KubernetesClusterUpdateResponseData(BaseModel): + type: Optional[KubernetesClusterUpdateResponseType] = None + + id: Optional[str] = None + r"""The cluster ID (format: kc_)""" + + attributes: Optional[KubernetesClusterUpdateResponseAttributes] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["type", "id", "attributes"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m + + +class KubernetesClusterUpdateResponseTypedDict(TypedDict): + data: NotRequired[KubernetesClusterUpdateResponseDataTypedDict] + + +class KubernetesClusterUpdateResponse(BaseModel): + data: Optional[KubernetesClusterUpdateResponseData] = None + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["data"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + + if val != UNSET_SENTINEL: + if val is not None or k not in optional_fields: + m[k] = val + + return m diff --git a/src/latitudesh_python_sdk/models/update_kubernetes_cluster.py b/src/latitudesh_python_sdk/models/update_kubernetes_cluster.py new file mode 100644 index 0000000..b177953 --- /dev/null +++ b/src/latitudesh_python_sdk/models/update_kubernetes_cluster.py @@ -0,0 +1,76 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from latitudesh_python_sdk.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing_extensions import NotRequired, TypedDict + + +class UpdateKubernetesClusterType(str, Enum): + KUBERNETES_CLUSTERS = "kubernetes_clusters" + + +class UpdateKubernetesClusterAttributesTypedDict(TypedDict): + worker_count: int + r"""Desired number of worker nodes. Must be between 0 and 10.""" + worker_plan: NotRequired[Nullable[str]] + r"""Plan slug for worker nodes. Required when scaling from 0 workers. Ignored when scaling an existing deployment.""" + + +class UpdateKubernetesClusterAttributes(BaseModel): + worker_count: int + r"""Desired number of worker nodes. Must be between 0 and 10.""" + + worker_plan: OptionalNullable[str] = UNSET + r"""Plan slug for worker nodes. Required when scaling from 0 workers. Ignored when scaling an existing deployment.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = set(["worker_plan"]) + nullable_fields = set(["worker_plan"]) + serialized = handler(self) + m = {} + + for n, f in type(self).model_fields.items(): + k = f.alias or n + val = serialized.get(k, serialized.get(n)) + is_nullable_and_explicitly_set = ( + k in nullable_fields + and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member + ) + + if val != UNSET_SENTINEL: + if ( + val is not None + or k not in optional_fields + or is_nullable_and_explicitly_set + ): + m[k] = val + + return m + + +class UpdateKubernetesClusterDataTypedDict(TypedDict): + type: UpdateKubernetesClusterType + attributes: UpdateKubernetesClusterAttributesTypedDict + + +class UpdateKubernetesClusterData(BaseModel): + type: UpdateKubernetesClusterType + + attributes: UpdateKubernetesClusterAttributes + + +class UpdateKubernetesClusterTypedDict(TypedDict): + data: UpdateKubernetesClusterDataTypedDict + + +class UpdateKubernetesCluster(BaseModel): + data: UpdateKubernetesClusterData diff --git a/src/latitudesh_python_sdk/models/update_kubernetes_clusterop.py b/src/latitudesh_python_sdk/models/update_kubernetes_clusterop.py new file mode 100644 index 0000000..2a1172d --- /dev/null +++ b/src/latitudesh_python_sdk/models/update_kubernetes_clusterop.py @@ -0,0 +1,32 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .update_kubernetes_cluster import ( + UpdateKubernetesCluster, + UpdateKubernetesClusterTypedDict, +) +from latitudesh_python_sdk.types import BaseModel +from latitudesh_python_sdk.utils import ( + FieldMetadata, + PathParamMetadata, + RequestMetadata, +) +from typing_extensions import Annotated, TypedDict + + +class UpdateKubernetesClusterRequestTypedDict(TypedDict): + kubernetes_cluster_id: str + r"""The cluster ID (format: kc_) or cluster name. Both formats are accepted for backward compatibility.""" + update_kubernetes_cluster: UpdateKubernetesClusterTypedDict + + +class UpdateKubernetesClusterRequest(BaseModel): + kubernetes_cluster_id: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The cluster ID (format: kc_) or cluster name. Both formats are accepted for backward compatibility.""" + + update_kubernetes_cluster: Annotated[ + UpdateKubernetesCluster, + FieldMetadata(request=RequestMetadata(media_type="application/vnd.api+json")), + ]