DemocracyOSManager.createDeployment()

Create a DemocracyOS deployment for a given user.

Usage

Hover over inputs/exits for more info.

var DemocracyOSManager = require('machinepack-democracyosmanager');


// Create a DemocracyOS deployment for a given user.

DemocracyOSManager.createDeployment({

url: 'http://manager.democracyos.com',

access_token: 'a6f743e10d6ba3001c70d0c190c71cf668093370',

name: 'mars-democracy',

title: 'Mars Democracy',

owner: '54eb6ab10eabd7d1254b1d88',

summary: 'Mars Democracy',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// Unexpected error occurred.

serverError: function () {

 

},

// When there's something wrong with the request.

badRequest: function () {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

url required

Url of Manager API.

'http://manager.democracyos.com'
access_token required

Access Token for the given Manager API.

'a6f743e10d6ba3001c70d0c190c71cf668093370'
name required

Deployment name.

'mars-democracy'
title required

Deployment Title.

'Mars Democracy'
owner required

Owner id.

'54eb6ab10eabd7d1254b1d88'
summary

Deployment long description.

'Mars Democracy'

Exits

error

An unexpected error occurred.

serverError

Unexpected error occurred.

badRequest

When there's something wrong with the request.

success

OK.

{ deployment: 
   { _id: '54f85ac65ebf6b6e180cf287',
     url: 'mars-democracy.democracyos.com',
     deis_uuid: 'bc612942-4f4e-4c2a-900b-7e6340bd91a9',
     mongo_url: 'mongodb://mars-democracy:passwordondatabase@dosmongodb.cloudapp.net:27017,dosmongodb.cloudapp.net:27018/mars-democracy',
     name: 'mars-democracy',
     title: 'Mars Democracy',
     summary: 'A long description about the implementation of democracy on Mars.',
     owner: 
      { _id: '54eb6ab10eabd7d1254b1d88',
        email: 'owner.email@democracyos.com' },
     createdAt: '2015-03-05T13:31:50.716Z' } }