node-deis
Manage Deis from your Node apps.
npm install node-deis --save
Create your client first of all.
var NodeDeis = require('./index');
var client = new NodeDeis({
controller : 'deis.yourdomain.com',
secure : true,
version : 1,
username : 'awesome_user',
password : 'sup3r5str3ng7h!1!1',
appname : 'myAwesomeDeisApp'
});
All of the properties that aren't marked optional will throw an error if they are missing.
Once you have a client you can connect and start managing your Deis apps right from Node.
client.connect(function(err) {
assert.equal(err, null, 'Bad login details');
});
Once you have connected you will be able to run any of the below commands (provided you have access)
rights to perform the below.
NodeDeis.addDomain(String domain, Function callback);
Create a new domain for the application in the client configuration and fire the callback once
it has completed with an error (if any).
NodeDeis.addDomain('node-deis-test.yourdomain.com', function(err) {
assert.equal(err, null, 'Something bad happened.');
});
NodeDeis.removeDomain(String domain, Function callback);
Remove a domain from the application in the client configuration and fire the callback once
it has completed with an error (if any).
NodeDeis.removeDomain('node-deis-test.yourdomain.com', function(err) {
assert.equal(err, null, 'Something bad happened.');
});
NodeDeis.getAllDomains(Function callback);
Get all the domains for this application.
NodeDeis.getAllDomains(function(err, data) {
assert.equal(err, null, 'Something bad happened.');
});
NodeDeis.getDomain(String domain, Function callback);
Get a specific domain for this application.
NodeDeis.getDomain('node-deis-test.yourdomain.com', function(err, domain) {
assert.equal(err, null, 'Something bad happened.');
});
Things still to do
Create api for