org.jclouds.cloudstack.features
Interface VolumeApi


public interface VolumeApi

Provides synchronous access to cloudstack via their REST API.

See Also:

Method Summary
 AsyncCreateResponse attachVolume(String volumeId, String virtualMachineId)
          Deletes a attached disk volume
 AsyncCreateResponse createVolumeFromCustomDiskOfferingInZone(String name, String diskOfferingId, String zoneId, int size)
          List volumes
 AsyncCreateResponse createVolumeFromDiskOfferingInZone(String name, String diskOfferingId, String zoneId)
          Create a volume with given name and snapshotId
 AsyncCreateResponse createVolumeFromSnapshotInZone(String name, String snapshotId, String zoneId)
          Get volume by id
 void deleteVolume(String id)
          Detaches a disk volume to a virtual machine.
 AsyncCreateResponse detachVolume(String volumeId)
          Attaches a disk volume to a virtual machine.
 Volume getVolume(String id)
          Create a volume with given name, size and diskOfferingId
 Set<Volume> listVolumes(ListVolumesOptions... options)
          Create a volume with given name and diskOfferingId
 

Method Detail

listVolumes

@Named(value="listVolumes")
Set<Volume> listVolumes(ListVolumesOptions... options)
Create a volume with given name and diskOfferingId

Parameters:
name - name of the volume
diskOfferingId - the ID of the disk offering.
zoneId - the ID of the availability zone
Returns:
AsyncCreateResponse job response used to track creation

getVolume

@Named(value="listVolumes")
Volume getVolume(String id)
Create a volume with given name, size and diskOfferingId

Parameters:
name - name of the volume
diskOfferingId - the ID of the disk offering (the offering should have the custom disk size flag set)
zoneId - the ID of the availability zone
size - the size of volume required (in GB)
Returns:
AsyncCreateResponse job response used to track creation

createVolumeFromDiskOfferingInZone

@Named(value="createVolume")
AsyncCreateResponse createVolumeFromDiskOfferingInZone(String name,
                                                             String diskOfferingId,
                                                             String zoneId)
Create a volume with given name and snapshotId

Parameters:
name - name of the volume
snapshotId - Snapshot id to be used while creating the volume
zoneId - the ID of the availability zone
Returns:
AsyncCreateResponse job response used to track creation

createVolumeFromCustomDiskOfferingInZone

AsyncCreateResponse createVolumeFromCustomDiskOfferingInZone(String name,
                                                             String diskOfferingId,
                                                             String zoneId,
                                                             int size)
List volumes

Returns:
volume list, empty if not found

createVolumeFromSnapshotInZone

@Named(value="createVolume")
AsyncCreateResponse createVolumeFromSnapshotInZone(String name,
                                                         String snapshotId,
                                                         String zoneId)
Get volume by id

Parameters:
id - the volume id to retrieve
Returns:
volume or null if not found

attachVolume

@Named(value="attachVolume")
AsyncCreateResponse attachVolume(String volumeId,
                                       String virtualMachineId)
Deletes a attached disk volume

Parameters:
id - id of the volume

detachVolume

@Named(value="detachVolume")
AsyncCreateResponse detachVolume(String volumeId)
Attaches a disk volume to a virtual machine.

Parameters:
volumeId - the ID of the disk volume
virtualMachineId - the ID of the virtual machine
Returns:
AsyncCreateResponse job response used to track creation

deleteVolume

@Named(value="deleteVolume")
void deleteVolume(String id)
Detaches a disk volume to a virtual machine.

Parameters:
volumeId - the ID of the disk volume


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.