1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.jclouds.gogrid.services;
20
21 import static org.jclouds.gogrid.reference.GoGridHeaders.VERSION;
22 import static org.jclouds.gogrid.reference.GoGridQueryParams.IMAGE_DESCRIPTION_KEY;
23 import static org.jclouds.gogrid.reference.GoGridQueryParams.IMAGE_FRIENDLY_NAME_KEY;
24 import static org.jclouds.gogrid.reference.GoGridQueryParams.IMAGE_KEY;
25 import static org.jclouds.gogrid.reference.GoGridQueryParams.LOOKUP_LIST_KEY;
26
27 import java.util.Set;
28
29 import javax.ws.rs.GET;
30 import javax.ws.rs.Path;
31 import javax.ws.rs.QueryParam;
32
33 import org.jclouds.gogrid.GoGridAsyncClient;
34 import org.jclouds.gogrid.binders.BindIdsToQueryParams;
35 import org.jclouds.gogrid.binders.BindNamesToQueryParams;
36 import org.jclouds.gogrid.domain.Option;
37 import org.jclouds.gogrid.domain.ServerImage;
38 import org.jclouds.gogrid.filters.SharedKeyLiteAuthentication;
39 import org.jclouds.gogrid.functions.ParseImageFromJsonResponse;
40 import org.jclouds.gogrid.functions.ParseImageListFromJsonResponse;
41 import org.jclouds.gogrid.functions.ParseOptionsFromJsonResponse;
42 import org.jclouds.gogrid.options.GetImageListOptions;
43 import org.jclouds.rest.annotations.BinderParam;
44 import org.jclouds.rest.annotations.QueryParams;
45 import org.jclouds.rest.annotations.RequestFilters;
46 import org.jclouds.rest.annotations.ResponseParser;
47
48 import com.google.common.util.concurrent.ListenableFuture;
49
50
51
52
53 @RequestFilters(SharedKeyLiteAuthentication.class)
54 @QueryParams(keys = VERSION, values = GoGridAsyncClient.VERSION)
55 public interface GridImageAsyncClient {
56
57
58
59
60 @GET
61 @ResponseParser(ParseImageListFromJsonResponse.class)
62 @Path("/grid/image/list")
63 ListenableFuture<Set<ServerImage>> getImageList(GetImageListOptions... options);
64
65
66
67
68 @GET
69 @ResponseParser(ParseImageListFromJsonResponse.class)
70 @Path("/grid/image/get")
71 ListenableFuture<Set<ServerImage>> getImagesById(
72 @BinderParam(BindIdsToQueryParams.class) Long... ids);
73
74
75
76
77 @GET
78 @ResponseParser(ParseImageListFromJsonResponse.class)
79 @Path("/grid/image/get")
80 ListenableFuture<Set<ServerImage>> getImagesByName(
81 @BinderParam(BindNamesToQueryParams.class) String... names);
82
83
84
85
86 @GET
87 @ResponseParser(ParseImageFromJsonResponse.class)
88 @Path("/grid/image/edit")
89 ListenableFuture<ServerImage> editImageDescription(@QueryParam(IMAGE_KEY) String idOrName,
90 @QueryParam(IMAGE_DESCRIPTION_KEY) String newDescription);
91
92
93
94
95 @GET
96 @ResponseParser(ParseImageFromJsonResponse.class)
97 @Path("/grid/image/edit")
98 ListenableFuture<ServerImage> editImageFriendlyName(@QueryParam(IMAGE_KEY) String idOrName,
99 @QueryParam(IMAGE_FRIENDLY_NAME_KEY) String newFriendlyName);
100
101
102
103
104 @GET
105 @ResponseParser(ParseOptionsFromJsonResponse.class)
106 @Path("/common/lookup/list")
107 @QueryParams(keys = LOOKUP_LIST_KEY, values = "datacenter")
108 ListenableFuture<Set<Option>> getDatacenters();
109 }