Class EstateCollector

java.lang.Object
com.eqixiac.equinix.design.estate.EstateCollector

public final class EstateCollector extends Object
Reads a scoped estate snapshot from the live APIs. Read-only: it issues GETs and POST .../search requests and nothing else.

Request shapes (verified live 2026-11-12 against one project, read-only):

  • Ports: GET /fabric/v4/ports returns every port the credentials can see in one response (794 for the test account), so the scope is applied client-side. POST /ports/search with a /project/projectId filter answered HTTP 400 EQ-3046106 "Invalid virtual port search request", so it is not used.
  • Connections, Cloud Routers, networks and service tokens: paged POST .../search with /project/projectId = once per project, or /uuid IN [...] for explicit resources (verified live), then the scope is always re-applied client-side. Live 2026-11-12: the connection search with /project/projectId = <id> returned 86 rows, none of which belonged to that project (14 other projects), and the same filter with IN returned one unrelated row; the router and network searches honoured the filter. The server filter only narrows the read; it is never trusted for scoping. Account-only scopes search without a server filter and keep matching rows.
  • Router package limits: GET /fabric/v4/routerPackages; the live response had no vcCountMax, so the limit map is usually empty.
  • Network Edge devices: the device API has no project, so only devices referenced by an in-scope connection (or listed explicitly in the scope) are read, one GET each.

Paging stops at EstateScope.maxResourcesPerType() per type; a stop is recorded as a TRUNCATED coverage gap and a warning. An HTTP error on one type (403, 5xx...) is recorded as a coverage gap and the rest of the snapshot is still collected.

  • Constructor Details

    • EstateCollector

      public EstateCollector(Fabric fabric, NetworkEdge networkEdge, EstateScope scope, Clock clock, Consumer<String> progress)
      Creates a collector.
      Parameters:
      fabric - the Fabric client
      networkEdge - the Network Edge client, or null to skip devices
      scope - the scope (an unscoped scope must come from EstateScope.entireAccount(int))
      clock - the clock for the as-of time
      progress - receives one line per resource type, or null
  • Method Details

    • collect

      public EstateInventory collect()
      Collects the snapshot.
      Returns:
      the snapshot