List Allocations
4 min
use this method to inspect allocations created by the authenticated client it is especially useful when an allocation is waiting for a device when to use this method check whether deviceserial has been assigned inspect queue position before starting a session find the expiration time of an active allocation review allocations created earlier in the same account sdk method java node js client allocations() list(request) await client allocations() list(request?) examples pagedto\<allocation> allocations = client allocations() list( allocationsearchrequest builder() page(0) size(20) build() );import { allocationfilter, allocationsearchrequestbuilder, searchoperation } from "@devicepark/public sdk"; const allocations = await client allocations() list( new allocationsearchrequestbuilder() addfilter(allocationfilter allocation, "allocation 123", searchoperation equal) build() ); java sdk 1 0 0 currently does not send builder filters java consumers should inspect the returned page for the expected allocationid understanding the result deviceserial is populated after assignment position describes queue position while waiting expiresat tells you how long the reservation remains valid the same active allocationid can be used for multiple sessions when polling, use bounded retries and a reasonable interval do not create a new allocation for every status check next step when allocationid is active and a device has been assigned, start a session /sessions/start session if the allocation is no longer needed, release it /allocations/release allocation
