0

I need some help with the Google IoT Core API for Python...

For now I'm able to create and delete a registry as needed but, I need to also edit the registry to add more topics to it.

I researched a lot the documentation but no luck, maybe someone here have a similar issue or request? I need to be able to add Topics to a existent registry with active devices in it (no delete and re-creation possible?)

Any help is Greatly appretiated

EDIT: I found this reference: Link to API Reference

But I cant issue the command correctly :( a example could be usefull

Juan Quintero
  • 53
  • 1
  • 10
  • Can you clarify what you mean by topics? Do you mean to change the PubSub topic associated with the registry for events? – class May 01 '19 at 17:34
  • Yes! there is 9 slots for topics (plus the default) on each register, I just want to add more topics associated to a existing register, for now i found if I use "patch(name=''regname", body=body)" i can get the registry to update but there seems some troubles with the command i cant seem to find out how to issue the command properly :( – Juan Quintero May 01 '19 at 18:02
  • 1
    Just to clarify I can create a registry with a given # of Pub/Sub topics but I need to edit this to add or delete such topics, my issue is with the "patch" function of the API I cant figure out how to issue the command correctly or even if is the proper way to do it to update the IoT Core Registry.... – Juan Quintero May 06 '19 at 14:07

1 Answers1

0

You may use the google SDK to edit the registry and wrap the Shell command in a python script that format the topics, the proyect name, etc... the shell comand has this sctructure:

gcloud iot devices update {DEVICE_ID}
  --project={PROJECT_ID} 
  --region={REGION} 
  --registry={REGISTRY_ID} 

For more information of the shell comand check the documentation: google registry docs