SoftLayer API: How to get the blockDevice information from a image template?
<p><a href="http://i.stack.imgur.com/dSjqz.png" rel="nofollow"><img src="http://i.stack.imgur.com/dSjqz.png" alt="enter image description here"></a></p>

<p>I have a image template as shown in the picture. I want to get the disk space and the virtual disks list as marked in the Figure. I used:</p>

<p><code>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]')</code>. </p>

<p>The mask blockDevices is set. But the result is as flows:</p>

<pre><code>{'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': ''}
</code></pre>

<p>The item of blockDevices is a empty array. Why?  </p>

<p>Any api can help me to get the image disk space and virtual disks info ?</p>

<p>Please try the following <code>mask</code> (This a Rest example):</p>

<pre><code> 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 
</code></pre>

<p>The <code>children</code> items contain the information that you want. Currently, you are trying to get of <code>parent</code>item.</p>

<p>I hope it help you.</p>

python api softlayer