Class ServiceSearchRequest

java.lang.Object
com.eqixiac.equinix.internetaccess.model.json.creators.ServiceSearchRequest

public class ServiceSearchRequest extends Object
Request body for searching Equinix Internet Access (EIA) v2 services via POST /internetAccess/v2/services/search.

Wraps an AND group of equality expressions. Each expression matches a service property (a JSON pointer such as /state or /name) against one or more values. Build it fluently:

ServiceSearchRequest filter = new ServiceSearchRequest()
    .state(ServiceState.ACTIVE)
    .equals("/locations/metroCode", "DC")
    .sort(ServiceSearchSortProperty.NAME, SortOrder.ASC);

Live behaviour (observed 2026-11-11). /type is listed by the spec and by the service's own "allowed properties" message, but every value (including SINGLE, which the service returns on read) is rejected with HTTP 400 EQ-7108002 "Invalid value", so this builder refuses a /type filter. /state works. Sorting is the sort query parameter, not part of the body.

  • Constructor Details

    • ServiceSearchRequest

      public ServiceSearchRequest()
  • Method Details

    • state

      public ServiceSearchRequest state(ServiceState... states)
      Filters by service state (/state).
      Parameters:
      states - the states to match; UNKNOWN is rejected
      Returns:
      this request for chaining
    • sort

      public ServiceSearchRequest sort(ServiceSearchSortProperty property, SortOrder direction)
      Adds a sort directive (sort query parameter, for example /name,-/state).
      Parameters:
      property - the property to sort by
      direction - the direction; null means ascending
      Returns:
      this request for chaining
    • getSortParameter

      public String getSortParameter()
      Returns the sort query-parameter value.
      Returns:
      the comma-joined sort directives, or null when none were added
    • equals

      public ServiceSearchRequest equals(String property, String... values)
      Adds an equality expression to the AND group.
      Parameters:
      property - the property pointer to match (e.g. /state)
      values - the values to match against
      Returns:
      this request for chaining
      Throws:
      IllegalArgumentException - for /type, which the live service rejects
    • equals

      public ServiceSearchRequest equals(String property, List<String> values)
      Adds an equality expression to the AND group.
      Parameters:
      property - the property pointer to match (e.g. /state)
      values - the values to match against
      Returns:
      this request for chaining
      Throws:
      IllegalArgumentException - for /type, which the live service rejects