Search in sources :

Example 1 with SubnetworkList

use of com.google.api.services.compute.model.SubnetworkList in project google-cloud-java by GoogleCloudPlatform.

the class HttpComputeRpc method listSubnetworks.

@Override
public Tuple<String, Iterable<Subnetwork>> listSubnetworks(String region, Map<Option, ?> options) {
    try {
        SubnetworkList subnetworkList = compute.subnetworks().list(this.options.getProjectId(), region).setFilter(Option.FILTER.getString(options)).setMaxResults(Option.MAX_RESULTS.getLong(options)).setPageToken(Option.PAGE_TOKEN.getString(options)).setFields(Option.FIELDS.getString(options)).execute();
        Iterable<Subnetwork> subnetworks = subnetworkList.getItems();
        return Tuple.of(subnetworkList.getNextPageToken(), subnetworks);
    } catch (IOException ex) {
        throw translate(ex);
    }
}
Also used : SubnetworkList(com.google.api.services.compute.model.SubnetworkList) Subnetwork(com.google.api.services.compute.model.Subnetwork) IOException(java.io.IOException)

Aggregations

Subnetwork (com.google.api.services.compute.model.Subnetwork)1 SubnetworkList (com.google.api.services.compute.model.SubnetworkList)1 IOException (java.io.IOException)1