> @@ -116,7 +117,14 @@ public boolean 
> apply(org.jclouds.digitalocean.domain.Image input) {
>     @Override
>     public boolean deleteImage(String id) {
>        try {
> -         api.getImageApi().delete(Integer.parseInt(id));
> +         // The id of the image can be an id or a slug. Use the 
> corresponding method of the API depending on what is
> +         // provided. If it can be parsed as a number, use the method to 
> destroy by ID. Otherwise, destroy by slug.

I think it will work, as there are not numeric slugs (and I don't expect there 
to be). This is the entire list of slugs:

```bash
$ curl 
"https://api.digitalocean.com/v1/images?client_id=<client_id>&api_key=<cpi_key>"
 | json_pp | grep '"slug"' | cut -d\" -f4 | sort | column

arch-linux-2013-05-x32          debian-6-0-x64                          
gitlab-ubuntu-13.10                                     ubuntu-12-10-x32
arch-linux-2013-05-x64          debian-7-0-x32                          
lamp-ubuntu-12.04                                       ubuntu-12-10-x64
centos-5-8-x32                          debian-7-0-x64                          
mean-ubuntu-12.04                                       ubuntu-12-10-x64-desktop
centos-5-8-x64                          dokku-ubuntu-14.04                      
rails-unicorn-nginx-ubuntu-12.10        ubuntu-13-10-x32
centos-6-4-x32                          fedora-19-x32                           
redmine-ubuntu-12.04                            ubuntu-13-10-x64
centos-6-4-x64                          fedora-19-x64                           
ubuntu-10-04-x32                                        ubuntu-14-04-x32
centos-6-5-x32                          fedora-20-x32                           
ubuntu-10-04-x64                                        ubuntu-14-04-x64
centos-6-5-x64                          fedora-20-x64                           
ubuntu-12-04-x32                                        wordpress-ubuntu-13.10
debian-6-0-x32                          ghost-ubuntu-12.04                      
ubuntu-12-04-x64                                        null
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/63/files#r12831366

Reply via email to