In the google iot core documentation it shows us how to collect the metadata of a device registered in a registry
https://cloud.google.com/iot/docs/how-tos/devices?hl