com.woorea.openstack.nova.model.Snapshots snapshots = nova.getClient().snapshots().list(true).execute(); for (com.woorea.openstack.nova.model.Snapshot snap : snapshots) { if (name != null) {
com.woorea.openstack.nova.model.Snapshots snapshots = nova.getClient().snapshots().list(true).execute(); for (com.woorea.openstack.nova.model.Snapshot snap : snapshots) { if (name != null) {
/** * @see com.att.cdp.zones.VolumeService#getSnapshotsByVolume(java.lang.String) */ @Override public List<Snapshot> getSnapshotsByVolume(String id) throws ZoneException { connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.VOLUME, id); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); ArrayList<Snapshot> list = new ArrayList<>(); try { com.woorea.openstack.nova.model.Snapshots snapshots = nova.getClient().snapshots().list(true).execute(); for (com.woorea.openstack.nova.model.Snapshot snap : snapshots) { if (id != null) { if (snap.getVolumeId() != null && snap.getVolumeId().matches(id)) { list.add(new OpenStackSnapshot(context, snap)); } } } } catch (OpenStackBaseException ex) { ExceptionMapper.mapException(ex); } return list; }
/** * 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, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); ArrayList<Snapshot> list = new ArrayList<>(); try { com.woorea.openstack.nova.model.Snapshots snapshots = nova.getClient().snapshots().list(true).execute(); for (com.woorea.openstack.nova.model.Snapshot snap : snapshots) { list.add(new OpenStackSnapshot(context, snap)); } } catch (OpenStackBaseException ex) { ExceptionMapper.mapException(ex); } return list; }
/** * 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, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); ArrayList<Snapshot> list = new ArrayList<>(); try { com.woorea.openstack.nova.model.Snapshots snapshots = nova.getClient().snapshots().list(true).execute(); for (com.woorea.openstack.nova.model.Snapshot snap : snapshots) { list.add(new OpenStackSnapshot(context, snap)); } } catch (OpenStackBaseException ex) { ExceptionMapper.mapException(ex); } return list; }