provision

package
v0.0.0-...-97327ab Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

README

Mainflux Things and Channels Provisioning Tool

A simple utility to create a list of channels and things connected to these channels with possibility to create certificates for mTLS use case.

This tool is usefule for testing, and it creates a TOML format output (on stdout, can be redirected into the file of needed) that can be used by Mainflux MQTT benchmarking tool (mqtt-bench).

Usage
./provision --help
Tool for provisioning series of Mainflux channels and things and connecting them together.
Complete documentation is available at https://mainflux.readthedocs.io

Usage:
  provision [flags]

Flags:
      --ca string         CA for creating and signing things certificate (default "ca.crt")
      --cakey string      ca.key for creating and signing things certificate (default "ca.key")
  -h, --help              help for provision
      --host string       address for mainflux instance (default "https://localhost")
      --num int           number of channels and things to create and connect (default 10)
  -p, --password string   mainflux users password
      --ssl               create certificates for mTLS access
  -u, --username string   mainflux user

Example:

./provision -u mirkot@mainflux.com -p test1234 --host https://142.93.118.47

If you want to create a list of channels with certificates:

./provision --host http://localhost --num 10 -u test@mainflux.com -p test1234 --ssl true --ca ../../docker/ssl/certs/ca.crt --cakey ../../docker/ssl/certs/ca.key

ca.crt and ca.key are used for creating things certificate and for HTTPS, if you are provisioning on remote server you will have to get these files to your local

Example of output:

[[mainflux]]
  ChannelID = "42053920-439a-461f-bd81-dece1ef06089"
  ThingID = "49f3c38c-400e-4171-a954-24850150124b"
  ThingKey = "835d74ab-7232-49b7-bc6d-a1ca97c6eecc"
  MTLSCert = "-----BEGIN CERTIFICATE-----\nMIIFmDCCA4CgAwIBAgIQVvvHUH9XPYMGF2F/YzfxFzANBgkqhkiG9w0BAQsFADBX\nMRIwEAYDVQQDDAlsb2NhbGhvc3QxETAPBgNVBAoMCE1haW5mbHV4MQwwCgYDVQQL\nDANJb1QxIDAeBgkqhkiG9w0BCQEWEWluZm9AbWFpbmZsdXguY29tMB4XDTE5MDgw\nNzIwMzU0NVoXDTE5MDgwNzIwMzU0NVowVTERMA8GA1UEChMITWFpbmZsd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AAHA9KQWW0IKJuqSg6PbETQQwy+GcxNNCis7yvwTftYN0E+hQI53R7Wh\n6IlP7rBUpJLkG6xBPGQkMKMvyuiSXUPTr7XbjRGsxOp0BrquXvtHCm8nExvpANRt\nH/zT9DlrWbfECc6c8jnfsVKAbyZLD8L4vIpcstFNJ+6Wmv3FoMa9Nv8BUh19UehB\nuMMDv2Gp8wOcTEnxlHs0MPPrkyBJJzqESA/Dt3BYrc6czYk4WSUQbgOdlkjDKnnZ\nXUfsmWWXnQdcqZTlVM1I7Uu6wMmpI//+GrwD6F+8z2I8g9+5rBh2Mq4Hsdbc1DFf\nKF+V6sU8lB1Ec/rVau3aA8n3+93JIG0CggEAHr1uvR5gYaSA/VvfJ45+Hiyyt/M4\nxygofEDIGHrqzLcJ/2m7HYhO5yGZYaOR1zLt7xM/Rd0f90PFc6KF4yyAhZoa2UXG\nK7xkWvQqDpHLQcsdyeb6WuseGtffhvWnRadOfy6rRA47yxIJRhJpcHrljzZc8uQh\n/vy0G98tOrtMYVitFm9bie9K2GlmRmLLfPU34oB7w8be2yFspHMOJOXfRBTJBNNx\nIV95wi4WhzjnG+F7EKiLUuDZb7ON5GhfBl/kXdJH5kMjtKxODs74/1dyAy3eyLjt\no5KRlqupWzpQm60Dz8GjySkZ6PAtqPxhHUT93TcM/8g4QGCFvCSIoybb3w==
  -----END RSA PRIVATE KEY-----"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provision

func Provision(conf Config)

Provision - function that does actual provisiong

Types

type Config

type Config struct {
	Host     string
	Username string
	Password string
	Num      int
	SSL      bool
	CA       string
	CAKey    string
	Prefix   string
}

Config - provisioning configuration

type MfConn

type MfConn struct {
	ChannelID string
	ThingID   string
	ThingKey  string
	MTLSCert  string
	MTLSKey   string
}

MfConn - structure describing Mainflux connection set

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL