Coder Social home page Coder Social logo

hot's Introduction

HoT – Hono Test GitHub release

This is a simple command line tool for testing Eclipse Hono™.

Authentication

Username and password

You can set the username and password for all operations using the --username and --password parameters.

When publishing data the username is normally a combination of <auth-id>@<tenant>. As you are already providing the tenant, you can use the --auth-id parameter instead, which will internally generate the correct user name, by adding the tenant suffix.

--auth-id,-a
The username to use for authenticating with the backend.
--username,-u
The full username to use for authenticating with the backend.
--password,-p
The password to use for authenticating with the backend.

Assuming you have a tenant foo and an authentication id of auth1, then you can use either:

--username auth1@foo

Or:

--auth-id auth1

X.509 client certificates

It is possible to use X.509 client certificates, instead of username/password authentication. For this you can use the parameters:

--client-key
The path to an X.509 PKCS#8 encoded private key
--client-cert
The path to an file containing a PEM encoded client certificate chain

Start a test consumer

Fill in your connection information, and then execute the following command:

hot consume amqps://my.server:443 tenant

Or:

hot consume amqps://username@password:my.server:443 tenant

You can use the following flags:

--disable-tls
Disable TLS negotiation on the AMQP connection
--insecure
Set to true to enable Insecure TLS connection
--cert
Path to the certificate bundle in PEM format (overrides system CA certs)

Telemetry & event

Running consume will consume both telemetry and event messages and output them on the console.

Command & control

You can enable command and control handling, by using the switch -c, --command. You can pass an optional value to the switch, which is the command name, TEST is being used by default.

When this feature is enabled and a message containing the ttd property is received, it will try to get the next command, and forward it to the device.

The source of the command can be specified with the -r,--reader argument. The following readers are available:

  • ondemand – When a command is required, it will show a prompt on the console, which can read the command payload. When the command requests times out, the prompt will get canceled.
  • prefill – A prompt on the console allows putting in the command payload for the next command request.
  • static:<payload> – Everything after the prefix static: will be used as the command payload. No interactive prompt is being presented.

Publish an HTTP message

Fill in your connection information, and then execute the following command:

hot publish http telemety https://my.server tenant device payload --username auth --password password

The following additional flags are supported:

--qos
Set the "Quality of Service". Defaults to 0.
--ttd
Set the "time till disconnect", the amount of seconds the HTTP call will wait for a command to the device

Publish an MQTT message

Fill in your connection information, and then execute the following command:

hot publish mqtt telemety ssl://my.server tenant device payload

The following additional flags are supported:

--qos
Set the "Quality of Service". Defaults to 0.
--ttd
Set the "time till disconnect", the amount of seconds the MQTT call will wait for a command to the device

Building

Building requires Go 1.13.x. You can build the binary by executing:

GO111MODULE=on go build -o hot ./cmd

hot's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

astoycos

hot's Issues

Align TLS options with URLs

Currently we have the problem that you can specify a TLS based endpoint (e.g. amqps vs amqp), which would also enable TLS internally. However, if you want to specify a custom TLS certificate, you need to add -T and -P. Only adding -P doesn't work.

I think when using a TLS based endpoint (same for mqtt and http), then -P or --insecure should be sufficient for configuring TLS.

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.