balena-cli/lib/models/environment-variables.coffee
2014-11-24 13:00:36 -04:00

21 lines
463 B
CoffeeScript

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
exports.remove = (id) ->
return canvas.delete
resource: 'environment_variable'
id: id