2019/11/13 - AWS IoT - 2 new 3 updated api methods
Changes This release adds the custom fields definition support in the index definition for AWS IoT Fleet Indexing Service. Custom fields can be used as an aggregation field to run aggregations with both existing GetStatistics API and newly added GetCardinality, GetPercentiles APIs. GetStatistics will return all statistics (min/max/sum/avg/count...) with this release. For more information, please refer to our latest documentation: https://docs.aws.amazon.com/iot/latest/developerguide/iot-indexing.html
Returns the percentile values for the aggregation field. The results from GetPercentiles is an approximation. The default percentile groupings are: 1,5,25,50,75,95,99. You can specify custom percentile grouping using the percents argument to the GetPercentiles API.
See also: AWS API Documentation
Request Syntax
client.get_percentiles( indexName='string', queryString='string', aggregationField='string', queryVersion='string', percents=[ 123.0, ] )
string
The name of the index to search.
string
[REQUIRED]
The query string.
string
The field to aggregate.
string
The query version.
list
The percentile groups returned.
(float) --
dict
Response Syntax
{ 'percentiles': [ { 'percent': 123.0, 'value': 123.0 }, ] }
Response Structure
(dict) --
percentiles (list) --
The percentile values of the aggregated fields.
(dict) --
Describes the percentile and percentile value.
percent (float) --
The percentile.
value (float) --
The value.
Returns the number of things with distinct values for the aggregation field.
See also: AWS API Documentation
Request Syntax
client.get_cardinality( indexName='string', queryString='string', aggregationField='string', queryVersion='string' )
string
The name of the index to search.
string
[REQUIRED]
The search query.
string
The field to aggregate.
string
The query version.
dict
Response Syntax
{ 'cardinality': 123 }
Response Structure
(dict) --
cardinality (integer) --
The number of things that match the query.
{'thingGroupIndexingConfiguration': {'customFields': [{'name': 'string', 'type': 'Number | ' 'String | ' 'Boolean'}], 'managedFields': [{'name': 'string', 'type': 'Number | ' 'String | ' 'Boolean'}]}, 'thingIndexingConfiguration': {'customFields': [{'name': 'string', 'type': 'Number | String | ' 'Boolean'}], 'managedFields': [{'name': 'string', 'type': 'Number | String | ' 'Boolean'}]}}
Gets the search configuration.
See also: AWS API Documentation
Request Syntax
client.get_indexing_configuration()
dict
Response Syntax
{ 'thingIndexingConfiguration': { 'thingIndexingMode': 'OFF'|'REGISTRY'|'REGISTRY_AND_SHADOW', 'thingConnectivityIndexingMode': 'OFF'|'STATUS', 'managedFields': [ { 'name': 'string', 'type': 'Number'|'String'|'Boolean' }, ], 'customFields': [ { 'name': 'string', 'type': 'Number'|'String'|'Boolean' }, ] }, '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.
managedFields (list) --
Contains fields that are indexed and whose types are already known by the Fleet Indexing service.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The datatype 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 datatype of the field.
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.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The datatype 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 datatype of the field.
{'statistics': {'average': 'double', 'maximum': 'double', 'minimum': 'double', 'stdDeviation': 'double', 'sum': 'double', 'sumOfSquares': 'double', 'variance': 'double'}}
Gets statistics returns the count, average, sum, minimum, maximum, sumOfSquares, variance, and standard deviation for the specified aggregated field. If the aggregation field is of type String, only the count statistic is returned.
See also: AWS API Documentation
Request Syntax
client.get_statistics( indexName='string', queryString='string', aggregationField='string', queryVersion='string' )
string
The name of the index to search. The default value is AWS_Things .
string
[REQUIRED]
The query used to search. You can specify "*" for the query string to get the count of all indexed things in your AWS account.
string
The aggregation field name.
string
The version of the query used to search.
dict
Response Syntax
{ 'statistics': { 'count': 123, 'average': 123.0, 'sum': 123.0, 'minimum': 123.0, 'maximum': 123.0, 'sumOfSquares': 123.0, 'variance': 123.0, 'stdDeviation': 123.0 } }
Response Structure
(dict) --
statistics (dict) --
The statistics returned by the Fleet Indexing service based on the query and aggregation field.
count (integer) --
The count of things that match the query.
average (float) --
The average of the aggregated field values.
sum (float) --
The sum of the aggregated field values.
minimum (float) --
The minimum aggregated field value.
maximum (float) --
The maximum aggregated field value.
sumOfSquares (float) --
The sum of the squares of the aggregated field values.
variance (float) --
The variance of the aggregated field values.
stdDeviation (float) --
The standard deviation of the aggregated field valuesl
{'thingGroupIndexingConfiguration': {'customFields': [{'name': 'string', 'type': 'Number | ' 'String | ' 'Boolean'}], 'managedFields': [{'name': 'string', 'type': 'Number | ' 'String | ' 'Boolean'}]}, 'thingIndexingConfiguration': {'customFields': [{'name': 'string', 'type': 'Number | String | ' 'Boolean'}], 'managedFields': [{'name': 'string', 'type': 'Number | String | ' 'Boolean'}]}}
Updates the search configuration.
See also: AWS API Documentation
Request Syntax
client.update_indexing_configuration( thingIndexingConfiguration={ 'thingIndexingMode': 'OFF'|'REGISTRY'|'REGISTRY_AND_SHADOW', 'thingConnectivityIndexingMode': 'OFF'|'STATUS', 'managedFields': [ { 'name': 'string', 'type': 'Number'|'String'|'Boolean' }, ], 'customFields': [ { 'name': 'string', 'type': 'Number'|'String'|'Boolean' }, ] }, 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.
managedFields (list) --
Contains fields that are indexed and whose types are already known by the Fleet Indexing service.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The datatype 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 datatype of the field.
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.
(dict) --
Describes the name and data type at a field.
name (string) --
The name of the field.
type (string) --
The datatype 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 datatype of the field.
dict
Response Syntax
{}
Response Structure
(dict) --