Module balenaSDK helpers

balenaSDK helpers

The BalenaSDK class contains an instance of the balena sdk, as well as some helper methods to interact with a device via the cloud. The balena attribute of the class contains the sdk,and can be used as follows in a test suite:

const Cloud = this.require("components/balena/sdk");

this.suite.context.set({
cloud: new Balena("https://api.balena-cloud.com/", this.getLogger())
});

// login
await this.context
.get()
.cloud.balena.auth.loginWithToken(this.suite.options.balena.apiKey);

// create a balena application
await this.context.get().cloud.balena.models.application.create({
name: `NAME`,
deviceType: `DEVICE_TYPE`,
organization: `ORG`,
});

Index

Classes