for (com.woorea.openstack.nova.model.Image osImage : nova.getClient().images().list(true).execute()) { if (pattern != null) { if (osImage.getName().matches(pattern)) {
public Nova(String endpoint, OpenStackClientConnector connector) { super(endpoint, connector); EXTENSIONS = new ExtensionsResource(this); SERVERS = new ServersResource(this); IMAGES = new ImagesResource(this); FLAVORS = new FlavorsResource(this); KEY_PAIRS = new KeyPairsExtension(this); FLOATING_IPS = new FloatingIpsExtension(this); SECURITY_GROUPS = new SecurityGroupsExtension(this); SNAPSHOTS = new SnapshotsExtension(this); VOLUMES = new VolumesExtension(this); AGGREGATES = new AggregatesExtension(this); QUOTA_SETS = new QuotaSetsResource(this); HOSTS = new HostsExtension(this); SERVICES = new ServicesResource(this); HYPERVISORS = new HypervisorsResource(this); }
/** * @see com.att.cdp.zones.ImageService#getImage(java.lang.String) */ @SuppressWarnings("nls") @Override public Image getImage(String id) throws ZoneException { checkArg(id, "id"); connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.IMAGE, id); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); try { return new OpenStackImage(context, nova.getClient().images().show(id).execute()); } catch (OpenStackBaseException ex) { ExceptionMapper.mapException(ex); } return null; // just for the compiler }
public Nova(String endpoint, OpenStackClientConnector connector) { super(endpoint, connector); EXTENSIONS = new ExtensionsResource(this); SERVERS = new ServersResource(this); IMAGES = new ImagesResource(this); FLAVORS = new FlavorsResource(this); KEY_PAIRS = new KeyPairsExtension(this); FLOATING_IPS = new FloatingIpsExtension(this); SECURITY_GROUPS = new SecurityGroupsExtension(this); SNAPSHOTS = new SnapshotsExtension(this); VOLUMES = new VolumesExtension(this); AGGREGATES = new AggregatesExtension(this); QUOTA_SETS = new QuotaSetsResource(this); HOSTS = new HostsExtension(this); SERVICES = new ServicesResource(this); HYPERVISORS = new HypervisorsResource(this); NETWORKS = new NetworksExtension(this); }
/** * This method is used to list all of the images that are available within the context. * * @return The list of images or an empty list if there are none available. * @throws ZoneException * If the service fails. * @see com.att.cdp.zones.ImageService#listImages() */ @Override public List<Image> listImages() throws ZoneException { connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); ArrayList<Image> list = new ArrayList<>(); try { for (com.woorea.openstack.nova.model.Image osImage : nova.getClient().images().list(true).execute()) { list.add(new OpenStackImage(context, osImage)); } } catch (OpenStackBaseException ex) { ExceptionMapper.mapException(ex); } return list; }
Images images = novaClient.images().list(true).execute(); for(Image image : images) { System.out.println(image);
com.woorea.openstack.nova.api.ImagesResource.List openStackRequest = nova.getClient().images().list(true); openStackRequest.queryParam("name", name); Images images = openStackRequest.execute();
Images images = nova.images().list(true).execute();