Skip to content

Commit 27fa1e7

Browse files
feat: Operational logs over API: hypeman.log, vmm.log
1 parent c475606 commit 27fa1e7

File tree

2 files changed

+32
-5
lines changed

2 files changed

+32
-5
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: 24
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-79d2560d22cc9ee4e2bf34ad8de2e4f3ae8f4c653b1ed871ad532320ead489bc.yml
3-
openapi_spec_hash: 53af3f7cd0fe7951664479a9de444d56
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fhypeman-8fded10e90df28c07b64a92d12d665d54749b9fc13c35520667637fc596957d9.yml
3+
openapi_spec_hash: 7374a732372bddf7f2c0b532b56ae3fb
44
config_hash: 510018ffa6ad6a17875954f66fe69598

instance.go

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,15 @@ func (r *InstanceService) Get(ctx context.Context, id string, opts ...option.Req
8383
return
8484
}
8585

86-
// Streams instance console logs as Server-Sent Events. Returns the last N lines
87-
// (controlled by `tail` parameter), then optionally continues streaming new lines
88-
// if `follow=true`.
86+
// Streams instance logs as Server-Sent Events. Use the `source` parameter to
87+
// select which log to stream:
88+
//
89+
// - `app` (default): Guest application logs (serial console)
90+
// - `vmm`: Cloud Hypervisor VMM logs
91+
// - `hypeman`: Hypeman operations log
92+
//
93+
// Returns the last N lines (controlled by `tail` parameter), then optionally
94+
// continues streaming new lines if `follow=true`.
8995
func (r *InstanceService) LogsStreaming(ctx context.Context, id string, query InstanceLogsParams, opts ...option.RequestOption) (stream *ssestream.Stream[string]) {
9096
var (
9197
raw *http.Response
@@ -385,6 +391,14 @@ type InstanceLogsParams struct {
385391
Follow param.Opt[bool] `query:"follow,omitzero" json:"-"`
386392
// Number of lines to return from end
387393
Tail param.Opt[int64] `query:"tail,omitzero" json:"-"`
394+
// Log source to stream:
395+
//
396+
// - app: Guest application logs (serial console output)
397+
// - vmm: Cloud Hypervisor VMM logs (hypervisor stdout+stderr)
398+
// - hypeman: Hypeman operations log (actions taken on this instance)
399+
//
400+
// Any of "app", "vmm", "hypeman".
401+
Source InstanceLogsParamsSource `query:"source,omitzero" json:"-"`
388402
paramObj
389403
}
390404

@@ -395,3 +409,16 @@ func (r InstanceLogsParams) URLQuery() (v url.Values, err error) {
395409
NestedFormat: apiquery.NestedQueryFormatBrackets,
396410
})
397411
}
412+
413+
// Log source to stream:
414+
//
415+
// - app: Guest application logs (serial console output)
416+
// - vmm: Cloud Hypervisor VMM logs (hypervisor stdout+stderr)
417+
// - hypeman: Hypeman operations log (actions taken on this instance)
418+
type InstanceLogsParamsSource string
419+
420+
const (
421+
InstanceLogsParamsSourceApp InstanceLogsParamsSource = "app"
422+
InstanceLogsParamsSourceVmm InstanceLogsParamsSource = "vmm"
423+
InstanceLogsParamsSourceHypeman InstanceLogsParamsSource = "hypeman"
424+
)

0 commit comments

Comments
 (0)