use of com.att.cdp.zones.model.Snapshot in project AJSC by att.
the class TestSnapshotService method testSnapshots.
/**
* @throws ZoneException
*/
@Test
@Ignore
public void testSnapshots() throws ZoneException {
Context context = connect();
SnapshotService service = context.getSnapshotService();
List<Snapshot> snapshots = service.getSnapshots();
assertNotNull(snapshots);
for (Snapshot snapshot : snapshots) {
assertNotNull(service.getSnapshot(snapshot.getId()));
assertNotNull(service.getSnapshots(snapshot.getName()));
}
}
use of com.att.cdp.zones.model.Snapshot in project AJSC by att.
the class TestSnapshotService method CreateSnapshot.
@Test
@Ignore
public void CreateSnapshot() throws ZoneException {
Context context = connect();
Snapshot temp = new Snapshot();
temp.setName("Snapshots");
temp.setDescription("Test");
temp.setVolumeId("42d6-8a23-f357bf767f61");
SnapshotService service = context.getSnapshotService();
Snapshot snap = service.createSnapshot(temp);
assertNotNull(snap);
}
use of com.att.cdp.zones.model.Snapshot in project AJSC by att.
the class OpenStackSnapshotService method getSnapshots.
/**
* Returns a list of snapshots that match the supplied name
*
* @param name
* The name pattern of the snapshots to be located. The name is a regular expression that is suitable for
* use in the Java String.matches() method.
* @return A list (potentially empty) of all snapshots that match the specified name pattern
* @throws ZoneException
* - If the snapshot service cannot be accessed.
* @see java.lang.String#matches(String)
* @see com.att.cdp.zones.SnapshotService#getSnapshots(java.lang.String)
*/
@Override
public List<Snapshot> getSnapshots(String name) throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SNAPSHOT, name);
RequestState.put(RequestState.SERVICE, "Volume");
RequestState.put(RequestState.SERVICE_URL, cinder.getEndpoint());
ArrayList<Snapshot> list = new ArrayList<>();
try {
com.woorea.openstack.cinder.model.Snapshots snapshots = cinder.getClient().snapshots().list(true).execute();
for (com.woorea.openstack.cinder.model.Snapshot snap : snapshots) {
if (name != null) {
if (snap.getName() != null && snap.getName().matches(name)) {
list.add(new OpenStackSnapshot(context, snap));
}
} else {
list.add(new OpenStackSnapshot(context, snap));
}
}
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
return list;
}
use of com.att.cdp.zones.model.Snapshot in project AJSC by att.
the class OpenStackSnapshotService method getSnapshots.
/**
* Retrieves the list of snapshots defined for this service.
*
* @return The list of snapshots for this tenant, if any. The list may be empty if there are no snapshots defined.
* @see com.att.cdp.zones.SnapshotService#getSnapshots()
*/
@Override
public List<Snapshot> getSnapshots() throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Volume");
RequestState.put(RequestState.SERVICE_URL, cinder.getEndpoint());
ArrayList<Snapshot> list = new ArrayList<>();
try {
com.woorea.openstack.cinder.model.Snapshots snapshots = cinder.getClient().snapshots().list(true).execute();
for (com.woorea.openstack.cinder.model.Snapshot snap : snapshots) {
list.add(new OpenStackSnapshot(context, snap));
}
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
return list;
}
use of com.att.cdp.zones.model.Snapshot in project AJSC by att.
the class OpenStackVolumeService method getSnapshots.
/**
* Retrieves the list of snapshots defined for this service.
*
* @return The list of snapshots for this tenant, if any. The list may be empty if there are no snapshots defined.
* @see com.att.cdp.zones.VolumeService#getSnapshots()
*/
@Override
public List<Snapshot> getSnapshots() throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Volume");
RequestState.put(RequestState.SERVICE_URL, cinder.getEndpoint());
ArrayList<Snapshot> list = new ArrayList<>();
try {
com.woorea.openstack.cinder.model.Snapshots snapshots = cinder.getClient().snapshots().list(true).execute();
for (com.woorea.openstack.cinder.model.Snapshot snap : snapshots) {
list.add(new OpenStackSnapshot(context, snap));
}
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
return list;
}
Aggregations