saltext.noderings.utils.marketplace¶
Marketplace offer lookup: turn a plan code and a city into a plan and region ID.
- saltext.noderings.utils.marketplace.main_price(prices)[source]¶
The price that best represents what the plan costs, for sorting.
Usage plans carry several meters (compute-hours, storage GB-hours, traffic, IPs); comparing the smallest of them would rank by the cheapest meter, not the cheapest server. Prefer the compute meter, then a recurring flat price, then fall back to the smallest amount.
- saltext.noderings.utils.marketplace.find_offers(client, plan_code, country, city, billing_type=None, asset_type='virtual_machine', provider_id=None, storefront_slug=None, require_capabilities=None, require_ipv6=False, sort='price')[source]¶
Return (offers, located) where offers are sorted best first and located counts the offers that matched the location before capability/IPv6 filters.