# FleetService

> The FleetService methods and their request and response messages.

Source: https://engramsfactory.com/docs/api/fleet/

Generated from [`fleet.proto`](https://github.com/cortexapps/engrams/blob/main/crates/engram-protocol/proto/engram/app/v1/fleet.proto). Every method is
`POST /rpc/engram.app.v1.FleetService/<Method>` with a JSON or protobuf body and an
`x-api-key` header.

## Methods

| Method | Request | Response |
|---|---|---|
| `ListHosts` | [`ListHostsRequest`](#listhostsrequest) | [`ListHostsResponse`](#listhostsresponse) |
| `GetHost` | [`GetHostRequest`](#gethostrequest) | [`GetHostResponse`](#gethostresponse) |
| `RetireHost` | [`RetireHostRequest`](#retirehostrequest) | [`RetireHostResponse`](#retirehostresponse) |
| `DrainHost` | [`DrainHostRequest`](#drainhostrequest) | [`DrainHostResponse`](#drainhostresponse) |
| `AdminDrainHost` | [`AdminDrainHostRequest`](#admindrainhostrequest) | [`AdminDrainHostResponse`](#admindrainhostresponse) |
| `CordonHost` | [`CordonHostRequest`](#cordonhostrequest) | [`CordonHostResponse`](#cordonhostresponse) |
| `BeginHostHandoff` | [`BeginHostHandoffRequest`](#beginhosthandoffrequest) | [`BeginHostHandoffResponse`](#beginhosthandoffresponse) |
| `UncordonHost` | [`UncordonHostRequest`](#uncordonhostrequest) | [`UncordonHostResponse`](#uncordonhostresponse) |
| `DeleteHost` | [`DeleteHostRequest`](#deletehostrequest) | [`DeleteHostResponse`](#deletehostresponse) |
| `GetStorageSummary` | [`GetStorageSummaryRequest`](#getstoragesummaryrequest) | [`GetStorageSummaryResponse`](#getstoragesummaryresponse) |
| `TeleportSession` | [`TeleportSessionRequest`](#teleportsessionrequest) | [`TeleportSessionResponse`](#teleportsessionresponse) |
| `ChunkGc` | [`ChunkGcRequest`](#chunkgcrequest) | [`ChunkGcResponse`](#chunkgcresponse) |
| `BundleGc` | [`BundleGcRequest`](#bundlegcrequest) | [`BundleGcResponse`](#bundlegcresponse) |
| `SnapshotBlobGc` | [`SnapshotBlobGcRequest`](#snapshotblobgcrequest) | [`SnapshotBlobGcResponse`](#snapshotblobgcresponse) |
| `GetFleetDemand` | [`GetFleetDemandRequest`](#getfleetdemandrequest) | [`GetFleetDemandResponse`](#getfleetdemandresponse) |

## Messages

### AdminDrainHostRequest

| Field | Type |
|---|---|
| `host_id` | `string` |

### AdminDrainHostResponse

| Field | Type |
|---|---|
| `host_id` | `string` |
| `planned` | repeated `string` |
| `descended` | repeated `string` |
| `skipped` | `uint32` |

### BeginHostHandoffRequest

| Field | Type |
|---|---|
| `host_id` | `string` |
| `ttl_secs` | `uint64` |

### BeginHostHandoffResponse

| Field | Type |
|---|---|
| `host_id` | `string` |
| `accepted` | `bool` |

### BundleGcRequest

| Field | Type |
|---|---|
| `dry_run` | `bool` |
| `grace_secs` | `uint64` (optional) |

### BundleGcResponse

| Field | Type |
|---|---|
| `listed` | `uint64` |
| `pin_set_size` | `uint64` |
| `candidates_marked` | `uint64` |
| `promoted_deletes` | `uint64` |
| `promote_delete_errors` | `uint64` |
| `restart_count` | `uint32` |
| `promote_repinned_skips` | `uint64` |

### ChunkGcRequest

| Field | Type |
|---|---|
| `dry_run` | `bool` |
| `grace_secs` | `uint64` (optional) |

### ChunkGcResponse

| Field | Type |
|---|---|
| `listed_chunks` | `uint64` |
| `malformed_keys` | `uint64` |
| `pin_set_size` | `uint64` |
| `candidates_marked` | `uint64` |
| `promoted_deletes` | `uint64` |
| `promote_delete_errors` | `uint64` |
| `grace_secs` | `uint64` |
| `generation_moved` | `bool` |
| `mark_error` | `string` (optional) |

### CordonHostRequest

| Field | Type |
|---|---|
| `host_id` | `string` |
| `owner` | `string` |

### CordonHostResponse

| Field | Type |
|---|---|
| `host_id` | `string` |
| `status` | `string` |

### DeleteHostRequest

| Field | Type |
|---|---|
| `host_id` | `string` |

### DeleteHostResponse

No fields.

### DrainHostRequest

| Field | Type |
|---|---|
| `host_id` | `string` |

### DrainHostResponse

No fields.

### GetFleetDemandRequest

No fields.

### GetFleetDemandResponse

| Field | Type |
|---|---|
| `ready_hosts` | `uint32` |
| `schedulable_hosts` | `uint32` |
| `free_mib` | `uint64` |
| `total_mib` | `uint64` |
| `free_vcpus` | `uint64` |
| `total_vcpus` | `uint64` |
| `cordoned_hosts` | `uint32` |
| `queued_sessions` | `uint64` |
| `queued_mib` | `uint64` |
| `queued_vcpus` | `uint64` |

### GetHostRequest

| Field | Type |
|---|---|
| `host_id` | `string` |

### GetHostResponse

| Field | Type |
|---|---|
| `host` | [`HostView`](#hostview) |

### GetStorageSummaryRequest

No fields.

### GetStorageSummaryResponse

| Field | Type |
|---|---|
| `snapshots` | `uint64` |
| `snapshot_bytes` | `uint64` |
| `gc_pending` | `uint64` |
| `gc_pending_exact` | `bool` |

### HostRetirement

| Field | Type |
|---|---|
| `requested_at` | `string` |
| `retired_at` | `string` |
| `blockers` | repeated [`RetirementBlocker`](#retirementblocker) |

### HostView

| Field | Type |
|---|---|
| `id` | `string` |
| `hostname` | `string` |
| `status` | `string` |
| `capacity_total_mib` | `uint64` |
| `capacity_used_mib` | `uint64` |
| `running_sandboxes` | `uint32` |
| `ready_images` | `uint64` |
| `ready_image_digests` | repeated `string` |
| `util_disk_total_mib` | `uint64` |
| `util_disk_used_mib` | `uint64` |
| `util_mem_total_mib` | `uint64` |
| `util_mem_used_mib` | `uint64` |
| `util_cpu_pct` | `float` |
| `last_heartbeat_at` | `string` |
| `cordoned` | `bool` |
| `allocatable_mib` | `uint64` |
| `reserved_mib` | `uint64` |
| `free_mib` | `uint64` |
| `total_vcpus` | `uint32` |
| `cpu_budget_vcpus` | `uint64` |
| `reserved_vcpus` | `uint64` |
| `free_vcpus` | `uint64` |
| `util_base_shm_mib` | `uint64` |
| `util_parked_pss_mib` | `uint64` |
| `util_running_pss_mib` | `uint64` |
| `failing_capabilities` | repeated `string` |
| `fc_snapshot_version` | `string` |
| `capabilities_schema` | `uint32` |
| `live_materializes` | `uint32` |
| `live_capture_jobs` | `uint32` |
| `cordon_owner` | `string` |
| `retirement` | [`HostRetirement`](#hostretirement) |
| `pool_data_free_mib` | `uint64` |
| `pool_data_total_mib` | `uint64` |
| `pool_metadata_free_mib` | `uint64` |
| `pool_metadata_total_mib` | `uint64` |
| `reattach_generation` | `uint32` |

### ListHostsRequest

No fields.

### ListHostsResponse

| Field | Type |
|---|---|
| `hosts` | repeated [`HostView`](#hostview) |

### RetireHostRequest

| Field | Type |
|---|---|
| `host_id` | `string` |
| `owner` | `string` |
| `reason` | `string` |

### RetireHostResponse

| Field | Type |
|---|---|
| `host_id` | `string` |
| `retirement` | [`HostRetirement`](#hostretirement) |
| `teleports_planned` | `uint32` |

### RetirementBlocker

| Field | Type |
|---|---|
| `kind` | `string` |
| `count` | `uint64` |

### SnapshotBlobGcRequest

| Field | Type |
|---|---|
| `dry_run` | `bool` |
| `grace_secs` | `uint64` (optional) |

### SnapshotBlobGcResponse

| Field | Type |
|---|---|
| `listed` | `uint64` |
| `malformed` | `uint64` |
| `pin_set_size` | `uint64` |
| `candidates_marked` | `uint64` |
| `promoted_deletes` | `uint64` |
| `promote_repinned_skips` | `uint64` |
| `promote_delete_errors` | `uint64` |
| `restart_count` | `uint32` |

### TeleportSessionRequest

| Field | Type |
|---|---|
| `session_id` | `string` |
| `target_host` | `string` (optional) |

### TeleportSessionResponse

| Field | Type |
|---|---|
| `teleport_id` | `string` |
| `kind` | `string` |
| `dest_host_id` | `string` |

### UncordonHostRequest

| Field | Type |
|---|---|
| `host_id` | `string` |
| `owner` | `string` |

### UncordonHostResponse

| Field | Type |
|---|---|
| `host_id` | `string` |
| `status` | `string` |
