SoftLayer API:イメージテンプレートからblockDevice情報を取得する方法は?
私は画像のような画像テンプレートを持っています。私はディスクスペースと仮想ディスクのリストを図に示すように取得したいと思います。私は使用した:
http://sldn.softlayer.com/zh/reference/services/SoftLayer_Virtual_Guest_Block_Device_Template_Group/getObject to get the image template with mask as ('mask[id,accountId,name,globalIdentifier,blockDevices[device,diskImageId,diskSpace,groupId,id,units],parentId,createDate,datacenter,imageType,storageRepository,datacenters]')
。
マスクblockDevicesが設定されています。しかし、フローは次のようになります。
{'accountId': xxxxxxx,
'blockDevices': [],
'createDate': '2016-09-18T07:16:57-05:00',
'datacenters': [{'id': xx4092,
'longName': 'Singapore 1',
'name': 'sng01',
'statusId': 2}],
'globalIdentifier': 'xxxxxxxx-b068-40b1-8377-9ab66df80131',
'id': 1331697,
'imageType': {'description': 'a disk that may be replaced on upgrade',
'keyName': 'SYSTEM',
'name': 'System'},
'name': 'xxx-test-all-disk',
'parentId': ''}
blockDevicesの項目は空の配列です。どうして?
すべてのAPIを使用すると、イメージディスクスペースと仮想ディスク情報を取得できますか?
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest_Block_Device_Template_Group/[imageId]/getObject?objectMask=mask[id,name,children[id,name,blockDevices[diskSpace,units,diskImage[localDiskFlag]]]]
Method:GET
children
項目必要な情報が含まれています。
あなたの完璧な答えをありがとうございました。あなたのマスクを使用して、私は結果(子供:[{blockDevice:[{device:0、...}]}])を取得しましたが、デバイスタイプ(sanまたはlocal?他のマスクが助けることができますか? – lippman
あなたのマスクに 'localDiskFlag'を追加することができます(children> blockDevices> diskImage> localDiskFlag)。それを試して、それがあなたのために働くかどうかを見てください:)。このプロパティを使用して上記のリクエストを更新しました。 – mcruz
さて、どんなに複雑なAPIなのですか? apiドキュメントはマスクの各項目の詳細ではありません。 1つのアイテムから他のアイテムへの参照が多いので、そんなに困惑しました。とにかく、あなたはとても親切です、もう一度あなたの助けに感謝します。 – lippman