diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 6538ca9..6d78745 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.8.0" + ".": "0.9.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 377ee95..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-28e78b73c796f9ee866671ed946402b5d569e683c3207d57c9143eb7d6f83fb6.yml -openapi_spec_hash: fce0ac8713369a5f048bac684ed34fc8 +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/CHANGELOG.md b/CHANGELOG.md index 7b777d4..d18687f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.9.0 (2026-01-05) + +Full Changelog: [v0.8.0...v0.9.0](https://github.com/onkernel/hypeman-go/compare/v0.8.0...v0.9.0) + +### Features + +* QEMU support ([d708091](https://github.com/onkernel/hypeman-go/commit/d70809169d136df3f1efbf961f2a90084e1f9fa5)) +* Resource accounting ([4141287](https://github.com/onkernel/hypeman-go/commit/414128770e8137ed2a40d404f0f4ac06ea1a0731)) + ## 0.8.0 (2025-12-23) Full Changelog: [v0.7.0...v0.8.0](https://github.com/onkernel/hypeman-go/compare/v0.7.0...v0.8.0) 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/README.md b/README.md index 7f8b79a..98ae5ac 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Or to pin the version: ```sh -go get -u 'github.com/onkernel/hypeman-go@v0.8.0' +go get -u 'github.com/onkernel/hypeman-go@v0.9.0' ``` diff --git a/instance.go b/instance.go index d393460..fed047f 100644 --- a/instance.go +++ b/instance.go @@ -191,12 +191,18 @@ 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 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) @@ -220,9 +226,11 @@ type Instance struct { Image respjson.Field Name respjson.Field State respjson.Field + DiskIoBps respjson.Field Env respjson.Field HasSnapshot respjson.Field HotplugSize respjson.Field + Hypervisor respjson.Field Network respjson.Field OverlaySize respjson.Field Size respjson.Field @@ -263,8 +271,20 @@ 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 { + // 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) @@ -275,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:"-"` } @@ -398,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") @@ -410,6 +435,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,8 +454,22 @@ 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 { + // 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 8b83e37..81bcf4d 100644 --- a/instance_test.go +++ b/instance_test.go @@ -27,16 +27,20 @@ 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", }, 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"), diff --git a/internal/version.go b/internal/version.go index 3c8392e..0e818c5 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.8.0" // x-release-please-version +const PackageVersion = "0.9.0" // x-release-please-version