All notable changes to the Styrmin Python SDK will be documented in this file.
client.clusters.update(config, cluster_id=None, cluster_name=None, *, dry_run=False)replaces a cluster's config and returns the deployments the update redeploys, leaves waiting for a dedicated ingress controller, skips for a restore or could not start.configis a dict, likeclusters.create(): snake_case or camelCase keys, and the stored enum values thatclusters.get()returns. An unknown key at any depth raisesValueErrorbefore any request. Withdry_run=True, nothing is saved. The call waits up to 600 seconds.client.deployments.wait_for_task(task_id, *, max_wait=None)waits until the change that a task of a deployment makes has finished, and returns aTaskWait. It takes the task thatcreate(),update(),scale(),update_version(),delete(),start_components(),stop_components()orrun_job()returns. It waits until the task result is no longerRUNNING, then, when the result isSUCCEEDED, until the deployment status isrunning,failedordeleted.TaskWait.succeededis true when the status isrunning, ordeletedafterdelete(). Otherwisefailure_reasonnames the failed step, the superseded task, the deployment status or the timeout, and the call does not raise. Before, a program polled by hand, and arunningstatus read right afterstart_components()orstop_components()was the status from before the change. (#545)client.environments.get_pod_statuses()andclient.clusters.get_pod_statuses()return the pod statuses of every deployment of an environment or of a cluster, andclient.environments.get_services()returns the services of every deployment of an environment. Before, a program calleddeployments.get_pod_statuses()once per deployment. (#547)- They take the same arguments as
environments.get()andclusters.get(): an ID or a name. They read the environment or the cluster first, so an unknown ID or name raisesResourceNotFoundError. - The lists include internal deployments, such as the ingress controller of a dedicated ingress, and leave out deleted deployments. Their order is not fixed.
- A pod that started since the agent's last report, about 5 seconds earlier, is not listed yet, so a new environment can return an empty list.
- The services have no URL or FQDN;
deployments.get()returns them. styrmin_sdk.modelsexports the item types asPodStatus, withPodPhase, andDeployedService.
- They take the same arguments as
StyrminAPIError.extensionsgives all the extensions of the GraphQL error that the server returned,codeincluded, in every subclass (OperationFailedError,ResourceNotFoundErrorand the others). Before, the exception kept only the message andextensions.code(typename), so a program had to parse the message to read, for example, thepathof a refused affinity term or thedeploymentsof a refusedenvironment_clones.create()request. An error without extensions gives an empty dict. (#522)
-
client.deployments.update(...)signature change. The method no longer acceptsname: str,config: dict,parameters: dict, orservice_name_overrides: listkeyword arguments. The only keyword arguments are nowdeployment_id: UUIDandinput: UpdateDeploymentInput. Every writable field (top-level env vars, scheduling, components, parameters, ip_whitelist, name, service_name_overrides) is now a named, type-checked attribute on the newUpdateDeploymentInputmodel, re-exported fromstyrmin_sdk.models.Before:
task = await client.deployments.update( deployment_id=UUID("5f2c4f8e-..."), name="web-staging-v2", config={ "components": { "web": {"envVars": {"OTEL": "https://otel.staging"}}, }, "scheduling": {"resources": {"requests": {"cpu": "200m"}}}, }, parameters={"replicas": 3}, )
After:
from uuid import UUID from styrmin_sdk import StyrminClient from styrmin_sdk.models import ( UpdateDeploymentInput, ComponentConfigInput, EnvVarInput, SchedulingInput, ResourceRequirementsInput, ResourceSpecInput, ParameterValueInput, ) task = await client.deployments.update( deployment_id=UUID("5f2c4f8e-..."), input=UpdateDeploymentInput( name="web-staging-v2", components=[ ComponentConfigInput( name="web", env_vars=[ EnvVarInput(name="OTEL", value="https://otel.staging"), ], ), ], scheduling=SchedulingInput( resources=ResourceRequirementsInput( requests=ResourceSpecInput(cpu="200m"), ), ), parameters=[ParameterValueInput(name="replicas", value=3)], ), )
- Omitted fields on
UpdateDeploymentInputare no-ops (the persisted value is not touched). Submittingfield=Noneis also a no-op. - Submitting
field=[](empty list) for list-shaped fields (ip_whitelist,service_name_overrides) is an explicit clear. parameterskeeps merge semantics: entries in the input merge on top of the persisted parameters dict; existing keys not named in the input survive.- Duplicate names within a single input scope return a typed error
(
DUPLICATE_ENV_VAR_NAME,DUPLICATE_PARAMETER_NAME,DUPLICATE_COMPONENT_NAME) instead of last-write-wins.