An unofficial synchronous Python client for the REG.Cloud CloudVPS API. It covers every operation currently published in the CloudVPS API v1 and API v2 OpenAPI contracts.
This project is maintained independently and is not an official REG.Cloud SDK.
Requirements
Python 3.11 through 3.14 are supported.
Installation
python -m pip install api-cloudvps-py
Authentication
Create an API token in the REG.Cloud control panel and keep it outside source code. For example:
export CLOUDVPS_TOKEN='replace-with-your-token'
import os
from cloudvps import Api
with Api(os.environ["CLOUDVPS_TOKEN"]) as api:
sizes = api.v1.common.sizes()
plans = api.v2.plans.list("openstack-sam1", items_per_page=10)
The default request timeout is 30 seconds. Set a scalar or a Requests-style connect/read tuple when necessary:
api = Api(os.environ["CLOUDVPS_TOKEN"], timeout=(5, 60))
Quick examples
The following operations only read account or catalog state:
servers = api.v1.servers.list()
images = api.v2.images.list(
"openstack-sam1",
page=1,
items_per_page=10,
type="distribution",
)
balance = api.v1.billing.balance()
The next example creates a billable server and deletes it. Review the selected plan, image, region, and resulting charges before executing it:
created = api.v1.servers.create(
"api-client-example",
"c1-m1-d10-hp",
"ubuntu-24-04-amd64",
region_slug="openstack-sam1",
backups=False,
)
server_id = created["reglet"]["id"]
api.v1.servers.delete(server_id)
The following calls also change infrastructure and may affect availability or cost. Inspect their responses and remove temporary resources promptly:
ip_result = api.v1.ips.create(server_id, ipv4_count=1)
snapshot_action = api.v1.servers.snapshot(server_id, "before-upgrade", offline=True)
network = api.v1.vpcs.create("private-network")
vpc_id = network["resource_id"]
attach_action = api.v1.vpcs.attach(vpc_id, server_id)
# After the provider actions finish:
api.v1.vpcs.detach(vpc_id, server_id)
# CloudVPS currently keeps private networks: vpcs.delete() returns HTTP 501.
Errors
Non-success HTTP responses raise CloudVpsAPIError. The exception exposes status_code, code, and message where supplied by the provider. Bearer tokens are redacted from exception text.
from cloudvps import CloudVpsAPIError
try:
api.v1.servers.get(123)
except CloudVpsAPIError as error:
print(error.status_code, error.code, error.message)
API versions and compatibility
Use api.v1 for operational resources and api.v2 for regional plans and images. The historical api.ssh, api.common, api.history, api.snapshots, api.images, api.actions, and api.vps accessors remain aliases for v1 in the 0.2 release line.
See API reference for all methods and migration guide before upgrading from 0.1.7.
Terraform or Python?
Use the official REG.Cloud Terraform provider for declarative lifecycle management of servers, GPU servers, SSH keys, and snapshots. Use this Python client for imperative automation and for the wider CloudVPS surface such as billing, IP addresses, private networks, actions, and account history. This package does not replace Terraform.
Development and releases
See contributing guide, security policy, and release runbook. Releases are published from GitHub Actions through PyPI Trusted Publishing; no long-lived PyPI upload token is stored in the repository.
License
MIT, copyright Anton Grudin.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file api_cloudvps_py-0.2.0.tar.gz.
File metadata
- Download URL: api_cloudvps_py-0.2.0.tar.gz
- Upload date:
- Size: 40.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ceb6a3239c3ecb133b29415a9c20df52b3e467640909eeb27db13850caf7ff9
|
|
| MD5 |
1683cc0572010cd05b115d3282e0aa6f
|
|
| BLAKE2b-256 |
83cee938073f247abe620227cf1dcd9e812806add0ead428339c2429b6b4b92a
|
Provenance
The following attestation bundles were made for api_cloudvps_py-0.2.0.tar.gz:
Publisher:
release.yml on wa-pis/api-cloudvps-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
api_cloudvps_py-0.2.0.tar.gz -
Subject digest:
5ceb6a3239c3ecb133b29415a9c20df52b3e467640909eeb27db13850caf7ff9 - Sigstore transparency entry: 2439761697
- Sigstore integration time:
-
Permalink:
wa-pis/api-cloudvps-py@8e8dcf587e0cc6a2f2025bbafe69b0a5bd21b652 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/wa-pis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e8dcf587e0cc6a2f2025bbafe69b0a5bd21b652 -
Trigger Event:
release
-
Statement type:
File details
Details for the file api_cloudvps_py-0.2.0-py3-none-any.whl.
File metadata
- Download URL: api_cloudvps_py-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e39014a11fe8ddb2a8264761a07a05b92bb0c3d6cd928bbf7ef60715fd5295cf
|
|
| MD5 |
a593a82b4fdaca6b8d6531b61cb568ff
|
|
| BLAKE2b-256 |
b1e0e6c51541199e40d6ba2e7bf8620be05776dc67136d59fc62ef1a30e6734b
|
Provenance
The following attestation bundles were made for api_cloudvps_py-0.2.0-py3-none-any.whl:
Publisher:
release.yml on wa-pis/api-cloudvps-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
api_cloudvps_py-0.2.0-py3-none-any.whl -
Subject digest:
e39014a11fe8ddb2a8264761a07a05b92bb0c3d6cd928bbf7ef60715fd5295cf - Sigstore transparency entry: 2439761718
- Sigstore integration time:
-
Permalink:
wa-pis/api-cloudvps-py@8e8dcf587e0cc6a2f2025bbafe69b0a5bd21b652 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/wa-pis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8e8dcf587e0cc6a2f2025bbafe69b0a5bd21b652 -
Trigger Event:
release
-
Statement type: