Package org.openstack4j.api.image
Interface ImageService
-
- All Superinterfaces:
RestService
- All Known Implementing Classes:
ImageServiceImpl
public interface ImageService extends RestService
OpenStack (Glance) Image based Operations- Author:
- Jeremy Unruh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaddMember(String imageId, String tenantId)Authorize a tenant to access a private imagebooleanaddMember(String imageId, String tenantId, boolean canShare)Authorize a tenant to access a private imageImagecreate(Image image, Payload<?> payload)Creates a new ImageActionResponsedelete(String imageId)Deletes an Image by IDImageget(String imageId)Gets an Image by IDInputStreamgetAsStream(String imageId)Return the image date for the image by IDList<? extends Image>list()Lists public VM images by the default page size defined by openstackList<? extends Image>list(Map<String,String> filteringParams)* Returns list of public VM images filtered by parameters.List<? extends Image>listAll()Lists all public VM imagesList<? extends Image>listAll(Map<String,String> filteringParams)* Returns list of public VM images filtered by parameters when the result greater than the default page size defined by openstackList<? extends CachedImage>listChachedImages()List images currently in the glance image cache.List<? extends ImageMember>listMembers(String imageId)List of the other system tenants that may access a given virtual machine image that the Glance server knows about.booleanremoveMember(String imageId, String tenantId)Revoke a tenant's right to access a private image.Imagereserve(Image image)Reserves a new image to be uploaded later.Imageupdate(Image image)Updates an Image.Imageupload(String imageId, Payload<?> payload, Image image)Upload image data for a previously-reserved image
If an image was previously reserved, and thus is in the queued state, then image data can be added using this method.
-
-
-
Method Detail
-
listChachedImages
List<? extends CachedImage> listChachedImages()
List images currently in the glance image cache.- Returns:
- list of cached images or empty list if the cache is empty or null if the cache is not enabled.
-
list
List<? extends Image> list()
Lists public VM images by the default page size defined by openstack- Returns:
- list of images or empty
-
list
List<? extends Image> list(Map<String,String> filteringParams)
* Returns list of public VM images filtered by parameters.- Parameters:
filteringParams- map (name, value) of filtering parameters
-
listAll
List<? extends Image> listAll(Map<String,String> filteringParams)
* Returns list of public VM images filtered by parameters when the result greater than the default page size defined by openstack- Parameters:
filteringParams- map (name, value) of filtering parameters
-
get
Image get(String imageId)
Gets an Image by ID- Parameters:
imageId- the image identifier- Returns:
- the image or null if not found
-
delete
ActionResponse delete(String imageId)
Deletes an Image by ID- Parameters:
imageId- the image identifier- Returns:
- the action response
-
update
Image update(Image image)
Updates an Image. The image must have the id set or a validation exception will be thrown- Parameters:
image- the image to update- Returns:
- the updated image
-
getAsStream
InputStream getAsStream(String imageId)
Return the image date for the image by ID- Parameters:
imageId- the image identifier- Returns:
- the input stream or null if not found
-
create
Image create(Image image, Payload<?> payload)
Creates a new Image- Parameters:
image- the image to createpayload- the payload (image data to upload). Note: if the payload is null thenreserve(Image)will be called internally- Returns:
- the updated data from the newly stored image
-
reserve
Image reserve(Image image)
Reserves a new image to be uploaded later. Seeupload(String, Payload, Image)- Parameters:
image- the image to reserve- Returns:
- the updated data from the newly stored image
-
upload
Image upload(String imageId, Payload<?> payload, @Nullable Image image)
Upload image data for a previously-reserved image
If an image was previously reserved, and thus is in the queued state, then image data can be added using this method. If the image already as data associated with it (e.g. not in the queued state), then you will receive a 409 Conflict exception- Parameters:
imageId- the image identifier of the previously reserved imagepayload- the playload to uploadimage- the optional Image which will be used to update meta data during this transaction
-
listMembers
List<? extends ImageMember> listMembers(String imageId)
List of the other system tenants that may access a given virtual machine image that the Glance server knows about.- Parameters:
imageId- the image identifer- Returns:
- List of ImageMember or empty
-
addMember
boolean addMember(String imageId, String tenantId)
Authorize a tenant to access a private image- Parameters:
imageId- the image identifiertenantId- the tenant- Returns:
- true if successful
-
addMember
boolean addMember(String imageId, String tenantId, boolean canShare)
Authorize a tenant to access a private image- Parameters:
imageId- the image identifiertenantId- the tenantcanShare- both existing and new memberships will have `can_share` set to the provided value- Returns:
- true if successful
-
-