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 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.
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:
|
ownership | No | String | 6 characters |
Available options:
|
order_status | No | String | 9 characters |
Available options:
|
server_status | No | String | 9 characters |
Available options:
|
package | No | String | 12 characters |
Available options:
|
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.
{
"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",
"order_status" : "active",
"server_status" : "on",
"package" : "trial",
"vcpu" : 1,
"ram" : 0.5,
"ssd" : 15,
"hdd" : 0,
"price" : 0,
"monthly_cap" : 0,
"activated_time" : "2016-09-01 12:00:56",
"end_time" : "2016-09-02 12:00:56",
"data_center" : "ID.NAPINFO",
"ownership" : "owner",
"custom_info_1" : "",
"custom_info_2" : "",
"custom_info_3" : ""
},
"1" : {
"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" : "",
"data_center" : "ID.NAPINFO",
"ownership" : "shared",
"custom_info_1" : "",
"custom_info_2" : "",
"custom_info_3" : ""
},
................................
}
}
}
<?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>
<order_status>active</order_status>
<server_status>on</server_status>
<package>trial</package>
<vcpu>1</vcpu>
<ram>0.5</ram>
<ssd>15</ssd>
<hdd>0</hdd>
<price>0</price>
<monthly_cap>0</monthly_cap>
<activated_time>2016-09-01 12:00:56</activated_time>
<end_time>2016-09-02 12:00:56</end_time>
<data_center>ID.NAPINFO</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>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>
<data_center>ID.NAPINFO</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
$url = "https://node.co.id/api-sandbox/v1/get_server_list";
//$url = "https://node.co.id/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
}
}
}