Google Cloud IoT Core is being retired on August 16, 2023. Contact your Google Cloud account team for more information.
Method: projects.locations.registries.devices.setState
Stay organized with collections
Save and categorize content based on your preferences.
Sets the state of a device.
HTTP request
POST https://cloudiotdevice.googleapis.com/v1beta1/{name=projects/*/locations/*/registries/*/devices/*}:setState
The URL uses gRPC Transcoding syntax.
Each request must include a JWT in the header.
Path parameters
Parameters |
name |
string
The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0 .
|
Request body
The request body contains data with the following structure:
JSON representation |
{
"state": {
object(DeviceState )
}
} |
Fields |
state |
object(DeviceState )
The device state.
|
Response body
If successful, the response body will be empty.
DeviceState
The device state reported to Cloud IoT Core.
JSON representation |
{
"binaryData": string
} |
Fields |
binaryData |
string (bytes format)
Data in binary format. A base64-encoded string.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2019-03-01 UTC.
[{
"type": "thumb-down",
"id": "hardToUnderstand",
"label":"Hard to understand"
},{
"type": "thumb-down",
"id": "incorrectInformationOrSampleCode",
"label":"Incorrect information or sample code"
},{
"type": "thumb-down",
"id": "missingTheInformationSamplesINeed",
"label":"Missing the information/samples I need"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]