Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/hypeman-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: |-
github.repository == 'stainless-sdks/hypeman-go' &&
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/hypeman-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork

steps:
Expand All @@ -65,7 +65,7 @@ jobs:
test:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/hypeman-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand Down
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.20.0"
".": "0.21.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 52
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/hypeman-f9fed11ca56bb499302232ce70b65d8fa6c0f88c5274dbf16670283303449c63.yml
openapi_spec_hash: 24530949a7f53ab57694443c45088190
config_hash: 99e93e381d8384de5a44c6eeed4bd4b1
configured_endpoints: 53
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/hypeman-eb4f6a68824524c05a939d52eba9b52f2cae6515dac6e6afa1b6d3f4aa5b6a9e.yml
openapi_spec_hash: ed9f74727470b32ac5a41fa21aaa4e24
config_hash: 6c3d12df98dffe34327778fe148a9556
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.21.0 (2026-07-28)

Full Changelog: [v0.20.0...v0.21.0](https://github.com/kernel/hypeman-go/compare/v0.20.0...v0.21.0)

### Features

* Add design proposal: Rosetta x86-64 emulation for vz Linux guests ([1fe1f91](https://github.com/kernel/hypeman-go/commit/1fe1f91295d1601606c8cfd192414379a2e41106))
* Add POST /instances/{id}/auto-standby/reset ([f87b47b](https://github.com/kernel/hypeman-go/commit/f87b47b2cd1e52b5987a0321c867fc1eb68cf6b9))
* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([a05ed0b](https://github.com/kernel/hypeman-go/commit/a05ed0b3571d085505f5adfe6f4121f79f2d642c))

## 0.20.0 (2026-05-18)

Full Changelog: [v0.19.0...v0.20.0](https://github.com/kernel/hypeman-go/compare/v0.19.0...v0.20.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/kernel/hypeman-go@v0.20.0'
go get -u 'github.com/kernel/hypeman-go@v0.21.0'
```

<!-- x-release-please-end -->
Expand Down
1 change: 1 addition & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Methods:

Methods:

- <code title="post /instances/{id}/auto-standby/hold">client.Instances.AutoStandby.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceAutoStandbyService.Hold">Hold</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#AutoStandbyStatus">AutoStandbyStatus</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>
- <code title="get /instances/{id}/auto-standby/status">client.Instances.AutoStandby.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#InstanceAutoStandbyService.Status">Status</a>(ctx <a href="https://pkg.go.dev/context">context</a>.<a href="https://pkg.go.dev/context#Context">Context</a>, id <a href="https://pkg.go.dev/builtin#string">string</a>) (\*<a href="https://pkg.go.dev/github.com/kernel/hypeman-go">hypeman</a>.<a href="https://pkg.go.dev/github.com/kernel/hypeman-go#AutoStandbyStatus">AutoStandbyStatus</a>, <a href="https://pkg.go.dev/builtin#error">error</a>)</code>

## Volumes
Expand Down
8 changes: 8 additions & 0 deletions image.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ type Image struct {
Env map[string]string `json:"env"`
// Error message if status is failed
Error string `json:"error" api:"nullable"`
// Resolved image platform as os/arch[/variant] (e.g. "linux/amd64")
Platform string `json:"platform"`
// Position in build queue (null if not queued)
QueuePosition int64 `json:"queue_position" api:"nullable"`
// Disk size in bytes (null until ready)
Expand All @@ -116,6 +118,7 @@ type Image struct {
Entrypoint respjson.Field
Env respjson.Field
Error respjson.Field
Platform respjson.Field
QueuePosition respjson.Field
SizeBytes respjson.Field
Tags respjson.Field
Expand Down Expand Up @@ -145,6 +148,11 @@ const (
type ImageNewParams struct {
// OCI image reference (e.g., docker.io/library/nginx:latest)
Name string `json:"name" api:"required"`
// Target platform as os/arch[/variant] (e.g. "linux/amd64"), matching Docker
// --platform. Omit for the host platform. Not a fixed enum: the os/arch[/variant]
// grammar is validated server-side and invalid values return 400 invalid_platform.
// Only os "linux" with arch amd64 or arm64 is accepted today.
Platform param.Opt[string] `json:"platform,omitzero"`
// User-defined key-value tags.
Tags map[string]string `json:"tags,omitzero"`
paramObj
Expand Down
3 changes: 2 additions & 1 deletion image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ func TestImageNewWithOptionalParams(t *testing.T) {
option.WithAPIKey("My API Key"),
)
_, err := client.Images.New(context.TODO(), hypeman.ImageNewParams{
Name: "docker.io/library/nginx:latest",
Name: "docker.io/library/nginx:latest",
Platform: hypeman.String("linux/amd64"),
Tags: map[string]string{
"team": "backend",
"env": "staging",
Expand Down
12 changes: 12 additions & 0 deletions instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ type AutoStandbyStatus struct {
TrackingMode string `json:"tracking_mode" api:"required"`
// Remaining time before the controller attempts standby, when applicable.
CountdownRemaining string `json:"countdown_remaining" api:"nullable"`
// Until when auto-standby is held off, if a hold is active.
HoldUntil time.Time `json:"hold_until" api:"nullable" format:"date-time"`
// When the controller most recently observed the instance become idle.
IdleSince time.Time `json:"idle_since" api:"nullable" format:"date-time"`
// Configured idle timeout from the auto-standby policy.
Expand All @@ -336,6 +338,7 @@ type AutoStandbyStatus struct {
Supported respjson.Field
TrackingMode respjson.Field
CountdownRemaining respjson.Field
HoldUntil respjson.Field
IdleSince respjson.Field
IdleTimeout respjson.Field
LastInboundActivityAt respjson.Field
Expand Down Expand Up @@ -690,6 +693,9 @@ type Instance struct {
// initializing, shutdown). Consumers (e.g. billing) sum the phases they consider
// billable.
PhaseDurationsMs map[string]int64 `json:"phase_durations_ms"`
// Resolved image platform as os/arch[/variant] (e.g. "linux/amd64"). amd64 images
// on an arm64 host run under Rosetta emulation.
Platform string `json:"platform"`
// Whole-instance restart supervision policy.
RestartPolicy RestartPolicy `json:"restart_policy"`
// Runtime status for restart policy decisions.
Expand Down Expand Up @@ -732,6 +738,7 @@ type Instance struct {
Network respjson.Field
OverlaySize respjson.Field
PhaseDurationsMs respjson.Field
Platform respjson.Field
RestartPolicy respjson.Field
RestartStatus respjson.Field
Size respjson.Field
Expand Down Expand Up @@ -1406,6 +1413,11 @@ type InstanceNewParams struct {
HotplugSize param.Opt[string] `json:"hotplug_size,omitzero"`
// Writable overlay disk size (human-readable format like "10GB", "50G")
OverlaySize param.Opt[string] `json:"overlay_size,omitzero"`
// Target platform as os/arch[/variant] (e.g. "linux/amd64"), matching Docker
// --platform. Omit for the host platform. Not a fixed enum: the os/arch[/variant]
// grammar is validated server-side and invalid values return 400 invalid_platform.
// Only os "linux" with arch amd64 or arm64 is accepted today.
Platform param.Opt[string] `json:"platform,omitzero"`
// Base memory size (human-readable format like "1GB", "512MB", "2G")
Size param.Opt[string] `json:"size,omitzero"`
// Skip guest-agent installation during boot. When true, the exec and stat APIs
Expand Down
1 change: 1 addition & 0 deletions instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func TestInstanceNewWithOptionalParams(t *testing.T) {
Enabled: hypeman.Bool(true),
},
OverlaySize: hypeman.String("20GB"),
Platform: hypeman.String("linux/amd64"),
RestartPolicy: hypeman.RestartPolicyParam{
Backoff: hypeman.String("5s"),
MaxAttempts: hypeman.Int(10),
Expand Down
21 changes: 21 additions & 0 deletions instanceautostandby.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,27 @@ func NewInstanceAutoStandbyService(opts ...option.RequestOption) (r InstanceAuto
return
}

// Places a hold that prevents the auto-standby controller from putting the
// instance into standby before `hold_until`, and cancels any queued auto-standby
// attempt.
//
// Callers may use this before opening a connection to a candidate-idle instance: a
// 200 means it is safe to connect until `hold_until`; a 409 means the instance is
// in standby (or irrevocably entering it) and must be restored first.
//
// Instances where auto-standby is disabled, unconfigured, or unsupported return
// 200 with their current status because no auto-standby will occur.
func (r *InstanceAutoStandbyService) Hold(ctx context.Context, id string, opts ...option.RequestOption) (res *AutoStandbyStatus, err error) {
opts = slices.Concat(r.Options, opts)
if id == "" {
err = errors.New("missing required id parameter")
return nil, err
}
path := fmt.Sprintf("instances/%s/auto-standby/hold", id)
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, nil, &res, opts...)
return res, err
}

// Get auto-standby diagnostic status
func (r *InstanceAutoStandbyService) Status(ctx context.Context, id string, opts ...option.RequestOption) (res *AutoStandbyStatus, err error) {
opts = slices.Concat(r.Options, opts)
Expand Down
23 changes: 23 additions & 0 deletions instanceautostandby_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,29 @@ import (
"github.com/kernel/hypeman-go/option"
)

func TestInstanceAutoStandbyHold(t *testing.T) {
t.Skip("Mock server tests are disabled")
baseURL := "http://localhost:4010"
if envURL, ok := os.LookupEnv("TEST_API_BASE_URL"); ok {
baseURL = envURL
}
if !testutil.CheckTestServer(t, baseURL) {
return
}
client := hypeman.NewClient(
option.WithBaseURL(baseURL),
option.WithAPIKey("My API Key"),
)
_, err := client.Instances.AutoStandby.Hold(context.TODO(), "id")
if err != nil {
var apierr *hypeman.Error
if errors.As(err, &apierr) {
t.Log(string(apierr.DumpRequest(true)))
}
t.Fatalf("err should be nil: %s", err.Error())
}
}

func TestInstanceAutoStandbyStatus(t *testing.T) {
t.Skip("Mock server tests are disabled")
baseURL := "http://localhost:4010"
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.20.0" // x-release-please-version
const PackageVersion = "0.21.0" // x-release-please-version
Loading