balena-cli/lib/models/environment-variables.coffee

21 lines
463 B
CoffeeScript
Raw Normal View History

2014-11-24 16:12:12 +00:00
Promise = require('bluebird')
canvas = require('./_canvas')
exports.getAll = (applicationId) ->
return canvas.get
resource: 'environment_variable'
options:
filter:
application: applicationId
orderby: 'name asc'
.then (environmentVariables) =>
if not environmentVariables?
return Promise.reject(new Error('Not found'))
return environmentVariables
2014-11-24 17:00:36 +00:00
exports.remove = (id) ->
return canvas.delete
resource: 'environment_variable'
id: id