API Usage samples

Authenticate

curl -X 'POST' \
  'https://api.cloud.denvrdata.com/api/TokenAuth/Authenticate' \
  -H 'accept: text/plain' \
  -H 'Content-Type: application/json-patch+json' \
  -d '{
  "userNameOrEmailAddress": "YOUR_EMAIL_ADDRESS",
  "password": "YOUR_PASSWORD"
}'

Response:

{
    "result": {
        "accessToken": "eyJhbGci...",
        "encryptedAccessToken": "l6/HiYvjFp...",
        "expireInSeconds": 86400,
        "shouldResetPassword": false,
        "passwordResetCode": null,
        "userId": 12345,
        "requiresTwoFactorVerification": false,
        "twoFactorAuthProviders": null,
        "twoFactorRememberClientToken": null,
        "returnUrl": null,
        "refreshToken": "eyJhbGciOi...",
        "refreshTokenExpireInSeconds": 31536000
    },
    "targetUrl": null,
    "success": true,
    "error": null,
    "unAuthorizedRequest": false,
    "__abp": true
}

/api/v1/clusters/GetAll

curl -X 'GET' \
  'https://api.cloud.denvrdata.com/api/v1/clusters/GetAll' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json-patch+json' \
  -H 'Authorization: Bearer  eyJhbGci...'

Response:

{
    "result": [
        "Hou1","Msc1"
    ],
    "targetUrl": null,
    "success": true,
    "error": null,
    "unAuthorizedRequest": false,
    "__abp": true
}

/api/v1/servers/virtual/CreateServer

curl -X 'POST' \
  'https://api.cloud.denvrdata.com/api/v1/servers/virtual/CreateServer' \
  -H 'accept: */*' \
  -H 'Content-Type: application/json-patch+json' \
  -H 'Authorization: Bearer  eyJhbGci...' \
  -d '{
  "name": "my-test-vm",
  "rpool": "on-demand",
  "vpc": "YOUR_VPC_NAME",
  "configuration": "A100_80GB_SXM_1x",
  "cluster": "Hou1",
  "ssh_keys": [
    "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC..."
  ],
  "operatingSystemImage": "Ubuntu 22.04.4 LTS",
  "rootDiskSize": 500
}'

Response:

{
    "result": {
        "username": "YOUR_EMAIL_ADDRESS",
        "tenancy_name": "YOUR_TENANCY_NAME",
        "rpool": "on-demand",
        "directAttachedStoragePersisted": false,
        "id": "my-test-vm",
        "namespace": "YOUR_VPC_NAME",
        "configuration": "A100_80GB_SXM_1x",
        "storage": 2125,
        "gpu_type": "nvidia.com/A100SXM480GB",
        "gpus": 1,
        "vcpus": 24,
        "memory": 116,
        "ip": "",
        "privateIp": "172...",
        "image": "Ubuntu_22.04.4_LTS",
        "cluster": "Hou1",
        "status": "na",
        "storageType": "na"
    },
    "targetUrl": null,
    "success": true,
    "error": null,
    "unAuthorizedRequest": false,
    "__abp": true
}

Last updated