Record Class EstateScope
java.lang.Object
java.lang.Record
com.eqixiac.equinix.design.estate.EstateScope
- Record Components:
projectIds- Fabric project ids; empty for no project criterionaccountNumbers- account numbers as text; empty for no account criterionresourceIds- explicit resource ids (ports, connections, routers, networks, tokens, devices) that are in scope whatever their project or accountentireAccount-trueonly when the caller explicitly asked for an unscoped runmaxResourcesPerType- the most resources of one type the collector reads before it stops and records the type as truncated
public record EstateScope(Set<String> projectIds, Set<String> accountNumbers, Set<String> resourceIds, boolean entireAccount, int maxResourcesPerType)
extends Record
Which part of an Equinix estate an analysis reads.
An account can see far more than one customer's resources (the test account behind this SDK's
live checks sees hundreds of routers and connections and dozens of projects owned by other
people), so the analyser never reads "everything" by accident. A scope names project ids, account
numbers, explicit resource ids, or a combination; an unscoped run must be requested with
entireAccount(int), which still caps how many resources of each type are read.
Matching rules (admits(String, String, String)): a resource is in scope when it
matches every non-empty project/account criterion, or when its id is listed explicitly.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default per-type ceiling: large enough for one customer's estate, small enough to stay polite. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccountNumbersrecord component.static EstateScopeA scope of one or more billing accounts.booleanWhether a resource is in scope.describe()A one-line description for reports.booleanReturns the value of theentireAccountrecord component.static EstateScopeentireAccount(int maxResourcesPerType) An explicitly requested unscoped run over everything the credentials can see, capped atmaxResourcesPerTyperesources of each type.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanWhether the scope names no project, account or resource.intReturns the value of themaxResourcesPerTyperecord component.plusResources(String... ids) Returns a copy with additional explicit resource ids.Returns the value of theprojectIdsrecord component.static EstateScopeA scope of one or more Fabric projects.Returns the value of theresourceIdsrecord component.static EstateScoperesources(Collection<String> resourceIds) A scope of explicitly named resources.final StringtoString()Returns a string representation of this record class.withMaxResourcesPerType(int max) Returns a copy with a different per-type ceiling.
-
Field Details
-
DEFAULT_MAX_RESOURCES_PER_TYPE
public static final int DEFAULT_MAX_RESOURCES_PER_TYPEThe default per-type ceiling: large enough for one customer's estate, small enough to stay polite.- See Also:
-
-
Constructor Details
-
EstateScope
-
-
Method Details
-
projects
A scope of one or more Fabric projects.- Parameters:
projectIds- the project ids- Returns:
- the scope
-
accounts
A scope of one or more billing accounts. Fabric searches cannot filter every resource type by account, so an account scope reads up tomaxResourcesPerType()of each type and keeps the matching ones; a larger estate is reported as truncated.- Parameters:
accountNumbers- the account numbers- Returns:
- the scope
-
resources
A scope of explicitly named resources.- Parameters:
resourceIds- the resource ids- Returns:
- the scope
-
entireAccount
An explicitly requested unscoped run over everything the credentials can see, capped atmaxResourcesPerTyperesources of each type.- Parameters:
maxResourcesPerType- the per-type ceiling- Returns:
- the scope
-
plusResources
Returns a copy with additional explicit resource ids.- Parameters:
ids- the ids to add- Returns:
- the new scope
-
withMaxResourcesPerType
Returns a copy with a different per-type ceiling.- Parameters:
max- the ceiling- Returns:
- the new scope
-
isUnscoped
public boolean isUnscoped()Whether the scope names no project, account or resource.- Returns:
truefor an unscoped run
-
admits
Whether a resource is in scope.- Parameters:
projectId- the resource's project id, ornullwhen the API does not report oneaccountNumber- the resource's account number, ornullresourceId- the resource id- Returns:
truewhen the resource belongs to the scope
-
describe
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
projectIds
Returns the value of theprojectIdsrecord component.- Returns:
- the value of the
projectIdsrecord component
-
accountNumbers
Returns the value of theaccountNumbersrecord component.- Returns:
- the value of the
accountNumbersrecord component
-
resourceIds
Returns the value of theresourceIdsrecord component.- Returns:
- the value of the
resourceIdsrecord component
-
entireAccount
public boolean entireAccount()Returns the value of theentireAccountrecord component.- Returns:
- the value of the
entireAccountrecord component
-
maxResourcesPerType
public int maxResourcesPerType()Returns the value of themaxResourcesPerTyperecord component.- Returns:
- the value of the
maxResourcesPerTyperecord component
-