Hello there,
Any clue about why API v1 is returning 105 results when asking all images against 36 results (including all pages) when asking to API v2 ?
#API v1:
curl -s -X GET 'https://api.digitalocean.com/v1/images/?client_id=$CLIENT_ID&api_key=$API_KEYc&filter=ams2' | python -mjson.tool | grep name | wc -l
105 <---- TOTAL
#API v2:
curl -s -X GET "https://api.digitalocean.com/v2/images/?page=3" -H "Authorization: Bearer $DO_TOKEN" | python -mjson.tool
{
"images": [],
"links": {
"pages": {
"first": "https://api.digitalocean.com/v2/images/?page=1",
"prev": "https://api.digitalocean.com/v2/images/?page=2"
}
},
"meta": {
"total": 36 <---- TOTAL
}
}
To add some more info, if I try to find a concrete image by slug/id, some of them are returned in API v1 but not in API v2:
#API v1
curl -s -X GET 'https://api.digitalocean.com/v1/images/1556606?client_id=$CLIENT_ID&api_key=$API_KEY' | python -mjson.tool
{
"image": {
"distribution": "Arch Linux",
"id": 1556606,
"name": "Arch Linux 2013.12.01 Dual ISO",
"public": true,
"region_slugs": [
"nyc1",
"ams1",
"sfo1",
"nyc2",
"ams2",
"lon1",
"nyc3",
"ams3"
],
"regions": [
1,
2,
3,
4,
5,
7,
8,
9
],
"slug": null
},
"status": "OK"
}
#API v2
curl -s -X GET "https://api.digitalocean.com/v2/images/1556606" -H "Authorization: Bearer $DO_TOKEN" | python -mjson.tool
{
"id": "not_found",
"message": "The resource you were accessing could not be found."
}
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi!
This was actually a bug in APIv1 due to an underlying component being upgraded. The extra images that were being exposed were deprecated releases. This should now be resolved. Thank you for catching this and bringing it up!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.