Get device config.json configuration.
The intention of this module is to provide low level access to how a balena.io device config.json
file is generated.
THIS MODULE IS LOW LEVEL AND IS NOT MEANT TO BE USED BY END USERS DIRECTLY.
Install balena-device-config
by running:
$ npm install --save balena-device-config
Kind: static method of deviceConfig
Summary: Generate a basic config.json object
Returns: Object
- config.json
Access: public
Param | Type | Description |
---|---|---|
options | Object |
options |
params | Object |
user params |
Example
config = deviceConfig.generate
application:
id: 18
device_type: 'raspberry-pi'
apiKey: 'asdf'
vpnPort: 443
endpoints:
api: 'https://api.balena-cloud.com'
vpn: 'vpn.balena-cloud.com'
registry: 'registry.balena-cloud.com'
,
network: 'ethernet'
appUpdatePollInterval: 50000
console.log(config)
Example
config = deviceConfig.generate
application:
id: 18
device_type: 'raspberry-pi2'
deviceType: 'raspberrypi3'
apiKey: 'asdf'
vpnPort: 443
endpoints:
api: 'https://api.balena-cloud.com'
vpn: 'vpn.balena-cloud.com'
registry: 'registry.balena-cloud.com'
,
network: 'ethernet'
appUpdatePollInterval: 50000
console.log(config)
Kind: static method of deviceConfig
Summary: Validate a generated config.json object
Throws:
- Will throw if there is a validation error
Access: public
Param | Type | Description |
---|---|---|
config | Object |
generated config object |
Example
config = deviceConfig.generate
application:
id: 18
device_type: 'raspberry-pi'
apiKey: 'asdf'
vpnPort: 443
endpoints:
api: 'https://api.balena-cloud.com'
vpn: 'vpn.balena-cloud.com'
registry: 'registry.balena-cloud.com'
,
network: 'ethernet'
appUpdatePollInterval: 50000
deviceConfig.validate(config)
If you're having any problem, please raise an issue on GitHub and the balena.io team will be happy to help.
Run the test suite by doing:
$ gulp test
- Issue Tracker: github.com/balena-io-modules/balena-device-config/issues
- Source Code: github.com/balena-io-modules/balena-device-config
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lint
The project is licensed under the Apache 2.0 license.