Register or update a host
Requires the master token: this endpoint takes a caller-supplied agent URL and token and can replace the provider details of an existing host ID, so it decides where the orchestrator sends every subsequent VM operation. An API-key principal gets 403.
The url is validated before anything is dialled: http or https
only, no embedded credentials, no query string, no fragment. A
rejected URL is never probed or persisted (400).
Registers a host. Re-registering an existing ID is a full
replacement, not a patch: the handler builds a fresh host
record from the request alone and overwrites the stored entry.
Beyond URL, token, region, and capacity, that also (a)
overwrites backend, (b) resets state to active — silently
uncordoning a cordoned host, (c) zeroes the allocated counters
even while VMs are still placed on the host, and that zeroed
record is persisted, and (d) resets created_at to now. Do not
use this endpoint to tweak one field of a live host; (b) and (c)
are scheduling side effects that can lead to overcommit.
The capacity probe against
the host agent doubles as an auth check: a token the agent
rejects fails registration with 502, while an unreachable agent
only blocks when cpus/ram_mb/storage_gb were not all declared
(otherwise the host registers with a warning, so pre-provisioning
an unreachable host still works). The response capacity reflects
resolved (probed or overridden) values, never the raw zeros
sent, and warnings is populated only on this response.
/v1/hostsAuthorizationBearer token · headerrequiredfuse_sessionAPI key · cookierequiredapplication/jsonidstringrequiredurlstringrequiredtokenstringregionstringbackendstringfirecrackerqemulabelsobjectcapacityobjectrequiredShow propertiesHide properties
cpusintegerram_mbintegerstorage_gbintegervm_countintegerrequiredgpusintegergpu_kindstringmig_profilesobjectgpu_devicesGPUDevice[]Show propertiesHide properties
GPUDeviceuuidstringmodelstringpci_bus_idstringmemory_mbintegerdriver_versionstringcuda_versionstringcompute_capstringmig_capablebooleanmig_modestringiommu_groupstringidstringrequiredurlstringrequiredregionstringstatestringrequiredactivecordoneddrainingbackendstringfirecrackerqemulabelsobjectcapacityHostCapacityrequiredShow propertiesHide properties
cpusintegerram_mbintegerstorage_gbintegervm_countintegerrequiredgpusintegergpu_kindstringmig_profilesobjectgpu_devicesGPUDevice[]Show propertiesHide properties
GPUDeviceuuidstringmodelstringpci_bus_idstringmemory_mbintegerdriver_versionstringcuda_versionstringcompute_capstringmig_capablebooleanmig_modestringiommu_groupstringallocatedHostCapacityrequiredShow propertiesHide properties
cpusintegerram_mbintegerstorage_gbintegervm_countintegerrequiredgpusintegergpu_kindstringmig_profilesobjectgpu_devicesGPUDevice[]Show propertiesHide properties
GPUDeviceuuidstringmodelstringpci_bus_idstringmemory_mbintegerdriver_versionstringcuda_versionstringcompute_capstringmig_capablebooleanmig_modestringiommu_groupstringlast_seenstring<date-time>requiredcreated_atstring<date-time>requiredupdated_atstring<date-time>requiredwarningsstring[]errorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedmessagestringrequireddetailsobjectcurl -X POST "http://localhost:8080/v1/hosts" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "string",
"url": "string",
"token": "string",
"region": "string",
"backend": "firecracker",
"labels": {},
"capacity": {
"cpus": 0,
"ram_mb": 0,
"storage_gb": 0,
"vm_count": 0,
"gpus": 0,
"gpu_kind": "string",
"mig_profiles": {},
"gpu_devices": [
{
"uuid": "string",
"model": "string",
"pci_bus_id": "string",
"memory_mb": 0,
"driver_version": "string",
"cuda_version": "string",
"compute_cap": "string",
"mig_capable": true,
"mig_mode": "string",
"iommu_group": "string"
}
]
}
}'const response = await fetch("http://localhost:8080/v1/hosts", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"id": "string",
"url": "string",
"token": "string",
"region": "string",
"backend": "firecracker",
"labels": {},
"capacity": {
"cpus": 0,
"ram_mb": 0,
"storage_gb": 0,
"vm_count": 0,
"gpus": 0,
"gpu_kind": "string",
"mig_profiles": {},
"gpu_devices": [
{
"uuid": "string",
"model": "string",
"pci_bus_id": "string",
"memory_mb": 0,
"driver_version": "string",
"cuda_version": "string",
"compute_cap": "string",
"mig_capable": true,
"mig_mode": "string",
"iommu_group": "string"
}
]
}
})
});import requests
response = requests.post(
"http://localhost:8080/v1/hosts",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"id": "string",
"url": "string",
"token": "string",
"region": "string",
"backend": "firecracker",
"labels": {},
"capacity": {
"cpus": 0,
"ram_mb": 0,
"storage_gb": 0,
"vm_count": 0,
"gpus": 0,
"gpu_kind": "string",
"mig_profiles": {},
"gpu_devices": [
{
"uuid": "string",
"model": "string",
"pci_bus_id": "string",
"memory_mb": 0,
"driver_version": "string",
"cuda_version": "string",
"compute_cap": "string",
"mig_capable": True,
"mig_mode": "string",
"iommu_group": "string"
}
]
}
},
){
"id": "string",
"url": "string",
"region": "string",
"state": "active",
"backend": "firecracker",
"labels": {},
"capacity": {
"cpus": 0,
"ram_mb": 0,
"storage_gb": 0,
"vm_count": 0,
"gpus": 0,
"gpu_kind": "string",
"mig_profiles": {},
"gpu_devices": [
{
"uuid": "string",
"model": "string",
"pci_bus_id": "string",
"memory_mb": 0,
"driver_version": "string",
"cuda_version": "string",
"compute_cap": "string",
"mig_capable": true,
"mig_mode": "string",
"iommu_group": "string"
}
]
},
"allocated": {
"cpus": 0,
"ram_mb": 0,
"storage_gb": 0,
"vm_count": 0,
"gpus": 0,
"gpu_kind": "string",
"mig_profiles": {},
"gpu_devices": [
{
"uuid": "string",
"model": "string",
"pci_bus_id": "string",
"memory_mb": 0,
"driver_version": "string",
"cuda_version": "string",
"compute_cap": "string",
"mig_capable": true,
"mig_mode": "string",
"iommu_group": "string"
}
]
},
"last_seen": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"warnings": [
"string"
]
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}