サーバの情報を表示します。
/api/v1/srv/info?srv=srv&vdc=controller-name
サーバの名前
ターゲットの仮想データ センターの名前
同期
GET
srv1 の情報を表示します。
GET http://192.168.123.200/api/v1/srv/info?srv=srv1&vdc=mygrid
XML
<server>
<name>srv1</name>
<bw_alloc>720000000</bw_alloc>
<bw_free>1280000000</bw_free>
<bw_reserved>0</bw_reserved>
<bw_total>2000000000</bw_total>
<cpu_alloc>1.69</cpu_alloc>
<cpu_bogomips>3991</cpu_bogomips>
<cpu_free>2.21</cpu_free>
<cpu_freq>1995</cpu_freq>
<cpu_load>0.06</cpu_load>
<cpu_phy_total>2</cpu_phy_total>
<cpu_reserved>0.10</cpu_reserved>
<cpu_total>4</cpu_total>
<cpu_type>Intel(R) Xeon(R) CPU 5130 @ 2.00GHz </cpu_type>
<disk_free>1143356945142</disk_free>
<disk_reserved>10737418240</disk_reserved>
<disk_total>1493697126400</disk_total>
<enabled>1</enabled>
<ha_role>primary</ha_role>
<hvm_support>1</hvm_support>
<mem_alloc>1610612736</mem_alloc>
<mem_free>1246756864</mem_free>
<mem_reserved>1435500544</mem_reserved>
<mem_service>0</mem_service>
<mem_total>4292870144</mem_total>
<n_disks>1</n_disks>
<state>up</state>
</server>
JSON
{
"cpu_freq" : "1995",
"cpu_type" : "Intel(R) Xeon(R) CPU 5130 @ 2.00GHz ",
"cpu_bogomips" : "3991",
"state" : "up",
"cpu_total" : "4",
"cpu_alloc" : "1.69",
"mem_alloc" : "1610612736",
"hvm_support" : "1",
"enabled" : "1",
"bw_total" : "2000000000",
"cpu_reserved" : "0.10",
"mem_total" : "4292870144",
"name" : "srv1",
"disk_reserved" : "10737418240",
"disk_total" : "1493697126400",
"cpu_phy_total" : "2",
"cpu_free" : "2.21",
"ha_role" : "primary",
"mem_reserved" : "1435500544",
"mem_service" : "0",
"bw_free" : "1280000000",
"disk_free" : "1143356945142",
"bw_reserved" : "0",
"mem_free" : "1246756864",
"cpu_load" : "0.30",
"bw_alloc" : "720000000",
"n_disks" : "1"
}
JSON の出力はすべて UTF8 にエンコードされています。 UTF8 デコードを使用して UTF8 にエンコードされた出力をデコードします。
UTF8 にエンコードされた JSON 出力をデコードするシンプルな PHP スクリプトの例を以下に示します。
<?
$json = '{"a": "¥u00e3¥u0081¥u0082" }';
$j = json_decode($json);
echo utf8_decode($j->{'a'});
?>
エンティティ vdc mygrid が見つかりません。WS_API アプリケーションに設定されていない VDC 名が指定されました。
必要な引数(srv)がありません。引数 srv=srv-name が指定されませんでした。
リクエストの処理に失敗しました。サーバ srv の情報を表示できませんでした。存在しません。
リクエストに無効なサーバ名が指定されました。
| Copyright © 2011 CA. All rights reserved. | このトピックについて CA Technologies に電子メールを送信する |