Search code examples
apivpnibm-cloud-infrastructurekvm

softlayer api: How to get kvm console info?


I'm developing softlayer api about softlayer vpn. Now I'd like to get the host IP, port, account and password about the kvm console on the portal. I want to know the method to get the infomation. regards~
As follows:

enter image description here

enter image description here


Solution

  • You can get that information using following mask in the SoftLayer_Virtual_Guest::getObject method.

    mask[consoleIpAddressRecord[ipAddress[ipAddress],port],operatingSystem[passwords]]
    

    The complete REST call should be:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[device_id]/getObject?objectMask=mask[consoleIpAddressRecord[ipAddress[ipAddress],port],operatingSystem[passwords]]
    
    Method: GET
    

    Also you can get same data separately by using the methods SoftLayer_Virtual_Guest::getSoftwareComponents and Softlayer_Virtual_Guest::getConsoleIpAddressRecord as following:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[device_id]/getSoftwareComponents?objectMask=mask[passwords]
    

    And

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/[device_id]/getConsoleIpAddressRecord?objectMask=mask[port,ipAddress[ipAddress]]
    

    About Bare Metal servers

    Take account you need to be into SoftLayer VPN to start a remote access through KMV Console, you can use following REST call to get access information:

    https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/[device_id]/getObject?objectMask=mask[id,remoteManagementAccounts,remoteManagementUsers,remoteManagementComponent]
    

    I hope this help you.