Class GcpBillingCatalogRateCard
- All Implemented Interfaces:
RateCard
RateCard that sources Google Cloud data-egress rates from the
Cloud Billing Catalog API
(https://cloudbilling.googleapis.com/v1/services/{service}/skus). Unlike the
Azure and AWS adapters this API requires an API key, supplied at construction.
It lists the SKUs of the Compute Engine service and selects the network-egress
ones: EgressPath.INTERNET maps to "Network Internet Egress" SKUs and
EgressPath.PRIVATE to "Interconnect"/"Network Inter-Region" egress SKUs.
The per-GiB figure is the first paid pricing tier (the free tier is skipped),
computed from unitPrice.units + nanos. Every rate it returns is tagged
PriceSource.PROVIDER_API.
Internet-egress selection is deterministic: many egress SKUs contain the word "egress", so a match must carry the "internet" marker (not merely "not-interconnect"), and when several qualify the adapter prefers the representative base rate - the standard, worldwide meter over the pricier Premium-Tier and destination-qualified (China/Australia) variants - rather than whichever happened to appear first in the catalogue.
GCP meters egress per gibibyte (GiBy), but the savings engine multiplies the
rate by a decimal-gigabyte volume (1 TB = 1000 GB). To keep the two consistent
the adapter converts $/GiB → $/GB by dividing by 1.073741824 (1 GiB = 1.073741824 GB),
yielding a slightly lower per-GB number; the returned note records the original per-GiB figure.
This is an opt-in, pluggable source intended for a
RateCard.layered(RateCard...) chain. It is fault-tolerant - a missing key,
network error, or unrecognised response yields no rate rather than an exception.
The SKU catalogue is fetched once (following pagination) on first success and
cached for the adapter's lifetime; a failed fetch - including a failure on any page of
the pagination, which would otherwise leave a partial catalogue and a wrong "cheapest
SKU" - is never memoized, so the next lookup retries.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe Cloud Billing Catalog service id of Compute Engine - the service that owns GCP's network-egress SKUs, and therefore the one whose SKU list this adapter fetches.static final StringThe public Cloud Billing Catalog endpoint root; the default forcreate(String). -
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 GcpBillingCatalogRateCardCreates an adapter against the public Cloud Billing Catalog endpoint (DEFAULT_ENDPOINT).static GcpBillingCatalogRateCardCreates an adapter against a custom endpoint root - for 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
cardName, cloudRouterLookup, colocation, colocationLookup, connectionLookup, egressLookup, multicloudLinkModifier and TypeMethodDescriptiondefault StringcardName()A short name for this card in provenance trails and unpriced reasons; the simple class name by default.default PriceLookup<PriceQuote> cloudRouterLookup(String packageCode, MetroCode metro, Term term) RateCard.cloudRouter(String, MetroCode, Term)with the reason when it cannot be priced.default Optional<PriceQuote> colocation(ColocationItem item, MetroCode metro, Term term) Resolves the price of an Equinix colocation primitive - a cabinet, a kW of power, or a cross-connect (seeColocationItemfor the per-unit semantics).default PriceLookup<PriceQuote> colocationLookup(ColocationItem item, MetroCode metro, Term term) RateCard.colocation(ColocationItem, MetroCode, Term)with the reason when it cannot be priced.default PriceLookup<PriceQuote> connectionLookup(ConnectionType type, int bandwidthMbps, MetroCode metro, Term term) RateCard.connection(ConnectionType, int, MetroCode, Term)with the reason when it cannot be priced.default PriceLookup<EgressRate> egressLookup(CloudProviderType provider, String region, EgressPath path, Term term) RateCard.egress(CloudProviderType, String, EgressPath, Term)with the reason when it cannot be priced.default Optional<MulticloudLinkQuote> multicloudLink(MulticloudLinkRequest request) Resolves the two-sided price of a native provider-to-provider multicloud link (for example AWS Interconnect - multicloud paired with a Google Partner Cross-Cloud Interconnect transport).
-
Field Details
-
DEFAULT_ENDPOINT
The public Cloud Billing Catalog endpoint root; the default forcreate(String). Override viacreate(String, String)for a proxy or testing.- See Also:
-
COMPUTE_ENGINE_SERVICE
The Cloud Billing Catalog service id of Compute Engine - the service that owns GCP's network-egress SKUs, and therefore the one whose SKU list this adapter fetches.- See Also:
-
-
Method Details
-
create
Creates an adapter against the public Cloud Billing Catalog endpoint (DEFAULT_ENDPOINT). With anull/empty key every lookup returns empty without making a call, so the adapter can be composed unconditionally into a layered chain and simply contributes nothing when unconfigured.- Parameters:
apiKey- a Google API key authorised for the Cloud Billing Catalog API
-
create
Creates an adapter against a custom endpoint root - for a proxy or testing.- Parameters:
apiKey- a Google API key authorised for the Cloud Billing Catalog APIendpoint- the endpoint root (e.g.https://cloudbilling.googleapis.com)
-
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.
-