Path: blob/master/src/packages/util/compute/cloud/hyperstack/pricing.ts
1451 views
export interface PurchaseOption {1flavor_name: string;2// name of region that has this machine type3region_name: string;4// number of vCPUs5cpu: number;6// GB of ram7ram: number;8// GB of less ephemeral disk (?)9disk: number;10// GB of local ephemeral disk11ephemeral: number;12// string that describes the GPU13gpu: string;14// how many gpu's in this machine15gpu_count: number;16// number of these VM's that are currently available17available?: number;18// how much this option costs per hour, or a string with an error19// if we can't determine the cost20cost_per_hour: number | string;21}2223export function optionKey({ region_name, flavor_name }) {24return `${region_name}|${flavor_name}`;25}2627export interface HyperstackPriceData {28markup: number;29// region_bar_flavor is `${region_name}|${flavor_name}` as in optionKey function above!30options: { [region_bar_flavor: string]: PurchaseOption };31// cost per hour of an external ip address32external_ip_cost_per_hour: number;33// cost per hour per GB of disk storage (for storage volumes)34ssd_cost_per_hour: number;35}3637export function markup({ cost, priceData }) {38if (priceData.markup) {39return cost * (1 + priceData.markup / 100.0);40}41return cost;42}434445