From 5ad4fd34cd66a60aa903f2ea80a1b16b8d75792b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Dec 2025 20:24:42 +0000 Subject: [PATCH 1/7] feat: QEMU support --- .stats.yml | 4 ++-- instance.go | 25 +++++++++++++++++++++++++ instance_test.go | 1 + 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 377ee95..4838a30 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-28e78b73c796f9ee866671ed946402b5d569e683c3207d57c9143eb7d6f83fb6.yml -openapi_spec_hash: fce0ac8713369a5f048bac684ed34fc8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-cfdd18a303e2e6c87d671e6ae3ecdcd1d9642b053c2ef6bc507eee3f55cc6aa8.yml +openapi_spec_hash: 0b038c955d95740ace74103a9c18d5a3 config_hash: f65a6a2bcef49a9f623212f9de6d6f6f diff --git a/instance.go b/instance.go index b340379..4b12af2 100644 --- a/instance.go +++ b/instance.go @@ -197,6 +197,10 @@ type Instance struct { HasSnapshot bool `json:"has_snapshot"` // Hotplug memory size (human-readable) HotplugSize string `json:"hotplug_size"` + // Hypervisor running this instance + // + // Any of "cloud-hypervisor", "qemu". + Hypervisor InstanceHypervisor `json:"hypervisor"` // Network configuration of the instance Network InstanceNetwork `json:"network"` // Writable overlay disk size (human-readable) @@ -223,6 +227,7 @@ type Instance struct { Env respjson.Field HasSnapshot respjson.Field HotplugSize respjson.Field + Hypervisor respjson.Field Network respjson.Field OverlaySize respjson.Field Size respjson.Field @@ -263,6 +268,14 @@ const ( InstanceStateUnknown InstanceState = "Unknown" ) +// Hypervisor running this instance +type InstanceHypervisor string + +const ( + InstanceHypervisorCloudHypervisor InstanceHypervisor = "cloud-hypervisor" + InstanceHypervisorQemu InstanceHypervisor = "qemu" +) + // Network configuration of the instance type InstanceNetwork struct { // Whether instance is attached to the default network @@ -410,6 +423,10 @@ type InstanceNewParams struct { Devices []string `json:"devices,omitzero"` // Environment variables Env map[string]string `json:"env,omitzero"` + // Hypervisor to use for this instance. Defaults to server configuration. + // + // Any of "cloud-hypervisor", "qemu". + Hypervisor InstanceNewParamsHypervisor `json:"hypervisor,omitzero"` // Network configuration for the instance Network InstanceNewParamsNetwork `json:"network,omitzero"` // Volumes to attach to the instance at creation time @@ -425,6 +442,14 @@ func (r *InstanceNewParams) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// Hypervisor to use for this instance. Defaults to server configuration. +type InstanceNewParamsHypervisor string + +const ( + InstanceNewParamsHypervisorCloudHypervisor InstanceNewParamsHypervisor = "cloud-hypervisor" + InstanceNewParamsHypervisorQemu InstanceNewParamsHypervisor = "qemu" +) + // Network configuration for the instance type InstanceNewParamsNetwork struct { // Whether to attach instance to the default network diff --git a/instance_test.go b/instance_test.go index 3978cb8..52ad166 100644 --- a/instance_test.go +++ b/instance_test.go @@ -35,6 +35,7 @@ func TestInstanceNewWithOptionalParams(t *testing.T) { "NODE_ENV": "production", }, HotplugSize: hypeman.String("2GB"), + Hypervisor: hypeman.InstanceNewParamsHypervisorCloudHypervisor, Network: hypeman.InstanceNewParamsNetwork{ Enabled: hypeman.Bool(true), }, From 28f7c108d3acb984fdce2dd161b657ed7981a53e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 22:05:59 +0000 Subject: [PATCH 2/7] feat: Resource accounting --- .stats.yml | 4 ++-- LICENSE | 2 +- instance.go | 30 ++++++++++++++++++++++++------ instance_test.go | 11 +++++++---- 4 files changed, 34 insertions(+), 13 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4838a30..35bd8a2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-cfdd18a303e2e6c87d671e6ae3ecdcd1d9642b053c2ef6bc507eee3f55cc6aa8.yml -openapi_spec_hash: 0b038c955d95740ace74103a9c18d5a3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-6e0a4efd150867a61bb7e6d1a9afe5ed0e51cc35ffd79839b9126a4e95e111a5.yml +openapi_spec_hash: 29efc937461cf32fb3ffcf9bff9d70dd config_hash: f65a6a2bcef49a9f623212f9de6d6f6f diff --git a/LICENSE b/LICENSE index 5e9bf84..d8dff65 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Hypeman + Copyright 2026 Hypeman Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/instance.go b/instance.go index 4b12af2..4d27eb0 100644 --- a/instance.go +++ b/instance.go @@ -191,6 +191,8 @@ type Instance struct { // Any of "Created", "Running", "Paused", "Shutdown", "Stopped", "Standby", // "Unknown". State InstanceState `json:"state,required"` + // Disk I/O rate limit (human-readable, e.g., "100MB/s") + DiskIoBps string `json:"disk_io_bps"` // Environment variables Env map[string]string `json:"env"` // Whether a snapshot exists for this instance @@ -224,6 +226,7 @@ type Instance struct { Image respjson.Field Name respjson.Field State respjson.Field + DiskIoBps respjson.Field Env respjson.Field HasSnapshot respjson.Field HotplugSize respjson.Field @@ -278,6 +281,10 @@ const ( // Network configuration of the instance type InstanceNetwork struct { + // Download bandwidth limit (human-readable, e.g., "1Gbps", "125MB/s") + BandwidthDownload string `json:"bandwidth_download"` + // Upload bandwidth limit (human-readable, e.g., "1Gbps", "125MB/s") + BandwidthUpload string `json:"bandwidth_upload"` // Whether instance is attached to the default network Enabled bool `json:"enabled"` // Assigned IP address (null if no network) @@ -288,12 +295,14 @@ type InstanceNetwork struct { Name string `json:"name"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { - Enabled respjson.Field - IP respjson.Field - Mac respjson.Field - Name respjson.Field - ExtraFields map[string]respjson.Field - raw string + BandwidthDownload respjson.Field + BandwidthUpload respjson.Field + Enabled respjson.Field + IP respjson.Field + Mac respjson.Field + Name respjson.Field + ExtraFields map[string]respjson.Field + raw string } `json:"-"` } @@ -411,6 +420,9 @@ type InstanceNewParams struct { // Human-readable name (lowercase letters, digits, and dashes only; cannot start or // end with a dash) Name string `json:"name,required"` + // Disk I/O rate limit (e.g., "100MB/s", "500MB/s"). Defaults to proportional share + // based on CPU allocation if configured. + DiskIoBps param.Opt[string] `json:"disk_io_bps,omitzero"` // Additional memory for hotplug (human-readable format like "3GB", "1G") HotplugSize param.Opt[string] `json:"hotplug_size,omitzero"` // Writable overlay disk size (human-readable format like "10GB", "50G") @@ -452,6 +464,12 @@ const ( // Network configuration for the instance type InstanceNewParamsNetwork struct { + // Download bandwidth limit (external→VM, e.g., "1Gbps", "125MB/s"). Defaults to + // proportional share based on CPU allocation. + BandwidthDownload param.Opt[string] `json:"bandwidth_download,omitzero"` + // Upload bandwidth limit (VM→external, e.g., "1Gbps", "125MB/s"). Defaults to + // proportional share based on CPU allocation. + BandwidthUpload param.Opt[string] `json:"bandwidth_upload,omitzero"` // Whether to attach instance to the default network Enabled param.Opt[bool] `json:"enabled,omitzero"` paramObj diff --git a/instance_test.go b/instance_test.go index 52ad166..724509f 100644 --- a/instance_test.go +++ b/instance_test.go @@ -27,9 +27,10 @@ func TestInstanceNewWithOptionalParams(t *testing.T) { option.WithAPIKey("My API Key"), ) _, err := client.Instances.New(context.TODO(), hypeman.InstanceNewParams{ - Image: "docker.io/library/alpine:latest", - Name: "my-workload-1", - Devices: []string{"l4-gpu"}, + Image: "docker.io/library/alpine:latest", + Name: "my-workload-1", + Devices: []string{"l4-gpu"}, + DiskIoBps: hypeman.String("100MB/s"), Env: map[string]string{ "PORT": "3000", "NODE_ENV": "production", @@ -37,7 +38,9 @@ func TestInstanceNewWithOptionalParams(t *testing.T) { HotplugSize: hypeman.String("2GB"), Hypervisor: hypeman.InstanceNewParamsHypervisorCloudHypervisor, Network: hypeman.InstanceNewParamsNetwork{ - Enabled: hypeman.Bool(true), + BandwidthDownload: hypeman.String("1Gbps"), + BandwidthUpload: hypeman.String("1Gbps"), + Enabled: hypeman.Bool(true), }, OverlaySize: hypeman.String("20GB"), Size: hypeman.String("2GB"), From 08a2f3c9c82bf1c45bf6b3d7ab5923afa63645cb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 Jan 2026 19:16:58 +0000 Subject: [PATCH 3/7] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 35bd8a2..c133bd6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-6e0a4efd150867a61bb7e6d1a9afe5ed0e51cc35ffd79839b9126a4e95e111a5.yml -openapi_spec_hash: 29efc937461cf32fb3ffcf9bff9d70dd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-cadf3c04bd1b4c87fc78f21d7430979d0b04d5d9d526ef54fa218a26f911e995.yml +openapi_spec_hash: 95cadf7dffcfcefd2da8b531303ff218 config_hash: f65a6a2bcef49a9f623212f9de6d6f6f From 4fb47bd3659a5ecf4778d144a884a3f50d8d3e30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 19:13:05 +0000 Subject: [PATCH 4/7] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c133bd6..326a58c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-cadf3c04bd1b4c87fc78f21d7430979d0b04d5d9d526ef54fa218a26f911e995.yml openapi_spec_hash: 95cadf7dffcfcefd2da8b531303ff218 -config_hash: f65a6a2bcef49a9f623212f9de6d6f6f +config_hash: 170041ea532e81620e0f6a73f6b31d44 From 7f330c1e7990f417e593214350200acd5b371d84 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 16:16:14 +0000 Subject: [PATCH 5/7] feat: Add vGPU support --- .stats.yml | 4 ++-- instance.go | 41 +++++++++++++++++++++++++++++++++++++++++ instance_test.go | 3 +++ 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 326a58c..d6e9571 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 30 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-cadf3c04bd1b4c87fc78f21d7430979d0b04d5d9d526ef54fa218a26f911e995.yml -openapi_spec_hash: 95cadf7dffcfcefd2da8b531303ff218 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-e052ac01c788e7e3e46c96bf3c42be7ae57f9dd046129add8012d0eeb388e884.yml +openapi_spec_hash: fd805921c0162d63405f5feb7e8c7082 config_hash: 170041ea532e81620e0f6a73f6b31d44 diff --git a/instance.go b/instance.go index 4d27eb0..7872d14 100644 --- a/instance.go +++ b/instance.go @@ -195,6 +195,8 @@ type Instance struct { DiskIoBps string `json:"disk_io_bps"` // Environment variables Env map[string]string `json:"env"` + // GPU information attached to the instance + GPU InstanceGPU `json:"gpu"` // Whether a snapshot exists for this instance HasSnapshot bool `json:"has_snapshot"` // Hotplug memory size (human-readable) @@ -228,6 +230,7 @@ type Instance struct { State respjson.Field DiskIoBps respjson.Field Env respjson.Field + GPU respjson.Field HasSnapshot respjson.Field HotplugSize respjson.Field Hypervisor respjson.Field @@ -271,6 +274,27 @@ const ( InstanceStateUnknown InstanceState = "Unknown" ) +// GPU information attached to the instance +type InstanceGPU struct { + // mdev device UUID + MdevUuid string `json:"mdev_uuid"` + // vGPU profile name + Profile string `json:"profile"` + // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. + JSON struct { + MdevUuid respjson.Field + Profile respjson.Field + ExtraFields map[string]respjson.Field + raw string + } `json:"-"` +} + +// Returns the unmodified JSON received from the API +func (r InstanceGPU) RawJSON() string { return r.JSON.raw } +func (r *InstanceGPU) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Hypervisor running this instance type InstanceHypervisor string @@ -435,6 +459,8 @@ type InstanceNewParams struct { Devices []string `json:"devices,omitzero"` // Environment variables Env map[string]string `json:"env,omitzero"` + // GPU configuration for the instance + GPU InstanceNewParamsGPU `json:"gpu,omitzero"` // Hypervisor to use for this instance. Defaults to server configuration. // // Any of "cloud-hypervisor", "qemu". @@ -454,6 +480,21 @@ func (r *InstanceNewParams) UnmarshalJSON(data []byte) error { return apijson.UnmarshalRoot(data, r) } +// GPU configuration for the instance +type InstanceNewParamsGPU struct { + // vGPU profile name (e.g., "L40S-1Q"). Only used in vGPU mode. + Profile param.Opt[string] `json:"profile,omitzero"` + paramObj +} + +func (r InstanceNewParamsGPU) MarshalJSON() (data []byte, err error) { + type shadow InstanceNewParamsGPU + return param.MarshalObject(r, (*shadow)(&r)) +} +func (r *InstanceNewParamsGPU) UnmarshalJSON(data []byte) error { + return apijson.UnmarshalRoot(data, r) +} + // Hypervisor to use for this instance. Defaults to server configuration. type InstanceNewParamsHypervisor string diff --git a/instance_test.go b/instance_test.go index 724509f..e5a73b9 100644 --- a/instance_test.go +++ b/instance_test.go @@ -35,6 +35,9 @@ func TestInstanceNewWithOptionalParams(t *testing.T) { "PORT": "3000", "NODE_ENV": "production", }, + GPU: hypeman.InstanceNewParamsGPU{ + Profile: hypeman.String("L40S-1Q"), + }, HotplugSize: hypeman.String("2GB"), Hypervisor: hypeman.InstanceNewParamsHypervisorCloudHypervisor, Network: hypeman.InstanceNewParamsNetwork{ From 7074484b88cc6e360a360a9c18725da807b57c18 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 17 Jan 2026 08:42:14 +0000 Subject: [PATCH 6/7] chore(internal): update `actions/checkout` version --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aaf9328..aa2972c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Setup go uses: actions/setup-go@v5 @@ -35,7 +35,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/hypeman-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Setup go uses: actions/setup-go@v5 From 1b4e67e881b60205c89bec005a195f378eec2c9a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 17 Jan 2026 08:45:53 +0000 Subject: [PATCH 7/7] fix(docs): add missing pointer prefix to api.md return types