export interface PurchaseOption {
flavor_name: string;
region_name: string;
cpu: number;
ram: number;
disk: number;
ephemeral: number;
gpu: string;
gpu_count: number;
available?: number;
cost_per_hour: number | string;
}
export function optionKey({ region_name, flavor_name }) {
return `${region_name}|${flavor_name}`;
}
export interface HyperstackPriceData {
markup: number;
options: { [region_bar_flavor: string]: PurchaseOption };
external_ip_cost_per_hour: number;
ssd_cost_per_hour: number;
}
export function markup({ cost, priceData }) {
if (priceData.markup) {
return cost * (1 + priceData.markup / 100.0);
}
return cost;
}