NAV
Cartika Inc
bash php python

Introduction

Our HTTP REST API allows you to manage vital details of your account and services in client portal. JSON is used for all API returns

Use left menu to browse trough available methods, use right menu to check required parameters, data to post and code samples in various languages.

Authentication

To authorize, use this code:

# With bash, you can just pass the correct header with each request
                curl 'https://accounts.cartika.com/api' \
                  -u "username:passowrd"
                
//We recommend to use Requests library available at https://github.com/rmccue/Requests
                require_once 'Requests.php';
                Requests::register_autoloader();

                $resp = Requests::get('https://accounts.cartika.com/api/details', array(), array(
                    'auth' => array('username', 'passowrd')
                ));
                
# python requests module will handle basic authentication if provided with auth parameter
                import requests

                req = requests.get('https://accounts.cartika.com/api/details', auth=('username', 'passowrd'))
                

Make sure to replace username and password with your client area details.

This API uses Basic HTTP Authentication.

To authenticate with API with your client area access details (email address as username and your client area password).

All API calls requires authentication, API expects for the auth to be included in a header that looks like the following:

Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

Clientarea

User Details

Return registration details for my account

curl "https://accounts.cartika.com/api/details" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/details', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/details', auth=auth)
print(req.json())
Example Response:
{
    "client": {
        "id": "20408",
        "email": "email@example.com",
        "lastlogin": "2015-09-17 09:00:20",
        "ip": "10.10.10.100",
        "host": "unknown",
        "status": "Active",
        "parent_id": "0",
        "firstname": "John",
        "lastname": "Doe",
        "companyname": "Company name",
        "address1": "Addres 1",
        "address2": "Addres 2",
        "city": "City",
        "state": "Alabama",
        "postcode": "Post code",
        "country": "US",
        "phonenumber": "+01.222444111",
        "datecreated": "2015-03-16",
        "language": "english",
        "company": "1",
        "credit": "0.0000",
        "privileges": null
    }
}

HTTP Request

GET /details

Update User Details

Update registration details under my account

curl "https://accounts.cartika.com/api/details" \
   -u user:pass \
   -d firstname="firstnameValue"\
   -d lastname="lastnameValue"\
   -d phonenumber="phonenumberValue"\
   -d email="emailValue"\
   -d companyname="companynameValue"\
   -d address1="address1Value"\
   -d address2="address2Value"\
   -d city="cityValue"\
   -d state="stateValue"\
   -d postcode="postcodeValue"\
   -d country="countryValue"\
   -d type="typeValue"
$data = array(
    'firstname' => 'firstnameValue',
    'lastname' => 'lastnameValue',
    'phonenumber' => 'phonenumberValue',
    'email' => 'emailValue',
    'companyname' => 'companynameValue',
    'address1' => 'address1Value',
    'address2' => 'address2Value',
    'city' => 'cityValue',
    'state' => 'stateValue',
    'postcode' => 'postcodeValue',
    'country' => 'countryValue',
    'type' => 'typeValue'
);
$resp = Requests::post('https://accounts.cartika.com/api/details', array(), $data, $options);

echo $resp->body;
payload = {
    'firstname' : 'firstnameValue',
    'lastname' : 'lastnameValue',
    'phonenumber' : 'phonenumberValue',
    'email' : 'emailValue',
    'companyname' : 'companynameValue',
    'address1' : 'address1Value',
    'address2' : 'address2Value',
    'city' : 'cityValue',
    'state' : 'stateValue',
    'postcode' : 'postcodeValue',
    'country' : 'countryValue',
    'type' : 'typeValue'
}
req = requests.post('https://accounts.cartika.com/api/details', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /details

Query Parameters

Parameter Type Description
firstname string First Name
lastname string Last Name - a wfaw fawf awf awf aw fawf
phonenumber string Phone
email string Email Address
companyname string Organization
address1 string Address 1 - Example description
address2 string Address 2
city string City
state string State
postcode string Post code
country string Country
type string Account Type

Billing

Account balance

Get current account balance(unpaid invoices total), account credit

curl "https://accounts.cartika.com/api/balance" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/balance', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/balance', auth=auth)
print(req.json())
Example Response:
{
  "details": {
    "acc_balance": "10.00",
    "acc_credit": "0.00"
  }
}

HTTP Request

GET /balance

List Invoices

List all invoices under my account

curl "https://accounts.cartika.com/api/invoice" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/invoice', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/invoice', auth=auth)
print(req.json())
Example Response:
{
    "invoices": [
        {
            "id": "239780",
            "date": "2015-05-26",
            "duedate": "2015-05-26",
            "paybefore": "2015-05-26",
            "total": "10.00",
            "datepaid": "0000-00-00 00:00:00",
            "status": "Unpaid",
            "merge_id": null,
            "number": "239780",
            "currency": "USD"
        }
    ]
}

HTTP Request

GET /invoice

Invoice Details

Get invoice details

curl "https://accounts.cartika.com/api/invoice/@id" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/invoice/@id', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/invoice/@id', auth=auth)
print(req.json())
Example Response:
{
    "invoice": {
        "id": "303090",
        "status": "Paid",
        "date": "2015-08-05",
        "duedate": "2015-08-05",
        "paybefore": "2015-08-05",
        "datepaid": "2015-09-10 13:13:37",
        "number": "2015-09-25",
        "currency": "USD",
        "subtotal": 58.5,
        "credit": 0,
        "tax": 0,
        "taxrate": 22,
        "tax2": 0,
        "taxrate2": 0,
        "taxexempt": "0",
        "total": 58.5,
        "rate": 1,
        "rate2": 0,
        "rate3": 1,
        "notes": "",
        "items": [
            {
                "id": "264330",
                "invoice_id": "303090",
                "type": "Hosting",
                "item_id": "33334",
                "description": "Hosting - Starter Hosting (2015.08.05 - 2015.09.04)",
                "amount": "58.50",
                "taxed": "0",
                "qty": "1.00",
                "linetotal": "58.50"
            }
        ],
        "client": {
            ...
        }
    }
}

HTTP Request

GET /invoice/@id

Query Parameters

Parameter Type Description
id int

Domains

List Domains

List domains under your account

curl "https://accounts.cartika.com/api/domain" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/domain', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/domain', auth=auth)
print(req.json())
Example Response:
{
    "domains": [
        {
            "id": "548",
            "name": "example.com",
            "expires": "2016-08-04",
            "recurring_amount": "10.00",
            "date_created": "2015-08-04",
            "status": "Active",
            "period": "1",
            "autorenew": "1",
            "daytoexpire": "322"
        }
    ]
}

HTTP Request

GET /domain

Domain details

Get domain details

curl "https://accounts.cartika.com/api/domain/@id" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/domain/@id', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/domain/@id', auth=auth)
print(req.json())
Example Response:
{
    "details": {
        "id": "548",
        "name": "example.com",
        "date_created": "2015-08-04",
        "firstpayment": "10.00",
        "recurring_amount": "10.00",
        "period": "1",
        "expires": "2016-08-04",
        "status": "Active",
        "next_due": "2016-08-04",
        "next_invoice": "2016-07-28",
        "idprotection": "0",
        "nameservers": [
            "ns1.example.com",
            "ns2.example.com",
            "ns3.example.com",
            ""
        ],
        "autorenew": "1"
    }
}

HTTP Request

GET /domain/@id

Query Parameters

Parameter Type Description
id int Domain id

Domain availability

Check if domain is available for registration. Returns status: "ok" if domain is available, empty response otherwise

curl "https://accounts.cartika.com/api/domainorder/status" \
   -u user:pass \
   -d name="nameValue"
$data = array(
    'name' => 'nameValue'
);
$resp = Requests::post('https://accounts.cartika.com/api/domainorder/status', array(), $data, $options);

echo $resp->body;
payload = {
    'name' : 'nameValue'
}
req = requests.post('https://accounts.cartika.com/api/domainorder/status', params=payload, auth=auth)
print(req.json())
Example Response:
{"details":{"status":"ok"}}

HTTP Request

POST /domainorder/status

Query Parameters

Parameter Type Description
name string Domain name, ie. example.com

Services

Most of API methods found here will require service @id, you can lookup your service ids with /service method

List services

List all services under your account

curl "https://accounts.cartika.com/api/service" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service', auth=auth)
print(req.json())
Example Response:
{
    "services": [
        {
            "id": "33301",
            "domain": "example.com",
            "total": "10.0000",
            "status": "Active",
            "billingcycle": "Monthly",
            "next_due": "2015-10-22",
            "category": "Hosting",
            "category_url": "hosting",
            "name": "Starter Hosting"
        }
    ]
}

HTTP Request

GET /service

Service details

Return details for service @id

curl "https://accounts.cartika.com/api/service/@id" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id', auth=auth)
print(req.json())
Example Response:
{
    "service": {
        "id": "33337",
        "date_created": "2015-09-02",
        "domain": "example.com",
        "firstpayment": "10.00",
        "total": "10.00",
        "billingcycle": "Monthly",
        "next_due": "2015-10-22",
        "next_invoice": "2015-10-20",
        "status": "Active",
        "label": "",
        "username": "",
        "password": "",
        "rootpassword": "",
        "name": "Starter Hosting"
    }
}

HTTP Request

GET /service/@id

Query Parameters

Parameter Type Description
id int Service id

Upgrade Options

List upgrade options

curl "https://accounts.cartika.com/api/service/@id/upgrade" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/upgrade', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/upgrade', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/upgrade

Query Parameters

Parameter Type Description
id int

Upgrade Request

Estimate or request upgrade

// Format of ''resources'' paremeter
{
    "resource_id" : "qty_value", // sliders & qty fields
    "resource_id" : "item_id", // dropdown & radio fields
    "resource_id" : {
        "item_id": "qty_value" // dropdown with qty field
    }
}
curl "https://accounts.cartika.com/api/service/@id/upgrade" \
   -u user:pass \
   -d id="idValue"\
   -d resources[key]="resourcesValue"\
   -d package="packageValue"\
   -d cycle="cycleValue"\
   -d send="sendValue"
$data = array(
    'id' => 'idValue',
    'resources' => array('key'=>'value'),
    'package' => 'packageValue',
    'cycle' => 'cycleValue',
    'send' => 'sendValue'
);
$resp = Requests::post('https://accounts.cartika.com/api/service/@id/upgrade', array(), $data, $options);

echo $resp->body;
payload = {
    'id' : 'idValue',
    'resources' : {'key':'value'},
    'package' : 'packageValue',
    'cycle' : 'cycleValue',
    'send' : 'sendValue'
}
req = requests.post('https://accounts.cartika.com/api/service/@id/upgrade', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/upgrade

Query Parameters

Parameter Type Description
id int Service id
resources array array with resource values
package int New package id, optonal when upgrading resources
cycle string New billing cycle, optonal when upgrading resources
send boolean Set to true when you want to send your upgrade request

PDU ports

List PDU ports assigned to service

curl "https://accounts.cartika.com/api/service/@id/pdu" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/pdu', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/pdu', auth=auth)
print(req.json())
Example Response:
{
    "ports": [
        {
            "id": "162",
            "port_status": "-1",
            "port": "a2",
            "port_name": "a2",
            "port_checked": "2015-09-17 11:24:01",
            "item_label": "",
            "item_name": "APC Switched Rack PDU",
            "rack_name": "Z-00",
            "connected_port_name": null,
            "connected_port_id": null,
            "connected_port_number": null,
            "connected_item_label": null,
            "connected_item_name": null,
            "connected_rack_name": null
        }
    ]
}

HTTP Request

GET /service/@id/pdu

Query Parameters

Parameter Type Description
id int Service id

PDU Port state

Get PDU port/outlet state

curl "https://accounts.cartika.com/api/service/@id/pdu/@port" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/pdu/@port', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/pdu/@port', auth=auth)
print(req.json())
Example Response:
{
  "state": "on"
}

HTTP Request

GET /service/@id/pdu/@port

Query Parameters

Parameter Type Description
id int Service id
port int Port id

Set PDU port status

Set PDU port/outlet state

curl "https://accounts.cartika.com/api/service/@id/pdu/@port" \
   -u user:pass \
   -d id="idValue"\
   -d port="portValue"\
   -d power="powerValue"
$data = array(
    'id' => 'idValue',
    'port' => 'portValue',
    'power' => 'powerValue'
);
$resp = Requests::post('https://accounts.cartika.com/api/service/@id/pdu/@port', array(), $data, $options);

echo $resp->body;
payload = {
    'id' : 'idValue',
    'port' : 'portValue',
    'power' : 'powerValue'
}
req = requests.post('https://accounts.cartika.com/api/service/@id/pdu/@port', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/pdu/@port

Query Parameters

Parameter Type Description
id int Service id
port int Port id
power bool Desired power state - 'true' for ON or 'false' for OFF

Services

List VMs

List virtual servers

curl "https://accounts.cartika.com/api/service/@id/vms" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/vms', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/vms', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms

Query Parameters

Parameter Type Description
id int

Get VM Details

Get the details of a particular virtual server

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/vms/@vmid', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/vms/@vmid', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id

Create VM

Add new virtual server

curl "https://accounts.cartika.com/api/service/@id/vms" \
   -u user:pass \
   -d id="idValue"\
   -d label="labelValue"\
   -d template_id="template_idValue"\
   -d password="passwordValue"\
   -d memory="memoryValue"\
   -d cpu="cpuValue"\
   -d cpu_share="cpu_shareValue"\
   -d disk="diskValue"\
   -d swap="swapValue"\
   -d note="noteValue"\
   -d license_key="license_keyValue"\
   -d license_type="license_typeValue"
$data = array(
    'id' => 'idValue',
    'label' => 'labelValue',
    'template_id' => 'template_idValue',
    'password' => 'passwordValue',
    'memory' => 'memoryValue',
    'cpu' => 'cpuValue',
    'cpu_share' => 'cpu_shareValue',
    'disk' => 'diskValue',
    'swap' => 'swapValue',
    'note' => 'noteValue',
    'license_key' => 'license_keyValue',
    'license_type' => 'license_typeValue'
);
$resp = Requests::post('https://accounts.cartika.com/api/service/@id/vms', array(), $data, $options);

echo $resp->body;
payload = {
    'id' : 'idValue',
    'label' : 'labelValue',
    'template_id' : 'template_idValue',
    'password' : 'passwordValue',
    'memory' : 'memoryValue',
    'cpu' : 'cpuValue',
    'cpu_share' : 'cpu_shareValue',
    'disk' : 'diskValue',
    'swap' : 'swapValue',
    'note' : 'noteValue',
    'license_key' : 'license_keyValue',
    'license_type' : 'license_typeValue'
}
req = requests.post('https://accounts.cartika.com/api/service/@id/vms', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/vms

Query Parameters

Parameter Type Description
id int
label string VM label
template_id string Template ID
password string Initial root password
memory string Amount of RAM memory in MB
cpu string Amount of CPU cores
cpu_share string Share percentage of CPU
disk string Disk Space in GB
swap string Swap Space in GB
note string Custom note
license_key string Type of os license: `mak`, `kms` or `own`. This parameter is required for Windows virtual machines only
license_type string The key of a license, required if you have selected own licensing type

Destroy VM

Remove virtual server

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid" \
   -u user:pass 
$resp = Requests::delete('https://accounts.cartika.com/api/service/@id/vms/@vmid', array(), $options);

echo $resp->body;
req = requests.delete('https://accounts.cartika.com/api/service/@id/vms/@vmid', auth=auth)
print(req.json())

HTTP Request

DELETE /service/@id/vms/@vmid

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id

Resize VM

Edit a virtual server

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid" \
   -u user:pass 
$resp = Requests::put('https://accounts.cartika.com/api/service/@id/vms/@vmid', array(), $options);

echo $resp->body;
req = requests.put('https://accounts.cartika.com/api/service/@id/vms/@vmid', auth=auth)
print(req.json())

HTTP Request

PUT /service/@id/vms/@vmid

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id
memory string Amount of RAM memory in MB
cpu string Amount of CPU cores
cpu_share string Share percentage of CPU
note string Custom note

Stop VM

Stop virtual server

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/stop" \
   -u user:pass \
   -d id="idValue"\
   -d vmid="vmidValue"
$data = array(
    'id' => 'idValue',
    'vmid' => 'vmidValue'
);
$resp = Requests::post('https://accounts.cartika.com/api/service/@id/vms/@vmid/stop', array(), $data, $options);

echo $resp->body;
payload = {
    'id' : 'idValue',
    'vmid' : 'vmidValue'
}
req = requests.post('https://accounts.cartika.com/api/service/@id/vms/@vmid/stop', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/stop

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id

Start VM

Start virtual servers

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/start" \
   -u user:pass \
   -d id="idValue"\
   -d vmid="vmidValue"
$data = array(
    'id' => 'idValue',
    'vmid' => 'vmidValue'
);
$resp = Requests::post('https://accounts.cartika.com/api/service/@id/vms/@vmid/start', array(), $data, $options);

echo $resp->body;
payload = {
    'id' : 'idValue',
    'vmid' : 'vmidValue'
}
req = requests.post('https://accounts.cartika.com/api/service/@id/vms/@vmid/start', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/start

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id

Reboot VM

Reboot virtual servers, you can optionally specify ISO image to buot from.

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/reboot" \
   -u user:pass \
   -d id="idValue"\
   -d vmid="vmidValue"\
   -d iso="isoValue"
$data = array(
    'id' => 'idValue',
    'vmid' => 'vmidValue',
    'iso' => 'isoValue'
);
$resp = Requests::post('https://accounts.cartika.com/api/service/@id/vms/@vmid/reboot', array(), $data, $options);

echo $resp->body;
payload = {
    'id' : 'idValue',
    'vmid' : 'vmidValue',
    'iso' : 'isoValue'
}
req = requests.post('https://accounts.cartika.com/api/service/@id/vms/@vmid/reboot', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/reboot

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id
iso string Optional ISO Image to boot from

VM Cpu Usage graph

Retuns html code that can be embedded in page

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/usage/cpu" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/vms/@vmid/usage/cpu', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/vms/@vmid/usage/cpu', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/usage/cpu

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id

VM Network Usage graph

Retuns html code that can be embedded in page

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/usage/net" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/vms/@vmid/usage/net', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/vms/@vmid/usage/net', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/usage/net

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id

VM Disk Usage graph

Retuns html code that can be embedded in page

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/usage/disk" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/vms/@vmid/usage/disk', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/vms/@vmid/usage/disk', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/usage/disk

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id

List Disks attached to VM

Get the list of disks available for a particular virtual server

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/storage" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/vms/@vmid/storage', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/vms/@vmid/storage', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/storage

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id

Resize Disk VM

Change disk size

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/storage/@diskid" \
   -u user:pass 
$resp = Requests::put('https://accounts.cartika.com/api/service/@id/vms/@vmid/storage/@diskid', array(), $options);

echo $resp->body;
req = requests.put('https://accounts.cartika.com/api/service/@id/vms/@vmid/storage/@diskid', auth=auth)
print(req.json())

HTTP Request

PUT /service/@id/vms/@vmid/storage/@diskid

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id
diskid string Disk ID
size int the disk space in GB

List OS templates

List templates that can be used to create virtual server

curl "https://accounts.cartika.com/api/service/@id/templates" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/templates', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/templates', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/templates

Query Parameters

Parameter Type Description
id int

List ISO images

List virtual servers

curl "https://accounts.cartika.com/api/service/@id/images" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/images', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/images', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/images

Query Parameters

Parameter Type Description
id int

Add ISO image

List virtual servers

curl "https://accounts.cartika.com/api/service/@id/images" \
   -u user:pass \
   -d id="idValue"\
   -d label="labelValue"\
   -d file_url="file_urlValue"\
   -d min_memory="min_memoryValue"\
   -d version="versionValue"\
   -d os="osValue"\
   -d distro="distroValue"\
   -d virtualization[key]="virtualizationValue"
$data = array(
    'id' => 'idValue',
    'label' => 'labelValue',
    'file_url' => 'file_urlValue',
    'min_memory' => 'min_memoryValue',
    'version' => 'versionValue',
    'os' => 'osValue',
    'distro' => 'distroValue',
    'virtualization' => array('key'=>'value')
);
$resp = Requests::post('https://accounts.cartika.com/api/service/@id/images', array(), $data, $options);

echo $resp->body;
payload = {
    'id' : 'idValue',
    'label' : 'labelValue',
    'file_url' : 'file_urlValue',
    'min_memory' : 'min_memoryValue',
    'version' : 'versionValue',
    'os' : 'osValue',
    'distro' : 'distroValue',
    'virtualization' : {'key':'value'}
}
req = requests.post('https://accounts.cartika.com/api/service/@id/images', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/images

Query Parameters

Parameter Type Description
id int
label string Label for this ISO Image
file_url string Url pointing to iso file
min_memory int Minimum memory size in MB
version string Version number
os string Os type, use `Windows`, `Linux` or `Freebsd`
distro string Distribution name
virtualization array Supported virualization types, `xen`, `kvm`,`kvm_virtio`

List VM Network Interfaces

Get network Interfaces assigned to virtual servers

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/interfaces" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/vms/@vmid/interfaces', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/vms/@vmid/interfaces', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/interfaces

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id

List Available IPs

List IPs that can be assigned to virtual srver

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/interfaces/@iface/ips" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/vms/@vmid/interfaces/@iface/ips', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/vms/@vmid/interfaces/@iface/ips', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/interfaces/@iface/ips

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id
iface string Network interface ID

List VM IPs

List IPs assigned to virtual server

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/ips" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/vms/@vmid/ips', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/vms/@vmid/ips', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/ips

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id

Assign IP to VM

Add new ip to virtual server

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/ips" \
   -u user:pass \
   -d id="idValue"\
   -d vmid="vmidValue"\
   -d ipid="ipidValue"\
   -d interfaceid="interfaceidValue"
$data = array(
    'id' => 'idValue',
    'vmid' => 'vmidValue',
    'ipid' => 'ipidValue',
    'interfaceid' => 'interfaceidValue'
);
$resp = Requests::post('https://accounts.cartika.com/api/service/@id/vms/@vmid/ips', array(), $data, $options);

echo $resp->body;
payload = {
    'id' : 'idValue',
    'vmid' : 'vmidValue',
    'ipid' : 'ipidValue',
    'interfaceid' : 'interfaceidValue'
}
req = requests.post('https://accounts.cartika.com/api/service/@id/vms/@vmid/ips', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/ips

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id
ipid string IP Address ID
interfaceid string Network interface ID

Remove IP from VM

Unassign ip from virtual server

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/ips/@ipid" \
   -u user:pass 
$resp = Requests::delete('https://accounts.cartika.com/api/service/@id/vms/@vmid/ips/@ipid', array(), $options);

echo $resp->body;
req = requests.delete('https://accounts.cartika.com/api/service/@id/vms/@vmid/ips/@ipid', auth=auth)
print(req.json())

HTTP Request

DELETE /service/@id/vms/@vmid/ips/@ipid

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id
ipid string IP Address ID
interfaceid string Network interface ID

Rebuild Network

Rebuild the network for a particular virtual server

curl "https://accounts.cartika.com/api/service/@id/vms/@vmid/rebuild_network" \
   -u user:pass \
   -d id="idValue"\
   -d vmid="vmidValue"
$data = array(
    'id' => 'idValue',
    'vmid' => 'vmidValue'
);
$resp = Requests::post('https://accounts.cartika.com/api/service/@id/vms/@vmid/rebuild_network', array(), $data, $options);

echo $resp->body;
payload = {
    'id' : 'idValue',
    'vmid' : 'vmidValue'
}
req = requests.post('https://accounts.cartika.com/api/service/@id/vms/@vmid/rebuild_network', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/rebuild_network

Query Parameters

Parameter Type Description
id int
vmid string Virtual server id

Resources

Show available and used resources

curl "https://accounts.cartika.com/api/service/@id/resources" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/resources', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/resources', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/resources

Query Parameters

Parameter Type Description
id int

Upgrade Options

List resource upgrade options

curl "https://accounts.cartika.com/api/service/@id/upgrade" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/upgrade', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/upgrade', auth=auth)
print(req.json())

HTTP Request

GET /service/@id/upgrade

Query Parameters

Parameter Type Description
id int

Upgrade Request

Estimate or request upgrade

curl "https://accounts.cartika.com/api/service/@id/upgrade" \
   -u user:pass \
   -d id="idValue"
$data = array(
    'id' => 'idValue'
);
$resp = Requests::post('https://accounts.cartika.com/api/service/@id/upgrade', array(), $data, $options);

echo $resp->body;
payload = {
    'id' : 'idValue'
}
req = requests.post('https://accounts.cartika.com/api/service/@id/upgrade', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/upgrade

Query Parameters

Parameter Type Description
id int

IP Addresses

List Service IP Addresses

curl "https://accounts.cartika.com/api/service/@id/ip" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/ip', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/ip', auth=auth)
print(req.json())
Example Response:
{
    "ips": [
        {
            "ipaddress": "15.20.101.2",
            "mask": "255.255.255.0",
            "client_description": "",
            "status": "assigned"
        }
    ]
}

HTTP Request

GET /service/@id/ip

Query Parameters

Parameter Type Description
id int Service ID

Reverse DNS

Get reverse DNS entries for service's IP addresses

curl "https://accounts.cartika.com/api/service/@id/rdns" \
   -u user:pass 
$resp = Requests::get('https://accounts.cartika.com/api/service/@id/rdns', array(), $options);

echo $resp->body;
req = requests.get('https://accounts.cartika.com/api/service/@id/rdns', auth=auth)
print(req.json())
Example Response:
{
    "ips": [
        {
            "ipaddress": "10.10.101.2",
            "ptrname": "2.101.10.10.in-addr.arpa",
            "ptrcontent": "example.com"
        }
    ]
}

HTTP Request

GET /service/@id/rdns

Query Parameters

Parameter Type Description
id int Service ID

Update rDNS

Update reverse DNS entries service's IP addresses

curl "https://accounts.cartika.com/api/service/@id/rdns" \
   -u user:pass \
   -d id="idValue"\
   -d ipaddress[key]="ipaddressValue"
$data = array(
    'id' => 'idValue',
    'ipaddress' => array('key'=>'value')
);
$resp = Requests::post('https://accounts.cartika.com/api/service/@id/rdns', array(), $data, $options);

echo $resp->body;
payload = {
    'id' : 'idValue',
    'ipaddress' : {'key':'value'}
}
req = requests.post('https://accounts.cartika.com/api/service/@id/rdns', params=payload, auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "revdnsupdated"
    ]
}

HTTP Request

POST /service/@id/rdns

Query Parameters

Parameter Type Description
id int Service ID
ipaddress array Use Ip address as parameter key and hostname as value