Class ListOptions
- java.lang.Object
-
- org.jclouds.http.options.BaseHttpRequestOptions
-
- org.jclouds.googlecloud.options.ListOptions
-
- org.jclouds.googlecomputeengine.options.ListOptions
-
- All Implemented Interfaces:
HttpRequestOptions
public final class ListOptions extends ListOptions
Allows to optionally specify a filter, max results and a page token forlistPage
REST methods.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ListOptions.Builder
-
Field Summary
-
Fields inherited from class org.jclouds.http.options.BaseHttpRequestOptions
formParameters, headers, pathSuffix, payload, queryParameters
-
-
Constructor Summary
Constructors Constructor Description ListOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListOptions
filter(String filter)
Optional.ListOptions
maxResults(Integer maxResults)
Sets Maximum count of results to be returned.-
Methods inherited from class org.jclouds.http.options.BaseHttpRequestOptions
buildFormParameters, buildPathSuffix, buildQueryParameters, buildRequestHeaders, buildStringPayload, equals, getFirstFormOrNull, getFirstHeaderOrNull, getFirstQueryOrNull, hashCode, replaceHeader, toString
-
-
-
-
Method Detail
-
filter
public ListOptions filter(String filter)
Optional. Filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must contain the following:<field_name> <comparison_string> <literal_string>
<field_name>
: The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported.<comparison_string>
: The comparison string, either eq (equals) or ne (not equals).<literal_string>
: The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. For example, when filtering instances, name eq my_instance won't work, but name eq .*my_instance will work.
filter=status ne RUNNING
The above filter returns only results whose status field does not equal RUNNING. You can also enclose your literal string in single, double, or no quotes. For example, all three of the following would be valid expressions:filter=status ne "RUNNING"
filter=status ne 'RUNNING'
filter=status ne RUNNING
Complex regular expressions can also be used, like the following:name eq '."my_instance_[0-9]+'
-
maxResults
public ListOptions maxResults(Integer maxResults)
Sets Maximum count of results to be returned. Maximum and default value is 100. Acceptable items are 0 to 100, inclusive. (Default: 100)- Overrides:
maxResults
in classListOptions
-
-