Skip to content

batch_update_device_position

batch_update_device_position(
    tracker_name: ResourceName,
    updates: DevicePositionUpdateList,
    *,
    config_overrides: Optional[LocationClientConfig] = None,
) -> BatchUpdateDevicePositionResponse

Uploads position update data for one or more devices to a tracker resource (up to 10 devices per batch). Amazon Location uses the data when it reports the last known device position and position history. Amazon Location retains location data for 30 days.

Position updates are handled based on the PositionFiltering property of the tracker. When PositionFiltering is set to TimeBased, updates are evaluated against linked geofence collections, and location data is stored at a maximum of one position per 30 second interval. If your update frequency is more often than every 30 seconds, only one update per 30 seconds is stored for each unique device ID.

When PositionFiltering is set to DistanceBased filtering, location data is stored and evaluated against linked geofence collections only if the device has moved more than 30 m (98.4 ft).

When PositionFiltering is set to AccuracyBased filtering, location data is stored and evaluated against linked geofence collections only if the device has moved more than the measured accuracy. For example, if two consecutive updates from a device have a horizontal accuracy of 5 m and 10 m, the second update is neither stored or evaluated if the device has moved less than 15 m. If PositionFiltering is set to AccuracyBased filtering, Amazon Location uses the default value { "Horizontal": 0} when accuracy is not provided on a DevicePositionUpdate.

Parameters:

  • tracker_name (ResourceName) –

    The name of the tracker resource to update.

  • updates (DevicePositionUpdateList) –

    Contains the position update details for each device, up to 10 devices.

Raises:

  • AccessDeniedException –

    The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.

  • InternalServerException –

    The request has failed to process because of an unknown server error, exception, or failure.

  • ResourceNotFoundException –

    The resource that you've entered was not found in your AWS account.

  • ThrottlingException –

    The request was denied because of request throttling.

  • ValidationException –

    The input failed to meet the constraints specified by the AWS service.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_location/_services/location.py
def batch_update_device_position(
    self,
    tracker_name: "capo_location.types.resource_name.ResourceName",
    updates: "capo_location.types.device_position_update_list.DevicePositionUpdateList",
    *,
    config_overrides: Optional[LocationClientConfig] = None,
) -> "capo_location.types.batch_update_device_position_response.BatchUpdateDevicePositionResponse":
    """<p>Uploads position update data for one or more devices to a tracker resource (up to 10 devices per batch). Amazon Location uses the data when it reports the last known device position and position history. Amazon Location retains location data for 30 days.</p> <note> <p>Position updates are handled based on the <code>PositionFiltering</code> property of the tracker. When <code>PositionFiltering</code> is set to <code>TimeBased</code>, updates are evaluated against linked geofence collections, and location data is stored at a maximum of one position per 30 second interval. If your update frequency is more often than every 30 seconds, only one update per 30 seconds is stored for each unique device ID.</p> <p>When <code>PositionFiltering</code> is set to <code>DistanceBased</code> filtering, location data is stored and evaluated against linked geofence collections only if the device has moved more than 30 m (98.4 ft).</p> <p>When <code>PositionFiltering</code> is set to <code>AccuracyBased</code> filtering, location data is stored and evaluated against linked geofence collections only if the device has moved more than the measured accuracy. For example, if two consecutive updates from a device have a horizontal accuracy of 5 m and 10 m, the second update is neither stored or evaluated if the device has moved less than 15 m. If <code>PositionFiltering</code> is set to <code>AccuracyBased</code> filtering, Amazon Location uses the default value <code>{ "Horizontal": 0}</code> when accuracy is not provided on a <code>DevicePositionUpdate</code>.</p> </note>

    Args:
        tracker_name: <p>The name of the tracker resource to update.</p>
        updates: <p>Contains the position update details for each device, up to 10 devices.</p>

    Raises:
        capo_location.errors.access_denied_exception.AccessDeniedException: <p>The request was denied because of insufficient access or permissions. Check with an administrator to verify your permissions.</p>
        capo_location.errors.internal_server_exception.InternalServerException: <p>The request has failed to process because of an unknown server error, exception, or failure.</p>
        capo_location.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource that you've entered was not found in your AWS account.</p>
        capo_location.errors.throttling_exception.ThrottlingException: <p>The request was denied because of request throttling.</p>
        capo_location.errors.validation_exception.ValidationException: <p>The input failed to meet the constraints specified by the AWS service. </p>
        capo_location.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_location.types.batch_update_device_position_request.BatchUpdateDevicePositionRequest]",
    ) -> OperationResponse[
        "capo_location.types.batch_update_device_position_response.BatchUpdateDevicePositionResponse"
    ]:
        import capo_location._operations.location_service.batch_update_device_position

        output, http_response = (
            capo_location._operations.location_service.batch_update_device_position.batch_update_device_position(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_location.types.batch_update_device_position_request.BatchUpdateDevicePositionRequest",
    ) -> dict[str, Any]:
        import capo_location.types.batch_update_device_position_request

        return capo_location.types.batch_update_device_position_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_location.types.batch_update_device_position_response.BatchUpdateDevicePositionResponse",
    ) -> dict[str, Any]:
        import capo_location.types.batch_update_device_position_response

        return capo_location.types.batch_update_device_position_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "BatchUpdateDevicePosition",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_location.types.batch_update_device_position_request.BatchUpdateDevicePositionRequest = {
        "tracker_name": tracker_name,
        "updates": updates,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output