API Documentation

Welcome to the Kamatera API documentation. The Kamatera API enables you to automate and manage your cloud resources with HTTP requests through a RESTful interface. 

To get started, you first need to create an API key under your account. This unique key will give you access to your server from any device, without logging in to the console. You’ll find instructions in the first section, Authentication. Authentication is required before using any of the listed API commands. Once you’ve done that, you can create, configure, monitor, and manage virtual servers, networking, storage, and other cloud services across Kamatera’s global data center network.

To begin using the Kamatera API, you’ll need:

  1. An active Kamatera server
  2. API credentials (API key and token)
  3. Basic understanding of RESTful APIs and HTTP requests

 

This documentation covers authentication methods, endpoint references, request/response formats, error handling, and practical examples to help you get up and running quickly. All requests must specify the Content-Type header with the value set to application/json. 

Let’s get started with authentication and your first API call.

Authentication

This will let you access your server with an API key. It provides a unique token that you can use for further API requests. The token will expire after one hour and should be used instead of clientId and secret. The expiration date is written in Epoch format.

URL: https://console.kamatera.com/service/authenticate

Method: POST

Request data:

Field Type Description
clientId            String              Api client id, generated in key generation page          
Secret String Secret key, generated in key generation page

Request example:

import requests

url = "https://console.kamatera.com/service/authenticate"

payload = {'clientId': '<clientid>',

'secret': '<secret>'}

files=[

]

headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

Response example:

{
  "authentication": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "expires": 1745393200
}

List servers

The purpose of this API is to retrieve a comprehensive inventory of all servers associated with your account. 

URL: https://console.kamatera.com/service/servers

Method: GET

No request data required.

Request example:

import requests
import json

url = "https://console.kamatera.com/service/servers"


payload = {}
files = {}
headers = {
    'content-type': 'application/json',
    'clientId': '<clientid>',

    'secret': '<secret>'

}

response = requests.request("GET", url, headers=headers, data=payload, files=files)

print(response.text)

Response:

[
    {
        "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "datacenter": "US",
        "name": "devops.testing.name.ca-manager",
        "power": "on"
    },
    {
        "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
        "datacenter": "US-AT",
        "name": "testing.devops.name.ca-manager-AT",
        "power": "on" 
    }
]

Create new server options

The Create new server options API returns all the available configuration choices and parameters needed to successfully create a new virtual server instance.

It does not create the server itself; instead, it provides the required and valid input values for the actual “Create Server” API call.

URL: https://console.kamatera.com/service/server

Method: GET

No request data required.

Response data:

Field Type Description
datacenter object key value pair with datacenter code and datacenter description
EX string
cpu [any] available CPUs count configuration for new server
ram object available ram size configuration, values are in MB
└─ A number
└─ B number
└─ T number
└─ D number
disk [any]
diskImages object key-based list of available hard disk templates
└─ EX array of object list of disk templates by datacenter
└─ description string short description for the hard disk image
└─ id string unique identifier for the disk image
└─ sizeGB number size in GB of the image
└─ additionalDisks [number]
└─ usageInfo string full description of the hard disk image
└─ guestDescription          string guest-visible description of the disk image
└─ freeTextOne string free text field
└─ freeTextTwo string another free text field
traffic object datacenter-based list of traffic packages
└─ EX array of object
└─ id number traffic package ID
└─ info string description of the traffic package
└─ name string traffic package name
networks object list of available networks
└─ EX array of object           
└─ name string name of the network
└─ ips [any] array of IP address ranges
billing [any]

Create new server

The “Create New Server” API is a POST request that accepts a JSON payload detailing the exact specifications of the desired server. Its job is to ingest this data and initiate the construction process.

URL: https://console.kamatera.com/service/server

Method: POST

Request data:

Field Type Description Mandatory
disk_src_0 string The ID for the base OS image, select from available images YES
datacenter string Datacenter location selection code YES
name string Name for the new server YES
cpu string Server CPU count YES
ram number Server memory size in MB YES
password string Password to set (9–32 chars, must contain lowercase, uppercase, numeric) YES
managed boolean Enable or disable management services NO
backup boolean        Enable or disable daily backup service NO
power boolean Enable auto boot after completion NO
billing string Billing option for the server YES
traffic number Traffic package ID (ignored for hourly billing) YES
disk_size_0 number Disk size in GB YES (ONLY 0)       
network_name_0 string Network name to connect this server (use ‘wan’ for auto IP) YES (ONLY 0)
network_ip_0 string IP address to assign (optional if WAN) NO IF WAN
network_bits_0 number Subnet mask bits (20–30) NO
selectedSSHKeyValue       string A public SSH key for the authenticated user NO

 

Response data: Task ID

Request example: 

import requests
import json

url = "https://console.kamatera.com/service/server"

payload = {
'disk_src_0': 'US:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'datacenter': 'US',
'name': 'training.devops.name.api-testing',
'cpu': '1B',
'ram': '2048',
'password': '<password>',
'network_name_0': 'wan',
'billing': 'monthly',
'traffic': 't5000',
'disk_size_0': '10'
}
files = []

headers = {
'Content-Type': 'application/json',
'clientId': '<clientid>',
'secret': '<secret>'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

Response example:

[
    17635771
]

Notes:

  • Max disc # is 15
  • Max NICs # is 9 (Wan is MANDATORY)

Server clone

The Server clone API allows you to create a duplicate of an existing server, including:

  • The operating system and all installed software
  • System configurations and settings
  • File systems and data stored on the server
  • Network configurations (which may be adjusted for the new instance)

URL: https://console.kamatera.com/service/server/clone

Method: POST

Request data:

Field Type Description Mandatory        
source string Name for the new server YES
name string Name for the new server YES
cpu string Server CPU count NO
ram number Server memory size in MB NO
password string Password to set (9–32 chars, must contain lowercase, uppercase, numeric)          YES
managed boolean Enable or disable management services NO
backup boolean            Enable or disable daily backup service NO
power boolean Enable auto boot after completion NO
billing string Billing option for the server YES
traffic number Traffic package ID (ignored for hourly billing) NO
disk_size_1-14 number Disk size in GB (main disk [0] is cloned) NO
network_name_1-14 string Network name to connect this server (can’t use WAN twice) NO
selectedSSHKeyValue               string A public SSH key for the authenticated user NO

 

Request example:

import requests
import json

url = "https://console.kamatera.com/service/server/clone"

payload = {
    'source': '<uuid>',
    'name': 'training.devops.name.api-testing22',
    'password': '<password>',
    'billing': 'monthly'
}
files = []

headers = {
    'Content-Type': 'application/json',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)

Response example: 

[

17635771
]

Server information

The Server information API retrieves detailed information about a specific virtual server in your Kamatera account.

When you call this API endpoint, it returns comprehensive data about the server, such as basic identification, operational status, and hardware configurations. 

URL: https://console.kamatera.com/service/server/{serverid}

Method: GET

No request data required.

Response data:

Field Type Description
id string Server ID (unique identifier used when specifying server ID)     
datacenter string Server datacenter code
name string Server name
power string Server’s power state: `on`, `off`
disks [number] List of disk sizes in GB
networks array of objec      t Array of network connection objects
└─ ips [any] Array of strings, each representing an IP address
└─ network      string The network name
billing string Billing type
traffic string Traffic package
managed boolean Management services enabled/disabled
backup boolean Daily backup service enabled/disabled

Request example:

import requests
import json

url = "https://console.kamatera.com/service/server/<serverid>"

payload = '{}'
files = []

headers = {
    'Content-Type': 'application/json',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("GET", url, headers=headers, data=payload, files=files)

print(response.text)

Response example:

{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "datacenter": "US",
  "cpu": "1B",
  "name": "training.devops.name.api-testing",
  "ram": 2048,
  "power": "off",
  "diskSizes": [
    10
  ],
  "networks": [
    {
      "network": "wan-us",
      "ips": [
        "123.123.12.123"
      ]
    }
  ],
  "billing": "monthly",
  "traffic": "t5000",
  "managed": "0",
  "backup": "0"
}

Server termination

The Server termination API is the crucial endpoint used to permanently shut down and remove a virtual server from the cloud provider’s infrastructure.

This action is final and results in the complete decommissioning of the resource.

URL: https://console.kamatera.com/service/server/{serverid}/terminate

Method: DELETE

Request data:

Field Type Description
confirm string Safety parameter; if not set to 1, operation will return an error.
force string Force terminate when server is on; if not set to 1 and server is on, operation will error.

 

Response data: Task ID

Request example:

import requests
import json

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/terminate"

payload = {'confirm': '1'}

headers = {
    'Content-Type': 'application/json',
    'clientId': '<clientid>',

    'secret': '<secret>'
}
response = requests.request("DELETE", url, headers=headers, data=payload, files=files)
print(response.text)

Response example:

17643931

Power options

The Power options API is a collection of specific endpoints designed to control the power state of a virtual server.

This API set allows for automation of administrative tasks that involve turning the server on or off, rebooting it, or performing a hard reset.

URL: https://console.kamatera.com/service/server/{serverid}/power

Method: PUT

Request data:

Field Type Description
power       string          set power state: on, off, restart           

 

Response data: Task ID
Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/power"

payload = 'power=on'
headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

Response example:

17669724

CPU list options

The CPU list options API provides a catalog of all valid and available CPU configurations or resource tiers that a user can select when creating or resizing a server instance.

Its purpose is to give developers and automation tools the necessary data to specify the hardware resources for a virtual machine.

URL: https://console.kamatera.com/service/server/{serverid}/cpu

Method: GET

No request data required.

Response data: A, B, T, D

Request example:

import requests
import json

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/cpu"

payload = {}
headers = {
    'Content-Type': 'application/json',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Response example:

{
    "B": [
        "1B",
        "2B",
        "4B",
        "6B",
        "8B",
        "12B",
        "16B",
        "20B",
        "24B",
        "28B",
        "32B",
        "36B",
        "40B",
        "48B",
        "56B",
        "64B",
        "72B",
        "88B",
        "104B"
    ],
    "D": [
        "1D",
        "2D",
        "4D",
        "6D",
        "8D",
        "12D",
        "16D",
        "20D",
        "24D",

CPU configure

The CPU Configure API (sometimes called “Update CPU configuration” or “Resize server”) is used to modify the number of virtual CPU (vCPU) cores allocated to an existing, already-deployed virtual server instance.

This is the API used for scaling the server’s computing power up or down after it has been created.

URL: https://console.kamatera.com/service/server/{serverid}/cpu

Method: PUT

Request data:

Field           Type Description
cpu string          cpu count to set for server              

 

Response data: Task ID

Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/cpu"

payload = 'cpu=2B'
headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

Response example:

17672196

RAM list options

The RAM List Options API provides a catalog of all valid and available Random Access Memory (RAM) configurations or increments that a user can select when creating a new server or resizing an existing one.

Its purpose is to provide dynamic, accurate information on the memory resources supported by the cloud platform.

URL: https://console.kamatera.com/service/server/{serverid}/ram

Method: GET

No request data required.

Response data: A, B, T, D

Request example:

import requests
import json

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/ram"

payload = {}
headers = {
    'Content-Type': 'application/json',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Response example:

{
    "A": [
        1024,
        2048,
        3072,
        4096,
        6144,
        8192,
        10240,
        12288,
        16384,
        24576,
        32768,
        49152,
        65536,
        98304,
        131072
    ],
    "B": [
        1024,
        2048,
        3072,
        4096,
        6144,
        8192,
        10240,

RAM configure

The RAM Configure API is used to change the amount of Random Access Memory (RAM) allocated to a virtual server.

This API is the tool used for scaling the server’s memory capacity up or down to match current workload demands.

URL: https://console.kamatera.com/service/server/{serverid}/ram

Method: PUT

Request data:

Field          Type Description
ram string           ram size in mb to set for server     

Response data: Task ID

Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/ram"

payload = 'ram=2048'
headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

Response example:

17674102

DISK list options

The Disk list options API provides a catalog of all available disk and storage configurations that a user can select when creating a new server or attaching a new storage volume.

URL: https://console.kamatera.com/service/server/{serverid}/disk

Method: GET

No request data required.

Response data: Number

Request example:

import requests
import json

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/disk"

payload = {}
headers = {
    'Content-Type': 'application/json',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Response example:

[
    5,
    10,
    15,
    20,
    30,
    40

DISK resize hard disk

The Resize Hard Disk API is used to change the size of an existing virtual hard disk or storage volume attached to a server instance.

This API allows for scaling the server’s persistent storage capacity up and down after the server has been deployed.

URL: https://console.kamatera.com/service/server/{serverid}/disk

Method: PUT

Request data:

Field Type    Description
size string           Specifies the new size for server hard disk, available disk sizes are listed in server disk option method         
index string The index of the hard disk to resize (disk0, disk1, etc)
provision            string Enables or disables disk provisioning, provision enabled will reboot the server

 

Response data: Task ID

Request example:

import requests
import json

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/disk"

payload = {
    'size': '20',
    'index': '0',
    'provision': '1'
}
headers = {
    'Content-Type': 'application/json',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("PUT", url, headers=headers, data=payload, files=files)

print(response.text)

Response example:

17672196

DISK add hard disk

The Add hard disk API is used to attach a new, secondary storage volume or hard disk to an existing virtual server instance.

This API allows you to expand the server’s storage capacity beyond its initial system disk, providing flexible data storage.

URL: https://console.kamatera.com/service/server/{serverid}/disk

Method: POST

Request data:

Field Type Description
size string The size of the new hard disk to create, in GB. Available disk sizes are listed in server disk options method
provision string Provision the new hard disk on create (0 or 1 only)

Response data: Task ID

Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/disk"

payload = 'size=10&provision=1'
headers = {
  'content-type': 'application/x-www-form-urlencoded',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Response example:

17693217

DISK delete hard disk

The Delete Hard Disk API is used to permanently remove an existing virtual storage volume from your cloud infrastructure.

This action results in the permanent loss of all data stored on that specific disk.

URL: https://console.kamatera.com/service/server/{serverid}/disk/remove

Method: Delete

Request data:

Field Type Description
Index string zero based index, specifies the disk number to terminate
confirm          string          safety parameter, if not set to 1, operation will return an error      

Response data: Task ID

Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/disk/remove"

payload = 'index=1&confirm=1'
headers = {
  'content-type': 'application/x-www-form-urlencoded',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)

Response example:

17694633

SNAPSHOT List snapshots

The Snapshot List API is used to retrieve a complete catalog of all stored server snapshots or disk images associated with a user’s account.

This API acts as the inventory tool for a user’s point-in-time backups.

URL: https://console.kamatera.com/service/server/{serverid}/snapshots

Method: GET

No request data required.

Response data:

Field   Type    
id      number  
name    string  
desc    string  
date    string  
dept    number  
active  boolean 
power   string  

Request example:

import requests
import json

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/snapshots"

payload = {}
headers = {
  'content-type': 'application/json',
    'clientId': '<clientid>',

    'secret': '<secret>'

}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Response example:

[
    {
        "id": 1745411375,
        "name": "test123@example.com",
        "date": "01/01/2025 15:29:35",
        "active": true,
        "depth": 0,
        "child": []
    }
]

SNAPSHOT create snapshot

The Create Snapshot API is used to initiate a backup process that captures the exact, point-in-time state of a specified virtual hard disk or entire server.

This process creates a recovery point that can be used later to restore the server back to that exact state.

URL:https://console.kamatera.com/service/server/{serverid}/snapshot

Method: POST

Request data:

Field Type Description
name          string         name for the new snapshot           

Response data: Task ID

Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/snapshot"

payload = 'name=test123'
headers = {
  'content-type': 'application/x-www-form-urlencoded',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Response example:

17695766

SNAPSHOT revert snapshot

The Snapshot Revert API is used to revert an existing virtual server instance to the exact state captured in a specific, previously created snapshot.

This operation is the core function of disaster recovery and quick rollback, effectively undoing all changes made to the server’s disk since the snapshot was taken.

URL: https://console.kamatera.com/service/server/{serverid}/snapshot

Method:  PUT

Request data:

Field Type Description
snapshotId      string      snapshot id to delete, snapshot id is available using server snapshot listing method     

Response data:

cmdId – snapshotId

Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/snapshot"

payload = 'snapshotId=1745411375'
headers = {
  'content-type': 'application/x-www-form-urlencoded',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

Response example:

{
    “cmdId”: 17698315
}

SNAPSHOT delete snapshot

The Snapshot Delete Snapshot API is used to permanently remove a specific stored server snapshot from the cloud provider’s storage system.

The primary goal of this API is to manage the snapshot inventory and reduce associated storage costs.

URL: https://console.kamatera.com/service/server/{serverid}/snapshot

Method:  Delete

Request data:

Field Type Description
snapshotId string snapshot id to delete, snapshot id is available using server snapshot listing method

Response data: Task ID

Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/snapshot"

payload = 'snapshotId=1745411375'
headers = {
  'content-type': 'application/x-www-form-urlencoded',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("DELETE", url, headers=headers, data=payload)

print(response.text)

Response example:

17699189

Billing list billing mode

The Billing List Billing Mode API provides a catalog of the various pricing structures and billing cycles offered by the cloud provider.

This API is essential for understanding how costs are calculated and for selecting the most appropriate billing model for a server or service.

URL: https://console.kamatera.com/service/server/{serverid}/snapshot

Method: GET

No request data required.

Response data: Active, Future status

Request example:

import requests
import json

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/billing"

payload = {}
headers = {
  'content-type': 'application/json',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Response example:

{
    "active": "monthly",
    "future": "monthly"
}

Billing Set billing model

The Billing Set Billing Mode API is used to change the billing arrangement for a specific existing cloud service or resource.

This API allows a user to switch the cost structure for a server or other service from one mode (like hourly) to another (like monthly or yearly) to optimize costs.

URL: https://console.kamatera.com/service/server/{serverid}/billing

Method:  PUT

Request data:

Field Type Description
type string        new billing mode to select for the server
traffic           string traffic package id, value is required only if monthly billing is selected, for hourly billed servers, this value is ignored.         

Response data: Active, Future status

Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/billing"

payload = 'type=monthly&traffic=t5000'
headers = {
  'content-type': 'application/x-www-form-urlencoded',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

Response:
{
    "active": "monthly",
    "future": "monthly"
}

Rename server

The Rename Server API is used to change the user-defined name or label assigned to an existing virtual server instance.

URL: https://console.kamatera.com/service/server/{serverid}/rename

Method: PUT

Request data:

Field Type Description
name        string     name is between 4 to 40 characters, may contain: letters, numbers . – _           

 

Response data: Task ID

Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/rename"

payload = 'name=training.devops.name.api-testing23'
headers = {
  'content-type': 'application/x-www-form-urlencoded',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

Response example:

17701760

Password

The Password API is used to programmatically change or set the root/administrator password for an existing virtual server instance.

This API is fundamental for managing server security and access credentials.

URL: https://console.kamatera.com/service/server/{serverid}/password

Method: PUT

Request data:

Field Type Description
password       string          password to set (9-32 chars, must contain lowercase, uppercase, numeric)         

 

Response data: Task ID

Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/password"

payload = 'password=Aa123456123456'
headers = {
  'content-type': 'application/x-www-form-urlencoded',
    'clientId': '<clientid>',

    'secret': '<secret>'

}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)

Response example:

17701834

Hard disk library – list 

The Hard Disk Library List API is used in cloud environments to retrieve an inventory of all available disk images, templates, and custom volumes stored in the user’s account and offered by the provider.

This “library” acts as the central repository for operating system images, application templates, and user-uploaded custom disk files that can be used to quickly create new server instances.

URL: https://console.kamatera.com/service/server/{serverid}/hdlib

Method: GET

No request data required.

Response data:

Field      Type Description        
uuid string disk UUID
size number          size in GB

Request example:

import requests
import json

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/hdlib"

payload = {}
headers = {
  'content-type': 'application/json',
    'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("GET", url, headers=headers, data=payload)

print(response.text)

Response example:

[
    {
        "uuid": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "sizeGB": 10737418240
    }
]

Hard disk library – Clone hard disk

The Hard Disk Library – Clone Hard Disk API is used to create an exact duplicate copy of an existing virtual hard disk (or a custom disk image) and store that copy within the user’s Hard Disk Library (also called the “My Private Images” section).

This cloned disk image is a full, independent copy of the original and can be used as a source to deploy new, identical servers or be attached as a secondary data disk.

URL: https://console.kamatera.com/service/server/{serverid}/hdlib

Method: POST

Request data:

Field Type Description
disk_name_0        string allows specifying names for the cloned hard disk (field is optional)   
disk_src_0 string      source to uuid

 

Response data: Task ID

Request example:

import requests

url = "https://console.kamatera.com/service/server/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/hdlib"

payload = 'disk_name_0=Cloned-disk&disk_src_0=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
headers = {
  'content-type': 'application/x-www-form-urlencoded',
   'clientId': '<clientid>',

    'secret': '<secret>'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)

Response example:

17702702

Have additional questions? Search below: