amenzhinsky / iothub

Azure IoT Hub SDK for Golang
MIT License
51 stars 57 forks source link

Possible to register a new device? #1

Closed jonathanface closed 5 years ago

jonathanface commented 5 years ago

Is this possible to do in code, and if so are there plans to add this feature?

I am trying to avoid having to manually register every IOT device with azure.

amenzhinsky commented 5 years ago

Hi @jonathanface , sorry for the late response.

Sure https://godoc.org/github.com/goautomotive/iothub/iotservice#Client.CreateDevice, unortunately the lib is not well documented because it's relatively new.

Have a look how iothub-service uses it: https://github.com/goautomotive/iothub/blob/8d09ac322ab93e37ed7f9b92baf62ac3e1335e3a/cmd/iothub-service/main.go#L268

Closing this for now, if you're having any problems feel free to create a new issue.