Package org.openstack4j.api.storage
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ActionResponseattach(String volumeId, String instanceId, String mountpoint, String hostName)
Description:Attaches a volume to a server.ActionResponsebootable(String volumeId, Boolean bootable)Update volume bootable status.Volumecreate(Volume volume)Creates a new Block Storage VolumeVolumeTypecreateVolumeType(VolumeType volumeType)Creates a new volume type with the specified nameVolumeTypeEncryptioncreateVolumeTypeEncryption(String volumeTypeId, VolumeTypeEncryption volumeTypeEncryption)Creates a new encryption with the specified instance for the specified volume typeActionResponsedelete(String volumeId)Deletes the specified volumevoiddeleteVolumeType(String volumeTypeId)Deletes the specified VolumeTypevoiddeleteVolumeTypeEncryption(String volumeTypeId, String encryptionId)Deletes the specified volume type encryption for the specified volume typeActionResponsedetach(String volumeId, String attachmentId)Detach volume from serverActionResponseextend(String volumeId, Integer newSize)Extends the specified volume size.ActionResponseforceDelete(String volumeId)Attempt forced removal of volume, regardless of the state.ActionResponseforceDetach(String volumeId, String initiator, String attachmentId)
Description:Forces a volume to detach.Volumeget(String volumeId)Gets a Block Storage volume by IDVolumeTypeEncryptiongetVolumeTypeEncryption(String volumeTypeId)Retrieves the encryption for the specified volume typeList<? extends Volume>list()Lists summary information for all Block Storage volumes that the tenant who submits the request can access.List<? extends Volume>list(Map<String,String> filteringParams)Returns list of Block Storage volumes filtered by parameters.List<? extends Volume>listAll()Lists all Block Storage volumes for all tenants.List<? extends VolumeType>listVolumeTypes()The volume type defines the characteristics of a volumeActionResponsemigrate(String volumeId, String hostService, boolean forceHostCopy)migrate a volume to another host and serviceActionResponsereadOnlyModeUpdate(String volumeId, boolean readonly)Updates volume read-only access-mode flagActionResponseresetState(String volumeId, Volume.Status status)Resets the specified volume status.BlockVolumeTransferServicetransfer()Returns the API used to transfer a Volume from one tenant/project to anotherActionResponseupdate(String volumeId, String name, String description)OpenStack only allows name or description to be updated.VolumeUploadImageuploadToImage(String volumeId, UploadImageData data)Uploads a volume to the image service
-
-
-
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 identifiervolumeTypeEncryption- 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 identifierencryptionId- 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 idstatus- new volume status- Returns:
- the action response
-
extend
ActionResponse extend(String volumeId, Integer newSize)
Extends the specified volume size.- Parameters:
volumeId- the volume idnewSize- 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 uploaddata- 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 idname- 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 idhostService- 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 updatereadonly- 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/王婷
-
detach
ActionResponse detach(String volumeId, String attachmentId)
Detach volume from server
-
bootable
ActionResponse bootable(String volumeId, Boolean bootable)
Update volume bootable status.- Parameters:
volumeId- the volume idbootable- Enables or disables the bootable attribute- Returns:
- the action response
-
-