Giter Club home page Giter Club logo

iobeam Command-line Interface

iobeam is a data platform for connected devices.

This is a Command-line Interface (CLI) for the iobeam API. For more information on the iobeam API, please read our full API documentation.

Please note that we are currently invite-only. You will need an invite to generate a valid token and use our APIs. (Want an invite? Sign up here.)

Installation

Included with each release are binary executables for OSX (darwin), Linux, and Windows. This is the easiest way to use the CLI: simply download the one that corresponds to your platform, rename it iobeam, and make sure it is executable.

For OSX users, it is also available via Homebrew:

$ brew tap iobeam/tap
$ brew install iobeam

Building and installing from source

You'll need to install Go (e.g., brew install go on Mac OSX). Make sure your GOPATH is set (e.g., export GOPATH=~/go). We recommend using the latest version of Go, but at least version 1.4.3. Older versions may have problems.

Then,

$ go get github.com/iobeam/iobeam

Getting Started

On first run, a dot directory, .iobeam, is created in your home directory to store state such as user and project tokens which authenticate you to the iobeam cloud.

Creating your first project and device

# Register as a new user, this will automatically log you in.
$ iobeam user create -email="<email>" -password="<password>" -invite="<invite_code>"

# Optionally, if you have an account already, you can just login.
# You will be prompted for your credentials
$ iobeam user login

# Create a new project. Project name must be globally unique.
# You will be given a project ID (keep track of it), and a
# project token will be stored.
$ iobeam project create -name="<project_name>"

# Create a new device. (Keep track of the device_id that the API returns.)
$ iobeam device create -projectId=<project_id>

Sending data

You can send single data row via the CLI. Timestamps are expressed as milliseconds since epoch.

# Send data row with temperature=72 and humidity=54 with the current time
$ iobeam import -fields=temperature,humidity -values=72,54 -labels device_id=<deviceId>

# Send data row for time 1429718512829 (epoch time).
$ iobeam import -fields=temperature,humidity -values=72,54 -labels device_id=<deviceId> \
    -time=1429718512829

# Optionally, you can specify the -projectId  (defaults to current project)
$ iobeam import -projectId <projectId> -labels device_id=<deviceId> \
    -fields=temperature,humidity -values=72,54 

You can also refer to our Imports API.

Querying data

Note: All of these commands require that you first create a valid project token with read access. This will be created when you create the project, however if this does not work for some reason, see the next section.

# Query the last 10 data rows for a project
$ iobeam query -projectId=<project_id>

# You can also leave off -projectId, which will use the projectId of the
# last project you got a token for. 
# The limit on the number of rows can be changed from its default of 10
$ iobeam query -limit 1000

# Query the last 10 data rows for a given device
$ iobeam query -where "eq(device_id,<device_id>)" 

# Query the last row for each device (up to 1000 total rows)
$ iobeam query -limitBy "device_id,1" -limit 1000

# Query a specific data field under a given project and device
$ iobeam query -where "eq(device_id,<device_id>)" -field="<field_name>"

# Query the last 1000 data rows over the last day 
$ iobeam query -last="1d" -limit 1000

The REST API also supports richer queries with operators (e.g., mean, min, max), date / value ranges, time-series rollups, and more. Please refer to our Exports API for more information.

Creating additional project tokens

When you create a project, the token you are given has admin privileges, which you will not want to distribute with devices going to third parties. Instead, you can generate a new token that allows you to upload data (i.e. has write permissions) but not admin permissions.

# Generating a read/write only token
$ iobeam project token -id=<project_id> -read=true -write=true -admin=false

# Generating a write only token
$ iobeam project token -id=<project_id> -read=false -write=true -admin=false

iobeam's Projects

aglio icon aglio

An API Blueprint renderer with theme support that outputs static HTML

arduino icon arduino

open-source electronics prototyping platform

coreos-kubernetes icon coreos-kubernetes

Cloud init and Fleet files for installing and running Kubernetes on CoreOS.

go-kafka-avro icon go-kafka-avro

go-kafka-avro implements Avro encoding and decoding compatible with Confluent Schema Registry.

hdfs icon hdfs

A native go client for HDFS

iobeam icon iobeam

Command-line interface for iobeam API

kubernetes-contrib icon kubernetes-contrib

This is a place for various components in the Kubernetes ecosystem that aren't part of the Kubernetes core.

plottable icon plottable

A library of modular chart components, built on D3

postgresql-async icon postgresql-async

Async, Netty based, database drivers for PostgreSQL and MySQL written in Scala

sarama icon sarama

Sarama is a Go library for Apache Kafka 0.8 and 0.9

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.