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

    if (!type || (type !== 'HTTP_COOKIE' && type !== 'SOURCE_IP')) {
      throw new Error('Please provide a valid session persistence type');
    }

    self._request({
      path: urlJoin(_urlPrefix, loadBalancerId, 'sessionpersistence'),
      method: 'PUT',
      body: {
        sessionPersistence: {
          persistenceType: type
        }
      }
    }, function (err) {
      return callback(err);
    });
  }
function (loadBalancer, type, callback) {
    var self = this,
        loadBalancerId =
          loadBalancer instanceof lb.LoadBalancer ? loadBalancer.id : loadBalancer;

    if (!type || (type !== 'HTTP_COOKIE' && type !== 'SOURCE_IP')) {
      throw new Error('Please provide a valid session persistence type');
    }

    self._request({
      path: urlJoin(_urlPrefix, loadBalancerId, 'sessionpersistence'),
      method: 'PUT',
      body: {
        sessionPersistence: {
          persistenceType: type
        }
      }
    }, function (err) {
      return callback(err);
    });
  }
function ( loadBalancer , type , callback ) { var self = this , loadBalancerId = loadBalancer instanceof lb . LoadBalancer ? loadBalancer . id : loadBalancer ; if ( ! type || ( type !== 'HTTP_COOKIE' && type !== 'SOURCE_IP' ) ) { throw new Error ( 'Please provide a valid session persistence type' ) ; } self . _request ( { path : urlJoin ( _urlPrefix , loadBalancerId , 'sessionpersistence' ) , method : 'PUT' , body : { sessionPersistence : { persistenceType : type } } } , function ( err ) { return callback ( err ) ; } ) ; }
client.enableSessionPersistence

@description Enable session persistence of the requested type

@param {Object}          loadBalancer      the loadBalancer or loadBalancerId
@param {String}          type              HTTP_COOKIE or SOURCE_IP
@param {function}        callback
client . enableSessionPersistence