Getting information about registries
To find out the unique ID or name of a registry, get a list of registries in a folder.
Getting a list of registries in a folder
- In the management console
, select the folder where you want to get a list of registries. - Select IoT Core.
- The Registries page will show the list of registries.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View the description of the CLI command to get a list of registries:
yc iot registry list --help
-
Get a list of registries in the default folder:
yc iot registry list
Result:
+----------------------+-------------+ | ID | NAME | +----------------------+-------------+ | b91ki3851hab******** | my-registry | +----------------------+-------------+
To get a list of registries, use the list REST API method for the Registry resource or the RegistryService/List gRPC API call.
Getting detailed information about a registry
To access a registry, use the unique ID or name of the registry from the previous step.
- In the management console
, select the folder where the registry is located. - Select IoT Core.
- Select the registry.
- The Overview page will show the registry details.
If you do not have the Yandex Cloud command line interface yet, install and initialize it.
The folder specified in the CLI profile is used by default. You can specify a different folder using the --folder-name
or --folder-id
parameter.
-
View the description of the CLI command to get information about the registry:
yc iot registry get --help
-
Get detailed information about the registry by specifying its name or ID:
yc iot registry get <registry_name>
Result:
id: b91ki3851hab******** folder_id: aoek49ghmknn******** created_at: "2019-05-28T11:29:42.420Z" name: my-registry
With Terraform
Terraform is distributed under the Business Source License
For more information about the provider resources, see the documentation on the Terraform
If you don't have Terraform, install it and configure the Yandex Cloud provider.
To get detailed information about a registry using Terraform:
-
Add the
data
andoutput
sections to the Terraform configuration file:data "yandex_iot_core_registry" "my_registry" { registry_id = "<registry_ID>" } output "registry_params" { value = data.yandex_iot_core_registry.my_registry.created_at }
Where:
data "yandex_iot_core_registry"
: Description of the registry as a data source:registry_id
: Registry ID.
output "registry_params"
: Output variable that contains information about the registry creation timestamp:value
: Returned value.
You can replace
created_at
with any other parameter to get the information you need. For more information about theyandex_iot_core_registry
data source parameters, see the relevant provider documentation . -
Create resources:
-
In the terminal, change to the folder where you edited the configuration file.
-
Make sure the configuration file is correct using the command:
terraform validate
If the configuration is correct, the following message is returned:
Success! The configuration is valid.
-
Run the command:
terraform plan
The terminal will display a list of resources with parameters. No changes are made at this step. If the configuration contains errors, Terraform will point them out.
-
Apply the configuration changes:
terraform apply
-
Confirm the changes: type
yes
in the terminal and press Enter.
Terraform will create the required resources and display the output variable values in the terminal. To check the results, run:
terraform output
Result:
registry_params = "2024-05-08T06:40:52Z"
-
To get detailed information about a registry, use the get REST API method for the Registry resource or the RegistryService/Get gRPC API call.