|
5 | 5 | import com.fasterxml.jackson.databind.node.ObjectNode; |
6 | 6 | import com.github.fge.jsonpatch.diff.JsonDiff; |
7 | 7 | import org.openstack4j.api.Apis; |
| 8 | +import org.openstack4j.api.exceptions.ResponseException; |
8 | 9 | import org.openstack4j.api.image.v2.ImageService; |
9 | 10 | import org.openstack4j.api.image.v2.TaskService; |
| 11 | +import org.openstack4j.core.transport.ExecutionOptions; |
10 | 12 | import org.openstack4j.core.transport.HttpResponse; |
| 13 | +import org.openstack4j.core.transport.propagation.PropagateOnStatus; |
11 | 14 | import org.openstack4j.model.common.ActionResponse; |
12 | 15 | import org.openstack4j.model.common.Payload; |
| 16 | +import org.openstack4j.model.image.v2.CachedImage; |
13 | 17 | import org.openstack4j.model.image.v2.Image; |
14 | 18 | import org.openstack4j.model.image.v2.ImageUpdate; |
15 | 19 | import org.openstack4j.model.image.v2.Member; |
| 20 | +import org.openstack4j.openstack.image.v2.domain.CachedGlanceImage.CachedImages; |
16 | 21 | import org.openstack4j.openstack.image.v2.domain.GlanceImage; |
17 | 22 | import org.openstack4j.openstack.image.v2.domain.GlanceImageUpdate; |
18 | 23 | import org.openstack4j.openstack.image.v2.domain.GlanceMember; |
@@ -52,6 +57,20 @@ public List<? extends Image> list() { |
52 | 57 | public List<? extends Image> list(Map<String, String> filteringParams) { |
53 | 58 | return get(GlanceImage.Images.class, uri("/images")).params(filteringParams).execute().getList(); |
54 | 59 | } |
| 60 | + |
| 61 | + /** |
| 62 | + * {@inheritDoc} |
| 63 | + */ |
| 64 | + @Override |
| 65 | + public List<? extends CachedImage> listCachedImages() { |
| 66 | + try { |
| 67 | + return get(CachedImages.class, uri("/cached_images")) |
| 68 | + .execute(ExecutionOptions.<CachedImages>create(PropagateOnStatus.on(404))).getList(); |
| 69 | + } |
| 70 | + catch (ResponseException e) { |
| 71 | + return null; |
| 72 | + } |
| 73 | + } |
55 | 74 |
|
56 | 75 | /** |
57 | 76 | * {@inheritDoc} |
|
0 commit comments