Skip to content

Kvindo/kc-sdk-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kc-sdk-python — Kvindo Cloud Python SDK

PyPI version Python versions License: MIT

Official Python SDK / client for the Kvindo Cloud API — manage cloud infrastructure as code from Python: VMs, volumes, S3 object storage, Kubernetes, load balancers, VPCs, VPNs, and managed PostgreSQL.

A thin, typed client over the REST API: one resource client per resource type, all sharing the same create / read / update / delete / list contract.

Install

pip install kc-sdk-python

Dependencies: requests, marshmallow-dataclass, py-ulid.

Usage

from kc_api import KcClient

client = KcClient("YOUR_API_TOKEN")  # api_url defaults to https://cloud-api.kvindo.ru

# List (label-filtered, paginated)
resp = client.vms.get_by_labels({"env": "prod"}, max_page_size=50)
for vm in resp.resources:
    print(vm["metadata"]["name"])

# Read one
vm = client.vms.read("01H...")
print(vm.resource)

# Create / update (async) then wait for it to reconcile
created = client.vms.create_or_update({
    "metadata": {"name": "my-vm", "folderId": "01H..."},
    "spec": {"offerId": "g3-1c2-100", "state": "running", ...},
})
status = client.vms.wait_request_satisfied(created.requestId, timeout_seconds=300)
assert status.succeeded

# Delete (optionally block until reconciled)
client.vms.delete("01H...", wait=True)

Create / update / delete are asynchronous: they return a requestId; poll read_request(requestId) or use wait_request_satisfied(...). Every response object carries errorMessage / errorCode (a typed KcApi*ErrorCode) which are None on success.

Available resources

KcClient exposes one KcResourceClient per type, e.g. client.vms, client.volumes, client.s3_buckets, client.kubernetes, client.load_balancers, client.vpcs, client.postgresql_standalones, client.folders, client.transactions, … (the surface mirrors the official Kvindo Cloud API).

Related projects

Part of the Kvindo Cloud developer toolchain:

License

MIT

About

Official Python SDK / client for the Kvindo Cloud API — manage VMs, S3 object storage, Kubernetes, load balancers, VPCs, and managed PostgreSQL as code.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages