Class ImageServiceImpl

    • Constructor Detail

      • ImageServiceImpl

        public ImageServiceImpl()
    • Method Detail

      • listChachedImages

        public List<? extends CachedImage> listChachedImages()
        List images currently in the glance image cache.
        Specified by:
        listChachedImages in interface ImageService
        Returns:
        list of cached images or empty list if the cache is empty or null if the cache is not enabled.
      • list

        public List<? extends Image> list()
        Lists public VM images by the default page size defined by openstack
        Specified by:
        list in interface ImageService
        Returns:
        list of images or empty
      • list

        public List<? extends Image> list​(Map<String,​String> filteringParams)
        * Returns list of public VM images filtered by parameters.
        Specified by:
        list in interface ImageService
        Parameters:
        filteringParams - map (name, value) of filtering parameters
      • listAll

        public List<? extends Image> listAll​(Map<String,​String> filteringParams)
        Description copied from interface: ImageService
        * Returns list of public VM images filtered by parameters when the result greater than the default page size defined by openstack
        Specified by:
        listAll in interface ImageService
        Parameters:
        filteringParams - map (name, value) of filtering parameters
      • listAll

        public List<? extends Image> listAll()
        Description copied from interface: ImageService
        Lists all public VM images
        Specified by:
        listAll in interface ImageService
        Returns:
        list of images or empty
      • get

        public Image get​(String imageId)
        Gets an Image by ID
        Specified by:
        get in interface ImageService
        Parameters:
        imageId - the image identifier
        Returns:
        the image or null if not found
      • delete

        public ActionResponse delete​(String imageId)
        Deletes an Image by ID
        Specified by:
        delete in interface ImageService
        Parameters:
        imageId - the image identifier
        Returns:
        the action response
      • update

        public Image update​(Image image)
        Updates an Image. The image must have the id set or a validation exception will be thrown
        Specified by:
        update in interface ImageService
        Parameters:
        image - the image to update
        Returns:
        the updated image
      • getAsStream

        public InputStream getAsStream​(String imageId)
        Return the image date for the image by ID
        Specified by:
        getAsStream in interface ImageService
        Parameters:
        imageId - the image identifier
        Returns:
        the input stream or null if not found
      • create

        public Image create​(Image image,
                            Payload<?> payload)
        Creates a new Image
        Specified by:
        create in interface ImageService
        Parameters:
        image - the image to create
        payload - the payload (image data to upload). Note: if the payload is null then ImageService.reserve(Image) will be called internally
        Returns:
        the updated data from the newly stored image
      • upload

        public 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
        Specified by:
        upload in interface ImageService
        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

        public 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.
        Specified by:
        listMembers in interface ImageService
        Parameters:
        imageId - the image identifer
        Returns:
        List of ImageMember or empty
      • addMember

        public boolean addMember​(String imageId,
                                 String tenantId)
        Authorize a tenant to access a private image
        Specified by:
        addMember in interface ImageService
        Parameters:
        imageId - the image identifier
        tenantId - the tenant
        Returns:
        true if successful
      • addMember

        public boolean addMember​(String imageId,
                                 String tenantId,
                                 boolean canShare)
        Authorize a tenant to access a private image
        Specified by:
        addMember in interface ImageService
        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

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