device_positions
Creates, updates, deletes, gets or lists a device_positions resource.
Overview
| Name | device_positions |
| Type | Resource |
| Id | aws.location.device_positions |
Fields
The following fields are returned by SELECT queries:
- batch_get_device_position
- get_device_position
- list_device_positions
| Name | Datatype | Description |
|---|---|---|
device_positions | array | Contains device position details such as the device ID, position, and timestamps for when the position was received and sampled. |
errors | array | Contains error details for each device that failed to send its position to the tracker resource. |
| Name | Datatype | Description |
|---|---|---|
accuracy | object | The accuracy of the device position. |
device_id | string | The device whose position you retrieved. (pattern: <code>[-._\p{L}\p{N}]+</code>) |
position | array | The last known device position. |
position_properties | object | The properties associated with the position. |
received_time | string (date-time) | The timestamp for when the tracker resource received the device position. Uses ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. |
sample_time | string (date-time) | The timestamp at which the device's position was determined. Uses ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. |
| Name | Datatype | Description |
|---|---|---|
accuracy | object | The accuracy of the device position. |
device_id | string | The ID of the device for this position. (pattern: <code>[-._\p{L}\p{N}]+</code>) |
position | array | The last known device position. Empty if no positions currently stored. |
position_properties | object | The properties associated with the position. |
sample_time | string (date-time) | The timestamp at which the device position was determined. Uses ISO 8601 format: YYYY-MM-DDThh:mm:ss.sssZ. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
batch_get_device_position | select | tracker_name, region | Lists the latest device positions for requested devices. | |
get_device_position | select | tracker_name, device_id, region | Retrieves a device's most recent position according to its sample time. Device positions are deleted after 30 days. | |
list_device_positions | select | tracker_name, region | A batch request to retrieve all device positions. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
device_id | string | The device whose position you want to retrieve. |
region | string | AWS region (default: us-east-1) |
tracker_name | string | The tracker resource containing the requested devices. |
SELECT examples
- batch_get_device_position
- get_device_position
- list_device_positions
Lists the latest device positions for requested devices.
SELECT
device_positions,
errors
FROM aws.location.device_positions
WHERE tracker_name = '{{ tracker_name }}' -- required
AND region = '{{ region }}' -- required
;
Retrieves a device's most recent position according to its sample time. Device positions are deleted after 30 days.
SELECT
accuracy,
device_id,
position,
position_properties,
received_time,
sample_time
FROM aws.location.device_positions
WHERE tracker_name = '{{ tracker_name }}' -- required
AND device_id = '{{ device_id }}' -- required
AND region = '{{ region }}' -- required
;
A batch request to retrieve all device positions.
SELECT
accuracy,
device_id,
position,
position_properties,
sample_time
FROM aws.location.device_positions
WHERE tracker_name = '{{ tracker_name }}' -- required
AND region = '{{ region }}' -- required
;