use of com.att.cdp.zones.VolumeService in project AJSC by att.
the class OpenStackVolume method associateSnapshots.
/**
* This method is used to locate all of the snapshots created from this volume (if any) and attach them to the model
* object
*
* @throws ZoneException
*/
private void associateSnapshots(Context context) throws ZoneException {
VolumeService service = context.getVolumeService();
getSnapshots().addAll(service.getSnapshotsByVolume(getId()));
}
use of com.att.cdp.zones.VolumeService in project AJSC by att.
the class TestOpenStackContext method testLoginLogout.
/**
* Test that we can login and out of the provider, and access the services once logged in (so we dont have to
* repeatedly login/out)
*
* @throws ZoneException
*/
@Test
@Ignore
public void testLoginLogout() throws ZoneException {
OpenStackContext context = login();
/*
* make sure we can retreive all of the services
*/
ComputeService computeService = context.getComputeService();
assertNotNull(computeService);
IdentityService identityService = context.getIdentityService();
assertNotNull(identityService);
ImageService imageService = context.getImageService();
assertNotNull(imageService);
NetworkService networkService = context.getNetworkService();
assertNotNull(networkService);
VolumeService volumeService = context.getVolumeService();
assertNotNull(volumeService);
SnapshotService snapshotService = context.getSnapshotService();
assertNotNull(snapshotService);
StackService stackService = context.getStackService();
assertNotNull(stackService);
/*
* Services are locally cached by the provider context. If we get them again, we should get the same exact
* object. Check that too.
*/
assertTrue(computeService == context.getComputeService());
assertTrue(identityService == context.getIdentityService());
assertTrue(imageService == context.getImageService());
assertTrue(networkService == context.getNetworkService());
assertTrue(volumeService == context.getVolumeService());
assertTrue(snapshotService == context.getSnapshotService());
assertTrue(stackService == context.getStackService());
/*
* Test that we can also obtain the connectors
*/
GlanceConnector glanceConnector = context.getGlanceConnector();
assertNotNull(glanceConnector);
NovaConnector novaConnector = context.getNovaConnector();
assertNotNull(novaConnector);
QuantumConnector quantumConnector = context.getQuantumConnector();
assertNotNull(quantumConnector);
/*
* Connectors are locally cached, check that
*/
assertTrue(glanceConnector == context.getGlanceConnector());
assertTrue(novaConnector == context.getNovaConnector());
assertTrue(quantumConnector == context.getQuantumConnector());
/*
* Now, check that we can obtain the tenant as well
*/
Tenant tenant = context.getTenant();
assertNotNull(tenant);
assertEquals(tenant.getName(), context.getTenantName());
assertEquals(tenant.getId(), context.getTenantId());
logout(context);
}
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 CreateVolume.
@Test
@Ignore
public void CreateVolume() throws ZoneException {
Context context = connect();
Volume template = new Volume();
template.setSize(Integer.valueOf(2));
template.setName("Volume");
VolumeService service = context.getVolumeService();
Volume vol = service.createVolume(template);
assertNotNull(vol);
}
use of com.att.cdp.zones.VolumeService in project AJSC by att.
the class TestVolumeService method DeleteVolume.
@Test
@Ignore
public void DeleteVolume() throws ZoneException {
Context context = connect();
String id = "";
VolumeService service = context.getVolumeService();
service.destroyVolume(id);
}
Aggregations