Search in sources :

Example 1 with OperationList

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

the class HttpComputeRpc method listGlobalOperations.

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

Example 2 with OperationList

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

the class HttpComputeRpc method listRegionOperations.

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

Example 3 with OperationList

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

the class HttpComputeRpc method listZoneOperations.

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

Aggregations

Operation (com.google.api.services.compute.model.Operation)3 OperationList (com.google.api.services.compute.model.OperationList)3 IOException (java.io.IOException)3