Getting information about devices
To find out the unique ID or name of a device, get a list of devices in a registry.
Getting a list of devices in a registry
If you don't know the unique ID or name of the registry where your device is located, view the list of existing registries.
- In the management console
, select the folder where the registry is located. - Select IoT Core.
- Select the registry.
- Go to the Devices tab.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
View the description of the CLI command to get a list of devices:
yc iot device list --help -
Get a list of devices in the registry by specifying its name or ID:
yc iot device list --registry-name <registry_name>Result:
+----------------------+-----------+ | ID | NAME | +----------------------+-----------+ | b9135goeh1uc******** | my-device | +----------------------+-----------+
To get a list of devices in a registry, use the list REST API method for the Device resource or the DeviceService/List gRPC API call.
Getting information about a device
To access a device, use the unique ID or name of the registry from the previous step.
- In the management console
, select the folder where the device is located. - Select IoT Core.
- Select the registry where the device is located.
- Go to the Devices tab.
- Select the device.
- The Overview page will show the device details.
If you do not have the Yandex Cloud CLI installed yet, install and initialize it.
By default, the CLI uses the folder specified when creating the profile. To change the default folder, use the yc config set folder-id <folder_ID> command. You can also set a different folder for any specific command using the --folder-name or --folder-id parameter.
-
View the description of the CLI command to get information about a device:
yc iot device get --help -
Get detailed information about a device by specifying its name or ID:
yc iot device get <device_name>Result:
id: b9135goeh1uc******** registry_id: b91ki3851hab******** created_at: "2019-05-28T16:08:30.938Z" name: my-device
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the relevant documentation on the Terraform
If you do not have Terraform yet, install it and configure the Yandex Cloud provider.
To get detailed information about a device using Terraform:
-
Add the
dataandoutputsections to the Terraform configuration file:data "yandex_iot_core_device" "my_device" { device_id = "<device_ID>" } output "device_params" { value = data.yandex_iot_core_device.my_device.registry_id }Where:
data "yandex_iot_core_device": Description of the device as a data source:device_id: Device ID.
output "device_params": Output variable containing information about the registry the device belongs to:value: Returned value.
You can replace
registry_idwith any other parameter to get the information you need. For more information about theyandex_iot_core_devicedata source parameters, see the relevant provider documentation. -
Create resources:
-
In the terminal, go to the directory where you edited the configuration file.
-
Make sure the configuration file is correct using this command:
terraform validateIf the configuration is correct, you will get this message:
Success! The configuration is valid. -
Run this command:
terraform planYou will see a detailed list of resources. No changes will be made at this step. If the configuration contains any errors, Terraform will show them.
-
Apply the changes:
terraform apply -
Type
yesand press Enter to confirm the changes.
Terraform will create the required resources and display the output variable values in the terminal. To check the results, run:
terraform outputResult:
device_params = "are7ajlrf493********" -
To get detailed information about a device, use the get REST API method for the Device resource or the DeviceService/Get gRPC API call.
Device monitoring data is updated when accessing the device via gRPCS and MQTT. The quality of service (QoS) level is at most once.