Application Programming Interface

Get Server Detail


Description:

This function enables you to get your deployed server detail.

URLs:
  • Sandbox URL: https://virtdedi.com/api-sandbox/v1/get_server_detail
  • Real API URL: https://virtdedi.com/api/v1/get_server_detail
Request Parameters:
Parameter Required Type Max Length Description
server_id Yes String 50 characters The ID of the server.
JSON Response:
    
        
{
    "code"    : "OK",
    "message" : "",
    "data"    : {
        "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"                    : ""
        "install_method"                   : "api",
        "install_source"                   : "template",
        "os_template"                      : "centos-8-64-vd",
        "iso_url"                          : "",
        "backup_id"                        : "",
        "os_variant"                       : "l24",
        "arch"                             : "x86_64",
        "networks"                   : {
            "public" : {
                "0": {
                    "interface"        : 0,
                    "mac_address"      : "aa:bb:cc:dd:ee:ff",
                    "ip_version"       : "v4",
                    "ip_address"       : "103.219.248.77",
                    "prefix"           : "/24",
                    "gateway"          : "103.219.248.1",
                    "dns_nameserver_1" : "8.8.8.8",
                    "dns_nameserver_2" : "8.8.4.4"
                },
                "1": {
                    "interface"        : 0,
                    "mac_address"      : "aa:bb:cc:dd:ee:ff",
                    "ip_version"       : "v6",
                    "ip_address"       : "2001:df2:5a00:1::123",
                    "prefix"           : "/64",
                    "gateway"          : "2001:df2:5a00:1::1",
                    "dns_nameserver_1" : "2001:4860:4860::8888",
                    "dns_nameserver_2" : "2606:4700:4700::1111"
                }
            },
            "local" : {
                "0": {
                    "interface"        : 1,
                    "mac_address"      : "11:22:33:44:55:66",
                    "ip_version"       : "v4",
                    "ip_address"       : "10.11.0.123",
                    "prefix"           : "/24"
                }
            }
        }

    }
}
    
XML Response:
    
        
<?xml version="1.0" encoding="utf-8"?>
<code>OK</code>
<message></message>
<data>
    <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-02 09:30:27</activated_time>
    <end_time></end_time>
    <install_method>api</install_method>
    <install_source>template</install_source>
    <os_template>centos-8-64-vd</os_template>
    <iso_url></iso_url>
    <backup_id></backup_id>
    <os_variant>l24</os_variant>
    <arch>x86_64</arch>
    <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>
    <networks>
        <public>
        <record>
            <interface>0</interface>
            <mac_address>aa:bb:cc:dd:ee:ff</mac_address>
            <ip_version>v4</ip_version>
            <ip_address>103.219.248.77</ip_address>
            <prefix>/27</prefix>
            <gateway>103.219.248.1</gateway>
            <dns_nameserver_1>8.8.8.8</dns_nameserver_1>
            <dns_nameserver_2>8.8.4.4</dns_nameserver_2>
        </record>
        <record>
            <interface>0</interface>
            <mac_address>11:22:33:44:55:66</mac_address>
            <ip_version>v6</ip_version>
            <ip_address>2001:df2:5a00:1::123</ip_address>
            <prefix>/64</prefix>
            <gateway>2001:df2:5a00:1::1</gateway>
            <dns_nameserver_1>2001:4860:4860::8888</dns_nameserver_1>
            <dns_nameserver_2>2606:4700:4700::1111</dns_nameserver_2>
        </record>
        </public>
        <local>
        <record>
            <interface>1</interface>
            <mac_address>11:22:33:44:55:66</mac_address>
            <ip_version>v4</ip_version>
            <ip_address>10.11.0.123</ip_address>
            <prefix>/24</prefix>
        </record>
        </local>
    </networks>
</data>
    
PHP Example:
    
        
<?php
$url      = "https://virtdedi.com/api-sandbox/v1/get_server_detail";
//$url    = "https://virtdedi.com/api/v1/get_server_detail";
$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,
    "server_id" => "12345"
);
$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
        }
    }
}