List Pools
A pool is a managed group of devices. Use a pool when the test can run on any suitable device from that group and availability matters more than one exact serial.
List Pools returns pool identifiers, names and whether each pool is the default pool. It does not return the devices inside each pool.
To retrieve devices from a pool, use List Devices with DeviceFilter.POOL_ID. To reserve any suitable device from the pool, pass pool.id as devicePoolId to Create Allocation.
SDK Method
Java | Node.js | Returns |
|---|---|---|
client.pools().list(request) | await client.pools().list(request?) | PageDto<Pool> |
client.pools().listByDefaultPool(request) | await client.pools().listByDefaultPool(request?) | PageDto<Pool> |
client.pools() returns a shared PoolsApi instance. Node.js allows the request to be omitted. Java accepts null, but ListPoolsRequest.builder().build() makes the selected defaults explicit.
Understanding isDefault
isDefault is read-only metadata returned by Device Park for each pool. It tells the caller whether the pool is marked as a default pool in Device Park; it does not change the pool configuration.
Value | Meaning |
|---|---|
true | The pool is marked as a default pool |
false | The pool is a regular, non-default pool |
null | The response did not provide default-pool information |
The wire field and SDK property are named isDefault:
Context | Access |
|---|---|
JSON response | "isDefault": true |
Java | pool.isDefault() |
Node.js | pool.isDefault |
There is no isDefaultPool property in the Java or Node.js SDK.
The two pool-list methods use this information differently:
- list(...) lists pools visible to the caller. Its results can contain default and non-default pools.
- listByDefaultPool(...) sends an IS_DEFAULT = true filter and returns only pools marked as default.
isDefault: true does not mean that a device is currently available in the pool, and it does not automatically select the pool for allocation. To allocate from that pool, explicitly pass its id as devicePoolId.
Required Imports
import java.util.Collections;
import io.testinium.devicepark.model.common.PageDto;
import io.testinium.devicepark.model.common.SearchOperation;
import io.testinium.devicepark.model.common.SortDirection;
import io.testinium.devicepark.model.pools.ListPoolsRequest;
import io.testinium.devicepark.model.pools.Pool;
import io.testinium.devicepark.model.pools.PoolFilter;
import io.testinium.devicepark.model.pools.PoolFilterRequest;Request Fields
ListPoolsRequest contains two top-level fields:
Field | Type | Default | Description |
|---|---|---|---|
filters | PoolFilterRequest[] / List<PoolFilterRequest> | Empty | Pool filter rules |
sorting | Sorting | Default Sorting | Pagination and sorting configuration |
The builder exposes every field through these methods:
Builder method | Value type | Default | Description |
|---|---|---|---|
.page(value) | integer | 0 | Zero-based page index |
.size(value) | integer | 20 | Maximum pools requested |
.sortBy(value) | string | ID | Server-side sort field |
.direction(value) | SortDirection | DESC | ASC or DESC |
.addFilter(key, value, operation) | PoolFilter, value, SearchOperation | None | Appends one filter |
.filters(rules) | Pool filter list | Empty | Replaces the complete filter list |
.build() | None | — | Returns the completed request |
Java additionally exposes getFilters(), setFilters(...), getSorting() and setSorting(...) on ListPoolsRequest. The Java getter returns an unmodifiable filter list, while the setter copies the supplied list.
Available Pool Filters
Constant | Query key | Value type | Supported operations | Purpose |
|---|---|---|---|---|
PoolFilter.NAME | NAME | string | EQUAL, NOT_EQUAL, GREATER_THAN, LESS_THAN | Compare the pool name |
PoolFilter.IS_DEFAULT | IS_DEFAULT | boolean | EQUAL | Match default or non-default pools |
Each filter is a PoolFilterRequest with the following fields:
Field | Java type | Node.js type | Required |
|---|---|---|---|
key | PoolFilter | PoolFilter value | Yes |
value | Object | unknown | Yes |
operation | SearchOperation | SearchOperation value | Yes |
Java can create one rule with PoolFilterRequest.of(key, value, operation). It also exposes getters and setters for all three fields. Node.js represents the same contract as a typed object.
The Java and Node.js SDKs send pool filters supplied to list(...). Both also expose listByDefaultPool(...), which applies the IS_DEFAULT = true rule automatically.
Request Mapping
The list operation has no request body. OAuth authorization is managed by the SDK client; callers do not supply headers to list(...).
Both SDKs send:
sorting.page=0
sorting.size=20
sorting.sortBy=ID
sorting.direction=DESCBoth SDKs send each filter as indexed query data:
filters[0].key=NAME
filters[0].value=Android Regression
filters[0].operation=EQUALList Pools
PageDto<Pool> pools = client.pools().list(
ListPoolsRequest.builder()
.page(0)
.size(20)
.sortBy("ID")
.direction(SortDirection.DESC)
.build()
);
pools.data().forEach(pool ->
System.out.println(
pool.id() + " - " + pool.name() + " - isDefault: " + pool.isDefault()
));Filter Pools by Name
Node.js sends this filter to Device Park:
const filterRequest: PoolFilterRequest = {
key: PoolFilter.NAME,
value: "Android Regression",
operation: SearchOperation.EQUAL
};
const pools = await client.pools().list(
new ListPoolsRequestBuilder()
.filters([filterRequest])
.page(0)
.size(20)
.build()
);The equivalent Java request is:
PoolFilterRequest nameFilter = PoolFilterRequest.of(
PoolFilter.NAME,
"Android Regression",
SearchOperation.EQUAL
);
ListPoolsRequest request = ListPoolsRequest.builder()
.filters(Collections.singletonList(nameFilter))
.page(0)
.size(20)
.build();List the Default Pool
listByDefaultPool(...) preserves the request pagination and sorting values and applies IS_DEFAULT = true.
PageDto<Pool> defaultPools = client.pools().listByDefaultPool(
ListPoolsRequest.builder()
.page(0)
.size(20)
.build()
);
defaultPools.data().forEach(pool ->
System.out.println(pool.id() + " - isDefault: " + pool.isDefault()));Response Model
The method returns PageDto<Pool>.
Page Fields
Field | Java type | Node.js type | Meaning |
|---|---|---|---|
size | int | number | Requested page size |
page | int | number | Zero-based returned page |
totalPages | int | number | Total number of pages |
totalElements | long | number | Total matching pool count |
data | List<Pool> | Pool[] | Pools in the current page |
Java exposes size(), page(), totalPages(), totalElements(), data(), isLast() and isEmpty() on PageDto<Pool>.
Pool Fields
Field | Type | Nullable | Meaning |
|---|---|---|---|
id | string | Yes | Identifier used as allocation devicePoolId |
name | string | Yes | Customer-facing pool name |
isDefault | boolean | Yes | Read-only status showing whether Device Park marks the pool as default |
{
"size": 20,
"page": 0,
"totalPages": 1,
"totalElements": 1,
"data": [
{
"id": "android-regression",
"name": "Android Regression",
"isDefault": true
}
]
}No device list is nested inside a Pool. Use the pool id in allocation when Device Park should choose an available member.
Empty Result
An empty data array is a successful response. It means the current credentials cannot see a pool on that page or no pool matched the transmitted filter. It does not mean the SDK failed.