答案在文档中:
http://sldn.softlayer.com/reference/datatypes/SoftLayer_Ticket
在那里你会看到这个:
attachHardware 与票证关联的硬件。这用于票证与一个或多个硬件直接关联的情况。
attachVirtualGuests 与票关联的虚拟客人。这用于票证与一个或多个虚拟客户安装或虚拟服务器直接关联的情况。
因此,您只需要查看您的主机名的这些参数。为了做到这一点,文档再次发挥作用。看到这个:
http://sldn.softlayer.com/article/Object-Filters
因此,您可以调用 Softlayer_Account::getTickets 并将结果限制为仅显示与确定的硬件或 VSI 关联的票证
这是一个使用 RESTFul 的示例:
for hardware:
URL: https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getTickets?objectMask=mask[attachedHardware, attachedVirtualGuests]&objectFilter={"tickets": {"attachedHardware": {"hostname": {"operation": "myHostname"}, "domain": {"operation": "myDomain.domain"}}}}
Method : Get
For VSI
URL : https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getTickets?objectMask=mask[attachedHardware, attachedVirtualGuests]&objectFilter={"tickets": {"attachedVirtualGuests": {"hostname": {"operation": "myHostname"}, "domain": {"operation": "myDomain.domain"} }}}
Note: replace "myHostname" and "myDomain.domain"
问候