lib/pkgcloud/rackspace/loadbalancer/client/nodes.js
function(loadBalancer, nodes, callback) {
    var self = this,
        loadBalancerId =
          loadBalancer instanceof lb.LoadBalancer ? loadBalancer.id : loadBalancer;

    if (!Array.isArray(nodes)) {
      nodes = [ nodes ];
    }

    var postOptions = {
      path: urlJoin(_urlPrefix, loadBalancerId, 'nodes'),
      method: 'POST',
      body: { nodes: [] }
    };

    postOptions.body.nodes = _.map(nodes, function(node) {
      return _.pick(node, ['address', 'port', 'condition', 'type', 'weight']);
    });

    self._request(postOptions, function (err, body, res) {
      if (err) {
        return callback(err);
      }

      else if (!body || !body.nodes) {
        return callback(new Error('Unexpected empty response'));
      }

      else {
        return callback(null, body.nodes.map(function (node) {
          return new lb.Node(self,
            _.extend(node, { loadBalancerId: loadBalancerId }));
        }), res);
      }
    });
  }
function(loadBalancer, nodes, callback) {
    var self = this,
        loadBalancerId =
          loadBalancer instanceof lb.LoadBalancer ? loadBalancer.id : loadBalancer;

    if (!Array.isArray(nodes)) {
      nodes = [ nodes ];
    }

    var postOptions = {
      path: urlJoin(_urlPrefix, loadBalancerId, 'nodes'),
      method: 'POST',
      body: { nodes: [] }
    };

    postOptions.body.nodes = _.map(nodes, function(node) {
      return _.pick(node, ['address', 'port', 'condition', 'type', 'weight']);
    });

    self._request(postOptions, function (err, body, res) {
      if (err) {
        return callback(err);
      }

      else if (!body || !body.nodes) {
        return callback(new Error('Unexpected empty response'));
      }

      else {
        return callback(null, body.nodes.map(function (node) {
          return new lb.Node(self,
            _.extend(node, { loadBalancerId: loadBalancerId }));
        }), res);
      }
    });
  }
function ( loadBalancer , nodes , callback ) { var self = this , loadBalancerId = loadBalancer instanceof lb . LoadBalancer ? loadBalancer . id : loadBalancer ; if ( ! Array . isArray ( nodes ) ) { nodes = [ nodes ] ; } var postOptions = { path : urlJoin ( _urlPrefix , loadBalancerId , 'nodes' ) , method : 'POST' , body : { nodes : [ ] } } ; postOptions . body . nodes = _ . map ( nodes , function ( node ) { return _ . pick ( node , [ 'address' , 'port' , 'condition' , 'type' , 'weight' ] ) ; } ) ; self . _request ( postOptions , function ( err , body , res ) { if ( err ) { return callback ( err ) ; } else if ( ! body || ! body . nodes ) { return callback ( new Error ( 'Unexpected empty response' ) ) ; } else { return callback ( null , body . nodes . map ( function ( node ) { return new lb . Node ( self , _ . extend ( node , { loadBalancerId : loadBalancerId } ) ) ; } ) , res ) ; } } ) ; }
client.addNodes

@description add a node or array of nodes to the provided load balancer. Each of the addresses must be unique to this load balancer.

@param {Object}          loadBalancer      the loadBalancer or loadBalancerId
@param {Object|Array}    nodes             list of nodes to add
@param {function}        callback

Sample node

{
address: '192.168.10.1',
port: 80,
condition: 'ENABLED', // also supports 'DISABLED' & 'DRAINING'
type: 'PRIMARY' // use 'SECONDARY' as a fail over node
}
client . addNodes