### Install and authenticate DCP CLI, then create a VM Source: https://docs.nexqloud.io/docs/3.CLI Quick start commands to install the DCP CLI via Homebrew, authenticate with `dcp auth login`, and create a virtual machine instance with `dcp dc2 instances create`. The example uses the `ubuntu-24.04` image and `nx-1-small` type. ```bash brew install nexqloud/tap/dcp dcp auth login dcp dc2 instances create --name my-app --image ubuntu-24.04 --type nx-1-small ``` -------------------------------- ### Install nexqloud-dcp-sdk Source: https://docs.nexqloud.io/docs/4.SDKs/python Install the Python SDK using pip. ```bash pip install nexqloud-dcp-sdk ``` -------------------------------- ### Expected output of kubectl get pods Source: https://docs.nexqloud.io/docs/1.Docs/containers/kubernetes/2.create-cluster Example output showing the nginx pod running successfully. ```text NAME READY STATUS RESTARTS AGE nginx-7854ff8877-x2k9f 1/1 Running 0 30s ``` -------------------------------- ### Install @nexqloud-dcp/sdk Source: https://docs.nexqloud.io/docs/4.SDKs/typescript Installs the SDK package. Works with npm, yarn, pnpm, and bun. ```bash npm install @nexqloud-dcp/sdk ``` -------------------------------- ### Push image example Source: https://docs.nexqloud.io/docs/1.Docs/containers/container-registry/4.push-images Example of pushing the tagged image 'myapp:latest' to the registry 'my-app-registry'. ```bash docker push dcr.nexqloud.io/my-app-registry/myapp:latest ``` -------------------------------- ### Install boto3 Source: https://docs.nexqloud.io/docs/1.Docs/storage/5.s3-api-usage Install the boto3 library using pip. ```bash pip install boto3 ``` -------------------------------- ### Tag image example Source: https://docs.nexqloud.io/docs/1.Docs/containers/container-registry/4.push-images Example of tagging a local image 'myapp:latest' for the registry 'my-app-registry'. ```bash docker tag myapp:latest dcr.nexqloud.io/my-app-registry/myapp:latest ``` -------------------------------- ### 200 response body for start VM Source: https://docs.nexqloud.io/docs/2.API-Reference/virtual-machines/startVirtualMachine Successful response indicating the VM start has been initiated. ```json { "message": "VM start initiated"} ``` -------------------------------- ### Install the DCP CLI Source: https://docs.nexqloud.io/docs/1.Docs/getting-started/3.quickstart Downloads and runs the official installer script for the latest DCP CLI. ```bash curl -fsSL https://cli.nexqloud.net/latest/install.sh | bash ``` -------------------------------- ### Example 200 response for get node type Source: https://docs.nexqloud.io/docs/2.API-Reference/virtual-machines/getNodeType Shows the JSON structure returned on success, including node type details like vcpu, ram, storage, and gpu. ```json { "_id": "nx-1-xsmall", "nodeTypeId": "nx-1-xsmall", "label": "NX 1 XSMALL", "vcpu": 4, "ram": 2048, "storage": "100 GB", "gpu": "RTX A1000", "cpu": "EPYC 7002", "createdAt": "2024-01-01T00:00:00.000Z", "updatedAt": "2024-01-01T00:00:00.000Z", "group": "standard" } ``` -------------------------------- ### Example Pull Command Source: https://docs.nexqloud.io/docs/1.Docs/containers/container-registry/5.pull-images Example of pulling a specific image from the registry. ```bash docker pull dcr.nexqloud.io/my-app-registry/myapp:latest ``` -------------------------------- ### dcp dss objects upload example with --key Source: https://docs.nexqloud.io/docs/3.CLI/commands/dss Example upload command that specifies a custom object key. The --key flag sets the object key to 'backups/archive.tar.gz' for the local file './archive.tar.gz'. ```bash dcp dss objects upload \ --bucket my-bucket \ --key backups/archive.tar.gz \ --file ./archive.tar.gz ``` -------------------------------- ### 201 response example for creating a managed database Source: https://docs.nexqloud.io/docs/2.API-Reference/managed-databases/createManagedDatabase Example response body for a successful creation, showing the managed database object with nodes, backup, and connection details. ```json { "id": "6a0db02257c559c6754ea92e", "accountId": "68b0af9e0e82cf468d167c52", "name": "pg-romit-v1-62482317", "displayName": "romit-v1", "engine": "postgresql", "version": "17", "tier": "dev", "mode": "standalone", "status": "pending", "instanceType": "db-small", "region": "us-east-1", "dpnId": "68b0af9e0e82cf468d167c52", "nodes": [ { "id": "pg-rXXXXXXX", "dc2InstanceId": "", "role": "primary", "status": "pending", "port": 5432, "createdAt": "2026-05-20T12:59:15.708517504Z", "updatedAt": "2026-05-20T12:59:15.708517504Z" } ], "backup": { "s3Bucket": "dcp-dev-dds-backups", "s3Region": "us-east-1", "retentionDays": 7 }, "publicEndpoint": true, "databaseName": "romit_v1", "username": "admin", "password": "XXXXXXXXX", "createdAt": "2026-05-20T12:59:15.708517504Z", "updatedAt": "2026-05-20T12:59:15.708517504Z" } ``` -------------------------------- ### Successful response example Source: https://docs.nexqloud.io/docs/2.API-Reference Example JSON response for a resource, including stable identifiers, lifecycle status, timestamps, and service-specific configuration. Status values vary by service. ```json { "id": "cluster_123", "name": "production-cluster", "status": "provisioning", "regionId": "us-east-1", "createdAt": "2026-05-29T00:00:00Z" } ``` -------------------------------- ### Repository structure example Source: https://docs.nexqloud.io/docs/1.Docs/containers/container-registry/6.manage-repositories Shows a typical hierarchical repository structure for organizing images by component and version. ```text dcr.nexqloud.io// ├── frontend/web:latest ├── frontend/web:v1.0.0 ├── backend/api:latest ├── backend/api:v2.1.0 ├── backend/worker:latest └── services/auth:v1.0.0 ``` -------------------------------- ### cURL request to start a virtual machine Source: https://docs.nexqloud.io/docs/2.API-Reference/virtual-machines/startVirtualMachine Sends a POST request to the start endpoint with a Bearer token. Replace 'string' with the VM ID and provide a valid token. ```bash curl -X POST "https://gateway.dcp.nexqloud.net/api/v1/virtualmachines/string/start" \ -H "Authorization: Bearer " ``` -------------------------------- ### Install DCP CLI via Homebrew (macOS) Source: https://docs.nexqloud.io/docs/3.CLI/installation Installs the DCP CLI using Homebrew on macOS. Run this command in your terminal. ```bash brew install nexqloud/tap/dcp ``` -------------------------------- ### DNS CNAME Record Example Source: https://docs.nexqloud.io/docs/1.Docs/containers/kubernetes/4.ingress-domains Example wildcard CNAME record pointing *.yourdomain.com to edge.dcptunnel.net with TTL 300, as shown in the DNS provider configuration. ```text *.yourdomain.com → edge.dcptunnel.net (TTL: 300) ``` -------------------------------- ### List virtual machines Source: https://docs.nexqloud.io/docs/1.Docs/getting-started/3.quickstart Lists your virtual machines. Expected result: quickstart-vm appears in the list and moves to Running or a ready state. ```bash dcp dc2 instances list ``` -------------------------------- ### Create a virtual machine with the Go SDK preview Source: https://docs.nexqloud.io/docs/4.SDKs/go Preview example showing how to create a virtual machine using the Go SDK. Requires a valid API key. The SDK is in active development and not recommended for production use. ```go package main import ( "context" "fmt" dcp "github.com/nexqloud/dcp-sdk-go" ) func main() { client := dcp.NewClient(dcp.WithAPIKey("your_api_key_here")) vm, err := client.VirtualMachines.Create(context.Background(), &dcp.CreateVMInput{ Name: "my-app-server", NodeTypeID: "standard-2c-4gb", RegionID: "us-east-1", OSImageID: "ubuntu-22.04", }) if err != nil { panic(err) } fmt.Printf("Created: %s\n", vm.ID) } ``` -------------------------------- ### 200 response body for get backup Source: https://docs.nexqloud.io/docs/2.API-Reference/virtual-machines/getVirtualMachineBackup Example of a successful response containing backup metadata such as id, vmId, status, and s3Path. ```json { "id": "test-backup-001", "accountId": "test-account-001", "vmId": "test-vm-001", "vmName": "Test VM", "name": "test-backup-001", "description": "Test backup", "status": "available", "s3Path": "s3://test-bucket/path/to/backup.qcow2", "size": 1024, "createdAt": "2026-01-01T00:00:00.000Z", "updatedAt": "2026-01-02T00:00:00.000Z" } ``` -------------------------------- ### Create a small Ubuntu VM Source: https://docs.nexqloud.io/docs/1.Docs/getting-started/3.quickstart Creates a VM named quickstart-vm using the ubuntu-24.04 image and nx-1-small node type. The CLI prompts for missing values if your account requires a region, zone, SSH key, or service tier. ```bash dcp dc2 instances create \ --name quickstart-vm \ --image ubuntu-24.04 \ --type nx-1-small ``` -------------------------------- ### 200 response body for get DPN Source: https://docs.nexqloud.io/docs/2.API-Reference/dpn/getDpn Example JSON response returned on success. Contains the DPN object and an array of members with their details. ```json { "dpn": { "id": "67f3af9c7f4dd6647e8f0a11", "name": "production-network", "accountId": "acc-123", "nebulaGroup": "dpn-67f3af9c7f4dd6647e8f0a11", "status": "active", "createdAt": "2026-05-13T10:30:00Z", "updatedAt": "2026-05-13T10:30:00Z" }, "members": [ { "id": "member-123", "resourceType": "dc2", "resourceId": "vm-123", "hostname": "dc2-vm-01", "nebulaIp": "100.64.7.50", "groups": [ "dc2-vm", "dpn-67f3af9c" ], "enrolledAt": "2026-05-13T10:30:00Z" } ] } ``` -------------------------------- ### Expected output of kubectl get nodes Source: https://docs.nexqloud.io/docs/1.Docs/containers/kubernetes/2.create-cluster Example output showing two worker nodes in Ready state after successful connection. ```text NAME STATUS ROLES AGE VERSION worker-node-1 Ready 2m v1.29.x worker-node-2 Ready 2m v1.29.x ``` -------------------------------- ### 201 Success response Source: https://docs.nexqloud.io/docs/2.API-Reference/kubernetes/createNodePool Example response when the node pool creation command is published successfully. ```json { "message": "Node pool creation command published successfully" } ``` -------------------------------- ### 200 response body for get cluster Source: https://docs.nexqloud.io/docs/2.API-Reference/kubernetes/getCluster Example of a successful response containing cluster details such as node groups, status, version, and custom domains. ```json { "_id": "66b0af9fe0e82cf468d167c52", "id": "66b0af9fe0e82cf468d167c52", "accountId": "68b0af9e0e82cf468d167c52", "name": "my-app-cluster", "region": "EMEA", "nodeGroups": [ { "_id": "66b0af9fe0e82cf468d167c52", "nodeGroupId": "66b0af9fe0e82cf468d167c52", "clusterId": "66b0af9fe0e82cf468d167c10", "name": "nodes-nx2-dce8s", "nodeTypeId": "nx2-small", "operatingSystem": "Linux 2023 (arm64) Standard (L23-ARM-64-Standard)", "capacityType": "Spot", "securityTier": "D", "status": "active", "nodes": 1, "hardwareSpec": { "cpu": 2, "memory": 4096, "disk": 20 }, "labels": [ { "key": "environment", "value": "dev", "scope": "All Nodes" } ], "taints": [ { "key": "dedicated", "value": "gpu", "effect": "NoSchedule" } ] } ], "dks_cluster": true, "status": "active", "version": "v1.29.0", "distribution": "talos", "customDomains": [ "*.example.com", "app.example.com" ], "description": "Production cluster for web applications", "tags": { "environment": "production", "team": "platform" }, "starred": true, "createdAt": "2026-05-22T00:00:00.000Z", "updatedAt": "2026-05-22T00:00:00.000Z", "clusterDNS": "cluster.local", "tailscaleEndpoint": "100.64.0.10", "tailscaleSubnet": "100.64.0.0/24", "tailscaleNamespace": "tailscale", "tailscaleCreatedAt": "2026-05-22T00:00:00.000Z", "controlPlaneHostname": "controlplane-01", "controlPlaneWaitStarted": "2026-05-22T00:00:00.000Z", "tunnelId": "tnl_abc123" } ``` -------------------------------- ### Connect to PostgreSQL using Go (lib/pq) Source: https://docs.nexqloud.io/docs/1.Docs/databases/3.connect-database Use the lib/pq driver to open a PostgreSQL connection in Go. The example imports database/sql and the driver, then builds a connection string and calls sql.Open. ```go import ( "database/sql" _ "github.com/lib/pq" ) connStr := "host= port=5432 user= password= dbname= sslmode=require" db, err := sql.Open("postgres", connStr) ``` -------------------------------- ### cURL request to list node types Source: https://docs.nexqloud.io/docs/2.API-Reference/virtual-machines/listNodeTypes Sends a GET request to https://gateway.dcp.nexqloud.net/api/v1/node-types with an Authorization header using a Bearer token. The token is shown as empty in the example. ```bash curl -X GET "https://gateway.dcp.nexqloud.net/api/v1/node-types" \ -H "Authorization: Bearer " ``` -------------------------------- ### cURL request to check public IPv4 availability Source: https://docs.nexqloud.io/docs/2.API-Reference/virtual-machines/checkVirtualMachinePublicIpv4Availability Sends a GET request to the availability endpoint with a Bearer token. The token is empty in the example; replace with your actual token. ```bash curl -X GET "https://gateway.dcp.nexqloud.net/api/v1/virtualmachines/public-ips/availability" \ -H "Authorization: Bearer " ``` -------------------------------- ### cURL request to fetch multiple secrets Source: https://docs.nexqloud.io/docs/2.API-Reference/secrets-manager/getRuntimeSecrets Sends a GET request to the runtime secrets endpoint with a Bearer token. The response is a 200 status with an empty body in the example. ```bash curl -X GET "https://gateway.dcp.nexqloud.net/api/v1/secrets-manager/runtime/projects/string/environments/string/secrets" \ -H "Authorization: Bearer " ``` -------------------------------- ### Create a DCPClient with API key and options Source: https://docs.nexqloud.io/docs/4.SDKs/python Initializes a DCPClient with an API key from the environment, a 60-second timeout, and 3 retries. ```python import os from nexqloud_dcp import DCPClient, DCPClientOptions client = DCPClient( DCPClientOptions( api_key=os.environ["DCP_API_KEY"], timeout_in_seconds=60, max_retries=3, ) ) ``` -------------------------------- ### cURL request to list managed database backups Source: https://docs.nexqloud.io/docs/2.API-Reference/managed-databases/listManagedDatabaseBackups Sends a GET request to the backups endpoint with a Bearer token. The {id} path parameter is replaced with 'string' in the example. ```bash curl -X GET "https://gateway.dcp.nexqloud.net/api/v1/managed-databases/string/backups" \ -H "Authorization: Bearer " ``` -------------------------------- ### cURL request to list all managed database backups Source: https://docs.nexqloud.io/docs/2.API-Reference/managed-databases/listAccountManagedDatabaseBackups Sends a GET request to the backups endpoint with Bearer token authentication. The token is provided as 'Bearer ' (empty in the example). ```bash curl -X GET "https://gateway.dcp.nexqloud.net/api/v1/managed-databases/backups" \ -H "Authorization: Bearer " ``` -------------------------------- ### 200 response for get object storage usage Source: https://docs.nexqloud.io/docs/2.API-Reference/object-storage/getObjectStorageUsage Example success response containing an array of usage data objects with fields for bucket ID, bytes in/out, and operation count. ```json { "success": true, "data": [ { "_id": "my-files", "totalBytesIn": 1024, "totalBytesOut": 2048, "operationCount": 12 } ] } ``` -------------------------------- ### Initialize DCPClient and list virtual machines Source: https://docs.nexqloud.io/docs/4.SDKs/python Creates a DCPClient and lists virtual machines using the dc2 service client. Requires Python 3.9+, a DCP API key, and server-side runtime access to DCP_API_KEY. ```python from nexqloud_dcp import DCPClient client = DCPClient() vms = client.dc2.list_virtual_machines() for vm in vms: print(vm.name, vm.status) ``` -------------------------------- ### cURL request to stream Kubernetes resource logs Source: https://docs.nexqloud.io/docs/2.API-Reference/kubernetes/streamK8sResourceLogs Sends a GET request to the logs endpoint with a Bearer token. The resourceKind and resourceName are placeholders in the URL. The token is empty in the example. ```cURL curl -X GET "https://gateway.dcp.nexqloud.net/api/v1/clusters/string/string/logs" \ -H "Authorization: Bearer " ``` -------------------------------- ### Create a Client Source: https://docs.nexqloud.io/docs/4.SDKs/typescript Initializes the DCPClient with an API key, timeout, and retry configuration. ```APIDOC ## Create a Client ### Description Initializes the DCPClient with an API key, timeout, and retry configuration. ### Method Constructor ### Endpoint `new DCPClient(options)` ### Parameters - **apiKey** (string) - Required - The API key for authentication. - **timeoutInSeconds** (number) - Optional - Timeout in seconds for requests. - **maxRetries** (number) - Optional - Maximum number of retries for failed requests. ### Request Example ```typescript import { DCPClient } from "@nexqloud-dcp/sdk"; export const dcp = new DCPClient({ apiKey: process.env.DCP_API_KEY, timeoutInSeconds: 60, maxRetries: 3, }); ``` ### Response No response body. Returns a DCPClient instance. ``` -------------------------------- ### Create an instance with flags using dcp dc2 instances create Source: https://docs.nexqloud.io/docs/3.CLI/commands/dc2 Creates an instance by providing values as flags. Supports --name, --image, --type, --region, --ssh-key, and more. Missing parameters are prompted interactively. ```bash dcp dc2 instances create \ --name my-vm \ --image ubuntu-24.04 \ --type nx-1-small \ --region us-east-1 \ --ssh-key my-key ``` -------------------------------- ### cURL request to list managed database sizes Source: https://docs.nexqloud.io/docs/2.API-Reference/managed-databases/listManagedDatabaseSizes Sends a GET request to the sizes endpoint with a Bearer token in the Authorization header. The token is empty in the example; replace with a valid token. ```cURL curl -X GET "https://gateway.dcp.nexqloud.net/api/v1/managed-databases/sizes" \ -H "Authorization: Bearer " ``` -------------------------------- ### Create an instance interactively with dcp dc2 instances create Source: https://docs.nexqloud.io/docs/3.CLI/commands/dc2 Runs the interactive flow for creating an instance. Missing parameters are prompted interactively. ```bash dcp dc2 instances create ``` -------------------------------- ### Successful response (200) for get artifact Source: https://docs.nexqloud.io/docs/2.API-Reference/container-registry/getRegistryArtifact Example JSON response when the artifact is found. Contains artifact details such as id, type, digest, tags, size, scan overview, and extra attributes. ```json { "success": true, "data": { "id": 4044, "type": "IMAGE", "digest": "sha256:f4c86f8ed581c5fbc196973852ffe73bc42b02a416635aec2d3bbc142400ebf8", "tags": [ { "id": 1131, "name": "sha256-9f86d081884c", "pushTime": "2026-04-23T09:29:00.666Z", "pullTime": "0001-01-01T00:00:00.000Z", "immutable": false, "signed": false } ], "size": 3866500, "projectId": 1024, "repositoryId": 2048, "pushTime": "2026-04-23T09:28:41.433Z", "pullTime": "2026-04-23T09:40:55.741Z", "scanOverview": { "application/vnd.security.vulnerability.report; version=1.1": { "complete_percent": 100, "duration": 4, "end_time": "2026-04-23T09:40:56.000Z", "report_id": "3c49040f-f317-4e9c-a658-8afef870f131", "scan_status": "Success", "scanner": { "name": "Trivy", "vendor": "Aqua Security", "version": "v0.62.1" }, "severity": "None", "start_time": "2026-04-23T09:40:52.000Z", "summary": { "fixable": 0, "summary": {}, "total": 0 } } }, "labels": null, "references": null, "accessories": null, "mediaType": "application/vnd.docker.container.image.v1+json", "manifestMediaType": "application/vnd.docker.distribution.manifest.v2+json", "immutableStatus": false, "extraAttrs": { "architecture": "amd64", "author": "Copilot Demo", "created": "2026-04-23T09:28:41.000Z", "os": "linux", "config": { "Env": [ "NODE_ENV=production" ], "Entrypoint": [ "node", "server.js" ] } }, "additionLinks": { "self": { "href": "/api/v2.0/projects/example/repositories/app/artifacts/sha256:..." } } } } ``` -------------------------------- ### Create a virtual machine with DCPClient Source: https://docs.nexqloud.io/docs/4.SDKs/typescript Shows how to instantiate DCPClient with an API key from the environment and create a VM using the dc2.virtualMachinesControllerCreate method. Requires Node.js 18+, a DCP API key, and server-side access to DCP_API_KEY. ```typescript import { DCPClient } from "@nexqloud-dcp/sdk"; const dcp = new DCPClient({ apiKey: process.env.DCP_API_KEY }); const vm = await dcp.dc2.virtualMachinesControllerCreate({ displayName: "my-app-server", vmType: "standard-2c-4gb", cpu: 1, memory: 2048, disk: 20, image: "ubuntu-24.04", region: "us-east-1", sshKeyIds: ["ssh-key-123"], }); ``` -------------------------------- ### cURL request to list container registry projects Source: https://docs.nexqloud.io/docs/2.API-Reference/container-registry/listRegistryProjects Sends a GET request to the container registry projects endpoint with a Bearer token. The token is empty in the example; replace with a valid JWT token. ```bash curl -X GET "https://gateway.dcp.nexqloud.net/api/v1/container-registry/projects" \ -H "Authorization: Bearer " ``` -------------------------------- ### 200 response body for get container registry project Source: https://docs.nexqloud.io/docs/2.API-Reference/container-registry/getRegistryProject Example JSON response returned with a 200 status code when the project is found. It includes the project name, account ID, timestamps, and harbor details. ```json { "success": true, "data": { "dcrProjectName": "my-app-project-1", "dcrProjectId": null, "accountId": "68b0af9e0e82cf468d167c52", "createdAt": "2026-05-19T12:59:33.448Z", "updatedAt": "2026-05-19T12:59:33.448Z", "harborDetails": { "projectId": 1024, "name": "my-app-project-1", "ownerName": "admin", "repoCount": 12, "creationTime": "2026-05-19T12:59:33.448Z", "updateTime": "2026-05-19T12:59:33.448Z", "metadata": {}, "currentUserRoleId": 0 } } } ``` -------------------------------- ### 200 response body for get virtual machine Source: https://docs.nexqloud.io/docs/2.API-Reference/virtual-machines/getVirtualMachine Example JSON response for a successful request (HTTP 200). Contains the full virtual machine object with fields such as id, name, status, cpu, memory, disk, and network details. ```json { "id": "test-vm-001", "accountId": "test-account-001", "name": "test-vm-dev-001", "displayName": "Test VM", "status": "running", "cpu": 4, "memory": 8, "disk": 50, "vmType": "nx-2-medium", "image": "ubuntu-24.04", "backupId": "test-backup-001", "region": "us-east-1", "sshKeyIds": [ "test-ssh-key-001" ], "airGapped": false, "dpnId": "67f3af9c7f4dd6647e8f0a11", "securityTier": "D", "rootPassword": "string", "publicIpv4": "203.0.113.42", "publicIpv4Requested": false, "publicIpv6Requested": false, "provider": "test-nanovirt", "privateIpv4": "192.168.122.50", "publicIpv6": "2001:db8::1", "privateIpv6": "fd00::1", "sshCommand": "ssh test-vm-dev-001", "sshConfigSnippet": "Host dc2-*\n User root\n ProxyCommand socat - PROXY:dev.dc2.dcptunnel.net:%h:%p,proxyport=5002", "tags": { "environment": "test", "project": "sample-project", "team": "platform" }, "backupEnabled": true, "backupIntervalHours": 24, "backupRetentionCount": 7, "primaryNanoserver": { "id": "test-nano-001" }, "createdAt": "2026-01-01T00:00:00.000Z", "updatedAt": "2026-01-02T00:00:00.000Z" } ``` -------------------------------- ### List instances with dcp dc2 instances list Source: https://docs.nexqloud.io/docs/3.CLI/commands/dc2 Lists virtual machine instances. For automation, request JSON output with --output json. ```bash dcp dc2 instances list ``` ```bash dcp dc2 instances list --output json ``` -------------------------------- ### 200 response body for get managed database Source: https://docs.nexqloud.io/docs/2.API-Reference/managed-databases/getManagedDatabase Example JSON response returned when the database is found. Contains fields such as id, accountId, name, engine, version, tier, mode, status, instanceType, region, dpnId, nodes, connection, backup, publicEndpoint, allowedCidrs, databaseName, username, password, createdAt, and updatedAt. ```json { "id": "6a0ef74fc85a61e0178586eb", "accountId": "68b0af9e0e82cf468d167c52", "name": "pg-CCCCa1e", "displayName": "romit-v2", "engine": "postgresql", "version": "17", "tier": "dev", "mode": "standalone", "status": "running", "instanceType": "db-small", "region": "us-east-1", "dpnId": "68b0af9e0e82cf468d167c52", "nodes": [ { "id": "pg-rCCCCC1e-node-0", "dc2InstanceId": "64sXXXXX", "role": "primary", "status": "running", "nebulaIp": "100.64.XXX.XXXX", "port": 5432, "nanoserverId": "NXQ5XCCCC", "nanoserverFqdn": "https://NXQXXXXX.devices.nexqloud.net", "createdAt": "2026-05-21T12:15:12.375Z", "updatedAt": "2026-05-21T12:15:18.271Z" } ], "connection": { "host": "primary.pg-CCCCCCrvice.dev-edge.consul", "port": 5432, "databaseName": "sampleXX", "username": "admin" }, "backup": { "s3Bucket": "dcp-dev-dds-backups", "s3Region": "us-east-1", "retentionDays": 7 }, "publicEndpoint": false, "allowedCidrs": [ "203.0.113.10/32" ], "databaseName": "romit_v2", "username": "admin", "password": "0CCCCCCVVXXXXd07221b", "createdAt": "2026-05-21T12:15:12.375Z", "updatedAt": "2026-05-21T12:15:18.284Z" } ``` -------------------------------- ### 200 response with Kubernetes versions Source: https://docs.nexqloud.io/docs/2.API-Reference/kubernetes/listKubernetesVersions Example success response containing a list of supported Kubernetes versions with metadata such as label, value, group, default flag, and deprecation status. ```json [ { "label": "v1.29.0", "value": "v1.29.0", "group": "DKS", "isDefault": true, "isDeprecated": false } ] ``` -------------------------------- ### POST /api/v1/virtualmachines/{id}/start Source: https://docs.nexqloud.io/docs/2.API-Reference/virtual-machines/startVirtualMachine Starts a virtual machine with the specified identifier. Requires JWT authentication via a Bearer token. ```APIDOC ## POST /api/v1/virtualmachines/{id}/start ### Description Starts a virtual machine with the specified identifier. Requires JWT authentication via a Bearer token. ### Method POST ### Endpoint `https://gateway.dcp.nexqloud.net/api/v1/virtualmachines/{id}/start` ### Parameters #### Path Parameters - **id** (string) - Required - Virtual machine identifier #### Authorization - **Authorization** (header) - Required - Bearer token. Use Bearer dcp_ ### Request Example ``` curl -X POST "https://gateway.dcp.nexqloud.net/api/v1/virtualmachines/string/start" \ -H "Authorization: Bearer " ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message #### Response Example (200) ``` { "message": "VM start initiated" } ``` #### Error Response (400) - **statusCode** (number) - HTTP status code - **message** (string) - Error message - **timestamp** (string) - Timestamp of the error - **path** (string) - Request path #### Response Example (400) ``` { "statusCode": 400, "message": "Invalid request", "timestamp": "2026-01-01T00:00:00.000Z", "path": "/api/v1/virtualmachines" } ``` #### Error Response (404) - **statusCode** (number) - HTTP status code - **message** (string) - Error message - **timestamp** (string) - Timestamp of the error - **path** (string) - Request path #### Response Example (404) ``` { "statusCode": 400, "message": "Invalid request", "timestamp": "2026-01-01T00:00:00.000Z", "path": "/api/v1/virtualmachines" } ``` ``` -------------------------------- ### Tips Source: https://docs.nexqloud.io/docs/1.Docs/storage/5.s3-api-usage Configuration tips for using the Nexqloud S3 API, including endpoint and region settings, and environment variable usage. ```APIDOC ## [Tips](https://docs.nexqloud.io/docs/1.Docs/storage/5.s3-api-usage#tips) - Always include `endpoint_url` / `--endpoint-url` — without it, requests go to AWS - Use `region_name='auto'` — Nexqloud uses a single global region - Use environment variables in production: ``` export AWS_ACCESS_KEY_ID=NQAK_YOUR_ACCESS_KEY_ID export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_ACCESS_KEY export AWS_ENDPOINT_URL=https://storage.dcp.nexqloud.net ``` ``` -------------------------------- ### List and get virtual machines with dc2 Source: https://docs.nexqloud.io/docs/4.SDKs/python Shows how to list all VMs and retrieve a specific VM by ID using the dc2 client. ```python # List all VMs vms = client.dc2.list_virtual_machines() # Get a specific VM vm = client.dc2.get_virtual_machine(id="vm-123") ("vm-123") ``` -------------------------------- ### Verify DCP CLI Installation Source: https://docs.nexqloud.io/docs/1.Docs/getting-started/3.quickstart Checks that the DCP CLI is installed and prints its version. ```bash dcp --version ``` -------------------------------- ### Manage virtual machines with dcp.dc2 Source: https://docs.nexqloud.io/docs/4.SDKs/typescript Shows how to launch a VM, list all VMs, and perform lifecycle operations (stop, start, remove) using the dcp.dc2 controller methods. ```typescript // Launch a VM const vm = await dcp.dc2.virtualMachinesControllerCreate({ displayName: "my-app-server", vmType: "nx-1-small", cpu: 1, memory: 2048, disk: 20, image: "ubuntu-24.04", region: "us-east-1", sshKeyIds: ["ssh-key-123"], }); // List all VMs const vms = await dcp.dc2.virtualMachinesControllerFindAll(); // Lifecycle management await dcp.dc2.virtualMachinesControllerStop({ id: vm.id }); await dcp.dc2.virtualMachinesControllerStart({ id: vm.id }); await dcp.dc2.virtualMachinesControllerRemove({ id: vm.id }); ``` -------------------------------- ### List all VMs Source: https://docs.nexqloud.io/docs/4.SDKs/python Retrieve and print all virtual machines. ```python vms = client.dc2.list_virtual_machines() for vm in vms: print(vm.id, vm.name) ``` -------------------------------- ### Create a registry project Source: https://docs.nexqloud.io/docs/3.CLI/commands/dcr Creates a new registry project with the specified name. ```bash dcp dcr projects create --name my-registry ``` -------------------------------- ### Manual download and install DCP CLI Source: https://docs.nexqloud.io/docs/3.CLI/installation Downloads a DCP CLI binary from GitHub Releases, extracts it, and moves it to `/usr/local/bin`. Replace `vX.Y.Z` with the actual version. Available platforms include `linux_amd64`, `linux_arm64`, `darwin_amd64`, and `darwin_arm64`. ```bash wget https://github.com/nexqloud/dcp-cli/releases/download/vX.Y.Z/dcp_X.Y.Z_linux_amd64.tar.gz tar xzf dcp_X.Y.Z_linux_amd64.tar.gz sudo mv dcp /usr/local/bin/ ``` -------------------------------- ### Inspect the installed CRDs Source: https://docs.nexqloud.io/docs/1.Docs/secrets-manager/5.kubernetes-secret-sync Lists the DCPSecretStore and DCPExternalSecret custom resource definitions installed by the Helm chart. ```bash kubectl get crd dcpsecretstores.secrets.dcp.nexqloud.io kubectl get crd dcpexternalsecrets.secrets.dcp.nexqloud.io ``` -------------------------------- ### Install socat for SSH tunneling Source: https://docs.nexqloud.io/docs/1.Docs/compute/virtual-machines/4.connect-with-ssh Install socat on macOS, Ubuntu/Debian, or CentOS/RHEL to enable SSH tunneling through the proxy. ```bash # macOS brew install socat # Ubuntu/Debian sudo apt-get install socat # CentOS/RHEL sudo yum install socat ``` -------------------------------- ### Run hostname command Source: https://docs.nexqloud.io/docs/1.Docs/getting-started/3.quickstart Runs the hostname command after connecting to the VM. Expected result: the terminal prints the VM hostname, such as quickstart-vm. ```bash hostname ``` -------------------------------- ### Login, tag, and push with Podman Source: https://docs.nexqloud.io/docs/1.Docs/containers/container-registry/4.push-images Commands for pushing images to the NexQloud registry using Podman. Substitute 'podman' for 'docker' in the standard workflow. ```bash podman login dcr.nexqloud.io/ podman tag : dcr.nexqloud.io//: podman push dcr.nexqloud.io//: ``` -------------------------------- ### Error response (500) example Source: https://docs.nexqloud.io/docs/2.API-Reference/virtual-machines/listVirtualMachineOsImages Example JSON error response with statusCode, message, timestamp, and path fields. ```json { "statusCode": 400, "message": "Invalid request", "timestamp": "2026-01-01T00:00:00.000Z", "path": "/api/v1/virtualmachines"} ``` -------------------------------- ### List repositories in a project Source: https://docs.nexqloud.io/docs/3.CLI/commands/dcr Lists all repositories within a specified project. ```bash dcp dcr projects repositories list ``` -------------------------------- ### Get secret metadata Source: https://docs.nexqloud.io/docs/3.CLI/commands/dsm Gets metadata for a secret by name (requires --environment) or by dsmsec_... ID. ```bash dcp dsm secrets get DATABASE_URL \ --project \ --environment production ``` -------------------------------- ### 200 response for list access keys Source: https://docs.nexqloud.io/docs/2.API-Reference/object-storage/listAccessKeys Example successful response with a list of access keys. Each key includes accessKeyId, label, permissions, status, lastUsedAt, and createdAt. ```json { "success": true, "data": [ { "accessKeyId": "NQAK1234567890abcd", "label": "ci-deploy-key", "permissions": { "buckets": [ "my-files" ], "actions": [ "*" ] }, "status": "active", "lastUsedAt": "2026-05-20T10:30:00.000Z", "createdAt": "2026-05-20T10:30:00.000Z" } ] } ``` -------------------------------- ### Install AWS CLI (macOS and pip) Source: https://docs.nexqloud.io/docs/1.Docs/storage/5.s3-api-usage Install the AWS CLI using Homebrew on macOS or pip. Choose the method appropriate for your environment. ```bash # macOS brew install awscli # pip pip install awscli ``` -------------------------------- ### cURL request to get cluster overview Source: https://docs.nexqloud.io/docs/2.API-Reference/kubernetes/getCluster Sends a GET request to the cluster overview endpoint. Requires a Bearer token in the Authorization header. ```bash curl -X GET "https://gateway.dcp.nexqloud.net/api/v1/clusters/string/overview" \ -H "Authorization: Bearer " ``` -------------------------------- ### Create TokenReview ServiceAccount and ClusterRoleBinding Source: https://docs.nexqloud.io/docs/1.Docs/secrets-manager/5.kubernetes-secret-sync Create a ServiceAccount and ClusterRoleBinding for TokenReview, once per cluster. ```bash kubectl create serviceaccount dcp-token-reviewer -n kube-system kubectl create clusterrolebinding dcp-token-reviewer \ --clusterrole=system:auth-delegator \ --serviceaccount=kube-system:dcp-token-reviewer ``` -------------------------------- ### Install Docker credential helper on macOS Source: https://docs.nexqloud.io/docs/1.Docs/containers/container-registry/3.manage-credentials Use this command to install the Docker credential helper on macOS, which stores credentials in Keychain for additional security. ```bash # macOS — use Keychain brew install docker-credential-helper ``` -------------------------------- ### Expected hostname output Source: https://docs.nexqloud.io/docs/1.Docs/getting-started/3.quickstart Expected output of the hostname command: the VM hostname, such as quickstart-vm. ```text quickstart-vm ``` -------------------------------- ### Verify nginx pod is running Source: https://docs.nexqloud.io/docs/1.Docs/containers/kubernetes/2.create-cluster Check that the nginx pod is Running and ready. Expected output shows the pod with 1/1 ready and Running status. ```bash kubectl get pods ``` -------------------------------- ### Error response example Source: https://docs.nexqloud.io/docs/2.API-Reference Example JSON error response body. Errors use HTTP status codes plus a JSON response body. ```json { "statusCode": 401, "message": "Unauthorized", "error": "Unauthorized" } ``` -------------------------------- ### Configure DCPClient with DCPClientOptions Source: https://docs.nexqloud.io/docs/4.SDKs/python Creates a DCPClient instance with an API key, a 60-second timeout, and 3 retries. Use this to set up the SDK client with custom configuration. ```python client = DCPClient( DCPClientOptions( api_key="dcp_your_api_key", timeout_in_seconds=60, max_retries=3, ) ) ``` -------------------------------- ### cURL request to get allowed CIDRs Source: https://docs.nexqloud.io/docs/2.API-Reference/managed-databases/getManagedDatabaseAllowedCidrs Sends a GET request to the managed database allowed-cidrs endpoint. Requires a Bearer token in the Authorization header. ```bash curl -X GET "https://gateway.dcp.nexqloud.net/api/v1/managed-databases/string/allowed-cidrs" \ -H "Authorization: Bearer " ``` -------------------------------- ### Connect to PostgreSQL using Node.js (pg) Source: https://docs.nexqloud.io/docs/1.Docs/databases/3.connect-database Use the pg library to connect to PostgreSQL from Node.js. The example creates a Pool, queries SELECT NOW(), and logs the result. SSL is enabled. ```javascript import { Pool } from 'pg'; const pool = new Pool({ host: '', port: 5432, user: '', password: '', database: '', ssl: true, }); const { rows } = await pool.query('SELECT NOW()'); console.log(rows[0]); ``` -------------------------------- ### Successful response (200) for listing bucket objects Source: https://docs.nexqloud.io/docs/2.API-Reference/object-storage/listBucketObjects Example JSON response with a success flag, the requested prefix, a list of folders, and a list of objects with key, size, and lastModified fields. ```json { "success": true, "data": { "prefix": "docs/", "folders": [ { "prefix": "documents/", "name": "documents" } ], "objects": [ { "key": "folder/report.csv", "size": 4096, "lastModified": "2026-05-20T10:30:00.000Z" } ] } } ``` -------------------------------- ### List K8s bindings via API Source: https://docs.nexqloud.io/docs/1.Docs/secrets-manager/5.kubernetes-secret-sync Sends a GET request to list all K8s bindings for the project. Requires the same environment variables. ```bash curl "https://gateway.dcp.nexqloud.net/api/v1/secrets-manager/projects/$DSM_PROJECT_ID/k8s-bindings" \ -H "Authorization: Bearer $DCP_API_KEY" ``` -------------------------------- ### cURL request to get DPN details Source: https://docs.nexqloud.io/docs/2.API-Reference/dpn/getDpn Use this cURL command to fetch DPN details. It sends a GET request to the endpoint with a Bearer token in the Authorization header. ```bash curl -X GET "https://gateway.dcp.nexqloud.net/api/v1/dpn/string" \ -H "Authorization: Bearer " ``` -------------------------------- ### Create a token with the CLI Source: https://docs.nexqloud.io/docs/1.Docs/secrets-manager/4.project-tokens Use the dcp dsm tokens create command to create a project runtime token. The response includes the client ID and client secret, which is shown only once. ```bash dcp dsm tokens create \ --project \ --name payments-api-prod ``` ```text id= name=payments-api-prod clientId= clientSecret= ```