Docs/Apio IoT Platform/SDK and tools

Command Line Interface

Installation

Requirements:

Shell
  npm i -g @apio/cli

Configuration

To complete this tutorial you need an account.

Shell
apio account login

The default target is the platform at https://api.apio.network, but you can change it with

Shell
apio config set apiBaseUrl https://example.com

Documentation

Open the documentation

Opens the browser at the documentation page

Shell
apio docs

Accounts

Signup

Create an account

Shell
apio account create

Login

Authenticate with the platform

Shell
apio account login

Logout

Forgets authentication

Shell
apio account logout

Configuration commands

Get configuration

Prints the current configuration to the terminal

Shell
apio config get

Updates configuration

Changes a configuration value

Shell
apio config set apiBaseUrl https://api.example.com

Projects

List projects

Returns a filtered sorted and paginated list of projects.

Shell
apio projects list

Get projects by uuid

Get projects by uuid, if any matches.

Shell
apio projects get <resourceId>

Create projects

Creates projects. Body can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio projects create @resource.json --someField=someValue

Update projects

Update projects. Update can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio projects update <resourceId> @resource.json --someField=someValue

Delete projects by uuid

Delete projects by uuid.

Shell
apio projects delete <resourceId>

Devices

List devices

Returns a filtered sorted and paginated list of devices.

Shell
apio devices list

Get devices by uuid

Get devices by uuid, if any matches.

Shell
apio devices get <resourceId>

Create devices

Creates devices. Body can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio devices create @resource.json --someField=someValue

Update devices

Update devices. Update can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio devices update <resourceId> @resource.json --someField=someValue

Delete devices by uuid

Delete devices by uuid.

Shell
apio devices delete <resourceId>

Plants

List plants

Returns a filtered sorted and paginated list of plants.

Shell
apio plants list

Get plants by uuid

Get plants by uuid, if any matches.

Shell
apio plants get <resourceId>

Create plants

Creates plants. Body can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio plants create @resource.json --someField=someValue

Update plants

Update plants. Update can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio plants update <resourceId> @resource.json --someField=someValue

Delete plants by uuid

Delete plants by uuid.

Shell
apio plants delete <resourceId>

Nodes

List nodes

Returns a filtered sorted and paginated list of nodes.

Shell
apio nodes list

Get nodes by uuid

Get nodes by uuid, if any matches.

Shell
apio nodes get <resourceId>

Create nodes

Creates nodes. Body can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio nodes create @resource.json --someField=someValue

Update nodes

Update nodes. Update can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio nodes update <resourceId> @resource.json --someField=someValue

Delete nodes by uuid

Delete nodes by uuid.

Shell
apio nodes delete <resourceId>

API keys

List apikeys

Returns a filtered sorted and paginated list of apikeys.

Shell
apio apikeys list

Get apikeys by uuid

Get apikeys by uuid, if any matches.

Shell
apio apikeys get <resourceId>

Create apikeys

Creates apikeys. Body can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio apikeys create @resource.json --someField=someValue

Update apikeys

Update apikeys. Update can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio apikeys update <resourceId> @resource.json --someField=someValue

Delete apikeys by uuid

Delete apikeys by uuid.

Shell
apio apikeys delete <resourceId>

Roles

List roles

Returns a filtered sorted and paginated list of roles.

Shell
apio roles list

Get roles by uuid

Get roles by uuid, if any matches.

Shell
apio roles get <resourceId>

Create roles

Creates roles. Body can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio roles create @resource.json --someField=someValue

Update roles

Update roles. Update can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio roles update <resourceId> @resource.json --someField=someValue

Delete roles by uuid

Delete roles by uuid.

Shell
apio roles delete <resourceId>

ACL rules

List aclrules

Returns a filtered sorted and paginated list of aclrules.

Shell
apio aclrules list

Get aclrules by uuid

Get aclrules by uuid, if any matches.

Shell
apio aclrules get <resourceId>

Create aclrules

Creates aclrules. Body can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio aclrules create @resource.json --someField=someValue

Update aclrules

Update aclrules. Update can be passed from a JSON file specifying it as @path.json or by passing fields as —field=value

Shell
apio aclrules update <resourceId> @resource.json --someField=someValue

Delete aclrules by uuid

Delete aclrules by uuid.

Shell
apio aclrules delete <resourceId>

Type to search guides and API endpoints.