@codesandbox/sdk
Version:
The CodeSandbox SDK
52 lines (51 loc) • 1.51 kB
TypeScript
import { VmUpdateSpecsRequest } from "./api-clients/client";
/**
* A VM tier is how we classify the specs of a VM. You can use this to request a VM with specific
* specs.
*
* You can either get a tier by its name, or by specifying the minimum specs you need.
*
* ## Example
*
* ```ts
* const tier = VMTier.Pico;
* ```
*
* ```ts
* const tier = VMTier.fromSpecs(16, 32, 40);
* ```
*/
export declare class VMTier {
readonly name: VmUpdateSpecsRequest["tier"];
readonly cpuCores: number;
readonly memoryGiB: number;
readonly diskGB: number;
/** 1 CPU, 2GiB RAM */
static readonly Pico: VMTier;
/** 2 CPU, 4GiB RAM */
static readonly Nano: VMTier;
/** 4 CPU, 8GiB RAM */
static readonly Micro: VMTier;
/** 8 CPU, 16GiB RAM */
static readonly Small: VMTier;
/** 16 CPU, 32GiB RAM */
static readonly Medium: VMTier;
/** 32 CPU, 64GiB RAM */
static readonly Large: VMTier;
/** 64 CPU, 128GiB RAM */
static readonly XLarge: VMTier;
static readonly All: VMTier[];
private constructor();
static fromName(name: VmUpdateSpecsRequest["tier"]): VMTier;
/**
* Returns the tier that complies to the given minimum specs.
* @param cpuCores Amount of CPU cores needed
* @param memoryGiB Amount of memory needed in GiB
* @param diskGB Amount of disk space needed in GB
*/
static fromSpecs(specs: {
cpu: number;
memGiB: number;
diskGB?: number;
}): VMTier | undefined;
}