Skip to main content

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 Machines
  • client.dks -> Kubernetes Clusters
  • client.dds -> Managed Databases
  • client.dcr -> Container Registry
  • client.dss -> Object Storage
  • client.nodeTypes (or client.node_types) -> Node Types
  • client.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_dcp so regenerated files are not overwritten.

Contributing

See CONTRIBUTING.md for developer setup, SDK regeneration steps, and PR guidelines.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nexqloud_dcp-1.0.0.tar.gz (88.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nexqloud_dcp-1.0.0-py3-none-any.whl (173.3 kB view details)

Uploaded Python 3

File details

Details for the file nexqloud_dcp-1.0.0.tar.gz.

File metadata

  • Download URL: nexqloud_dcp-1.0.0.tar.gz
  • Upload date:
  • Size: 88.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nexqloud_dcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b002f43ff5f7e59b6ffabb77c3022ec66f25ef24e15e81d8fadc1ec989ea7112
MD5 ab053acd50d350f883dfd0e3963f3a9f
BLAKE2b-256 a8a9d21658aed0582abd9da55bf032e6801017ca6eb65106f984d8fdae4fe799

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexqloud_dcp-1.0.0.tar.gz:

Publisher: publish.yml on nexqloud/dcp-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nexqloud_dcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: nexqloud_dcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 173.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for nexqloud_dcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99ccca822a9c6ec4c9a50b947cd5365e002c7ea1eb8cc1d5be9ba09d16c91876
MD5 9b496ddb0437ad53892a52d1a643a684
BLAKE2b-256 bf69ec52da80075c037a681ecfe0e98e54cc5a686cb899a5dd536ccea8cf3e93

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexqloud_dcp-1.0.0-py3-none-any.whl:

Publisher: publish.yml on nexqloud/dcp-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page