Introduction
Get Arch List
Get OS Variant List
Get OS Template List
Get Server List
Get Server Detail
Create Server
Cancel Server
Reinstall Server
Turn Server On
Turn Server Off
Change Server Label
Change Server Hostname
Change Reverse Host
Set Server Custom Info
Change Server Password
Get Server Virtual Monitor URL
Get Server Shared Access List
Add Server Shared Access
Delete Server Shared Access
Get Snapshot List
Get Snapshot Detail
Create Snapshot
Delete Snapshot
Set Server Snapshot Schedule
This function enables you to get your deployed server detail.
Parameter | Required | Type | Max Length | Description |
---|---|---|---|---|
server_id | Yes | String | 50 characters | The ID of the server. |
{
"code" : "OK",
"message" : "",
"data" : {
"server_id" : "12346",
"server_label" : "My Server Two",
"order_status" : "active",
"server_status" : "on",
"package" : "compute1",
"vcpu" : 1,
"ram" : 0.5,
"ssd" : 15,
"hdd" : 0,
"price" : 0.025,
"monthly_cap" : 60000,
"activated_time" : "2016-09-02 09:30:27",
"end_time" : "",
"install_method" : "api",
"install_source" : "template",
"os_template" : "centos-6-64",
"iso_url" : "",
"hostname" : "myserver.domain.com",
"os_variant" : "centos6.5",
"arch" : "x86_64",
"root_password" : "jhg&*^hgasgs",
"data_center" : "ID.NAPINFO",
"extra_data_transfer_action" : "unplug_network_interfaces",
"ownership" : "shared",
"custom_info_1" : "",
"custom_info_2" : "",
"custom_info_3" : "",
"daiy_snapshots" : "yes",
"retain_daily_snapshots" : 7,
"weekly_snapshots" : "no",
"retain_weekly_snapshots" : 0,
"monthly_snapshots" : "no",
"retain_monthly_snapshots" : 0,
"total_active_snapshots" : 7,
"total_deleted_snapshots" : 12345,
"networks" : {
"0": {
"mac_address" : "aa:bb:cc:dd:ee:ff",
"ip_address" : "103.219.248.77",
"netmask" : "255.255.255.0",
"prefix" : "/24",
"gateway" : "103.219.248.1",
"dns_nameserver_1" : "8.8.8.8",
"dns_nameserver_2" : "8.8.4.4",
"reverse_host" : "103-219-248-77.host.node.id"
},
"1": {
"mac_address" : "11:22:33:44:55:66",
"ip_address" : "103.219.248.78",
"netmask" : "255.255.255.0",
"prefix" : "/24",
"gateway" : "103.219.248.1",
"dns_nameserver_1" : "8.8.8.8",
"dns_nameserver_2" : "8.8.4.4",
"reverse_host" : "103-219-248-78.host.node.id"
}
.................................
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<code>OK</code>
<message></message>
<data>
<server_id>1234<server_id>
<server_label>My Server Two</server_label>
<order_status>active</order_status>
<server_status>on</server_status>
<package>compute1</package>
<vcpu>1</vcpu>
<ram>0.5</ram>
<ssd>15</ssd>
<hdd>0</hdd>
<price>0.025</price>
<monthly_cap>60000</monthly_cap>
<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-6-64</os_template>
<iso_url></iso_url>
<hostname>myserver.domain.com</hostname>
<os_variant>centos6.5</os_variant>
<arch>x86_64</arch>
<root_password>jhg&*^hgasgs</root_password>
<data_center>ID.NAPINFO</data_center>
<extra_data_transfer_action>unplug_network_interfaces</extra_data_transfer_action>
<ownership>shared</ownership>
<custom_info_1></custom_info_1>
<custom_info_2></custom_info_2>
<custom_info_3></custom_info_3>
<daiy_snapshots>yes</daiy_snapshots>
<retain_daily_snapshots>7</retain_daily_snapshots>
<weekly_snapshots>no</weekly_snapshots>
<retain_weekly_snapshots>0</retain_weekly_snapshots>
<monthly_snapshots>no</monthly_snapshots>
<retain_monthly_snapshots>0</retain_monthly_snapshots>
<total_active_snapshots>7</total_active_snapshots>
<total_deleted_snapshots>12345</total_deleted_snapshots>
<networks>
<record>
<mac_address>aa:bb:cc:dd:ee:ff</mac_address>
<ip_address>103.219.248.77</ip_address>
<netmask>255.255.255.0</netmask>
<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>
<reverse_host>103-219-248-77.host.node.id</reverse_host>
</record>
<record>
<mac_address>11:22:33:44:55:66</mac_address>
<ip_address>103.219.248.78</ip_address>
<netmask>255.255.255.0</netmask>
<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>
<reverse_host>103-219-248-78.host.node.id</reverse_host>
</record>
.................................
</networks>
</data>
<?php
$url = "https://node.co.id/api-sandbox/v1/get_server_detail";
//$url = "https://node.co.id/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
}
}
}