getThingConnectivityData method
Retrieves the live connectivity status per device. If a device has never
connected to IoT Core or was disconnected for more than 1 hour before
fleet indexing's thingConnectivityIndexingMode was enabled,
the response will have the connected field set to
false with no additional session details.
May throw IndexNotReadyException.
May throw InternalFailureException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
May throw UnauthorizedException.
Parameter thingName :
The name of your IoT thing.
Parameter includeSocketInformation :
Specifies if socket information (sourcePort, targetPort, sourceIp,
targetIp, vpcEndpointId) should be included in the
GetThingConnectivityData response. Set to true to include
socket information. Set to false to omit socket information.
By default, this is set to false.
Implementation
Future<GetThingConnectivityDataResponse> getThingConnectivityData({
required String thingName,
bool? includeSocketInformation,
}) async {
final $payload = <String, dynamic>{
if (includeSocketInformation != null)
'includeSocketInformation': includeSocketInformation,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/things/${Uri.encodeComponent(thingName)}/connectivity-data',
exceptionFnMap: _exceptionFns,
);
return GetThingConnectivityDataResponse.fromJson(response);
}