Package org.jclouds.cloudstack.features
Interface VolumeApi
public interface VolumeApi
Provides synchronous access to cloudstack via their REST API.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionattachVolume
(String volumeId, String virtualMachineId) Attaches a disk volume to a virtual machine.createVolumeFromCustomDiskOfferingInZone
(String name, String diskOfferingId, String zoneId, int size) Create a volume with given name, size and diskOfferingIdcreateVolumeFromDiskOfferingInZone
(String name, String diskOfferingId, String zoneId) Create a volume with given name and diskOfferingIdcreateVolumeFromSnapshotInZone
(String name, String snapshotId, String zoneId) Create a volume with given name and snapshotIdvoid
deleteVolume
(String id) Deletes a detached disk volumedetachVolume
(String volumeId) Detaches a disk volume from a virtual machine.Get volume by idlistVolumes
(ListVolumesOptions... options) List volumes
-
Method Details
-
listVolumes
@Named("listVolumes") @GET @Consumes("application/json") Set<Volume> listVolumes(ListVolumesOptions... options) List volumes- Returns:
- volume list, empty if not found
-
getVolume
@Named("listVolumes") @GET @Consumes("application/json") Volume getVolume(@QueryParam("id") String id) Get volume by id- Parameters:
id
- the volume id to retrieve- Returns:
- volume or null if not found
-
createVolumeFromDiskOfferingInZone
@Named("createVolume") @GET @Consumes("application/json") AsyncCreateResponse createVolumeFromDiskOfferingInZone(@QueryParam("name") String name, @QueryParam("diskofferingid") String diskOfferingId, @QueryParam("zoneid") String zoneId) Create a volume with given name and diskOfferingId- Parameters:
name
- name of the volumediskOfferingId
- the ID of the disk offering.zoneId
- the ID of the availability zone- Returns:
- AsyncCreateResponse job response used to track creation
-
createVolumeFromCustomDiskOfferingInZone
@GET @Consumes("application/json") AsyncCreateResponse createVolumeFromCustomDiskOfferingInZone(@QueryParam("name") String name, @QueryParam("diskofferingid") String diskOfferingId, @QueryParam("zoneid") String zoneId, @QueryParam("size") int size) Create a volume with given name, size and diskOfferingId- Parameters:
name
- name of the volumediskOfferingId
- the ID of the disk offering (the offering should have the custom disk size flag set)zoneId
- the ID of the availability zonesize
- the size of volume required (in GB)- Returns:
- AsyncCreateResponse job response used to track creation
-
createVolumeFromSnapshotInZone
@Named("createVolume") @GET @Consumes("application/json") AsyncCreateResponse createVolumeFromSnapshotInZone(@QueryParam("name") String name, @QueryParam("snapshotid") String snapshotId, @QueryParam("zoneid") String zoneId) Create a volume with given name and snapshotId- Parameters:
name
- name of the volumesnapshotId
- Snapshot id to be used while creating the volumezoneId
- the ID of the availability zone- Returns:
- AsyncCreateResponse job response used to track creation
-
attachVolume
@Named("attachVolume") @GET @Consumes("application/json") AsyncCreateResponse attachVolume(@QueryParam("id") String volumeId, @QueryParam("virtualmachineid") String virtualMachineId) Attaches a disk volume to a virtual machine.- Parameters:
volumeId
- the ID of the disk volumevirtualMachineId
- the ID of the virtual machine- Returns:
- AsyncCreateResponse job response used to track creation
-
detachVolume
@Named("detachVolume") @GET @Consumes("application/json") AsyncCreateResponse detachVolume(@QueryParam("id") String volumeId) Detaches a disk volume from a virtual machine.- Parameters:
volumeId
- the ID of the disk volume- Returns:
- AsyncCreateResponse job response used to track creation
-
deleteVolume
Deletes a detached disk volume- Parameters:
id
- id of the volume
-