Search in sources :

Example 1 with AddressList

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

the class HttpComputeRpc method listGlobalAddresses.

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

Example 2 with AddressList

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

the class HttpComputeRpc method listRegionAddresses.

@Override
public Tuple<String, Iterable<Address>> listRegionAddresses(String region, Map<Option, ?> options) {
    try {
        AddressList addressList = compute.addresses().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<Address> operations = addressList.getItems();
        return Tuple.of(addressList.getNextPageToken(), operations);
    } catch (IOException ex) {
        throw translate(ex);
    }
}
Also used : Address(com.google.api.services.compute.model.Address) IOException(java.io.IOException) AddressList(com.google.api.services.compute.model.AddressList)

Aggregations

Address (com.google.api.services.compute.model.Address)2 AddressList (com.google.api.services.compute.model.AddressList)2 IOException (java.io.IOException)2