Class BlockVolumeServiceImpl

    • Constructor Detail

      • BlockVolumeServiceImpl

        public BlockVolumeServiceImpl()
    • Method Detail

      • list

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

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

        public List<? extends Volume> listAll()
        Lists all Block Storage volumes for all tenants.
        Specified by:
        listAll in interface BlockVolumeService
        Returns:
        List of all Volumes
      • get

        public Volume get​(String volumeId)
        Gets a Block Storage volume by ID
        Specified by:
        get in interface BlockVolumeService
        Parameters:
        volumeId - the volume identifier
        Returns:
        the volume or null if not found
      • forceDelete

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

        public ActionResponse extend​(String volumeId,
                                     Integer newSize)
        Extends the specified volume size.
        Specified by:
        extend in interface BlockVolumeService
        Parameters:
        volumeId - the volume id
        newSize - new volume size
        Returns:
        the action response
      • bootable

        public ActionResponse bootable​(String volumeId,
                                       Boolean bootable)
        Update volume bootable status.
        Specified by:
        bootable in interface BlockVolumeService
        Parameters:
        volumeId - the volume id
        bootable - Enables or disables the bootable attribute
        Returns:
        the action response
      • create

        public Volume create​(Volume volume)
        Creates a new Block Storage Volume
        Specified by:
        create in interface BlockVolumeService
        Parameters:
        volume - the volume for create
        Returns:
        the created volume
      • update

        public 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.
        Specified by:
        update in interface BlockVolumeService
        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
      • deleteVolumeType

        public void deleteVolumeType​(String volumeTypeId)
        Deletes the specified VolumeType
        Specified by:
        deleteVolumeType in interface BlockVolumeService
        Parameters:
        volumeTypeId - the volume type identifier
      • createVolumeType

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

        public VolumeTypeEncryption createVolumeTypeEncryption​(String volumeTypeId,
                                                               VolumeTypeEncryption volumeTypeEncryption)
        Creates a new encryption with the specified instance for the specified volume type
        Specified by:
        createVolumeTypeEncryption in interface BlockVolumeService
        Parameters:
        volumeTypeId - the volume type identifier
        volumeTypeEncryption - the encryption to create
        Returns:
        the created volume type encryption
      • deleteVolumeTypeEncryption

        public void deleteVolumeTypeEncryption​(String volumeTypeId,
                                               String encryptionId)
        Deletes the specified volume type encryption for the specified volume type
        Specified by:
        deleteVolumeTypeEncryption in interface BlockVolumeService
        Parameters:
        volumeTypeId - the volume type identifier
        encryptionId - the encryption identifier
      • migrate

        public ActionResponse migrate​(String volumeId,
                                      String hostService,
                                      boolean forceHostCopy)
        Description copied from interface: BlockVolumeService
        migrate a volume to another host and service
        Specified by:
        migrate in interface BlockVolumeService
        Parameters:
        volumeId - the volume id
        hostService - the destination host and service ,like kvmnode002021.cnsuning.com@lvmdriver
        Returns:
        the action response
      • readOnlyModeUpdate

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

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

        Description:Attach volume to a server

        Volume status must be available. You should set instanceId or hostName.

        Author:Wang Ting/王婷

        Specified by:
        attach in interface BlockVolumeService
        Returns:
        ActionResponse