Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.8.0"
".": "0.9.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/onkernel/hypeman-go@v0.8.0'
go get -u 'github.com/onkernel/hypeman-go@v0.9.0'
```

<!-- x-release-please-end -->
Expand Down
55 changes: 49 additions & 6 deletions instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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:"-"`
}

Expand Down Expand Up @@ -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")
Expand All @@ -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
Expand All @@ -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
Expand Down
12 changes: 8 additions & 4 deletions instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

package internal

const PackageVersion = "0.8.0" // x-release-please-version
const PackageVersion = "0.9.0" // x-release-please-version