Class ImageServiceImpl
- java.lang.Object
-
- org.openstack4j.openstack.internal.BaseOpenStackService
-
- org.openstack4j.openstack.image.v2.internal.BaseImageServices
-
- org.openstack4j.openstack.image.v2.internal.ImageServiceImpl
-
- All Implemented Interfaces:
ImageService,RestService
public class ImageServiceImpl extends BaseImageServices implements ImageService
Implementation of Glance V2 Image Service- Author:
- emjburns
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstack4j.openstack.internal.BaseOpenStackService
BaseOpenStackService.Invocation<R>
-
-
Constructor Summary
Constructors Constructor Description ImageServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Imagecreate(Image image)Creates a catalog record for an operating system disk image.MembercreateMember(String imageId, String memberId)The image must exist, be private, and be owned by the author of the request.ActionResponsedeactivate(String imageId)Deactivate an image If you try to download a deactivated image, you will receive a 403 (Forbidden) response code.ActionResponsedelete(String imageId)Deletes an image.ActionResponsedeleteMember(String imageId, String memberId)You must be the owner of the image to delete the memberActionResponsedeleteTag(String imageId, String tag)Delete tag from image.ActionResponsedownload(String imageId, File filename)Downloads binary image dataImageget(String imageId)Show details for an image by imageid.MembergetMember(String imageId, String memberId)Get details about a memberList<? extends Image>list()List all available operating system imagesList<? extends Image>list(Map<String,String> filteringParams)Returns list of images filtered by parameters.List<? extends CachedImage>listCachedImages()List images currently in the glance image cache.List<? extends Member>listMembers(String imageId)List members of a particular image.List<? extends Member>listMembers(String imageId, Map<String,String> filteringParams)List members of a particular image.ActionResponsereactivate(String imageId)Reactivate an imageTaskServicetasks()Imageupdate(String imageId, ImageUpdate imageUpdate)Update an image by building the string of json operations that represent the json transformation instead of the building the whole imageImageupdate(Image image)Update image by providing the changed image object.MemberupdateMember(String imageId, String memberId, Member.MemberStatus memberStatus)Change status of an image member For more details see http://specs.openstack.org/openstack/glance-specs/specs/api/v2/sharing-image-api-v2.htmlActionResponseupdateTag(String imageId, String tag)Add tag to image.ActionResponseupload(String imageId, Payload<?> payload, Image image)Uploads binary image data-
Methods inherited from class org.openstack4j.openstack.internal.BaseOpenStackService
delete, deleteWithResponse, get, getProvider, getServiceVersion, getWithResponse, getXOpenstackRequestId, head, patch, patchWithResponse, post, postWithResponse, put, putWithResponse, request, toList, uri
-
-
-
-
Method Detail
-
list
public List<? extends Image> list()
List all available operating system images- Specified by:
listin interfaceImageService- Returns:
- list of images
-
list
public List<? extends Image> list(Map<String,String> filteringParams)
Returns list of images filtered by parameters. For filtering guidelines, see http://developer.openstack.org/api-ref/image/v2/index.html#show-images To paginate, use "limit" and "marker" parameters- Specified by:
listin interfaceImageService- Parameters:
filteringParams- map (name, value) of filtering parameters- Returns:
- list of images fitered by filteringParams
-
listCachedImages
public List<? extends CachedImage> listCachedImages()
List images currently in the glance image cache.- Specified by:
listCachedImagesin interfaceImageService- Returns:
- list of cached images or empty list if the cache is empty or null if the cache is not enabled.
-
get
public Image get(String imageId)
Show details for an image by imageid. The image must exist- Specified by:
getin interfaceImageService- Returns:
- the image
-
create
public Image create(Image image)
Creates a catalog record for an operating system disk image.- Specified by:
createin interfaceImageService- Returns:
- Image
-
update
public Image update(Image image)
Update image by providing the changed image object.- Specified by:
updatein interfaceImageService- Returns:
- image
-
update
public Image update(String imageId, ImageUpdate imageUpdate)
Update an image by building the string of json operations that represent the json transformation instead of the building the whole image- Specified by:
updatein interfaceImageService- Returns:
- Image
-
delete
public ActionResponse delete(String imageId)
Deletes an image. You cannot delete images with the protected attribute set to true (boolean).- Specified by:
deletein interfaceImageService
-
deactivate
public ActionResponse deactivate(String imageId)
Deactivate an image If you try to download a deactivated image, you will receive a 403 (Forbidden) response code. Additionally, only administrative users can view image locations for deactivated images.- Specified by:
deactivatein interfaceImageService
-
reactivate
public ActionResponse reactivate(String imageId)
Reactivate an image- Specified by:
reactivatein interfaceImageService
-
upload
public ActionResponse upload(String imageId, Payload<?> payload, @Nullable Image image)
Uploads binary image data- Specified by:
uploadin interfaceImageService
-
download
public ActionResponse download(String imageId, File filename)
Downloads binary image data- Specified by:
downloadin interfaceImageService
-
updateTag
public ActionResponse updateTag(String imageId, String tag)
Add tag to image. Can also be done with ImagesService#update(image)- Specified by:
updateTagin interfaceImageService
-
deleteTag
public ActionResponse deleteTag(String imageId, String tag)
Delete tag from image. Can also be done with ImagesService#update(image)- Specified by:
deleteTagin interfaceImageService
-
listMembers
public List<? extends Member> listMembers(String imageId)
List members of a particular image. These members are projects or tenants that can see the image.- Specified by:
listMembersin interfaceImageService- Returns:
- List of members
-
listMembers
public List<? extends Member> listMembers(String imageId, Map<String,String> filteringParams)
List members of a particular image. These members are projects or tenants that can see the image.- Specified by:
listMembersin interfaceImageService- Returns:
- List of members
-
getMember
public Member getMember(String imageId, String memberId)
Get details about a member- Specified by:
getMemberin interfaceImageService- Returns:
- member
-
createMember
public Member createMember(String imageId, String memberId)
The image must exist, be private, and be owned by the author of the request. Otherwise, this will fail.- Specified by:
createMemberin interfaceImageService- Parameters:
imageId- the image to share- Returns:
- member
-
updateMember
public Member updateMember(String imageId, String memberId, Member.MemberStatus memberStatus)
Change status of an image member For more details see http://specs.openstack.org/openstack/glance-specs/specs/api/v2/sharing-image-api-v2.html- Specified by:
updateMemberin interfaceImageService- Returns:
- member
-
deleteMember
public ActionResponse deleteMember(String imageId, String memberId)
You must be the owner of the image to delete the member- Specified by:
deleteMemberin interfaceImageService
-
tasks
public TaskService tasks()
- Specified by:
tasksin interfaceImageService- Returns:
- the image v2 tasks service
-
-