Application Programming Interface

Get Server List


Description:

This function enables you to get your deployed server list. The server list will be limited up to 100 records per request, divided into multipe pages (record sets). You can set the limit and the page. If you are reseller, we recommend you to store server list in your own database for faster retrieval.

URLs:
  • Sandbox URL: https://virtdedi.com/api-sandbox/v1/get_server_list
  • Real API URL: https://virtdedi.com/api/v1/get_server_list
Request Parameters:
Parameter Required Type Max Length Description
records_per_page No Integer 3 digits Minimum: 10 records per page.
Maximum: 100 records per page.
Default: 20 records per page.
page No Integer 10 digits If the provided value is greater than max available pages, the max pages will be applied. Default is 1.
sorted_by No String 25 characters Available options:
  • server_label_ascending
  • server_label_descending
  • activated_time_ascending
  • activated_time_descending (default)
ownership No String 6 characters Available options:
  • all (default)
  • owner
  • shared
order_status No String 9 characters Available options:
  • all (default)
  • pending
  • active
  • suspended
  • pendingcancel
  • canceled
server_status No String 9 characters Available options:
  • all (default)
  • install
  • reinstall
  • on
  • off
  • suspended
  • deleted
package No String 12 characters Available options:
  • all (default)
  • ryzen9950x
  • epyc7763
custom_info_1 No String 50 characters Your custom parameter 1
custom_info_2 No String 50 characters Your custom parameter 2
custom_info_3 No String 50 characters Your custom parameter 3
Custom parameters let you identify you servers with your own identifier. These are useful for resellers, for example, to determine customer ID, package bundle, etc.
JSON Response:
    
        
{
    "code"    : "OK",
    "message" : "",
    "data"    : {
        "total_records"    : 100,
        "records_per_page" : 20
        "total_pages"      : 5,
        "page"             : 1,
        "records"          : {
            "0" : {
                "server_id"                        : "12345",
                "server_label"                     : "My Server One",
                "hostname"                         : "server.domain.com",
                "order_status"                     : "active",
                "server_status"                    : "on",
                "package"                          : "ryzen9950x",
                "vcpu"                             : 1,
                "ram"                              : 4,
                "nvme"                             : 50,
                "hdd"                              : 0,
                "monthly_data_transfer"            : 2
                "additional_monthly_data_transfer" : 0,
                "daiy_backup"                      : "no",
                "daily_backup_max_age"             : 0,
                "weekly_backup"                    : "no",
                "weekly_backup_max_age"            : 0,
                "monthly_backup"                   : "no",
                "monthly_backup_max_age"           : 0,
                "hdd_backup"                       : "no",
                "price"                            : 9,
                "billing_cycle"                    : "1monthly",
                "billing_cycle_discount"           : 0,
                "reseller_discount"                : 0,
                "pay_with_balance"                 : "yes",
                "activated_time"                   : "2016-09-01 12:00:56",
                "end_time"                         : "2016-09-02 12:00:56",
                "data_center"                      : "ID.DATAHALL",
                "ownership"                        : "owner",
                "custom_info_1"                    : "",
                "custom_info_2"                    : "",
                "custom_info_3"                    : ""
            },
            "1" : {
                "server_id"                        : "653456",
                "server_label"                     : "My Server Two",
                "hostname"                         : "server2.domain.com",
                "order_status"                     : "active",
                "server_status"                    : "on",
                "package"                          : "epyc7763",
                "vcpu"                             : 1,
                "ram"                              : 4,
                "nvme"                             : 50,
                "hdd"                              : 0,
                "monthly_data_transfer"            : 2
                "additional_monthly_data_transfer" : 0,
                "daiy_backup"                      : "no",
                "daily_backup_max_age"             : 0,
                "weekly_backup"                    : "no",
                "weekly_backup_max_age"            : 0,
                "monthly_backup"                   : "no",
                "monthly_backup_max_age"           : 0,
                "hdd_backup"                       : "no",
                "price"                            : 9,
                "billing_cycle"                    : "1monthly",
                "billing_cycle_discount"           : 0,
                "reseller_discount"                : 0,
                "pay_with_balance"                 : "yes",
                "activated_time"                   : "2016-09-01 12:00:56",
                "end_time"                         : "2016-09-02 12:00:56",
                "data_center"                      : "ID.DATAHALL",
                "ownership"                        : "owner",
                "custom_info_1"                    : "",
                "custom_info_2"                    : "",
                "custom_info_3"                    : ""
            },
            ................................
        }

    }
}
    
XML Response:
    
        
<?xml version="1.0" encoding="utf-8"?>
<code>OK</code>
<message></message>
<data>
    <total_records>100</total_records>
    <records_per_page>20</records_per_page>
    <total_pages>5</total_pages>
    <page>1</page>
    <records>
        <record>
            <server_id>12345<server_id>
            <server_label>My Server One</server_label>
            <hostname>server.domain.com</hostname>
            <order_status>active</order_status>
            <server_status>on</server_status>
            <package>ryzen9950x</package>
            <vcpu>1</vcpu>
            <ram>4</ram>
            <nvme>50</nvme>
            <hdd>0</hdd>
            <monthly_data_transfer>2</monthly_data_transfer>
            <additional_monthly_data_transfer>0</additional_monthly_data_transfer>
            <daiy_backup>no</daiy_backup>
            <daily_backup_max_age>0</daily_backup_max_age>
            <weekly_backup>no</weekly_backup>
            <weekly_backup_max_age>0</weekly_backup_max_age>
            <monthly_backup>no</monthly_backup>
            <monthly_backup_max_age>0</monthly_backup_max_age>
            <hdd_backup>no</hdd_backup>
            <price>9</price>
            <billing_cycle>1monthly</billing_cycle>
            <billing_cycle_discount>0</billing_cycle_discount>
            <reseller_discount>0</reseller_discount>
            <pay_with_balance>yes</pay_with_balance>
            <activated_time>2016-09-01 12:00:56</activated_time>
            <end_time>2016-09-02 12:00:56</end_time>
            <data_center>ID.DATAHALL</data_center>
            <ownership>owner</ownership>
            <custom_info_1></custom_info_1>
            <custom_info_2></custom_info_2>
            <custom_info_3></custom_info_3>
        </record>
        <record>
            <server_id>1234<server_id>
            <server_label>My Server Two</server_label>
            <order_status>active</order_status>
            <server_status>on</server_status>
            <package>epyc7763</package>
            <vcpu>1</vcpu>
            <ram>4</ram>
            <nvme>50</nvme>
            <hdd>0</hdd>
            <monthly_data_transfer>2</monthly_data_transfer>
            <additional_monthly_data_transfer>0</additional_monthly_data_transfer>
            <daiy_backup>no</daiy_backup>
            <daily_backup_max_age>0</daily_backup_max_age>
            <weekly_backup>no</weekly_backup>
            <weekly_backup_max_age>0</weekly_backup_max_age>
            <monthly_backup>no</monthly_backup>
            <monthly_backup_max_age>0</monthly_backup_max_age>
            <hdd_backup>no</hdd_backup>
            <price>9</price>
            <billing_cycle>1monthly</billing_cycle>
            <billing_cycle_discount>0</billing_cycle_discount>
            <reseller_discount>0</reseller_discount>
            <pay_with_balance>yes</pay_with_balance>
            <activated_time>2016-09-02 09:30:27</activated_time>
            <end_time></end_time>
            <data_center>ID.DATAHALL</data_center>
            <ownership>shared</ownership>
            <custom_info_1></custom_info_1>
            <custom_info_2></custom_info_2>
            <custom_info_3></custom_info_3>
        </record>
        ................................
    }
    </records>
</data>
    
PHP Example:
    
        
<?php
$url      = "https://virtdedi.com/api-sandbox/v1/get_server_list";
//$url    = "https://virtdedi.com/api/v1/get_server_list";
$user_id  = "12312";
$API_key  = "hasdh6ghvhgFDa454565jasdbNBS";
$random   = rand(10000,99999).uniqid().rand(100000,999999);
$checksum = sha1(sha1(sha1($user_id.$API_key.$random)));
$data = array(
    "user_id"          => $user_id,
    "random"           => $random,
    "format"           => "json",
    "checksum"         => $checksum,
    "records_per_page" => 30,
    "page"             => 1,
    "sorted_by"        => "activated_time_ascending"
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$output = curl_exec($ch);
$curl_error = curl_errno($ch);
curl_close($ch);
if ($curl_error){
    echo "Unable to connect to API Server.";
} else {
    $outputArray = json_decode($output,true);
    if (!$outputArray){
        echo "Invalid JSON Format";
    } else {
        if ($outputArray["code"] == "OK"){
            print_r($outputArray);
            // Do what you want to do here if OK
        } else {
            echo "Error Message: ".$outputArray["message"];
            // Do what you want to do here if not OK
        }
    }
}