Official Python SDK for Nexqloud DCP (Distributed Cloud Platform)
Project description
Nexqloud DCP Python SDK
Official Python SDK for Nexqloud DCP (Distributed Cloud Platform).
This SDK provides a high-level DCPClient wrapper over the generated API client, with:
- API key authentication via constructor or
DCP_API_KEY - Service aliases that match the JavaScript SDK style (
dc2,dks,dds,dcr,dss) - Configurable timeout and retries
- Passthrough
fetch(...)for authenticated low-level requests
Requirements
- Python 3.9+
- A Nexqloud DCP API key
Installation
Install from PyPI:
pip install nexqloud-dcp
The import path remains:
from nexqloud_dcp import DCPClient, DCPClientOptions
Local Development Setup
If you are working from this repository directly, run your scripts with src on PYTHONPATH:
PYTHONPATH=src python your_script.py
Quick Start
import os
from nexqloud_dcp import DCPClient
os.environ["DCP_API_KEY"] = "dcp_your_api_key"
client = DCPClient()
node_types = client.nodeTypes.node_types_controller_find_all()
for node_type in node_types:
print(node_type.node_type_id, node_type.label)
Authentication
Option 1: Environment variable
export DCP_API_KEY=dcp_your_api_key
from nexqloud_dcp import DCPClient
client = DCPClient()
Option 2: Pass key directly
from nexqloud_dcp import DCPClient, DCPClientOptions
client = DCPClient(
DCPClientOptions(api_key="dcp_your_api_key")
)
Service Clients
DCPClient exposes service aliases aligned with the TypeScript SDK naming:
client.dc2-> Virtual Machinesclient.dks-> Kubernetes Clustersclient.dds-> Managed Databasesclient.dcr-> Container Registryclient.dss-> Object Storageclient.nodeTypes(orclient.node_types) -> Node Typesclient.regions-> Metadata
Usage Examples
List Virtual Machines
from nexqloud_dcp import DCPClient, DCPClientOptions
client = DCPClient(DCPClientOptions(api_key="dcp_your_api_key"))
vms = client.dc2.virtual_machines_controller_find_all()
print(vms)
List Clusters
from nexqloud_dcp import DCPClient, DCPClientOptions
client = DCPClient(DCPClientOptions(api_key="dcp_your_api_key"))
clusters = client.dks.clusters_controller_find_all(query="")
print(clusters)
List Managed Databases
from nexqloud_dcp import DCPClient, DCPClientOptions
client = DCPClient(DCPClientOptions(api_key="dcp_your_api_key"))
databases = client.dds.managed_databases_controller_list_databases(
include_deleted="false",
page=1,
page_size=10,
)
print(databases)
Advanced Configuration
from nexqloud_dcp import DCPClient, DCPClientOptions
client = DCPClient(
DCPClientOptions(
api_key="dcp_your_api_key",
base_url="https://gateway.dcp.nexqloud.net",
timeout_in_seconds=60,
max_retries=3,
)
)
Low-Level Authenticated Requests
Use fetch(...) when you need raw HTTP behavior while still using SDK auth/retry config.
from nexqloud_dcp import DCPClient, DCPClientOptions
client = DCPClient(DCPClientOptions(api_key="dcp_your_api_key"))
response = client.fetch("/api/v1/node-types", method="GET")
response.raise_for_status()
print(response.json())
You can also pass a full URL:
response = client.fetch("https://gateway.dcp.nexqloud.net/api/v1/node-types")
Error Handling
from nexqloud_dcp import DCPClient, DCPClientOptions
from generated.errors import BadRequestError, NotFoundError
client = DCPClient(DCPClientOptions(api_key="dcp_your_api_key"))
try:
client.dc2.virtual_machines_controller_find_one("vm-id")
except NotFoundError:
print("VM not found")
except BadRequestError as err:
print("Bad request:", err)
Notes
- The generated SDK lives under
src/generated. - The high-level wrapper lives under
src/nexqloud_dcp. - Prefer adding custom behavior in
src/nexqloud_dcpso regenerated files are not overwritten.
Contributing
See CONTRIBUTING.md for developer setup, SDK regeneration steps, and PR guidelines.
Project details
Release history Release notifications | RSS feed
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 nexqloud_dcp-1.0.3.tar.gz.
File metadata
- Download URL: nexqloud_dcp-1.0.3.tar.gz
- Upload date:
- Size: 87.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efce69174294634faad971686775497f469e9d53a1ec1197932752072f2bad3a
|
|
| MD5 |
8fecd02df794458c0af60d175cecbd3b
|
|
| BLAKE2b-256 |
d210091ddaf548ab7c73a31f4ea6a27340a390b2ab49acc196fcb1c669ab09a9
|
Provenance
The following attestation bundles were made for nexqloud_dcp-1.0.3.tar.gz:
Publisher:
publish.yml on nexqloud/dcp-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nexqloud_dcp-1.0.3.tar.gz -
Subject digest:
efce69174294634faad971686775497f469e9d53a1ec1197932752072f2bad3a - Sigstore transparency entry: 1852817164
- Sigstore integration time:
-
Permalink:
nexqloud/dcp-sdk-python@16652c2b271bfe1c1699d9269767b6dfe73cf8ea -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/nexqloud
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16652c2b271bfe1c1699d9269767b6dfe73cf8ea -
Trigger Event:
push
-
Statement type:
File details
Details for the file nexqloud_dcp-1.0.3-py3-none-any.whl.
File metadata
- Download URL: nexqloud_dcp-1.0.3-py3-none-any.whl
- Upload date:
- Size: 164.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d0c6794e9b6f7838d5eaf472e27f74d5ff86a9961fcfe7d692651426854bfb8
|
|
| MD5 |
a576467452f89a5004df0fb5f711c532
|
|
| BLAKE2b-256 |
45477cfce7a527c80fa9795335d2794882d70d1eff9262f8f360d4d0d4298a8f
|
Provenance
The following attestation bundles were made for nexqloud_dcp-1.0.3-py3-none-any.whl:
Publisher:
publish.yml on nexqloud/dcp-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nexqloud_dcp-1.0.3-py3-none-any.whl -
Subject digest:
3d0c6794e9b6f7838d5eaf472e27f74d5ff86a9961fcfe7d692651426854bfb8 - Sigstore transparency entry: 1852817290
- Sigstore integration time:
-
Permalink:
nexqloud/dcp-sdk-python@16652c2b271bfe1c1699d9269767b6dfe73cf8ea -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/nexqloud
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@16652c2b271bfe1c1699d9269767b6dfe73cf8ea -
Trigger Event:
push
-
Statement type: