kc-sdk-python 0.1.0__tar.gz → 0.2.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-0.2.0/PKG-INFO +107 -0
- kc_sdk_python-0.1.0/kc_sdk_python.egg-info/PKG-INFO → kc_sdk_python-0.2.0/README.md +20 -27
- kc_sdk_python-0.2.0/kc_sdk_python.egg-info/PKG-INFO +107 -0
- kc_sdk_python-0.2.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-0.2.0}/LICENSE +0 -0
- {kc_sdk_python-0.1.0 → kc_sdk_python-0.2.0}/kc_api.py +0 -0
- {kc_sdk_python-0.1.0 → kc_sdk_python-0.2.0}/kc_sdk_python.egg-info/SOURCES.txt +0 -0
- {kc_sdk_python-0.1.0 → kc_sdk_python-0.2.0}/kc_sdk_python.egg-info/dependency_links.txt +0 -0
- {kc_sdk_python-0.1.0 → kc_sdk_python-0.2.0}/kc_sdk_python.egg-info/requires.txt +0 -0
- {kc_sdk_python-0.1.0 → kc_sdk_python-0.2.0}/kc_sdk_python.egg-info/top_level.txt +0 -0
- {kc_sdk_python-0.1.0 → kc_sdk_python-0.2.0}/setup.cfg +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kc-sdk-python
|
|
3
|
+
Version: 0.2.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
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kc-sdk-python
|
|
3
|
+
Version: 0.2.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 = "0.2.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
|
|
File without changes
|