If given a particular hostname (myhost.abc.com), how can I look up currently open tickets associated with this hostname?
I've used the REST API to look at SoftLayer_Account, SoftLayer_Ticket, and SoftLayer_Hardware_Server; but I do not see where tickets to hostname association is being stored.
I've reviewed blog posting on the sldn: https://sldn.softlayer.com/blog/waelriac/getting-started-tickets; but I'm still unable to retrieve/see the associated machine object/data.
Any suggestions?
The answer is in documentation:
http://sldn.softlayer.com/reference/datatypes/SoftLayer_Ticket
there you will see this:
attachedHardware The hardware associated with a ticket. This is used in cases where a ticket is directly associated with one or more pieces of hardware.
attachedVirtualGuests The virtual guests associated with a ticket. This is used in cases where a ticket is directly associated with one or more virtualized guests installations or Virtual Servers.
So you just need to look into those parameters your hostname. In order to do that ,the documentation again comes to the rescue. See this:
http://sldn.softlayer.com/article/Object-Filters
So you can call the Softlayer_Account::getTickets and limit your result to display only the tickets associated to a determined either Hardware or VSI
here an example using RESTFul for that:
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"
Regards