Search code examples
ibm-cloudibm-cloud-infrastructure

Ordering Server adding sshkeys


I want to order server with sshkeys using the api, but when I use the sshkey property in the structure it returns the result without the keys, I know my code is working fine becausw I orderwd before. I would like to check if my ids are correct, is there any form to check them by using my label names???


Solution

  • this is the structure for ssh keys:

     "sshKeys": [
            {
                "sshKeyIds": [94206]
            }
    ]
    

    You can call http://sldn.softlayer.com/reference/services/SoftLayer_Account/getSshKeys method to get the IDs of your sshs keys and you can use object filters to get the ssks by label this is am example using Rest:

    GET https://<USERNAME>:<APIKEY>@api.softlayer.com/rest/v3/SoftLayer_Account/getSshKeys?objectFilter={"sshKeys":{"label":{"operation":"tonny"}}}
    

    here more information about object filters http://sldn.softlayer.com/article/object-filters