Skip to content

Commit f550e62

Browse files
feat: show pool browsers in dashboard and API
1 parent 13b9433 commit f550e62

5 files changed

Lines changed: 43 additions & 3 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 101
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-d53de581fcac5c3b06940fc93667b9cd2a6a60dd3674da7c1f47484b0f442bf8.yml
3-
openapi_spec_hash: 177d0c537b7e5357c815bb64175e6484
4-
config_hash: c6b88eea9a15840f26130eb8ed3b42a0
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-e6e88da6e6fffe12873a108ca33ebfbd59b85232078ab0e4dca5c8273c131053.yml
3+
openapi_spec_hash: 4f22b8ec1d048cc74a751e3ab39b943c
4+
config_hash: 6bac5bbe5d5fc26e0912e33f646adb14

api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ Params Types:
7575
Response Types:
7676

7777
- <a href="https://pkg.go.dev/github.com/kernel/kernel-go-sdk">kernel</a>.<a href="https://pkg.go.dev/github.com/kernel/kernel-go-sdk#BrowserPersistence">BrowserPersistence</a>
78+
- <a href="https://pkg.go.dev/github.com/kernel/kernel-go-sdk">kernel</a>.<a href="https://pkg.go.dev/github.com/kernel/kernel-go-sdk#BrowserPoolRef">BrowserPoolRef</a>
7879
- <a href="https://pkg.go.dev/github.com/kernel/kernel-go-sdk">kernel</a>.<a href="https://pkg.go.dev/github.com/kernel/kernel-go-sdk#Profile">Profile</a>
7980
- <a href="https://pkg.go.dev/github.com/kernel/kernel-go-sdk">kernel</a>.<a href="https://pkg.go.dev/github.com/kernel/kernel-go-sdk#BrowserNewResponse">BrowserNewResponse</a>
8081
- <a href="https://pkg.go.dev/github.com/kernel/kernel-go-sdk">kernel</a>.<a href="https://pkg.go.dev/github.com/kernel/kernel-go-sdk#BrowserGetResponse">BrowserGetResponse</a>

browser.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,27 @@ func (r *BrowserPersistenceParam) UnmarshalJSON(data []byte) error {
201201
return apijson.UnmarshalRoot(data, r)
202202
}
203203

204+
// Browser pool this session was acquired from, if any.
205+
type BrowserPoolRef struct {
206+
// Browser pool ID
207+
ID string `json:"id" api:"required"`
208+
// Browser pool name, if set
209+
Name string `json:"name"`
210+
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
211+
JSON struct {
212+
ID respjson.Field
213+
Name respjson.Field
214+
ExtraFields map[string]respjson.Field
215+
raw string
216+
} `json:"-"`
217+
}
218+
219+
// Returns the unmodified JSON received from the API
220+
func (r BrowserPoolRef) RawJSON() string { return r.JSON.raw }
221+
func (r *BrowserPoolRef) UnmarshalJSON(data []byte) error {
222+
return apijson.UnmarshalRoot(data, r)
223+
}
224+
204225
// Browser profile metadata.
205226
type Profile struct {
206227
// Unique identifier for the profile
@@ -257,6 +278,8 @@ type BrowserNewResponse struct {
257278
//
258279
// Deprecated: deprecated
259280
Persistence BrowserPersistence `json:"persistence"`
281+
// Browser pool this session was acquired from, if any.
282+
Pool BrowserPoolRef `json:"pool"`
260283
// Browser profile metadata.
261284
Profile Profile `json:"profile"`
262285
// ID of the proxy associated with this browser session, if any.
@@ -283,6 +306,7 @@ type BrowserNewResponse struct {
283306
GPU respjson.Field
284307
KioskMode respjson.Field
285308
Persistence respjson.Field
309+
Pool respjson.Field
286310
Profile respjson.Field
287311
ProxyID respjson.Field
288312
Viewport respjson.Field
@@ -323,6 +347,8 @@ type BrowserGetResponse struct {
323347
//
324348
// Deprecated: deprecated
325349
Persistence BrowserPersistence `json:"persistence"`
350+
// Browser pool this session was acquired from, if any.
351+
Pool BrowserPoolRef `json:"pool"`
326352
// Browser profile metadata.
327353
Profile Profile `json:"profile"`
328354
// ID of the proxy associated with this browser session, if any.
@@ -349,6 +375,7 @@ type BrowserGetResponse struct {
349375
GPU respjson.Field
350376
KioskMode respjson.Field
351377
Persistence respjson.Field
378+
Pool respjson.Field
352379
Profile respjson.Field
353380
ProxyID respjson.Field
354381
Viewport respjson.Field
@@ -389,6 +416,8 @@ type BrowserUpdateResponse struct {
389416
//
390417
// Deprecated: deprecated
391418
Persistence BrowserPersistence `json:"persistence"`
419+
// Browser pool this session was acquired from, if any.
420+
Pool BrowserPoolRef `json:"pool"`
392421
// Browser profile metadata.
393422
Profile Profile `json:"profile"`
394423
// ID of the proxy associated with this browser session, if any.
@@ -415,6 +444,7 @@ type BrowserUpdateResponse struct {
415444
GPU respjson.Field
416445
KioskMode respjson.Field
417446
Persistence respjson.Field
447+
Pool respjson.Field
418448
Profile respjson.Field
419449
ProxyID respjson.Field
420450
Viewport respjson.Field
@@ -455,6 +485,8 @@ type BrowserListResponse struct {
455485
//
456486
// Deprecated: deprecated
457487
Persistence BrowserPersistence `json:"persistence"`
488+
// Browser pool this session was acquired from, if any.
489+
Pool BrowserPoolRef `json:"pool"`
458490
// Browser profile metadata.
459491
Profile Profile `json:"profile"`
460492
// ID of the proxy associated with this browser session, if any.
@@ -481,6 +513,7 @@ type BrowserListResponse struct {
481513
GPU respjson.Field
482514
KioskMode respjson.Field
483515
Persistence respjson.Field
516+
Pool respjson.Field
484517
Profile respjson.Field
485518
ProxyID respjson.Field
486519
Viewport respjson.Field

browserpool.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,8 @@ type BrowserPoolAcquireResponse struct {
254254
//
255255
// Deprecated: deprecated
256256
Persistence BrowserPersistence `json:"persistence"`
257+
// Browser pool this session was acquired from, if any.
258+
Pool BrowserPoolRef `json:"pool"`
257259
// Browser profile metadata.
258260
Profile Profile `json:"profile"`
259261
// ID of the proxy associated with this browser session, if any.
@@ -280,6 +282,7 @@ type BrowserPoolAcquireResponse struct {
280282
GPU respjson.Field
281283
KioskMode respjson.Field
282284
Persistence respjson.Field
285+
Pool respjson.Field
283286
Profile respjson.Field
284287
ProxyID respjson.Field
285288
Viewport respjson.Field

invocation.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,8 @@ type InvocationListBrowsersResponseBrowser struct {
561561
//
562562
// Deprecated: deprecated
563563
Persistence BrowserPersistence `json:"persistence"`
564+
// Browser pool this session was acquired from, if any.
565+
Pool BrowserPoolRef `json:"pool"`
564566
// Browser profile metadata.
565567
Profile Profile `json:"profile"`
566568
// ID of the proxy associated with this browser session, if any.
@@ -587,6 +589,7 @@ type InvocationListBrowsersResponseBrowser struct {
587589
GPU respjson.Field
588590
KioskMode respjson.Field
589591
Persistence respjson.Field
592+
Pool respjson.Field
590593
Profile respjson.Field
591594
ProxyID respjson.Field
592595
Viewport respjson.Field

0 commit comments

Comments
 (0)