Fleet Module (FM)¶
SDK API reference for the tlm_cloud_sdk.fleet package.
Use this package to interact with the Fleet Manager programmatically. FMClient gives you typed access to claimed devices
and their live status — the same interfaces that power the tlm-cli fm commands.
FMClient¶
tlm_cloud_sdk.fleet.client.FMClient
¶
Client interface for accessing Fleet Manager API interfaces.
This class exposes a property-based interface for accessing various Fleet Manager API model interfaces. Each property returns an interface responsible for interacting with a specific Fleet Manager model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
session
|
CloudSession | None
|
The authenticated session whose |
None
|
resource_api
|
JsonApiProtocol | None
|
Instead of |
None
|
Examples:
>>> client = FMClient(session)
>>> device_interface = client.claimed_device
>>> device = device_interface.get("serial_number", "SN-001")
Source code in packages/tlm-cloud-sdk/tlm_cloud_sdk/fleet/client.py
claimed_device
property
¶
claimed_device_status
property
¶
name_claimed_device(resource_id, name, *, attempts=5, delay=3.0, on_retry=None)
¶
Name a freshly claimed device, retrying while the Fleet Manager has not indexed it yet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource_id
|
str
|
Resource ID returned by the claim. |
required |
name
|
str
|
Display name to assign. |
required |
attempts
|
int
|
Maximum number of tries. |
5
|
delay
|
float
|
Seconds to wait between tries. |
3.0
|
on_retry
|
Callable[[int, int], None] | None
|
Called as |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True once the name is saved; False when every attempt failed. |
Source code in packages/tlm-cloud-sdk/tlm_cloud_sdk/fleet/client.py
FMInterfaceFactory¶
tlm_cloud_sdk.fleet.client.FMInterfaceFactory
¶
Bases: BaseInterfaceFactory
Factory class for retrieving Fleet Manager API interface instances.
This class provides access to interface classes responsible for interacting with various Fleet Manager API models. It also supports data population for those models through their corresponding interfaces.
Attributes:
| Name | Type | Description |
|---|---|---|
_model_map |
dict
|
A mapping of model names to their interface classes. |
Examples: