Application migrates registries, devices, credentials and configs from Google's iot core to Hono.
There are 2 methods to authenticate with the application:
-
Running application on Google Cloud.
If you’re running in a Google Virtual Machine Environment (Compute Engine, App Engine, Cloud Run, Cloud Functions), authentication should “just work”.
-
Using Service Account json key.
If you’re running your application elsewhere, you should download a service account JSON keyfile and point to it using an environment variable:
$ export GOOGLE_APPLICATION_CREDENTIALS="/path/to/keyfile.json"or use the --key argument to pass the key path to the service account.
Account should have the roles:
- Cloud IoT Core Service Agent
- Cloud IoT Viewer
- Cloud Trace Agent
- IAP-secured Web App User (for the project to which the devices should be migrated to)
- Pub/Sub Editor
- Service Controller
To run the application, use the output/hono_migration_tool.exe file.
EXE file was created with Pylancher.
| Line Args | Mandatory | Description |
|---|---|---|
| -p, --project |
Yes | Google Cloud Project ID (migration source) |
| -k, --key |
Yes | Service Account Json Key path |
| -u, --api |
Yes | Hono device registry api url (migration target), example https://my_hono_api/v1 |
| -a, --audience |
Yes | Target audience (OAuth 2.0 Client), example 837927849228-js9djh3li9shfut7hfbcjjapsjf8d86s.apps.googleusercontent.com |
| -t, --tenant | Yes | The Hono tenant ID |
| -reg, --registry | Yes | The Google IoT Core registry to migrate |
| -r, --region |
No | Google Cloud Region (migration source). Valid regions are: {asia-east1,europe-west1,us-central1} Default is europe-west1 |
| --migrate_gateways | No | Boolean flag indicating whether to migrate gateways or not |
EXE file:
hono_migration_tool.exe
--project my-project
--api https://my_hono_api/v1
--region europe-west1
--tenant test-1
--registry hono-registry-1
--audience 837927849228-js9djh3li9shfut7hfbcjjapsjf8d86s.apps.googleusercontent.com --key .\hono-cloud-endpoint-manager.json
Python file:
python.exe app.py
--project my-project
--api https://my_hono_api/v1
--region europe-west1
--tenant test-1
--registry hono-registry-1
--audience 837927849228-js9djh3li9shfut7hfbcjjapsjf8d86s.apps.googleusercontent.com --key .\hono-cloud-endpoint-manager.json
Gateways from IoT Core will be migrated as devices to Hono. To migrate gateways args flag --migrate_gateways should be set.
example:
python.exe app.py
--project my-project
--api https://my_hono_api/v1
--region europe-west1
--audience 837927849228-js9djh3li9shfut7hfbcjjapsjf8d86s.apps.googleusercontent.com --key .\hono-cloud-endpoint-manager.json
--migrate_gateways