月次利用料金を取得します。
リクエストパラメーター
パラメーター名 | 項目 | 項目説明 |
---|---|---|
[version] | 説明 | 課金APIのバージョンID |
型 | string ASCII | |
設定内容 | "1.0"を指定してください。省略した場合は最新のバージョンで動作します。 | |
action | 説明 | 実行する課金APIの名称 |
型 | string ASCII | |
設定内容 | 固定。"GetMonthlyCharge"を指定してください。 | |
[startDate] | 説明 | 取得する情報の開始年月 |
型 | string ASCII | |
設定内容 | yyyy-MM endDateの翌月以降の年月、API実行月、およびそれより先の年月は指定不可。 省略した場合は、API実行時点の前月として動作します。 | |
[endDate] | 説明 | 取得する情報の終了年月 |
型 | string ASCII | |
設定内容 | yyyy-MM startDate以前の年月、API実行月、およびそれより先の年月は指定不可。 省略した場合は、API実行時点の前月として動作します。 | |
[sum] | 説明 | 取得した情報を月ごとに出力するか、まとめた集計値を出力するかのオプション |
型 | string ASCII | |
設定内容 | 以下のどちらかを指定します。 ・true : 集計値を出力 省略した場合は、"false"として動作します。 | |
[lplatformId] | 説明 | 指定したL-Platformの情報を取得 |
型 | string ASCII | |
設定内容 | 複数指定する場合は、パラメーターをそれぞれに指定します。 例) lplatformId=aaa&lplatformId=bbb&… なお、"lplatformId"を指定した場合は、"tenantName"は指定できません(逆も同様)。 | |
[tenantName] | 説明 | 指定したテナントの情報を取得 |
型 | string ASCII | |
設定内容 | 複数指定する場合は、パラメーターをそれぞれに指定します。 例) tenantName=aaa&tenantName=bbb&… なお、"lplatformId"を指定した場合は、"tenantName"は指定できません(逆も同様)。 |
レスポンス
《ステータスコード》
正常に終了した場合に"200 OK"を返します。
《XML》
<?xml version="1.0" encoding="UTF-8"?> <GetMonthlyChargeResponse> <responseMessage>[メッセージ]</responseMessage> <responseStatus>[ステータス]</responseStatus> <version>[バージョン]</version> <startDate>[参照情報の開始年月]</startDate> <endDate>>[参照情報の終了年月]</endDate> <systems date="2012-01"> <system id="[L-Platform ID]" name="[L-Platform名]" tenantName="[管理元テナントのテナント名]" tenantDeleteDate="[管理元テナントの削除日]"> <totalCharge>[月次利用料金の合計]</totalCharge> <accountingItems> <accountingItem> <subtotalCharge>[月次利用料金の小計]</subtotalCharge> <products> <product id="[商品ID]" category="[カテゴリーコード]" resource="[リソース識別子]" usageUnit="[課金単位]" unitPrice="[単価]" unitNum="[単位数]"> <usagePoint>[利用度数]</usagePoint> <usagePointUnit>[度数単位]</usagePointUnit> <usageCharge>[月次利用料金]</usageCharge> </product> </products> </accountingItem> </accountingItems> <servers> <server id="[L-Server ID]" name="[L-Server名]"> <disks> <disk id="[ディスクID]" name="[ディスク名]"> </disk> </disks> <images type="[イメージ情報の種類]"> <image id="[イメージリソースID]"> </image> </images> </server> </servers> </system> </systems> </GetMonthlyChargeResponse>
《要素》
要素名 | 項目 | 項目説明 |
---|---|---|
GetMonthlyChargeResponse | 説明 | レスポンスの情報を持つ要素 |
型 | なし | |
出現回数 | 1 | |
responseMessage | 説明 | メッセージ。リクエストが正しく処理されたかどうかを表します。 |
型 | string UTF-8 | |
出現回数 | 1 | |
responseStatus | 説明 | ステータス。リクエストが正常に処理されたかどうかを表します。正常に処理された場合は "SUCCESS" が返却されます。それ以外の場合はエラーコードが返却されます。 |
型 | string ASCII | |
出現回数 | 1 | |
version | 説明 | APIのバージョン |
型 | string ASCII | |
出現回数 | 1 | |
startDate | 説明 | 参照情報の開始年月 |
型 | string ASCII | |
出現回数 | 1 | |
endDate | 説明 | 参照情報の終了年月 |
型 | string ASCII | |
出現回数 | 1 | |
systems | 説明 | L-Platform一覧のレスポンス情報を持つ要素。 |
型 | なし | |
出現回数 | 1以上 | |
system | 説明 | L-Platformテンプレート情報の一式 ・id : L-Platform ID 削除されていないテナントの場合は、空が返却されます。属性は省略されません。 |
型 | なし | |
出現回数 | 0以上 | |
totalCharge | 説明 | 月次利用料金の合計 |
型 | decimal | |
出現回数 | systemの数分(それぞれに対して1) | |
servers | 説明 | L-Server一覧のレスポンス情報を持つ要素 |
型 | string ASCII | |
出現回数 | systemの数分(それぞれに対して0または1) | |
server | 説明 | L-Server情報の一式 ・id : L-Server ID |
型 | string UTF-8 | |
出現回数 | serversの数分(それぞれに対して0または1) | |
disks | 説明 | ディスク一覧のレスポンス情報を持つ要素 |
型 | string ASCII | |
出現回数 | serverの数分(それぞれに対して0または1) | |
disk | 説明 | ディスク情報の一式 ・id : ディスクID |
型 | string ASCII | |
出現回数 | disksの数分(それぞれに対して0以上) | |
images | 説明 | イメージリソース一覧のレスポンス情報を持つ要素 type : イメージ情報の種類 ・snapshot : スナップショット |
型 | string ASCII | |
出現回数 | serverの数分(それぞれに対して0または1) | |
image | 説明 | イメージリソース情報の一式 |
型 | string ASCII | |
出現回数 | imagesの数分(それぞれに対して0以上) | |
accountingItems | 説明 | 課金情報一覧のレスポンス情報を持つ要素 |
型 | string ASCII | |
出現回数 | system、server、disk、およびimageの数分(それぞれに対して0以上) | |
accountingItem | 説明 | 課金情報の一式 |
型 | string ASCII | |
出現回数 | accountingItemsの数分(それぞれに対して1以上) | |
subtotalCharge | 説明 | 月次利用料金の小計 |
型 | decimal | |
出現回数 | accountingItemの数分(それぞれに対して1) | |
products | 説明 | 商品情報一覧のレスポンス情報を持つ要素 |
型 | string ASCII | |
出現回数 | accountingItemの数分(それぞれに対して0または1) | |
product | 説明 | 商品情報の一式 ・id : 商品ID (注1) 注1)とりうる値は商品マスタの仕様に準じます。商品が登録されていない場合は、属性は省略されず、空を返却します。 注2)商品ごとに性能値などを返却します。 ・template : 1 (固定) |
型 | string ASCII | |
出現回数 | productsの数分(それぞれに対して0以上) | |
usagePoint | 説明 | 利用度数 |
型 | decimal | |
出現回数 | productの数分(それぞれに対して1) | |
usagePointUnit | 説明 | 度数単位。以下のどれかを指摘します。 ・minute (分) |
型 | string ASCII | |
出現回数 | productの数分(それぞれに対して1) | |
usageCharge | 説明 | 月次利用料金 |
型 | decimal | |
出現回数 | productの数分(それぞれに対して1) |
ポイント
product要素のcategory属性がcpu、cpu_clockのusageCharge要素の値について
独自に利用料金登録APIを利用して登録したデータではなく、RORの利用料金計算で集計されたデータを取得する場合、product要素のcategory属性がcpu、cpu_clockのusageCharge要素の値は0になります。
CPUに対する利用料金はcategory属性がcpu、cpu_clockのproduct要素を含むaccountingItem要素内のsubtotalCharge要素の値を参照してください。CPUの利用料金の計算方法については「運用ガイド CE」の「15.4.4 リソースの使用量と使用時間」を参照してください。
サンプルレスポンス
<?xml version="1.0" encoding="UTF-8"?> <GetMonthlyChargeResponse> <responseMessage>PAPI00000 Process completed..</responseMessage> <responseStatus>SUCCESS</responseStatus> <version>1.0</version> <startDate>2012-01</startDate> <endDate>2012-01</endDate> <systems date="2012-01"> <system id="Tenant1-IYHPD30VJ" name="lplatform001" tenantName="Tenant1" tenantDeleteDate="" ownerUserId="tenant_user_001"> <totalCharge>2382.15</totalCharge> <costSharingRates> <costSharingRate tenantName="Tenant1" rate="80"/> <costSharingRate tenantName="Tenant2" rate="20"/> </costSharingRates> <accountingItems> <accountingItem> <subtotalCharge>1000.000</subtotalCharge> <products> <product id="PID-TMP-001" category="template" resource="template-135562b98d2" usageUnit="month" unitPrice="1000.000" unitNum="1"> <usagePoint>1440</usagePoint> <usagePointUnit>minute</usagePointUnit> <usageCharge>1000.000</usageCharge> </product> </products> </accountingItem> </accountingItems> <servers> <server id="Tenant1-IYHPD30VJ-S-0001" name="server01"> <accountingItems> <accountingItem> <subtotalCharge>800.000</subtotalCharge> <products> <product id="PID-VIM-001" category="vm" resource="/VMHostPool" usageUnit="month" unitPrice="800.000" unitNum="1"> <usagePoint>1440</usagePoint> <usagePointUnit>minute</usagePointUnit> <usageCharge>800.000</usageCharge> </product> </products> </accountingItem> <accountingItem> <subtotalCharge>24.150</subtotalCharge> <products> <product id="PID-CPU-001" category="cpu" resource="/VMHostPool" usageUnit="hour" unitPrice="0.150" unitNum="2"> <usagePoint>630</usagePoint> <usagePointUnit>minute</usagePointUnit> <usageCharge>3.150</usageCharge> </product> <product id="PID-CLK-001" category="cpu_clock" resource="/VMHostPool" usageUnit="hour" unitPrice="0.100" unitNum="10"> <usagePoint>630</usagePoint> <usagePointUnit>minute</usagePointUnit> <usageCharge>21.000</usageCharge> </product> </products> </accountingItem> <accountingItem> <subtotalCharge>10.000</subtotalCharge> <products> <product id="PID-MEM-001" category="memory" resource="/VMHostPool" usageUnit="hour" unitPrice="0.100" unitNum="40"> <usagePoint>150</usagePoint> <usagePointUnit>minute</usagePointUnit> <usageCharge>10.000</usageCharge> </product> </products> </accountingItem> <accountingItem> <subtotalCharge>48.000</subtotalCharge> <products> <product id="PID-MEM-001" category="memory" resource="/VMHostPool" usageUnit="hour" unitPrice="0.150" unitNum="40"> <usagePoint>480</usagePoint> <usagePointUnit>minute</usagePointUnit> <usageCharge>48.000</usageCharge> </product> </products> </accountingItem> <accountingItem> <subtotalCharge>2000.000</subtotalCharge> <products> <product id="PID-SYS-001" category="sys_disk" resource="/StoragePool" usageUnit="month" unitPrice="2000.000" unitNum="1"> <usagePoint>1440</usagePoint> <usagePointUnit>minute</usagePointUnit> <usageCharge>2000.000</usageCharge> </product> </products> </accountingItem> </accountingItems> <disks> <disk id="Tenant1-IYHPD30VJ-D-0002" name="DISK01"> <accountingItems> <accountingItem> <subtotalCharge>200</subtotalCharge> <products> <product id="PID-DSK-001" category="disk" resource="VMStoragePool" usageUnit="month" unitPrice="1.000" unitNum="200"> <usagePoint>1440</usagePoint> <usagePointUnit>minute</usagePointUnit> <usageCharge>200.000</usageCharge> </product> </products> </accountingItem> </accountingItems> </disk> <disk id="Tenant1-IYHPD30VJ-D-0002" name="DISK02"> <accountingItems> <accountingItem> <subtotalCharge>300</subtotalCharge> <products> <product id="PID-DSK-002" category="disk" resource="VMStoragePool" usageUnit="month" unitPrice="1.000" unitNum="300"> <usagePoint>1440</usagePoint> <usagePointUnit>minute</usagePointUnit> <usageCharge>300.000</usageCharge> </product> </products> </accountingItem> </accountingItems> </disk> </disks> <images type="snapshot"> <image id="Tenant1-IYHPD30VJ-SS-0001"> <accountingItems> <accountingItem> <subtotalCharge>200</subtotalCharge> <products> <product id="PID-SS-001" category="snapshot" resource="VMStoragePool" usageUnit="month" unitPrice="1.000" unitNum="200"> <usagePoint>1440</usagePoint> <usagePointUnit>minute</usagePointUnit> <usageCharge>200.000</usageCharge> </product> </products> </accountingItem> </accountingItems> </image> </images> </server> </servers> </system> </systems> </GetMonthlyChargeResponse>