Record Class EstateInventory
java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.estate.EstateInventory
- Record Components:
scope- the scope the snapshot was taken forasOf- when the snapshot was takensource- where the data came from, for examplelive Fabric v4 APIorfixtureports- Fabric ports in scopeconnections- Fabric virtual connections in scoperouters- Fabric Cloud Routers in scopenetworks- Fabric networks in scopeserviceTokens- Fabric service tokens in scopedevices- Network Edge devices in scoperouterPackageLimits- Cloud Router package code to the maximum number of virtual connections, as the/routerPackagesAPI reported it (empty when not reported)coverageGaps- what could not be read, and whystats- how the snapshot was collected (requests, timings)
public record EstateInventory(EstateScope scope, Instant asOf, String source, List<EstateInventory.PortRecord> ports, List<EstateInventory.ConnectionRecord> connections, List<EstateInventory.RouterRecord> routers, List<EstateInventory.NetworkRecord> networks, List<EstateInventory.ServiceTokenRecord> serviceTokens, List<EstateInventory.DeviceRecord> devices, Map<String,Integer> routerPackageLimits, List<EstateInventory.CoverageGap> coverageGaps, EstateInventory.CollectionStats stats)
extends Record
An immutable, serializable snapshot of the part of an Equinix estate an analysis covers.
The snapshot is plain data (no live SDK objects), so an analysis can be repeated offline,
stored next to its report, and built by hand in tests. Every list is sorted by resource id so
the same estate always produces the same snapshot. Values the API did not report are null
(unknown), never zero. Anything that could not be read is listed in coverageGaps().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds an inventory by hand.static final recordHow the snapshot was collected.static final recordA Fabric virtual connection.static final recordSomething the collector could not read, recorded instead of failing the run.static final recordA Network Edge virtual device.static final recordOne side of a virtual connection.static final recordA Fabric network (EVPLAN, EPLAN, IPWAN...).static final recordA Fabric port.static final recordA Fabric Cloud Router.static final recordA Fabric service token.static final recordCollection figures for one resource type. -
Constructor Summary
ConstructorsConstructorDescriptionEstateInventory(EstateScope scope, Instant asOf, String source, List<EstateInventory.PortRecord> ports, List<EstateInventory.ConnectionRecord> connections, List<EstateInventory.RouterRecord> routers, List<EstateInventory.NetworkRecord> networks, List<EstateInventory.ServiceTokenRecord> serviceTokens, List<EstateInventory.DeviceRecord> devices, Map<String, Integer> routerPackageLimits, List<EstateInventory.CoverageGap> coverageGaps, EstateInventory.CollectionStats stats) Sorts every list by id and makes every collection immutable. -
Method Summary
Modifier and TypeMethodDescriptionasOf()Returns the value of theasOfrecord component.static EstateInventory.Builderbuilder(EstateScope scope, Instant asOf) Starts a hand-built inventory (tests, imports from other tools).Returns the value of theconnectionsrecord component.connectionsOnPort(String portId) The connections whose A or Z side terminates on the given port.connectionsOnRouter(String routerId) The connections whose A or Z side terminates on the given Cloud Router.counts()Counts of each resource type, for report headers.Returns the value of thecoverageGapsrecord component.devices()Returns the value of thedevicesrecord component.final booleanIndicates whether some other object is "equal to" this one.static EstateInventoryReads a snapshot written bytoJson().final inthashCode()Returns a hash code value for this object.networks()Returns the value of thenetworksrecord component.Finds a port by id.ports()Returns the value of theportsrecord component.Finds a Cloud Router by id.Returns the value of therouterPackageLimitsrecord component.routers()Returns the value of theroutersrecord component.scope()Returns the value of thescoperecord component.Returns the value of theserviceTokensrecord component.source()Returns the value of thesourcerecord component.stats()Returns the value of thestatsrecord component.toJson()Serializes the snapshot to JSON (ISO-8601 timestamps).final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EstateInventory
public EstateInventory(EstateScope scope, Instant asOf, String source, List<EstateInventory.PortRecord> ports, List<EstateInventory.ConnectionRecord> connections, List<EstateInventory.RouterRecord> routers, List<EstateInventory.NetworkRecord> networks, List<EstateInventory.ServiceTokenRecord> serviceTokens, List<EstateInventory.DeviceRecord> devices, Map<String, Integer> routerPackageLimits, List<EstateInventory.CoverageGap> coverageGaps, EstateInventory.CollectionStats stats) Sorts every list by id and makes every collection immutable.
-
-
Method Details
-
builder
Starts a hand-built inventory (tests, imports from other tools).- Parameters:
scope- the scopeasOf- the as-of time- Returns:
- a builder
-
counts
-
port
Finds a port by id.- Parameters:
id- the port id- Returns:
- the port, if in the snapshot
-
router
Finds a Cloud Router by id.- Parameters:
id- the router id- Returns:
- the router, if in the snapshot
-
connectionsOnPort
The connections whose A or Z side terminates on the given port.- Parameters:
portId- the port id- Returns:
- the connections, in id order
-
connectionsOnRouter
The connections whose A or Z side terminates on the given Cloud Router.- Parameters:
routerId- the router id- Returns:
- the connections, in id order
-
toJson
Serializes the snapshot to JSON (ISO-8601 timestamps).- Returns:
- the JSON document
-
fromJson
Reads a snapshot written bytoJson().- Parameters:
json- the JSON document- Returns:
- the snapshot
- Throws:
IllegalArgumentException- when the document is not a snapshot
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
scope
-
asOf
-
source
-
ports
-
connections
Returns the value of theconnectionsrecord component.- Returns:
- the value of the
connectionsrecord component
-
routers
-
networks
-
serviceTokens
Returns the value of theserviceTokensrecord component.- Returns:
- the value of the
serviceTokensrecord component
-
devices
-
routerPackageLimits
Returns the value of therouterPackageLimitsrecord component.- Returns:
- the value of the
routerPackageLimitsrecord component
-
coverageGaps
Returns the value of thecoverageGapsrecord component.- Returns:
- the value of the
coverageGapsrecord component
-
stats
-