Search code examples
ibm-cloud-infrastructure

Does the SoftLayer API return the ACTIVE or INACTIVE status of an image?


I'm trying to get a list of images that are inactive. Does the SoftLayer API return the ACTIVE or INACTIVE status of an image? Thanks!


Solution

  • SoftLayer API returns both images, active and inactive, you can retrieve only inactive images with the following rest call:

    https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Account/getBlockDeviceTemplateGroups?objectFilter={"blockDeviceTemplateGroups":{"statusId":{"operation":"2"}}}
    
    Method: Get
    

    References: