Search code examples
ibm-cloud-infrastructure

How to list all the tickets for a specific machine via SLCLI


Is there a way to list down all the tickets associated with a host via slcli. I tried slcli -ticket -list but that does not list all the tickets and o/p does not have hostname.

I also tried

slcli ticket list --closed

but tht fails with below error.

#slcli ticket list --closed

SoftLayerAPIError(SOAP-ENV:Server): Internal Error

Thanks


Solution

  • The exception that you got, could be due to a lot of data that the request is trying to get

    Using SLCLI, you can increase the timeout

    slcli setup 
    

    Option (timeout)

    or using a result limit (unfortunately, for this, it's necessary to use call-api command)below an example:

    slcli call-api Account getClosedTickets --limit 50
    

    How to list all the tickets for a specific machine via SLCLI

    It's necessary use "call-api" command for this.

    • For Virtual Guests:

    a) Id:

    slcli call-api Account getTickets -f tickets.attachedVirtualGuests.id=13552947
    

    b) Hostname:

    slcli call-api Account getTickets -f tickets.attachedVirtualGuests.hostname=testDomain
    
    • For Baremetals/Hardware:

    a) Id:

    slcli call-api Account getTickets -f tickets.attachedHardware.id=123123
    

    b) Hostname:

    slcli call-api Account getTickets -f tickets.attachedHardware.hostname=testDomain
    

    This is the only way through SLCLI, if you would like something more automatic, it's necessary to use an script