繁体   English   中英

SoftLayer API:如何从图像模板获取blockDevice信息?

[英]SoftLayer API: How to get the blockDevice information from a image template?

在此处输入图片说明

我有一个图片模板,如图所示。 我想要获取图中标记的磁盘空间和虚拟磁盘列表。 我用了:

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]')

设置了mask 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都可以帮助我获取映像磁盘空间和虚拟磁盘信息吗?

请尝试以下mask (此为“休息”示例):

 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项包含所需的信息。 目前,您正在尝试获取parent项。

希望对您有帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM