Giter Site home page Giter Site logo

hono-migration's Introduction

Hono Migration Tool

Application migrates registries, devices, credentials and configs from Google's iot core to Hono.


Authentication

There are 2 methods to authenticate with the application:

  1. 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”.

  2. 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:

    1. Cloud IoT Core Service Agent
    2. Cloud IoT Viewer
    3. Cloud Trace Agent
    4. IAP-secured Web App User (for the project to which the devices should be migrated to)
    5. Pub/Sub Editor
    6. Service Controller

Running the application


To run the application, use the output/hono_migration_tool.exe file.

EXE file was created with Pylancher.


Line Args

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

Running the application examples


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 migration


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

hono-migration's People

Contributors

mattkaem avatar

Watchers

Matthias Feurer avatar Julian Hauth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.