2026/05/28 - AWS IoT - 4 updated api methods
Changes Adds new connectivity-related fields to Fleet Indexing API requests and responses.
{'thingIndexingConfiguration': {'filter': {'connectivity': {'includeSocketInformation': ['GET_THING_CONNECTIVITY_DATA']}}}}
Gets the indexing configuration.
Requires permission to access the GetIndexingConfiguration action.
See also: AWS API Documentation
Request Syntax
client.get_indexing_configuration()
dict
Response Syntax
{
'thingIndexingConfiguration': {
'thingIndexingMode': 'OFF'|'REGISTRY'|'REGISTRY_AND_SHADOW',
'thingConnectivityIndexingMode': 'OFF'|'STATUS',
'deviceDefenderIndexingMode': 'OFF'|'VIOLATIONS',
'namedShadowIndexingMode': 'OFF'|'ON',
'managedFields': [
{
'name': 'string',
'type': 'Number'|'String'|'Boolean'
},
],
'customFields': [
{
'name': 'string',
'type': 'Number'|'String'|'Boolean'
},
],
'filter': {
'namedShadowNames': [
'string',
],
'geoLocations': [
{
'name': 'string',
'order': 'LatLon'|'LonLat'
},
],
'connectivity': {
'includeSocketInformation': [
'GET_THING_CONNECTIVITY_DATA',
]
}
}
},
'thingGroupIndexingConfiguration': {
'thingGroupIndexingMode': 'OFF'|'ON',
'managedFields': [
{
'name': 'string',
'type': 'Number'|'String'|'Boolean'
},
],
'customFields': [
{
'name': 'string',
'type': 'Number'|'String'|'Boolean'
},
]
}
}
Response Structure
(dict) --
thingIndexingConfiguration (dict) --
Thing indexing configuration.
thingIndexingMode (string) --
Thing indexing mode. Valid values are:
REGISTRY – Your thing index contains registry data only.
REGISTRY_AND_SHADOW - Your thing index contains registry and shadow data.
OFF - Thing indexing is disabled.
thingConnectivityIndexingMode (string) --
Thing connectivity indexing mode. Valid values are:
STATUS – Your thing index contains connectivity status. To enable thing connectivity indexing, thingIndexMode must not be set to OFF.
OFF - Thing connectivity status indexing is disabled.
deviceDefenderIndexingMode (string) --
Device Defender indexing mode. Valid values are:
VIOLATIONS – Your thing index contains Device Defender violations. To enable Device Defender indexing, deviceDefenderIndexingMode must not be set to OFF.
OFF - Device Defender indexing is disabled.
For more information about Device Defender violations, see Device Defender Detect.
namedShadowIndexingMode (string) --
Named shadow indexing mode. Valid values are:
ON – Your thing index contains named shadow. To enable thing named shadow indexing, namedShadowIndexingMode must not be set to OFF.
OFF - Named shadow indexing is disabled.
For more information about Shadows, see IoT Device Shadow service.
managedFields (list) --
Contains fields that are indexed and whose types are already known by the Fleet Indexing service. This is an optional field. For more information, see Managed fields in the Amazon Web Services IoT Core Developer Guide.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The data type of the field.
customFields (list) --
Contains custom field names and their data type.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The data type of the field.
filter (dict) --
Provides additional selections for named shadows and geolocation data.
To add named shadows to your fleet indexing configuration, set namedShadowIndexingMode to be ON and specify your shadow names in namedShadowNames filter.
To add geolocation data to your fleet indexing configuration:
If you store geolocation data in a class/unnamed shadow, set thingIndexingMode to be REGISTRY_AND_SHADOW and specify your geolocation data in geoLocations filter.
If you store geolocation data in a named shadow, set namedShadowIndexingMode to be ON, add the shadow name in namedShadowNames filter, and specify your geolocation data in geoLocations filter. For more information, see Managing fleet indexing.
namedShadowNames (list) --
The shadow names that you select to index. The default maximum number of shadow names for indexing is 10. To increase the limit, see Amazon Web Services IoT Device Management Quotas in the Amazon Web Services General Reference.
(string) --
geoLocations (list) --
The list of geolocation targets that you select to index. The default maximum number of geolocation targets for indexing is 1. To increase the limit, see Amazon Web Services IoT Device Management Quotas in the Amazon Web Services General Reference.
(dict) --
A geolocation target that you select to index. Each geolocation target contains a name and order key-value pair that specifies the geolocation target fields.
name (string) --
The name of the geolocation target field. If the target field is part of a named shadow, you must select the named shadow using the namedShadow filter.
order (string) --
The order of the geolocation target field. This field is optional. The default value is LatLon.
connectivity (dict) --
Provides additional connectivity filter selections for the fleet indexing configuration.
includeSocketInformation (list) --
A list of fleet indexing APIs for which to enable socket information retrieval. Currently, the only supported value is GET_THING_CONNECTIVITY_DATA.
(string) --
thingGroupIndexingConfiguration (dict) --
The index configuration.
thingGroupIndexingMode (string) --
Thing group indexing mode.
managedFields (list) --
Contains fields that are indexed and whose types are already known by the Fleet Indexing service. This is an optional field. For more information, see Managed fields in the Amazon Web Services IoT Core Developer Guide.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The data type of the field.
customFields (list) --
A list of thing group fields to index. This list cannot contain any managed fields. Use the GetIndexingConfiguration API to get a list of managed fields.
Contains custom field names and their data type.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The data type of the field.
{'includeSocketInformation': 'boolean'}
Response {'cleanSession': 'boolean',
'clientId': 'string',
'disconnectReason': {'API_INITIATED_DISCONNECT'},
'keepAliveDuration': 'integer',
'sessionExpiry': 'long',
'sourceIp': 'string',
'sourcePort': 'integer',
'targetIp': 'string',
'targetPort': 'integer',
'vpcEndpointId': 'string'}
Retrieves the live connectivity status per device.
See also: AWS API Documentation
Request Syntax
client.get_thing_connectivity_data(
thingName='string',
includeSocketInformation=True|False
)
string
[REQUIRED]
The name of your IoT thing.
boolean
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.
dict
Response Syntax
{
'thingName': 'string',
'connected': True|False,
'timestamp': datetime(2015, 1, 1),
'disconnectReason': 'AUTH_ERROR'|'CLIENT_INITIATED_DISCONNECT'|'CLIENT_ERROR'|'CONNECTION_LOST'|'DUPLICATE_CLIENTID'|'FORBIDDEN_ACCESS'|'MQTT_KEEP_ALIVE_TIMEOUT'|'SERVER_ERROR'|'SERVER_INITIATED_DISCONNECT'|'API_INITIATED_DISCONNECT'|'THROTTLED'|'WEBSOCKET_TTL_EXPIRATION'|'CUSTOMAUTH_TTL_EXPIRATION'|'UNKNOWN'|'NONE',
'sourceIp': 'string',
'sourcePort': 123,
'targetIp': 'string',
'targetPort': 123,
'vpcEndpointId': 'string',
'keepAliveDuration': 123,
'cleanSession': True|False,
'sessionExpiry': 123,
'clientId': 'string'
}
Response Structure
(dict) --
thingName (string) --
The name of your IoT thing.
connected (boolean) --
A Boolean that indicates the connectivity status.
timestamp (datetime) --
The timestamp of when the event occurred. When you enable or update the indexing configuration, this value might be the Unix epoch time (0) for devices that have never connected or have been disconnected for more than an hour.
disconnectReason (string) --
The reason why the client is disconnecting. When you enable or update the indexing configuration, this value might be UNKNOWN for devices that have never connected or have been disconnected for more than an hour.
sourceIp (string) --
The IP address of the client that initiated the connection.
sourcePort (integer) --
The client's source port.
targetIp (string) --
The IP address of the Amazon Web Services IoT Core endpoint that the client connected to.
targetPort (integer) --
The port number of the Amazon Web Services IoT Core endpoint that the client connected to.
vpcEndpointId (string) --
The ID of the VPC endpoint. Present for clients connected to Amazon Web Services IoT Core via a VPC endpoint.
keepAliveDuration (integer) --
The keep-alive interval in seconds that the client specified when establishing the connection.
cleanSession (boolean) --
Indicates whether the client is using a clean session. Returns true for clean sessions.
sessionExpiry (integer) --
The session expiry interval in seconds for the MQTT client connection. This value indicates how long the session will remain active after the client disconnects.
clientId (string) --
The unique identifier of the MQTT client.
{'things': {'connectivity': {'cleanSession': 'boolean',
'clientId': 'string',
'keepAliveDuration': 'integer',
'sessionExpiry': 'long'}}}
The query search index.
Requires permission to access the SearchIndex action.
See also: AWS API Documentation
Request Syntax
client.search_index(
indexName='string',
queryString='string',
nextToken='string',
maxResults=123,
queryVersion='string'
)
string
The search index name.
string
[REQUIRED]
The search query string. For more information about the search query syntax, see Query syntax.
string
The token used to get the next set of results, or null if there are no additional results.
integer
The maximum number of results to return per page at one time. This maximum number cannot exceed 100. The response might contain fewer results but will never contain more. You can use nextToken to retrieve the next set of results until nextToken returns NULL.
string
The query version.
dict
Response Syntax
{
'nextToken': 'string',
'things': [
{
'thingName': 'string',
'thingId': 'string',
'thingTypeName': 'string',
'thingGroupNames': [
'string',
],
'attributes': {
'string': 'string'
},
'shadow': 'string',
'deviceDefender': 'string',
'connectivity': {
'connected': True|False,
'timestamp': 123,
'disconnectReason': 'string',
'keepAliveDuration': 123,
'cleanSession': True|False,
'sessionExpiry': 123,
'clientId': 'string'
}
},
],
'thingGroups': [
{
'thingGroupName': 'string',
'thingGroupId': 'string',
'thingGroupDescription': 'string',
'attributes': {
'string': 'string'
},
'parentGroupNames': [
'string',
]
},
]
}
Response Structure
(dict) --
nextToken (string) --
The token used to get the next set of results, or null if there are no additional results.
things (list) --
The things that match the search query.
(dict) --
The thing search index document.
thingName (string) --
The thing name.
thingId (string) --
The thing ID.
thingTypeName (string) --
The thing type name.
thingGroupNames (list) --
Thing group and billing group names.
(string) --
attributes (dict) --
The attributes.
(string) --
(string) --
shadow (string) --
The unnamed shadow and named shadow.
For more information about shadows, see IoT Device Shadow service.
deviceDefender (string) --
Contains Device Defender data.
For more information about Device Defender, see Device Defender.
connectivity (dict) --
Indicates whether the thing is connected to the Amazon Web Services IoT Core service.
connected (boolean) --
True if the thing is connected to the Amazon Web Services IoT Core service; false if it is not connected.
timestamp (integer) --
The epoch time (in milliseconds) when the thing last connected or disconnected. If the thing has been disconnected for approximately an hour, the time value might be missing. When you enable or update the indexing configuration, this value might be 0 (the Unix epoch time) for devices that have never connected or have been disconnected for more than an hour.
disconnectReason (string) --
The reason why the client is disconnected. When you enable or update the indexing configuration, this value might be missing for devices that have never connected or have been disconnected for more than an hour.
keepAliveDuration (integer) --
The keep-alive interval in seconds that the client specified when establishing the connection.
cleanSession (boolean) --
Indicates whether the client is using a clean session. Returns true for clean sessions.
sessionExpiry (integer) --
The session expiry interval in seconds for the MQTT client connection. This value indicates how long the session will remain active after the client disconnects.
clientId (string) --
The unique identifier of the MQTT client.
thingGroups (list) --
The thing groups that match the search query.
(dict) --
The thing group search index document.
thingGroupName (string) --
The thing group name.
thingGroupId (string) --
The thing group ID.
thingGroupDescription (string) --
The thing group description.
attributes (dict) --
The thing group attributes.
(string) --
(string) --
parentGroupNames (list) --
Parent group names.
(string) --
{'thingIndexingConfiguration': {'filter': {'connectivity': {'includeSocketInformation': ['GET_THING_CONNECTIVITY_DATA']}}}}
Updates the search configuration.
Requires permission to access the UpdateIndexingConfiguration action.
See also: AWS API Documentation
Request Syntax
client.update_indexing_configuration(
thingIndexingConfiguration={
'thingIndexingMode': 'OFF'|'REGISTRY'|'REGISTRY_AND_SHADOW',
'thingConnectivityIndexingMode': 'OFF'|'STATUS',
'deviceDefenderIndexingMode': 'OFF'|'VIOLATIONS',
'namedShadowIndexingMode': 'OFF'|'ON',
'managedFields': [
{
'name': 'string',
'type': 'Number'|'String'|'Boolean'
},
],
'customFields': [
{
'name': 'string',
'type': 'Number'|'String'|'Boolean'
},
],
'filter': {
'namedShadowNames': [
'string',
],
'geoLocations': [
{
'name': 'string',
'order': 'LatLon'|'LonLat'
},
],
'connectivity': {
'includeSocketInformation': [
'GET_THING_CONNECTIVITY_DATA',
]
}
}
},
thingGroupIndexingConfiguration={
'thingGroupIndexingMode': 'OFF'|'ON',
'managedFields': [
{
'name': 'string',
'type': 'Number'|'String'|'Boolean'
},
],
'customFields': [
{
'name': 'string',
'type': 'Number'|'String'|'Boolean'
},
]
}
)
dict
Thing indexing configuration.
thingIndexingMode (string) -- [REQUIRED]
Thing indexing mode. Valid values are:
REGISTRY – Your thing index contains registry data only.
REGISTRY_AND_SHADOW - Your thing index contains registry and shadow data.
OFF - Thing indexing is disabled.
thingConnectivityIndexingMode (string) --
Thing connectivity indexing mode. Valid values are:
STATUS – Your thing index contains connectivity status. To enable thing connectivity indexing, thingIndexMode must not be set to OFF.
OFF - Thing connectivity status indexing is disabled.
deviceDefenderIndexingMode (string) --
Device Defender indexing mode. Valid values are:
VIOLATIONS – Your thing index contains Device Defender violations. To enable Device Defender indexing, deviceDefenderIndexingMode must not be set to OFF.
OFF - Device Defender indexing is disabled.
For more information about Device Defender violations, see Device Defender Detect.
namedShadowIndexingMode (string) --
Named shadow indexing mode. Valid values are:
ON – Your thing index contains named shadow. To enable thing named shadow indexing, namedShadowIndexingMode must not be set to OFF.
OFF - Named shadow indexing is disabled.
For more information about Shadows, see IoT Device Shadow service.
managedFields (list) --
Contains fields that are indexed and whose types are already known by the Fleet Indexing service. This is an optional field. For more information, see Managed fields in the Amazon Web Services IoT Core Developer Guide.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The data type of the field.
customFields (list) --
Contains custom field names and their data type.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The data type of the field.
filter (dict) --
Provides additional selections for named shadows and geolocation data.
To add named shadows to your fleet indexing configuration, set namedShadowIndexingMode to be ON and specify your shadow names in namedShadowNames filter.
To add geolocation data to your fleet indexing configuration:
If you store geolocation data in a class/unnamed shadow, set thingIndexingMode to be REGISTRY_AND_SHADOW and specify your geolocation data in geoLocations filter.
If you store geolocation data in a named shadow, set namedShadowIndexingMode to be ON, add the shadow name in namedShadowNames filter, and specify your geolocation data in geoLocations filter. For more information, see Managing fleet indexing.
namedShadowNames (list) --
The shadow names that you select to index. The default maximum number of shadow names for indexing is 10. To increase the limit, see Amazon Web Services IoT Device Management Quotas in the Amazon Web Services General Reference.
(string) --
geoLocations (list) --
The list of geolocation targets that you select to index. The default maximum number of geolocation targets for indexing is 1. To increase the limit, see Amazon Web Services IoT Device Management Quotas in the Amazon Web Services General Reference.
(dict) --
A geolocation target that you select to index. Each geolocation target contains a name and order key-value pair that specifies the geolocation target fields.
name (string) --
The name of the geolocation target field. If the target field is part of a named shadow, you must select the named shadow using the namedShadow filter.
order (string) --
The order of the geolocation target field. This field is optional. The default value is LatLon.
connectivity (dict) --
Provides additional connectivity filter selections for the fleet indexing configuration.
includeSocketInformation (list) --
A list of fleet indexing APIs for which to enable socket information retrieval. Currently, the only supported value is GET_THING_CONNECTIVITY_DATA.
(string) --
dict
Thing group indexing configuration.
thingGroupIndexingMode (string) -- [REQUIRED]
Thing group indexing mode.
managedFields (list) --
Contains fields that are indexed and whose types are already known by the Fleet Indexing service. This is an optional field. For more information, see Managed fields in the Amazon Web Services IoT Core Developer Guide.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The data type of the field.
customFields (list) --
A list of thing group fields to index. This list cannot contain any managed fields. Use the GetIndexingConfiguration API to get a list of managed fields.
Contains custom field names and their data type.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The data type of the field.
dict
Response Syntax
{}
Response Structure
(dict) --