Class AzureRetailPricesRateCard
- All Implemented Interfaces:
RateCard
RateCard that sources cloud-egress rates from the public
Azure Retail Prices API
(https://prices.azure.com/api/retail/prices). The API is unauthenticated,
so this adapter needs no credentials.
It prices only data egress for CloudProviderType.AZURE; connection and
cloud-router lookups return Optional.empty() (those are Equinix-side costs).
It maps EgressPath.INTERNET to the Bandwidth service (data transfer
out to the internet) and EgressPath.PRIVATE to the ExpressRoute
service (metered egress over a dedicated interconnect). Every rate it returns is tagged
PriceSource.PROVIDER_API.
The adapter is an opt-in, pluggable source: compose it into a precedence chain
with RateCard.layered(RateCard...) (e.g. caller-supplied → Equinix live →
provider APIs → bundled reference). It is fault-tolerant — a network error, throttling,
or an unrecognised response yields no rate rather than an exception, so a layered card
falls back to the next source.
RateCard rates = RateCard.layered(
EquinixRateCard.of(fabric),
AzureRetailPricesRateCard.create(),
ReferenceRateCard.standard());
Results are cached per lookup key for the adapter's lifetime, but only authoritative ones: a rate, or a genuinely empty result set from a fully-paginated response. A transport failure (network error, non-200, truncated pagination) is never cached — the next lookup retries, so a transient outage cannot pin "no rate" forever.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptioncloudRouter(String packageCode, MetroCode metro, Term term) Resolves the price of a single Fabric Cloud Router instance.connection(ConnectionType type, int bandwidthMbps, MetroCode metro, Term term) Resolves the price of a single Fabric connection / virtual connection.static AzureRetailPricesRateCardcreate()Creates an adapter against the public Azure Retail Prices endpoint (DEFAULT_ENDPOINT).static AzureRetailPricesRateCardCreates an adapter against a custom Retail Prices endpoint — for an Azure sovereign/government cloud, a proxy, or testing.egress(CloudProviderType provider, String region, EgressPath path, Term term) Resolves the per-GB data-egress rate for a cloud provider over a given path.source()The dominant provenance of prices this card produces.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RateCard
colocation
-
Field Details
-
DEFAULT_ENDPOINT
The public Azure Retail Prices endpoint; the default forcreate(). Override viacreate(String)for a sovereign/government cloud, a proxy, or testing.- See Also:
-
-
Method Details
-
create
Creates an adapter against the public Azure Retail Prices endpoint (DEFAULT_ENDPOINT). No credentials required.- Returns:
- a new Azure pricing adapter
-
create
Creates an adapter against a custom Retail Prices endpoint — for an Azure sovereign/government cloud, a proxy, or testing.- Parameters:
endpoint- the full.../api/retail/pricesURL
-
connection
public Optional<PriceQuote> connection(ConnectionType type, int bandwidthMbps, MetroCode metro, Term term) Description copied from interface:RateCardResolves the price of a single Fabric connection / virtual connection.Implementation contract. The matching strategy is implementation-specific, and a card whose data lacks an axis (metro, term, type) still returns its best figure — or empty — rather than failing; callers must not assume every card is sensitive to every parameter. Of the bundled cards:
CustomRateCardresolves the most specific declared entry (exact metro+term down to metro/term-agnostic, then a declared default);EquinixRateCardmatches bandwidth and type against the live catalogue, honours a requested metro strictly (a wrong-metro row is never returned), and prefers a term-matched row — a different-term row is only ever returned with a note naming the substitution;ReferenceRateCardmatches on bandwidth alone (smallest tabulated tier at or above the request, linearly extrapolated with anEXTRAPOLATEDnote above the top tier) and ignores type, metro, and term entirely.- Specified by:
connectionin interfaceRateCard- Parameters:
type- the connection type (e.g.EVPL_VC); may benullfor any typebandwidthMbps- the provisioned bandwidth in Mbpsmetro- the metro the connection originates in (may benullif metro-agnostic)term- the commitment term (may benullif term-agnostic)- Returns:
- the resolved quote, or
Optional.empty()if this card cannot price the connection
-
cloudRouter
Description copied from interface:RateCardResolves the price of a single Fabric Cloud Router instance.Implementation contract. As with
RateCard.connection(ConnectionType, int, MetroCode, Term), matching is implementation-specific and cards without a metro/term axis return their best figure regardless. Of the bundled cards:CustomRateCardresolves the most specific declared(packageCode, metro, term)entry;EquinixRateCardmatches the package code and metro structurally against the row's own descriptor (exact package equality, the row's own metro code) and prefers a term-matched row, labelling any term substitution;ReferenceRateCardignores metro and term, and substitutes its STANDARD figure for an unlisted package with a note naming the substitution.- Specified by:
cloudRouterin interfaceRateCard- Parameters:
packageCode- the router package / tier code (e.g."STANDARD"); may benullfor anymetro- the metro the router is deployed in (may benullif metro-agnostic)term- the commitment term (may benullif term-agnostic)- Returns:
- the resolved quote, or
Optional.empty()if this card cannot price the router
-
egress
public Optional<EgressRate> egress(CloudProviderType provider, String region, EgressPath path, Term term) Description copied from interface:RateCardResolves the per-GB data-egress rate for a cloud provider over a given path.Equinix does not sell cloud egress, so
EquinixRateCardreturnsOptional.empty()here (the default); egress rates come from aCustomRateCard(your figures), aReferenceRateCard(bundled indicative figures), or a provider-pricing-API card. The default returns empty so cards that do not model egress need not override it. Cards whose data has no region or term axis ignore those parameters — the custom and reference cards match on provider + path alone; only the provider-API adapters are region-sensitive.- Specified by:
egressin interfaceRateCard- Parameters:
provider- the cloud provider the data is leavingregion- the provider region (may benullfor a provider-wide rate)path- internet vs. private interconnectterm- the commitment term (may benull; ignored by term-agnostic cards)- Returns:
- the resolved egress rate, or
Optional.empty()if this card cannot price it
-
source
Description copied from interface:RateCardThe dominant provenance of prices this card produces. Aggregating cards reportPriceSource.COMPOSITE.
-