0
SoftLayer APIを使用して仮想サーバーを監視するためのスクリプトを作成しています。SoftLayer APIからのディスク使用量の取得
私は指定hereとして、各仮想サーバーのblockDevice
と関連diskImage
を取得することによって、現在のディスクスペースを取得することができていますが、どのように私は、各ブロックデバイス上の空き/使用容量を得ることができますので、私はパーセントを計算することができます利用可能なスペースの?ここで
は、私は現在、データをフェッチしています方法です:
$server = SoapClient::getClient("SoftLayer_Virtual_Guest", $id, $username, $apikey);
$server->setObjectMask("mask[maxCpu,maxCpuUnits,maxMemory,statusId,status[keyName],bandwidthAllocation,billingCycleBandwidthUsage[amountOut,type],metricTrackingObjectId,billingItem[recurringMonths,nextInvoiceTotalRecurringAmount],datacenter[name,longName],blockDevices[statusId,status[keyName],diskImage[capacity,typeId,type[keyName],units]]]");
$server_data = $server->getObject();
問題は、様々なブロックデバイスのみが順番にcapacity
フィールドを持っているディスクイメージへの参照を保持していないが、何もということです実際の使用スペースにリンクしているようです。