Interface ImageService

  • All Superinterfaces:
    RestService
    All Known Implementing Classes:
    ImageServiceImpl

    public interface ImageService
    extends RestService
    OpenStack (Glance) Image based Operations
    Author:
    Jeremy Unruh
    • 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()
        Lists all public VM images
        Returns:
        list of images or empty
      • 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 create
        payload - the payload (image data to upload). Note: if the payload is null then reserve(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. See upload(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 image
        payload - the playload to upload
        image - 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 identifier
        tenantId - 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 identifier
        tenantId - the tenant
        canShare - both existing and new memberships will have `can_share` set to the provided value
        Returns:
        true if successful
      • removeMember

        boolean removeMember​(String imageId,
                             String tenantId)
        Revoke a tenant's right to access a private image.
        Parameters:
        imageId - the image identifier
        tenantId - the tenant to remove (identifier)
        Returns:
        true if successful