Reputation: 51
I would like to automate the following ui process:
Can this be done via the api? Can you point me to some documentation detailing this?
Upvotes: 0
Views: 96
Reputation: 728
To create a public image by api you can use the following rest api:
Method: POST
https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest_Block_Device_Template_Group/[imageId]/createPublicArchiveTransaction
Body: Json
{
"parameters": [
"groupName",
"summary",
"note",
[
{
"id": 265592
},
{
"id": 1555995
}
]
]
}
To get the private images Ids available in your account use this rest example:
Method: GET
https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Account/getPrivateBlockDeviceTemplateGroups
To get the location ids available for the image use the following rest api:
Method: GET
https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest_Block_Device_Template_Group/[imageId]/getStorageLocations
Or you can use this other rest example to get the locations:
Method: GET
https://[username]:[apiKey]@api.softlayer.com/rest/v3/SoftLayer_Location/getDatacenters
Upvotes: 1