Class ListOptions

All Implemented Interfaces:
HttpRequestOptions

public final class ListOptions extends ListOptions
Allows to optionally specify a filter, max results and a page token for listPage REST methods.
  • Constructor Details

    • ListOptions

      public ListOptions()
  • Method Details

    • 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.

      For example:

      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 class ListOptions