Table of Contents
A low-level client to interact locally with the AWS Greengrass Core in order to publish messages and use the local shadow service. This low-level client possesses the same interface as the one used in boto3 to interact with AWS IoT.
import greengrasssdk
client = greengrasssdk.client('iot-data')
These are the available methods:
Gets the thing shadow for the specified thing.
For more information, see GetThingShadow in the AWS IoT Developer Guide .
Request Syntax
response = client.get_thing_shadow(
thingName='string'
)
[REQUIRED]
The name of the thing.
{
'payload': StreamingBody()
}
Response Structure
The output from the GetThingShadow operation.
The state information, in JSON format.
Publishes state information.
For more information, see HTTP Protocol in the AWS IoT Developer Guide .
Request Syntax
response = client.publish(
topic='string',
payload=b'bytes'|file
)
[REQUIRED]
The name of the MQTT topic.
None
Updates the thing shadow for the specified thing.
For more information, see UpdateThingShadow in the AWS IoT Developer Guide .
Request Syntax
response = client.update_thing_shadow(
thingName='string',
payload=b'bytes'|file
)
[REQUIRED]
The name of the thing.
[REQUIRED]
The state information, in JSON format.
dict
Response Syntax
{
'payload': StreamingBody()
}
Response Structure
(dict) --
The output from the UpdateThingShadow operation.
payload (StreamingBody) --
The state information, in JSON format.