imp-build-api-v4

1.0.1 • Public • Published

Build Status

Electric Imp Build API v4 Client

Node.js client for Build API v4.

This package deprecates https://www.npmjs.com/package/imp-api.

Installation

npm i -g imp-build-api-v4

Node.js 4.0+ is required.

Reference

BuildAPIClient:

.apiKey

(property)

string

Gets/sets Build API key.

.debug

(property)

boolean

Enables/disables debug output.

.listDevices()

.listDevices([name], [deviceId], [modelId])

{Promise}

.getDevice()

.getDevice(deviceId)

.updateDevice()

.updateDevice(deviceId, [name], [modelId])

.restartDevice()

.restartDevice(deviceId)

.listModels()

.listModels([name])

.createModel()

.createModel(name)

.deleteModel()

.deleteModel(modelId)

.getModel()

.getModel(modelId)

.updateModel()

.updateModel(modelId, [name])

.restartModel()

.restartModel(modelId)

.listRevisions()

.listRevisions(modelId, [since], [until], [buildMin], [buildMax])

.createRevision()

.createRevision(modelId, [deviceCode], [agentCode], [releaseNotes])

.getRevision()

.getRevision(modelId, buildNumber)

.getDeviceLogs()

.getDeviceLogs(deviceId, [since])

.streamDeviceLogs()

.streamDeviceLogs(deviceId, callback)

Example

const BuildAPIClient = require('imp-build-api-v4');
 
let client = new BuildAPIClient();
client.apiKey = '<your Build API key>';
 
// print list of devices
client.listDevices()
  .then((res) => {
    console.log('Devices:', res.devices);
  })
  .catch(console.error);

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i imp-build-api-v4

Weekly Downloads

3

Version

1.0.1

License

MIT

Last publish

Collaborators

  • mym___