use of com.google.api.services.compute.model.InstanceList in project google-cloud-java by GoogleCloudPlatform.
the class HttpComputeRpc method listInstances.
@Override
public Tuple<String, Iterable<Instance>> listInstances(String zone, Map<Option, ?> options) {
try {
InstanceList instanceList = compute.instances().list(this.options.getProjectId(), zone).setFilter(Option.FILTER.getString(options)).setMaxResults(Option.MAX_RESULTS.getLong(options)).setPageToken(Option.PAGE_TOKEN.getString(options)).setFields(Option.FIELDS.getString(options)).execute();
Iterable<Instance> instances = instanceList.getItems();
return Tuple.of(instanceList.getNextPageToken(), instances);
} catch (IOException ex) {
throw translate(ex);
}
}
Aggregations