Interface BlockVolumeService

  • All Superinterfaces:
    RestService

    public interface BlockVolumeService
    extends RestService
    Manages Volumes and Volume Type based operations against Block Storage (Cinder)
    Author:
    Jeremy Unruh
    • Method Detail

      • listVolumeTypes

        List<? extends VolumeType> listVolumeTypes()
        The volume type defines the characteristics of a volume
        Returns:
        List of VolumeType entities
      • deleteVolumeType

        void deleteVolumeType​(String volumeTypeId)
        Deletes the specified VolumeType
        Parameters:
        volumeTypeId - the volume type identifier
      • createVolumeType

        VolumeType createVolumeType​(VolumeType volumeType)
        Creates a new volume type with the specified name
        Parameters:
        volumeType - the volumeType for create
        Returns:
        the created volume type
      • createVolumeTypeEncryption

        VolumeTypeEncryption createVolumeTypeEncryption​(String volumeTypeId,
                                                        VolumeTypeEncryption volumeTypeEncryption)
        Creates a new encryption with the specified instance for the specified volume type
        Parameters:
        volumeTypeId - the volume type identifier
        volumeTypeEncryption - the encryption to create
        Returns:
        the created volume type encryption
      • getVolumeTypeEncryption

        VolumeTypeEncryption getVolumeTypeEncryption​(String volumeTypeId)
        Retrieves the encryption for the specified volume type
        Parameters:
        volumeTypeId - the volume type identifier
        Returns:
        the encryption
      • deleteVolumeTypeEncryption

        void deleteVolumeTypeEncryption​(String volumeTypeId,
                                        String encryptionId)
        Deletes the specified volume type encryption for the specified volume type
        Parameters:
        volumeTypeId - the volume type identifier
        encryptionId - the encryption identifier
      • list

        List<? extends Volume> list()
        Lists summary information for all Block Storage volumes that the tenant who submits the request can access.
        Returns:
        List of Volumes
      • list

        List<? extends Volume> list​(Map<String,​String> filteringParams)
        Returns list of Block Storage volumes filtered by parameters.
        Parameters:
        filteringParams - map (name, value) of filtering parameters
      • listAll

        List<? extends Volume> listAll()
        Lists all Block Storage volumes for all tenants.
        Returns:
        List of all Volumes
      • get

        Volume get​(String volumeId)
        Gets a Block Storage volume by ID
        Parameters:
        volumeId - the volume identifier
        Returns:
        the volume or null if not found
      • delete

        ActionResponse delete​(String volumeId)
        Deletes the specified volume
        Parameters:
        volumeId - the volume identifier
        Returns:
        the action response
      • forceDelete

        ActionResponse forceDelete​(String volumeId)
        Attempt forced removal of volume, regardless of the state. It's dangerous but useful. It's not 100% success.
        Parameters:
        volumeId - the volume id
        Returns:
        the action response
      • resetState

        ActionResponse resetState​(String volumeId,
                                  Volume.Status status)
        Resets the specified volume status.
        Parameters:
        volumeId - the volume id
        status - new volume status
        Returns:
        the action response
      • extend

        ActionResponse extend​(String volumeId,
                              Integer newSize)
        Extends the specified volume size.
        Parameters:
        volumeId - the volume id
        newSize - new volume size
        Returns:
        the action response
      • create

        Volume create​(Volume volume)
        Creates a new Block Storage Volume
        Parameters:
        volume - the volume for create
        Returns:
        the created volume
      • uploadToImage

        VolumeUploadImage uploadToImage​(String volumeId,
                                        UploadImageData data)
        Uploads a volume to the image service
        Parameters:
        volumeId - the volume identifier to upload
        data - the data about the volume being uploaded (required)
        Returns:
        the volume upload image containing the current status
      • update

        ActionResponse update​(String volumeId,
                              String name,
                              String description)
        OpenStack only allows name or description to be updated. This call enforces that based on the API docs.
        Parameters:
        volumeId - the volume id
        name - the name to update (null indicates no name update)
        description - the description to update (null indicates no description update)
        Returns:
        the action response
      • migrate

        ActionResponse migrate​(String volumeId,
                               String hostService,
                               boolean forceHostCopy)
        migrate a volume to another host and service
        Parameters:
        volumeId - the volume id
        hostService - the destination host and service ,like kvmnode002021.cnsuning.com@lvmdriver
        Returns:
        the action response
      • transfer

        BlockVolumeTransferService transfer()
        Returns the API used to transfer a Volume from one tenant/project to another
        Returns:
        the volume transfer service
      • readOnlyModeUpdate

        ActionResponse readOnlyModeUpdate​(String volumeId,
                                          boolean readonly)
        Updates volume read-only access-mode flag
        Parameters:
        volumeId - ID of volume to update
        readonly - enables or disables update of volume to read-only access mode
        Returns:
        the action response
      • attach

        ActionResponse attach​(String volumeId,
                              String instanceId,
                              String mountpoint,
                              String hostName)

        Description:Attaches a volume to a server. You should set instance_uuid or host_name. Volume status must be available.

        Author:Wang Ting/王婷

      • forceDetach

        ActionResponse forceDetach​(String volumeId,
                                   String initiator,
                                   String attachmentId)

        Description:Forces a volume to detach.

        Author:Wang Ting/王婷

      • bootable

        ActionResponse bootable​(String volumeId,
                                Boolean bootable)
        Update volume bootable status.
        Parameters:
        volumeId - the volume id
        bootable - Enables or disables the bootable attribute
        Returns:
        the action response