Menu
Platform
AI
App store purchases
Database
Flags
Jobs and cron
Localization
Monitoring
Notifications
Payments
Queues
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
List lease events
Lists a lease's events in order.
Lists a lease's events in order. With wait, blocks up to that long for an event after page_token (long poll).
- Path
GET https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease/lease_events - Scope
sandboxes:read - Effect
read— nothing is written. - Collection lease_events
- Query
page_size,page_token,filter,wait - Pagination the answer carries
lease_eventsand, when there is more,next_page_token
#Request
| Field | Type | What it is |
|---|---|---|
parent | string | The lease. Required. |
page_size | int32 | At most this many; default 50, clamped to 1000. |
page_token | string | next_page_token of the previous page. |
filter | string | AIP-160 filter over kind. |
wait | duration | Block up to this long (at most 60 seconds) when there is no event after page_token. |
#Response
| Field | Type | What it is |
|---|---|---|
lease_events | LeaseEvent[] | The page, oldest first. |
next_page_token | string | Pass it back to continue after the last event; set on every page, so a caller can long-poll from it. |
#LeaseEvent
| Field | Type | What it is |
|---|---|---|
name | string | orgs/{org}/projects/{project}/envs/{env}/leases/{lease}/lease_events/{lease_event}. |
uid | string | lev_<cell><ulid>; never reused. Output only. |
meta | ResourceMeta | Resource metadata. |
kind | LeaseEventKind | What happened. Output only. One of granted, ready, refused, ended, renewed, network_changed, control_acquired, control_released, control_expired, budget_warning, paused, resumed. |
sequence | int64 | The position in the lease's event sequence, from 1. Output only. |
occur_time | timestamp | When it happened. Output only. |
lease_generation | int64 | The lease generation after the event. Output only. |
state | LeaseState | The lease state after the event. Output only. One of requested, granted, ready, paused, ending, ended, refused. |
end_reason | EndReason | For LEASE_ENDED. Output only. One of released, expired, idle, cpu_budget, cost_budget, abuse, quota, org_deleted, machine_lost, boot_failed. |
usage | LeaseUsage | For LEASE_ENDED: final usage. Output only. |
control | ControlState | For CONTROL_* events: the control after the event. Output only. |
control_duration | duration | For CONTROL_RELEASED and CONTROL_EXPIRED: how long control was held. Output only. |
principal | string | The principal that caused it, when a caller did. Output only. |
#ResourceMeta
| Field | Type | What it is |
|---|---|---|
generation | int64 | Increases by one on every change to spec. Output only. |
etag | string | Strong ETag (AIP-154): changes on any change to spec, status, or metadata. Send it back as If-Match or etag to make Update and Delete conditional; a mismatch fails with ABORTED / 409 ETAG_MISMATCH. Output only. |
create_time | timestamp | When the Resource was created. Output only. |
update_time | timestamp | When the Resource last changed. Output only. |
delete_time | timestamp | Set while the Resource is being deleted. Output only. |
labels | map<string, string> | Caller-writable, indexed labels (AIP-122 label rules). |
annotations | map<string, string> | Caller-writable, unindexed annotations. |
display_name | string | Caller-writable human-readable name. |
creator | string | The principal that created the Resource. Output only. |
#LeaseUsage
| Field | Type | What it is |
|---|---|---|
wall_seconds | int64 | Wall seconds from grant. Output only. |
cpu_seconds | int64 | Guest vCPU-seconds. Output only. |
cost_micros | int64 | List-price cost so far, in millionths of a US dollar; 0 on classes that are not priced. Output only. |
measure_time | timestamp | When this usage was measured. Output only. |
memory_gib_seconds | int64 | Memory GiB-seconds (shape memory times wall seconds). Output only. |
egress_bytes | int64 | Bytes sent to the internet. Output only. |
stream_seconds | int64 | Seconds of live stream viewing, summed over viewers. Output only. |
#ControlState
| Field | Type | What it is |
|---|---|---|
holder | ControlHolder | Who holds control; UNSPECIFIED when nobody does (agent actions allowed). Output only. One of agent, human. |
epoch | int64 | Increases on every acquire; release names it. Output only. |
principal | string | The Access principal that acquired control. Output only. |
holder_label | string | The caller's label for the person or agent, for example a user id. Output only. |
acquire_time | timestamp | When control was acquired. Output only. |
expire_time | timestamp | When control lapses unless re-acquired. Output only. |
#Errors
UNAUTHENTICATED— No valid key or token was presented.PERMISSION_DENIED— The key lacks the method's permission.RESOURCE_NOT_FOUND— The named Resource does not exist or is not visible.INVALID_FIELD— A field failed validation.PAGE_TOKEN_MISMATCH— A page token was reused with different parameters.
Every error arrives in the body Errors describes.
#Examples
curl "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/leases/lease/lease_events" \
-H "Authorization: Bearer $SYLPHX_API_KEY"