use of com.att.cdp.zones.VolumeService in project AJSC by att.
the class OpenStackServer method loadVolumeAttachments.
/**
* This method is called to load the volume attachments, if they have not already been loaded. If they have been
* loaded, then the call is ignored.
*
* @param context
* The context that represents the connection we are servicing
* @throws ZoneException
* If the attachments cannot be obtained, or if a volume cannot be listed, or a volume does not exist
*/
private void loadVolumeAttachments(Context context) throws ZoneException {
if (volumeAttachmentsProcessed.compareAndSet(false, true)) {
VolumeService volumeService = context.getVolumeService();
ComputeService computeService = context.getComputeService();
Map<String, String> attachments = computeService.getAttachments(getId());
for (Entry<String, String> entry : attachments.entrySet()) {
Volume volume = volumeService.getVolume(entry.getValue());
getVolumes().put(entry.getKey(), volume);
}
}
}
use of com.att.cdp.zones.VolumeService in project AJSC by att.
the class TestVolumeService method listVolumes.
/**
* @throws ZoneException
*/
@Test
@Ignore
public void listVolumes() throws ZoneException {
Context context = connect();
VolumeService service = context.getVolumeService();
List<Volume> volumes = service.getVolumes();
assertNotNull(volumes);
for (Volume volume : volumes) {
assertNotNull(service.getVolume(volume.getId()));
assertNotNull(service.getVolumes(volume.getName()));
if (volume.getStatus().equals(Volume.Status.ERROR)) {
System.out.printf("%-12s: %s\n", volume.getName(), volume.getId());
}
}
}
use of com.att.cdp.zones.VolumeService in project AJSC by att.
the class TestVolumeService method listVolume.
@Test
@Ignore
public void listVolume() throws ZoneException {
Context context = connect();
VolumeService service = context.getVolumeService();
String id = "15afc83f-557c-42d6-8a23-f357bf767f61";
Volume volumes = service.getVolume(id);
assertNotNull(volumes);
System.out.println("::DONE::");
}
Aggregations