Interface ImageApi
-
@Consumes("application/json") @Path("/images") public interface ImageApi
Provides access to the OpenStack Compute (Nova) Image API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
delete(String id)
Delete the specified imagevoid
deleteMetadata(String id, String key)
Delete a metadata item from an image.Image
get(String id)
List details of the specified imageMap<String,String>
getMetadata(String id)
List all metadata for an image.String
getMetadata(String id, String key)
Update the metadata for an image.PagedIterable<Resource>
list()
List all images (IDs, names, links)PaginatedCollection<Resource>
list(PaginationOptions options)
PagedIterable<Image>
listInDetail()
List all images (all details)PaginatedCollection<Image>
listInDetail(PaginationOptions options)
Map<String,String>
setMetadata(String id, Map<String,String> metadata)
Sets the metadata for an image.String
updateMetadata(String id, String key, String value)
Set a metadata item for an image.Map<String,String>
updateMetadata(String id, Map<String,String> metadata)
Update the metadata for a server.
-
-
-
Method Detail
-
list
@Named("image:list") @GET PagedIterable<Resource> list()
List all images (IDs, names, links)- Returns:
- all images (IDs, names, links)
-
list
@Named("image:list") @GET PaginatedCollection<Resource> list(PaginationOptions options)
-
listInDetail
@Named("image:list") @GET @Path("/detail") PagedIterable<Image> listInDetail()
List all images (all details)- Returns:
- all images (all details)
-
listInDetail
@Named("image:list") @GET @Path("/detail") PaginatedCollection<Image> listInDetail(PaginationOptions options)
-
get
@Named("image:get") @GET @Path("/{id}") @Nullable Image get(@PathParam("id") String id)
List details of the specified image- Parameters:
id
- id of the server- Returns:
- server or null if not found
-
delete
@Named("image:delete") @DELETE @Path("/{id}") void delete(@PathParam("id") String id)
Delete the specified image- Parameters:
id
- id of the image
-
getMetadata
@Named("image:getMetadata") @GET @Path("/{id}/metadata") Map<String,String> getMetadata(@PathParam("id") String id)
List all metadata for an image.- Parameters:
id
- id of the image- Returns:
- the metadata as a Map
-
setMetadata
@Named("image:setMetadata") @PUT @Path("/{id}/metadata") @Produces("application/json") Map<String,String> setMetadata(@PathParam("id") String id, Map<String,String> metadata)
Sets the metadata for an image.- Parameters:
id
- id of the imagemetadata
- a Map containing the metadata- Returns:
- the metadata as a Map
-
updateMetadata
@Named("image:updateMetadata") @POST @Path("/{id}/metadata") @Produces("application/json") Map<String,String> updateMetadata(@PathParam("id") String id, Map<String,String> metadata)
Update the metadata for a server.- Parameters:
id
- id of the imagemetadata
- a Map containing the metadata- Returns:
- the metadata as a Map
-
getMetadata
@Named("image:getMetadata") @GET @Path("/{id}/metadata/{key}") @Nullable String getMetadata(@PathParam("id") String id, @PathParam("key") String key)
Update the metadata for an image.- Parameters:
id
- id of the imagemetadata
- a Map containing the metadata- Returns:
- the value or null if not present
-
updateMetadata
@Named("image:updateMetadata") @PUT @Path("/{id}/metadata/{key}") @Nullable String updateMetadata(@PathParam("id") String id, @PathParam("key") String key, @PathParam("value") String value)
Set a metadata item for an image.- Parameters:
id
- id of the imagekey
- the name of the metadata itemvalue
- the value of the metadata item- Returns:
- the value you updated
-
-