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.3.tar.gz (87.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.3-py3-none-any.whl (164.0 kB view details)

Uploaded Python 3

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

Hashes for nexqloud_dcp-1.0.3.tar.gz
Algorithm Hash digest
SHA256 efce69174294634faad971686775497f469e9d53a1ec1197932752072f2bad3a
MD5 8fecd02df794458c0af60d175cecbd3b
BLAKE2b-256 d210091ddaf548ab7c73a31f4ea6a27340a390b2ab49acc196fcb1c669ab09a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for nexqloud_dcp-1.0.3.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.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

Hashes for nexqloud_dcp-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3d0c6794e9b6f7838d5eaf472e27f74d5ff86a9961fcfe7d692651426854bfb8
MD5 a576467452f89a5004df0fb5f711c532
BLAKE2b-256 45477cfce7a527c80fa9795335d2794882d70d1eff9262f8f360d4d0d4298a8f

See more details on using hashes here.

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

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