22
33import { APIResource } from '../../core/resource' ;
44import * as Shared from '../shared' ;
5+ import * as AutoStandbyAPI from './auto-standby' ;
6+ import { AutoStandby } from './auto-standby' ;
57import * as SnapshotScheduleAPI from './snapshot-schedule' ;
68import { SnapshotScheduleUpdateParams } from './snapshot-schedule' ;
79import * as SnapshotsAPI from './snapshots' ;
@@ -15,6 +17,7 @@ import { RequestOptions } from '../../internal/request-options';
1517import { path } from '../../internal/utils/path' ;
1618
1719export class Instances extends APIResource {
20+ autoStandby : AutoStandbyAPI . AutoStandby = new AutoStandbyAPI . AutoStandby ( this . _client ) ;
1821 volumes : VolumesAPI . Volumes = new VolumesAPI . Volumes ( this . _client ) ;
1922 snapshots : SnapshotsAPI . Snapshots = new SnapshotsAPI . Snapshots ( this . _client ) ;
2023 snapshotSchedule : SnapshotScheduleAPI . SnapshotSchedule = new SnapshotScheduleAPI . SnapshotSchedule (
@@ -235,6 +238,114 @@ export class Instances extends APIResource {
235238 }
236239}
237240
241+ /**
242+ * Linux-only automatic standby policy based on active inbound TCP connections
243+ * observed from the host conntrack table.
244+ */
245+ export interface AutoStandbyPolicy {
246+ /**
247+ * Whether automatic standby is enabled for this instance.
248+ */
249+ enabled ?: boolean ;
250+
251+ /**
252+ * How long the instance must have zero qualifying inbound TCP connections before
253+ * Hypeman places it into standby.
254+ */
255+ idle_timeout ?: string ;
256+
257+ /**
258+ * Optional destination TCP ports that should not keep the instance awake.
259+ */
260+ ignore_destination_ports ?: Array < number > ;
261+
262+ /**
263+ * Optional client CIDRs that should not keep the instance awake.
264+ */
265+ ignore_source_cidrs ?: Array < string > ;
266+ }
267+
268+ export interface AutoStandbyStatus {
269+ /**
270+ * Number of currently tracked qualifying inbound TCP connections.
271+ */
272+ active_inbound_connections : number ;
273+
274+ /**
275+ * Whether the instance has any auto-standby policy configured.
276+ */
277+ configured : boolean ;
278+
279+ /**
280+ * Whether the instance is currently eligible to enter standby.
281+ */
282+ eligible : boolean ;
283+
284+ /**
285+ * Whether the configured auto-standby policy is enabled.
286+ */
287+ enabled : boolean ;
288+
289+ reason :
290+ | 'unsupported_platform'
291+ | 'policy_missing'
292+ | 'policy_disabled'
293+ | 'instance_not_running'
294+ | 'network_disabled'
295+ | 'missing_ip'
296+ | 'has_vgpu'
297+ | 'active_inbound_connections'
298+ | 'idle_timeout_not_elapsed'
299+ | 'observer_error'
300+ | 'ready_for_standby' ;
301+
302+ status :
303+ | 'unsupported'
304+ | 'disabled'
305+ | 'ineligible'
306+ | 'active'
307+ | 'idle_countdown'
308+ | 'ready_for_standby'
309+ | 'standby_requested'
310+ | 'error' ;
311+
312+ /**
313+ * Whether the current host platform supports auto-standby diagnostics.
314+ */
315+ supported : boolean ;
316+
317+ /**
318+ * Diagnostic identifier for the runtime tracking mode in use.
319+ */
320+ tracking_mode : string ;
321+
322+ /**
323+ * Remaining time before the controller attempts standby, when applicable.
324+ */
325+ countdown_remaining ?: string | null ;
326+
327+ /**
328+ * When the controller most recently observed the instance become idle.
329+ */
330+ idle_since ?: string | null ;
331+
332+ /**
333+ * Configured idle timeout from the auto-standby policy.
334+ */
335+ idle_timeout ?: string | null ;
336+
337+ /**
338+ * Timestamp of the most recent qualifying inbound TCP activity the controller
339+ * observed.
340+ */
341+ last_inbound_activity_at ?: string | null ;
342+
343+ /**
344+ * When the controller expects to attempt standby next, if a countdown is active.
345+ */
346+ next_standby_at ?: string | null ;
347+ }
348+
238349export interface Instance {
239350 /**
240351 * Auto-generated unique identifier (CUID2 format)
@@ -270,6 +381,12 @@ export interface Instance {
270381 */
271382 state : 'Created' | 'Initializing' | 'Running' | 'Paused' | 'Shutdown' | 'Stopped' | 'Standby' | 'Unknown' ;
272383
384+ /**
385+ * Linux-only automatic standby policy based on active inbound TCP connections
386+ * observed from the host conntrack table.
387+ */
388+ auto_standby ?: AutoStandbyPolicy ;
389+
273390 /**
274391 * Disk I/O rate limit (human-readable, e.g., "100MB/s")
275392 */
@@ -684,6 +801,12 @@ export interface InstanceCreateParams {
684801 */
685802 name : string ;
686803
804+ /**
805+ * Linux-only automatic standby policy based on active inbound TCP connections
806+ * observed from the host conntrack table.
807+ */
808+ auto_standby ?: AutoStandbyPolicy ;
809+
687810 /**
688811 * Override image CMD (like docker run <image> <command>). Omit to use image
689812 * default.
@@ -913,6 +1036,12 @@ export namespace InstanceCreateParams {
9131036}
9141037
9151038export interface InstanceUpdateParams {
1039+ /**
1040+ * Linux-only automatic standby policy based on active inbound TCP connections
1041+ * observed from the host conntrack table.
1042+ */
1043+ auto_standby ?: AutoStandbyPolicy ;
1044+
9161045 /**
9171046 * Environment variables to update (merged with existing). Only keys referenced by
9181047 * the instance's existing credential `source.env` bindings are accepted. Use this
@@ -1018,11 +1147,14 @@ export interface InstanceWaitParams {
10181147 timeout ?: string ;
10191148}
10201149
1150+ Instances . AutoStandby = AutoStandby ;
10211151Instances . Volumes = Volumes ;
10221152Instances . Snapshots = Snapshots ;
10231153
10241154export declare namespace Instances {
10251155 export {
1156+ type AutoStandbyPolicy as AutoStandbyPolicy ,
1157+ type AutoStandbyStatus as AutoStandbyStatus ,
10261158 type Instance as Instance ,
10271159 type InstanceStats as InstanceStats ,
10281160 type PathInfo as PathInfo ,
@@ -1046,6 +1178,8 @@ export declare namespace Instances {
10461178 type InstanceWaitParams as InstanceWaitParams ,
10471179 } ;
10481180
1181+ export { AutoStandby as AutoStandby } ;
1182+
10491183 export {
10501184 Volumes as Volumes ,
10511185 type VolumeAttachParams as VolumeAttachParams ,
0 commit comments