From the project root:
make cli
mainflux-cli health
mainflux-cli users create <user_email> <user_password>
mainflux-cli users token <user_email> <user_password>
mainflux-cli users get <user_auth_token>
mainflux-cli users update '{"key1":"value1", "key2":"value2"}' <user_auth_token>
mainflux-cli users password <old_password> <password> <user_auth_token>
mainflux-cli things create '{"name":"myThing"}' <user_auth_token>
mainflux-cli things create '{"name":"myThing", "metadata": {\"key1\":\"value1\"}}' <user_auth_token>
mainflux-cli provision things <file> <user_auth_token>
file
- A CSV or JSON file containing thingsuser_auth_token
- A valid user auth token for the current system
mainflux-cli things update '{"id":"<thing_id>", "name":"myNewName"}' <user_auth_token>
mainflux-cli things delete <thing_id> <user_auth_token>
mainflux-cli things get all --offset=1 --limit=5 <user_auth_token>
mainflux-cli things get <thing_id> <user_auth_token>
mainflux-cli channels create '{"name":"myChannel"}' <user_auth_token>
mainflux-cli provision channels <file> <user_auth_token>
file
- A CSV or JSON file containing channelsuser_auth_token
- A valid user auth token for the current system
mainflux-cli channels update '{"id":"<channel_id>","name":"myNewName"}' <user_auth_token>
mainflux-cli channels delete <channel_id> <user_auth_token>
mainflux-cli channels get all --offset=1 --limit=5 <user_auth_token>
mainflux-cli channels get <channel_id> <user_auth_token>
mainflux-cli things connect <thing_id> <channel_id> <user_auth_token>
mainflux-cli provision connect <file> <user_auth_token>
file
- A CSV or JSON file containing thing and channel idsuser_auth_token
- A valid user auth token for the current system
An example CSV file might be
<thing_id>,<channel_id>
<thing_id>,<channel_id>
in which the first column is thing IDs and the second column is channel IDs. A connection will be created for each thing to each channel. This example would result in 4 connections being created.
A comparable JSON file would be
{
"thing_ids": [
"<thing_id>",
"<thing_id>"
],
"channel_ids": [
"<channel_id>",
"<channel_id>"
]
}
mainflux-cli things disconnect <thing_id> <channel_id> <user_auth_token>
mainflux-cli things connections <thing_id> <user_auth_token>
mainflux-cli channels connections <channel_id> <user_auth_token>
mainflux-cli messages send <channel_id> '[{"bn":"Dev1","n":"temp","v":20}, {"n":"hum","v":40}, {"bn":"Dev2", "n":"temp","v":20}, {"n":"hum","v":40}]' <thing_auth_token>
mainflux-cli messages read <channel_id> <thing_auth_token>
mainflux-cli bootstrap add '{"external_id": "myExtID", "external_key": "myExtKey", "name": "myName", "content": "myContent"}' <user_auth_token>
mainflux-cli bootstrap view <thing_id> <user_auth_token>
mainflux-cli bootstrap update '{"MFThing":"<thing_id>", "name": "newName", "content": "newContent"}' <user_auth_token>
mainflux-cli bootstrap remove <thing_id> <user_auth_token>
mainflux-cli bootstrap bootstrap <external_id> <external_key>
mainflux-cli groups create '{"name":"<group_name>","parent_id":"<parent_group_id>","description":"<description>","metadata":{"key":"value",...}}' <user_auth_token>
mainflux-cli groups delete <group_id> <user_auth_token>
mainflux-cli groups get <group_id> <user_auth_token>
mainflux-cli groups get all <user_auth_token>
mainflux-cli groups get children <parent_group_id> <user_auth_token>
mainflux-cli groups assign <user_id> <group_id> <user_auth_token>
mainflux-cli groups unassign <user_id> <group_id> <user_auth_token>
mainflux-cli groups members <group_id> <user_auth_token>
mainflux-cli groups membership <user_id> <user_auth_token>
mainflux-cli keys issue <duration> <user_auth_token>
mainflux-cli keys revoke <key_id> <user_auth_token>
mainflux-cli keys retrieve <key_id> <user_auth_token>