Skip to content

Commit 57ff511

Browse files
feat: Resource accounting
1 parent 8711e41 commit 57ff511

File tree

4 files changed

+38
-4
lines changed

4 files changed

+38
-4
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 30
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-cfdd18a303e2e6c87d671e6ae3ecdcd1d9642b053c2ef6bc507eee3f55cc6aa8.yml
3-
openapi_spec_hash: 0b038c955d95740ace74103a9c18d5a3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-6e0a4efd150867a61bb7e6d1a9afe5ed0e51cc35ffd79839b9126a4e95e111a5.yml
3+
openapi_spec_hash: 29efc937461cf32fb3ffcf9bff9d70dd
44
config_hash: f65a6a2bcef49a9f623212f9de6d6f6f

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2025 Hypeman
189+
Copyright 2026 Hypeman
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

src/resources/instances/instances.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ export interface Instance {
193193
*/
194194
state: 'Created' | 'Running' | 'Paused' | 'Shutdown' | 'Stopped' | 'Standby' | 'Unknown';
195195

196+
/**
197+
* Disk I/O rate limit (human-readable, e.g., "100MB/s")
198+
*/
199+
disk_io_bps?: string;
200+
196201
/**
197202
* Environment variables
198203
*/
@@ -259,6 +264,16 @@ export namespace Instance {
259264
* Network configuration of the instance
260265
*/
261266
export interface Network {
267+
/**
268+
* Download bandwidth limit (human-readable, e.g., "1Gbps", "125MB/s")
269+
*/
270+
bandwidth_download?: string;
271+
272+
/**
273+
* Upload bandwidth limit (human-readable, e.g., "1Gbps", "125MB/s")
274+
*/
275+
bandwidth_upload?: string;
276+
262277
/**
263278
* Whether instance is attached to the default network
264279
*/
@@ -387,6 +402,12 @@ export interface InstanceCreateParams {
387402
*/
388403
devices?: Array<string>;
389404

405+
/**
406+
* Disk I/O rate limit (e.g., "100MB/s", "500MB/s"). Defaults to proportional share
407+
* based on CPU allocation if configured.
408+
*/
409+
disk_io_bps?: string;
410+
390411
/**
391412
* Environment variables
392413
*/
@@ -433,6 +454,18 @@ export namespace InstanceCreateParams {
433454
* Network configuration for the instance
434455
*/
435456
export interface Network {
457+
/**
458+
* Download bandwidth limit (external→VM, e.g., "1Gbps", "125MB/s"). Defaults to
459+
* proportional share based on CPU allocation.
460+
*/
461+
bandwidth_download?: string;
462+
463+
/**
464+
* Upload bandwidth limit (VM→external, e.g., "1Gbps", "125MB/s"). Defaults to
465+
* proportional share based on CPU allocation.
466+
*/
467+
bandwidth_upload?: string;
468+
436469
/**
437470
* Whether to attach instance to the default network
438471
*/

tests/api-resources/instances/instances.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ describe('resource instances', () => {
2929
image: 'docker.io/library/alpine:latest',
3030
name: 'my-workload-1',
3131
devices: ['l4-gpu'],
32+
disk_io_bps: '100MB/s',
3233
env: { PORT: '3000', NODE_ENV: 'production' },
3334
hotplug_size: '2GB',
3435
hypervisor: 'cloud-hypervisor',
35-
network: { enabled: true },
36+
network: { bandwidth_download: '1Gbps', bandwidth_upload: '1Gbps', enabled: true },
3637
overlay_size: '20GB',
3738
size: '2GB',
3839
vcpus: 2,

0 commit comments

Comments
 (0)