kc-sdk-python 0.1.0__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kc_sdk_python-1.0.0/PKG-INFO +107 -0
- kc_sdk_python-0.1.0/kc_sdk_python.egg-info/PKG-INFO → kc_sdk_python-1.0.0/README.md +20 -27
- {kc_sdk_python-0.1.0 → kc_sdk_python-1.0.0}/kc_api.py +5 -6
- kc_sdk_python-1.0.0/kc_sdk_python.egg-info/PKG-INFO +107 -0
- kc_sdk_python-1.0.0/pyproject.toml +64 -0
- kc_sdk_python-0.1.0/PKG-INFO +0 -80
- kc_sdk_python-0.1.0/README.md +0 -60
- kc_sdk_python-0.1.0/pyproject.toml +0 -31
- {kc_sdk_python-0.1.0 → kc_sdk_python-1.0.0}/LICENSE +0 -0
- {kc_sdk_python-0.1.0 → kc_sdk_python-1.0.0}/kc_sdk_python.egg-info/SOURCES.txt +0 -0
- {kc_sdk_python-0.1.0 → kc_sdk_python-1.0.0}/kc_sdk_python.egg-info/dependency_links.txt +0 -0
- {kc_sdk_python-0.1.0 → kc_sdk_python-1.0.0}/kc_sdk_python.egg-info/requires.txt +0 -0
- {kc_sdk_python-0.1.0 → kc_sdk_python-1.0.0}/kc_sdk_python.egg-info/top_level.txt +0 -0
- {kc_sdk_python-0.1.0 → kc_sdk_python-1.0.0}/setup.cfg +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kc-sdk-python
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Kvindo Cloud Python SDK — typed client for managing Kvindo Cloud infrastructure (VMs, S3, Kubernetes, load balancers, VPCs, PostgreSQL) via the REST API
|
|
5
|
+
Author: Kvindo
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://cloud.kvindo.com
|
|
8
|
+
Project-URL: Repository, https://github.com/Kvindo/kc-sdk-python
|
|
9
|
+
Project-URL: Documentation, https://github.com/Kvindo/kc-sdk-python#readme
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/Kvindo/kc-sdk-python/issues
|
|
11
|
+
Keywords: kvindo,kvindo-cloud,cloud,cloud-api,iaas,infrastructure,infrastructure-as-code,sdk,api-client,rest-api,devops,vm,kubernetes,s3,object-storage,load-balancer,vpc,postgresql
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: System Administrators
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Operating System :: OS Independent
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Topic :: System :: Systems Administration
|
|
25
|
+
Classifier: Topic :: Internet
|
|
26
|
+
Classifier: Typing :: Typed
|
|
27
|
+
Requires-Python: >=3.8
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: requests
|
|
31
|
+
Requires-Dist: marshmallow-dataclass
|
|
32
|
+
Requires-Dist: py-ulid
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# kc-sdk-python — Kvindo Cloud Python SDK
|
|
36
|
+
|
|
37
|
+
[](https://pypi.org/project/kc-sdk-python/)
|
|
38
|
+
[](https://pypi.org/project/kc-sdk-python/)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
|
|
41
|
+
Official **Python SDK / client for the [Kvindo Cloud](https://cloud.kvindo.com) API** — manage
|
|
42
|
+
cloud infrastructure as code from Python: VMs, volumes, S3 object storage, Kubernetes, load
|
|
43
|
+
balancers, VPCs, VPNs, and managed PostgreSQL.
|
|
44
|
+
|
|
45
|
+
A thin, typed client over the REST API: one resource client per resource type, all sharing the
|
|
46
|
+
same create / read / update / delete / list contract.
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
pip install kc-sdk-python
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Dependencies: `requests`, `marshmallow-dataclass`, `py-ulid`.
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from kc_api import KcClient
|
|
60
|
+
|
|
61
|
+
client = KcClient("YOUR_API_TOKEN") # api_url defaults to https://cloud-api.kvindo.ru
|
|
62
|
+
|
|
63
|
+
# List (label-filtered, paginated)
|
|
64
|
+
resp = client.vms.get_by_labels({"env": "prod"}, max_page_size=50)
|
|
65
|
+
for vm in resp.resources:
|
|
66
|
+
print(vm["metadata"]["name"])
|
|
67
|
+
|
|
68
|
+
# Read one
|
|
69
|
+
vm = client.vms.read("01H...")
|
|
70
|
+
print(vm.resource)
|
|
71
|
+
|
|
72
|
+
# Create / update (async) then wait for it to reconcile
|
|
73
|
+
created = client.vms.create_or_update({
|
|
74
|
+
"metadata": {"name": "my-vm", "folderId": "01H..."},
|
|
75
|
+
"spec": {"offerId": "g3-1c2-100", "state": "running", ...},
|
|
76
|
+
})
|
|
77
|
+
status = client.vms.wait_request_satisfied(created.requestId, timeout_seconds=300)
|
|
78
|
+
assert status.succeeded
|
|
79
|
+
|
|
80
|
+
# Delete (optionally block until reconciled)
|
|
81
|
+
client.vms.delete("01H...", wait=True)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Create / update / delete are **asynchronous**: they return a `requestId`; poll
|
|
85
|
+
`read_request(requestId)` or use `wait_request_satisfied(...)`. Every response
|
|
86
|
+
object carries `errorMessage` / `errorCode` (a typed `KcApi*ErrorCode`) which are
|
|
87
|
+
`None` on success.
|
|
88
|
+
|
|
89
|
+
### Available resources
|
|
90
|
+
|
|
91
|
+
`KcClient` exposes one `KcResourceClient` per type, e.g. `client.vms`,
|
|
92
|
+
`client.volumes`, `client.s3_buckets`, `client.kubernetes`,
|
|
93
|
+
`client.load_balancers`, `client.vpcs`, `client.postgresql_standalones`,
|
|
94
|
+
`client.folders`, `client.transactions`, … (the surface mirrors the official
|
|
95
|
+
Kvindo Cloud API).
|
|
96
|
+
|
|
97
|
+
## Related projects
|
|
98
|
+
|
|
99
|
+
Part of the Kvindo Cloud developer toolchain:
|
|
100
|
+
|
|
101
|
+
- **[kc CLI](https://github.com/Kvindo/kc-cli)** — kubectl-style command-line client for Kvindo Cloud.
|
|
102
|
+
- **[terraform-provider-kvindo](https://github.com/Kvindo/terraform-provider-kvindo)** — Terraform provider ([Registry](https://registry.terraform.io/providers/kvindo/kvindo/latest)).
|
|
103
|
+
- **[Kvindo Cloud console](https://cloud.kvindo.com)** — web UI and API.
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
MIT
|
|
@@ -1,30 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Requires-Python: >=3.8
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
Requires-Dist: requests
|
|
17
|
-
Requires-Dist: marshmallow-dataclass
|
|
18
|
-
Requires-Dist: py-ulid
|
|
19
|
-
Dynamic: license-file
|
|
20
|
-
|
|
21
|
-
# kc-sdk-python
|
|
22
|
-
|
|
23
|
-
Python SDK / client for the **Kvindo Cloud API**.
|
|
24
|
-
|
|
25
|
-
A thin, typed client over the REST API: one resource client per resource type
|
|
26
|
-
(VMs, volumes, load balancers, kubernetes, S3, VPCs, …), all sharing the same
|
|
27
|
-
create / read / update / delete / list contract.
|
|
1
|
+
# kc-sdk-python — Kvindo Cloud Python SDK
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/kc-sdk-python/)
|
|
4
|
+
[](https://pypi.org/project/kc-sdk-python/)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
Official **Python SDK / client for the [Kvindo Cloud](https://cloud.kvindo.com) API** — manage
|
|
8
|
+
cloud infrastructure as code from Python: VMs, volumes, S3 object storage, Kubernetes, load
|
|
9
|
+
balancers, VPCs, VPNs, and managed PostgreSQL.
|
|
10
|
+
|
|
11
|
+
A thin, typed client over the REST API: one resource client per resource type, all sharing the
|
|
12
|
+
same create / read / update / delete / list contract.
|
|
28
13
|
|
|
29
14
|
## Install
|
|
30
15
|
|
|
@@ -75,6 +60,14 @@ object carries `errorMessage` / `errorCode` (a typed `KcApi*ErrorCode`) which ar
|
|
|
75
60
|
`client.folders`, `client.transactions`, … (the surface mirrors the official
|
|
76
61
|
Kvindo Cloud API).
|
|
77
62
|
|
|
63
|
+
## Related projects
|
|
64
|
+
|
|
65
|
+
Part of the Kvindo Cloud developer toolchain:
|
|
66
|
+
|
|
67
|
+
- **[kc CLI](https://github.com/Kvindo/kc-cli)** — kubectl-style command-line client for Kvindo Cloud.
|
|
68
|
+
- **[terraform-provider-kvindo](https://github.com/Kvindo/terraform-provider-kvindo)** — Terraform provider ([Registry](https://registry.terraform.io/providers/kvindo/kvindo/latest)).
|
|
69
|
+
- **[Kvindo Cloud console](https://cloud.kvindo.com)** — web UI and API.
|
|
70
|
+
|
|
78
71
|
## License
|
|
79
72
|
|
|
80
73
|
MIT
|
|
@@ -520,13 +520,16 @@ class KcResourceClient:
|
|
|
520
520
|
|
|
521
521
|
# Inject a ULID id when absent so the call is idempotent and the caller can
|
|
522
522
|
# poll the returned requestId. Two body shapes are supported:
|
|
523
|
+
# py-ulid's ULID has no __str__/__repr__ override, so str(ULID()) yields
|
|
524
|
+
# "<ulid.ulid.ULID object at 0x...>" instead of the Crockford-base32 string the
|
|
525
|
+
# API requires — always use .generate() to get the actual string form.
|
|
523
526
|
if "metadata" in data:
|
|
524
527
|
# Envelope shape: id lives under metadata.
|
|
525
528
|
if "id" not in data["metadata"] or not data["metadata"]["id"]:
|
|
526
|
-
data["metadata"]["id"] =
|
|
529
|
+
data["metadata"]["id"] = ULID().generate()
|
|
527
530
|
elif "id" not in data or not data["id"]:
|
|
528
531
|
# Flat shape: id at the top level.
|
|
529
|
-
data["id"] =
|
|
532
|
+
data["id"] = ULID().generate()
|
|
530
533
|
|
|
531
534
|
url = f"{self.__api_url}/api/v1/{self.__resource_type}"
|
|
532
535
|
|
|
@@ -594,7 +597,6 @@ class KcClient:
|
|
|
594
597
|
route_table_attachments: KcResourceClient
|
|
595
598
|
route_table_routes: KcResourceClient
|
|
596
599
|
security_groups: KcResourceClient
|
|
597
|
-
nat_gateways: KcResourceClient
|
|
598
600
|
|
|
599
601
|
# Load balancer
|
|
600
602
|
load_balancers: KcResourceClient
|
|
@@ -634,7 +636,6 @@ class KcClient:
|
|
|
634
636
|
gitlabs: KcResourceClient
|
|
635
637
|
gitlab_runners: KcResourceClient
|
|
636
638
|
grafanas: KcResourceClient
|
|
637
|
-
victoria_metrics: KcResourceClient
|
|
638
639
|
ollamas: KcResourceClient
|
|
639
640
|
|
|
640
641
|
# IaM / org
|
|
@@ -698,7 +699,6 @@ class KcClient:
|
|
|
698
699
|
self.route_table_attachments = _r("route-table-attachment")
|
|
699
700
|
self.route_table_routes = _r("route-table-route")
|
|
700
701
|
self.security_groups = _r("security-group")
|
|
701
|
-
self.nat_gateways = _r("nat-gateway")
|
|
702
702
|
|
|
703
703
|
# Load balancer
|
|
704
704
|
self.load_balancers = _r("loadbalancer")
|
|
@@ -738,7 +738,6 @@ class KcClient:
|
|
|
738
738
|
self.gitlabs = _r("gitlab")
|
|
739
739
|
self.gitlab_runners = _r("gitlab-runner")
|
|
740
740
|
self.grafanas = _r("grafana")
|
|
741
|
-
self.victoria_metrics = _r("victoria-metrics")
|
|
742
741
|
self.ollamas = _r("ollama")
|
|
743
742
|
|
|
744
743
|
# IaM / org
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kc-sdk-python
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Kvindo Cloud Python SDK — typed client for managing Kvindo Cloud infrastructure (VMs, S3, Kubernetes, load balancers, VPCs, PostgreSQL) via the REST API
|
|
5
|
+
Author: Kvindo
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://cloud.kvindo.com
|
|
8
|
+
Project-URL: Repository, https://github.com/Kvindo/kc-sdk-python
|
|
9
|
+
Project-URL: Documentation, https://github.com/Kvindo/kc-sdk-python#readme
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/Kvindo/kc-sdk-python/issues
|
|
11
|
+
Keywords: kvindo,kvindo-cloud,cloud,cloud-api,iaas,infrastructure,infrastructure-as-code,sdk,api-client,rest-api,devops,vm,kubernetes,s3,object-storage,load-balancer,vpc,postgresql
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: System Administrators
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Operating System :: OS Independent
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Classifier: Topic :: System :: Systems Administration
|
|
25
|
+
Classifier: Topic :: Internet
|
|
26
|
+
Classifier: Typing :: Typed
|
|
27
|
+
Requires-Python: >=3.8
|
|
28
|
+
Description-Content-Type: text/markdown
|
|
29
|
+
License-File: LICENSE
|
|
30
|
+
Requires-Dist: requests
|
|
31
|
+
Requires-Dist: marshmallow-dataclass
|
|
32
|
+
Requires-Dist: py-ulid
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# kc-sdk-python — Kvindo Cloud Python SDK
|
|
36
|
+
|
|
37
|
+
[](https://pypi.org/project/kc-sdk-python/)
|
|
38
|
+
[](https://pypi.org/project/kc-sdk-python/)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
|
|
41
|
+
Official **Python SDK / client for the [Kvindo Cloud](https://cloud.kvindo.com) API** — manage
|
|
42
|
+
cloud infrastructure as code from Python: VMs, volumes, S3 object storage, Kubernetes, load
|
|
43
|
+
balancers, VPCs, VPNs, and managed PostgreSQL.
|
|
44
|
+
|
|
45
|
+
A thin, typed client over the REST API: one resource client per resource type, all sharing the
|
|
46
|
+
same create / read / update / delete / list contract.
|
|
47
|
+
|
|
48
|
+
## Install
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
pip install kc-sdk-python
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Dependencies: `requests`, `marshmallow-dataclass`, `py-ulid`.
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from kc_api import KcClient
|
|
60
|
+
|
|
61
|
+
client = KcClient("YOUR_API_TOKEN") # api_url defaults to https://cloud-api.kvindo.ru
|
|
62
|
+
|
|
63
|
+
# List (label-filtered, paginated)
|
|
64
|
+
resp = client.vms.get_by_labels({"env": "prod"}, max_page_size=50)
|
|
65
|
+
for vm in resp.resources:
|
|
66
|
+
print(vm["metadata"]["name"])
|
|
67
|
+
|
|
68
|
+
# Read one
|
|
69
|
+
vm = client.vms.read("01H...")
|
|
70
|
+
print(vm.resource)
|
|
71
|
+
|
|
72
|
+
# Create / update (async) then wait for it to reconcile
|
|
73
|
+
created = client.vms.create_or_update({
|
|
74
|
+
"metadata": {"name": "my-vm", "folderId": "01H..."},
|
|
75
|
+
"spec": {"offerId": "g3-1c2-100", "state": "running", ...},
|
|
76
|
+
})
|
|
77
|
+
status = client.vms.wait_request_satisfied(created.requestId, timeout_seconds=300)
|
|
78
|
+
assert status.succeeded
|
|
79
|
+
|
|
80
|
+
# Delete (optionally block until reconciled)
|
|
81
|
+
client.vms.delete("01H...", wait=True)
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Create / update / delete are **asynchronous**: they return a `requestId`; poll
|
|
85
|
+
`read_request(requestId)` or use `wait_request_satisfied(...)`. Every response
|
|
86
|
+
object carries `errorMessage` / `errorCode` (a typed `KcApi*ErrorCode`) which are
|
|
87
|
+
`None` on success.
|
|
88
|
+
|
|
89
|
+
### Available resources
|
|
90
|
+
|
|
91
|
+
`KcClient` exposes one `KcResourceClient` per type, e.g. `client.vms`,
|
|
92
|
+
`client.volumes`, `client.s3_buckets`, `client.kubernetes`,
|
|
93
|
+
`client.load_balancers`, `client.vpcs`, `client.postgresql_standalones`,
|
|
94
|
+
`client.folders`, `client.transactions`, … (the surface mirrors the official
|
|
95
|
+
Kvindo Cloud API).
|
|
96
|
+
|
|
97
|
+
## Related projects
|
|
98
|
+
|
|
99
|
+
Part of the Kvindo Cloud developer toolchain:
|
|
100
|
+
|
|
101
|
+
- **[kc CLI](https://github.com/Kvindo/kc-cli)** — kubectl-style command-line client for Kvindo Cloud.
|
|
102
|
+
- **[terraform-provider-kvindo](https://github.com/Kvindo/terraform-provider-kvindo)** — Terraform provider ([Registry](https://registry.terraform.io/providers/kvindo/kvindo/latest)).
|
|
103
|
+
- **[Kvindo Cloud console](https://cloud.kvindo.com)** — web UI and API.
|
|
104
|
+
|
|
105
|
+
## License
|
|
106
|
+
|
|
107
|
+
MIT
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "kc-sdk-python"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Kvindo Cloud Python SDK — typed client for managing Kvindo Cloud infrastructure (VMs, S3, Kubernetes, load balancers, VPCs, PostgreSQL) via the REST API"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "Kvindo" }]
|
|
14
|
+
keywords = [
|
|
15
|
+
"kvindo",
|
|
16
|
+
"kvindo-cloud",
|
|
17
|
+
"cloud",
|
|
18
|
+
"cloud-api",
|
|
19
|
+
"iaas",
|
|
20
|
+
"infrastructure",
|
|
21
|
+
"infrastructure-as-code",
|
|
22
|
+
"sdk",
|
|
23
|
+
"api-client",
|
|
24
|
+
"rest-api",
|
|
25
|
+
"devops",
|
|
26
|
+
"vm",
|
|
27
|
+
"kubernetes",
|
|
28
|
+
"s3",
|
|
29
|
+
"object-storage",
|
|
30
|
+
"load-balancer",
|
|
31
|
+
"vpc",
|
|
32
|
+
"postgresql",
|
|
33
|
+
]
|
|
34
|
+
dependencies = [
|
|
35
|
+
"requests",
|
|
36
|
+
"marshmallow-dataclass",
|
|
37
|
+
"py-ulid",
|
|
38
|
+
]
|
|
39
|
+
classifiers = [
|
|
40
|
+
"Development Status :: 4 - Beta",
|
|
41
|
+
"Intended Audience :: Developers",
|
|
42
|
+
"Intended Audience :: System Administrators",
|
|
43
|
+
"Programming Language :: Python :: 3",
|
|
44
|
+
"Programming Language :: Python :: 3.8",
|
|
45
|
+
"Programming Language :: Python :: 3.9",
|
|
46
|
+
"Programming Language :: Python :: 3.10",
|
|
47
|
+
"Programming Language :: Python :: 3.11",
|
|
48
|
+
"Programming Language :: Python :: 3.12",
|
|
49
|
+
"Programming Language :: Python :: 3.13",
|
|
50
|
+
"Operating System :: OS Independent",
|
|
51
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
52
|
+
"Topic :: System :: Systems Administration",
|
|
53
|
+
"Topic :: Internet",
|
|
54
|
+
"Typing :: Typed",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[project.urls]
|
|
58
|
+
Homepage = "https://cloud.kvindo.com"
|
|
59
|
+
Repository = "https://github.com/Kvindo/kc-sdk-python"
|
|
60
|
+
Documentation = "https://github.com/Kvindo/kc-sdk-python#readme"
|
|
61
|
+
"Bug Tracker" = "https://github.com/Kvindo/kc-sdk-python/issues"
|
|
62
|
+
|
|
63
|
+
[tool.setuptools]
|
|
64
|
+
py-modules = ["kc_api"]
|
kc_sdk_python-0.1.0/PKG-INFO
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: kc-sdk-python
|
|
3
|
-
Version: 0.1.0
|
|
4
|
-
Summary: Python SDK / client for the Kvindo Cloud API
|
|
5
|
-
Author: Kvindo
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/Kvindo/kc-sdk-python
|
|
8
|
-
Project-URL: Repository, https://github.com/Kvindo/kc-sdk-python
|
|
9
|
-
Keywords: kvindo,cloud,sdk,client,api
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: Operating System :: OS Independent
|
|
12
|
-
Classifier: Intended Audience :: Developers
|
|
13
|
-
Requires-Python: >=3.8
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
Requires-Dist: requests
|
|
17
|
-
Requires-Dist: marshmallow-dataclass
|
|
18
|
-
Requires-Dist: py-ulid
|
|
19
|
-
Dynamic: license-file
|
|
20
|
-
|
|
21
|
-
# kc-sdk-python
|
|
22
|
-
|
|
23
|
-
Python SDK / client for the **Kvindo Cloud API**.
|
|
24
|
-
|
|
25
|
-
A thin, typed client over the REST API: one resource client per resource type
|
|
26
|
-
(VMs, volumes, load balancers, kubernetes, S3, VPCs, …), all sharing the same
|
|
27
|
-
create / read / update / delete / list contract.
|
|
28
|
-
|
|
29
|
-
## Install
|
|
30
|
-
|
|
31
|
-
```sh
|
|
32
|
-
pip install kc-sdk-python
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Dependencies: `requests`, `marshmallow-dataclass`, `py-ulid`.
|
|
36
|
-
|
|
37
|
-
## Usage
|
|
38
|
-
|
|
39
|
-
```python
|
|
40
|
-
from kc_api import KcClient
|
|
41
|
-
|
|
42
|
-
client = KcClient("YOUR_API_TOKEN") # api_url defaults to https://cloud-api.kvindo.ru
|
|
43
|
-
|
|
44
|
-
# List (label-filtered, paginated)
|
|
45
|
-
resp = client.vms.get_by_labels({"env": "prod"}, max_page_size=50)
|
|
46
|
-
for vm in resp.resources:
|
|
47
|
-
print(vm["metadata"]["name"])
|
|
48
|
-
|
|
49
|
-
# Read one
|
|
50
|
-
vm = client.vms.read("01H...")
|
|
51
|
-
print(vm.resource)
|
|
52
|
-
|
|
53
|
-
# Create / update (async) then wait for it to reconcile
|
|
54
|
-
created = client.vms.create_or_update({
|
|
55
|
-
"metadata": {"name": "my-vm", "folderId": "01H..."},
|
|
56
|
-
"spec": {"offerId": "g3-1c2-100", "state": "running", ...},
|
|
57
|
-
})
|
|
58
|
-
status = client.vms.wait_request_satisfied(created.requestId, timeout_seconds=300)
|
|
59
|
-
assert status.succeeded
|
|
60
|
-
|
|
61
|
-
# Delete (optionally block until reconciled)
|
|
62
|
-
client.vms.delete("01H...", wait=True)
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Create / update / delete are **asynchronous**: they return a `requestId`; poll
|
|
66
|
-
`read_request(requestId)` or use `wait_request_satisfied(...)`. Every response
|
|
67
|
-
object carries `errorMessage` / `errorCode` (a typed `KcApi*ErrorCode`) which are
|
|
68
|
-
`None` on success.
|
|
69
|
-
|
|
70
|
-
### Available resources
|
|
71
|
-
|
|
72
|
-
`KcClient` exposes one `KcResourceClient` per type, e.g. `client.vms`,
|
|
73
|
-
`client.volumes`, `client.s3_buckets`, `client.kubernetes`,
|
|
74
|
-
`client.load_balancers`, `client.vpcs`, `client.postgresql_standalones`,
|
|
75
|
-
`client.folders`, `client.transactions`, … (the surface mirrors the official
|
|
76
|
-
Kvindo Cloud API).
|
|
77
|
-
|
|
78
|
-
## License
|
|
79
|
-
|
|
80
|
-
MIT
|
kc_sdk_python-0.1.0/README.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# kc-sdk-python
|
|
2
|
-
|
|
3
|
-
Python SDK / client for the **Kvindo Cloud API**.
|
|
4
|
-
|
|
5
|
-
A thin, typed client over the REST API: one resource client per resource type
|
|
6
|
-
(VMs, volumes, load balancers, kubernetes, S3, VPCs, …), all sharing the same
|
|
7
|
-
create / read / update / delete / list contract.
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```sh
|
|
12
|
-
pip install kc-sdk-python
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Dependencies: `requests`, `marshmallow-dataclass`, `py-ulid`.
|
|
16
|
-
|
|
17
|
-
## Usage
|
|
18
|
-
|
|
19
|
-
```python
|
|
20
|
-
from kc_api import KcClient
|
|
21
|
-
|
|
22
|
-
client = KcClient("YOUR_API_TOKEN") # api_url defaults to https://cloud-api.kvindo.ru
|
|
23
|
-
|
|
24
|
-
# List (label-filtered, paginated)
|
|
25
|
-
resp = client.vms.get_by_labels({"env": "prod"}, max_page_size=50)
|
|
26
|
-
for vm in resp.resources:
|
|
27
|
-
print(vm["metadata"]["name"])
|
|
28
|
-
|
|
29
|
-
# Read one
|
|
30
|
-
vm = client.vms.read("01H...")
|
|
31
|
-
print(vm.resource)
|
|
32
|
-
|
|
33
|
-
# Create / update (async) then wait for it to reconcile
|
|
34
|
-
created = client.vms.create_or_update({
|
|
35
|
-
"metadata": {"name": "my-vm", "folderId": "01H..."},
|
|
36
|
-
"spec": {"offerId": "g3-1c2-100", "state": "running", ...},
|
|
37
|
-
})
|
|
38
|
-
status = client.vms.wait_request_satisfied(created.requestId, timeout_seconds=300)
|
|
39
|
-
assert status.succeeded
|
|
40
|
-
|
|
41
|
-
# Delete (optionally block until reconciled)
|
|
42
|
-
client.vms.delete("01H...", wait=True)
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Create / update / delete are **asynchronous**: they return a `requestId`; poll
|
|
46
|
-
`read_request(requestId)` or use `wait_request_satisfied(...)`. Every response
|
|
47
|
-
object carries `errorMessage` / `errorCode` (a typed `KcApi*ErrorCode`) which are
|
|
48
|
-
`None` on success.
|
|
49
|
-
|
|
50
|
-
### Available resources
|
|
51
|
-
|
|
52
|
-
`KcClient` exposes one `KcResourceClient` per type, e.g. `client.vms`,
|
|
53
|
-
`client.volumes`, `client.s3_buckets`, `client.kubernetes`,
|
|
54
|
-
`client.load_balancers`, `client.vpcs`, `client.postgresql_standalones`,
|
|
55
|
-
`client.folders`, `client.transactions`, … (the surface mirrors the official
|
|
56
|
-
Kvindo Cloud API).
|
|
57
|
-
|
|
58
|
-
## License
|
|
59
|
-
|
|
60
|
-
MIT
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
[build-system]
|
|
2
|
-
requires = ["setuptools>=77.0"]
|
|
3
|
-
build-backend = "setuptools.build_meta"
|
|
4
|
-
|
|
5
|
-
[project]
|
|
6
|
-
name = "kc-sdk-python"
|
|
7
|
-
version = "0.1.0"
|
|
8
|
-
description = "Python SDK / client for the Kvindo Cloud API"
|
|
9
|
-
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.8"
|
|
11
|
-
license = "MIT"
|
|
12
|
-
license-files = ["LICENSE"]
|
|
13
|
-
authors = [{ name = "Kvindo" }]
|
|
14
|
-
keywords = ["kvindo", "cloud", "sdk", "client", "api"]
|
|
15
|
-
dependencies = [
|
|
16
|
-
"requests",
|
|
17
|
-
"marshmallow-dataclass",
|
|
18
|
-
"py-ulid",
|
|
19
|
-
]
|
|
20
|
-
classifiers = [
|
|
21
|
-
"Programming Language :: Python :: 3",
|
|
22
|
-
"Operating System :: OS Independent",
|
|
23
|
-
"Intended Audience :: Developers",
|
|
24
|
-
]
|
|
25
|
-
|
|
26
|
-
[project.urls]
|
|
27
|
-
Homepage = "https://github.com/Kvindo/kc-sdk-python"
|
|
28
|
-
Repository = "https://github.com/Kvindo/kc-sdk-python"
|
|
29
|
-
|
|
30
|
-
[tool.setuptools]
|
|
31
|
-
py-modules = ["kc_api"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|