import { APIResource } from "../../core/resource.js"; import * as ExecutionsAPI from "./executions.js"; import { ArtifactRef, Execution, ExecutionCreateParams, ExecutionDeleteParams, ExecutionEvent, ExecutionEvents, ExecutionEventsCursorPage, ExecutionEventsParams, ExecutionList, ExecutionListParams, ExecutionOutput, ExecutionOutputParams, ExecutionRetrieveParams, Executions, ExecutionsCursorPage } from "./executions.js"; import * as SSHAPI from "./ssh.js"; import { SSH, SSHConnection, SSHCreateParams, SSHDeleteParams, SSHHostTrust, SSHListParams, SSHRetrieveParams, SSHSession, SSHSessionCreateParams, SSHSessionList, SSHSessionsCursorPage } from "./ssh.js"; import { APIPromise } from "../../core/api-promise.js"; import { CursorPage, type CursorPageParams, PagePromise } from "../../core/pagination.js"; import { RequestOptions } from "../../internal/request-options.js"; export declare class Machines extends APIResource { ssh: SSHAPI.SSH; executions: ExecutionsAPI.Executions; /** * Create machine */ create(body: MachineCreateParams, options?: RequestOptions): APIPromise; /** * Get machine */ retrieve(params: MachineRetrieveParams, options?: RequestOptions): APIPromise; /** * Update machine */ update(params: MachineUpdateParams, options?: RequestOptions): APIPromise; /** * List machines */ list(query?: MachineListParams | null | undefined, options?: RequestOptions): PagePromise; /** * Destroy machine */ delete(params: MachineDeleteParams, options?: RequestOptions): APIPromise; /** * Sleep a running machine */ sleep(params: MachineSleepParams, options?: RequestOptions): APIPromise; /** * Wake a sleeping machine */ wake(params: MachineWakeParams, options?: RequestOptions): APIPromise; } export type MachineListItemsCursorPage = CursorPage; export interface CreateParams { /** * Idle window before autosleep. Accepts fixed duration units like 30s, 30m, 2h, * 7d3h4s, or 1w3d, raw seconds ("1800"), or never to disable. */ autosleep?: string; /** * Memory in MiB. */ memory_mib?: number; /** * Storage in GiB. */ storage_gib?: number; /** * CPU in vCPUs. */ vcpu?: number; } export interface LifecycleStatus { last_progress_at: string; last_transition_at: string; phase: 'accepted' | 'placement_pending' | 'starting' | 'running' | 'stopping' | 'sleeping' | 'destroying' | 'destroyed' | 'failed'; reason: string; retryable: boolean; revision: string; last_error?: string; } export interface Machine { /** * Seconds of inactivity before autosleep. 0 disables autosleep. */ autosleep_seconds: number; desired_state: 'running' | 'sleeping' | 'destroyed'; machine_id: string; /** * Memory in MiB. */ memory_mib: number; phase: 'accepted' | 'placement_pending' | 'starting' | 'running' | 'stopping' | 'sleeping' | 'destroying' | 'destroyed' | 'failed'; storage_gib: number; /** * CPU in vCPUs. */ vcpu: number; } export interface MachineList { items: Array | null; next_cursor?: string; } export interface MachineListItem { /** * Seconds of inactivity before autosleep. 0 disables autosleep. */ autosleep_seconds: number; created_at: string; desired_state: 'running' | 'sleeping' | 'destroyed'; machine_id: string; /** * Memory in MiB. */ memory_mib: number; phase: 'accepted' | 'placement_pending' | 'starting' | 'running' | 'stopping' | 'sleeping' | 'destroying' | 'destroyed' | 'failed'; storage_gib: number; /** * CPU in vCPUs. */ vcpu: number; } export interface UpdateParams { /** * Idle window before autosleep. Accepts fixed duration units like 30s, 30m, 2h, * 7d3h4s, or 1w3d, raw seconds ("1800"), or never to disable. */ autosleep?: string; /** * Memory in MiB. */ memory_mib?: number; /** * Storage in GiB. */ storage_gib?: number; /** * CPU in vCPUs. */ vcpu?: number; } export interface MachineRetrieveResponse { /** * Seconds of inactivity before autosleep. 0 disables autosleep. */ autosleep_seconds: number; desired_state: 'running' | 'sleeping' | 'destroyed'; machine_id: string; /** * Memory in MiB. */ memory_mib: number; status: LifecycleStatus; storage_gib: number; /** * CPU in vCPUs. */ vcpu: number; } export interface MachineCreateParams { /** * Idle window before autosleep. Accepts fixed duration units like 30s, 30m, 2h, * 7d3h4s, or 1w3d, raw seconds ("1800"), or never to disable. */ autosleep?: string; /** * Memory in MiB. */ memory_mib?: number; /** * Storage in GiB. */ storage_gib?: number; /** * CPU in vCPUs. */ vcpu?: number; } export interface MachineRetrieveParams { machine_id: string; } export interface MachineUpdateParams { /** * Path param */ machine_id: string; /** * Body param: Idle window before autosleep. Accepts fixed duration units like 30s, * 30m, 2h, 7d3h4s, or 1w3d, raw seconds ("1800"), or never to disable. */ autosleep?: string; /** * Body param: Memory in MiB. */ memory_mib?: number; /** * Body param: Storage in GiB. */ storage_gib?: number; /** * Body param: CPU in vCPUs. */ vcpu?: number; } export interface MachineListParams extends CursorPageParams { } export interface MachineDeleteParams { machine_id: string; } export interface MachineSleepParams { machine_id: string; } export interface MachineWakeParams { machine_id: string; } export declare namespace Machines { export { type CreateParams as CreateParams, type LifecycleStatus as LifecycleStatus, type Machine as Machine, type MachineList as MachineList, type MachineListItem as MachineListItem, type UpdateParams as UpdateParams, type MachineRetrieveResponse as MachineRetrieveResponse, type MachineListItemsCursorPage as MachineListItemsCursorPage, type MachineCreateParams as MachineCreateParams, type MachineRetrieveParams as MachineRetrieveParams, type MachineUpdateParams as MachineUpdateParams, type MachineListParams as MachineListParams, type MachineDeleteParams as MachineDeleteParams, type MachineSleepParams as MachineSleepParams, type MachineWakeParams as MachineWakeParams, }; export { SSH as SSH, type SSHConnection as SSHConnection, type SSHHostTrust as SSHHostTrust, type SSHSession as SSHSession, type SSHSessionCreateParams as SSHSessionCreateParams, type SSHSessionList as SSHSessionList, type SSHSessionsCursorPage as SSHSessionsCursorPage, type SSHCreateParams as SSHCreateParams, type SSHRetrieveParams as SSHRetrieveParams, type SSHListParams as SSHListParams, type SSHDeleteParams as SSHDeleteParams, }; export { Executions as Executions, type ArtifactRef as ArtifactRef, type Execution as Execution, type ExecutionCreateParams as ExecutionCreateParams, type ExecutionEvent as ExecutionEvent, type ExecutionEvents as ExecutionEvents, type ExecutionList as ExecutionList, type ExecutionOutput as ExecutionOutput, type ExecutionsCursorPage as ExecutionsCursorPage, type ExecutionEventsCursorPage as ExecutionEventsCursorPage, type ExecutionRetrieveParams as ExecutionRetrieveParams, type ExecutionListParams as ExecutionListParams, type ExecutionDeleteParams as ExecutionDeleteParams, type ExecutionEventsParams as ExecutionEventsParams, type ExecutionOutputParams as ExecutionOutputParams, }; } //# sourceMappingURL=machines.d.ts.map