2016-09-19 19 views
0

enter image description hereSoftLayer 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項目必要な情報が含まれています。

答えて

0

mask(この休憩例)を試してみてください。現在、parentアイテムを取得しようとしています。

私はそれがあなたを助けてくれることを願っています。

+0

あなたの完璧な答えをありがとうございました。あなたのマスクを使用して、私は結果(子供:[{blockDevice:[{device:0、...}]}])を取得しましたが、デバイスタイプ(sanまたはlocal?他のマスクが助けることができますか? – lippman

+0

あなたのマスクに 'localDiskFlag'を追加することができます(children> blockDevices> diskImage> localDiskFlag)。それを試して、それがあなたのために働くかどうかを見てください:)。このプロパティを使用して上記のリクエストを更新しました。 – mcruz

+0

さて、どんなに複雑なAPIなのですか? apiドキュメントはマスクの各項目の詳細ではありません。 1つのアイテムから他のアイテムへの参照が多いので、そんなに困惑しました。とにかく、あなたはとても親切です、もう一度あなたの助けに感謝します。 – lippman

関連する問題