Controller: ClusterLb

API Controller /nodeworx/cluster/lb
Required Permissions ["CLUSTERING"]
Action Description
addService Add load balancing to a service.
deleteService Delete loadbalancing of a service.
editService Edit a clustered service.
isRunning Checks if the service is running or not.
isRunningOnNode Checks if the service is running on a specific node (Clustering only).
listCurrentLoadBalancerStatus Lists the current load balancer status.
listGeneralName Lists the "normal" name - ie "web server" instead of "httpd".
listPortNumbers Lists a string of the port numbers that this service uses, comma-seperated.
listPortNumbersArray Lists array of port numbers and ranges that this service uses.
listRequiredPermissions Lists an array of permissions required to control the service.
listServiceInfo Lists the service name, ports, page, and status.
listServiceName Lists the service name - ie "httpd" instead of "web server".
listServicePage Lists the page that controls the service.
restart Restarts the service.
restartOnNode Restarts the service on a specific node (Clustering only).
settings Modify ldirectord variables.
start Starts the service.
startOnBoot Set the loadbalancer start on boot status.
startOnNode Starts the service on a specific node (Clustering only).
stop Stops the service.
stopOnNode Stops the service on a specific node (Clustering only).

Action: addService (Added in version 4.2.0-260)

Add load balancing to a service.

Input Parameters

Name Type Notes Required?
service_port integer
Example Values
80, 25, 110, 143, 443
Yes
virtual_ip string
Example Values
0.0.0.0, 4.3.2.1, 123.123.123.123, 123.123.123.125
Yes
policy string
Example Values
rr, wrr, lc, wlc, lblc
Yes
persistent integer
Example Values
0, 300, 1800, 3600
Example Default Value
300
Yes
weight_208.69.122.234 integer
Example Values
0, 1
Example Default Value
1
No*
weight_node1.testing.com integer
Example Values
0, 1
Example Default Value
1
No*
* indicates that it's actually required, but probably already has a valid default value

Action: deleteService (Added in version 4.2.0-260)

Delete loadbalancing of a service.

Input Parameters

Name Type Notes Required?
services struct (string)
Example Values
4.3.2.1:80, 123.123.123.123:80, 123.123.123.125:80
Yes

Action: editService (Added in version 4.3.0-290)

Edit a clustered service.

Input Parameters

Name Type Notes Required?
service string
Example Values
4.3.2.1:80, 123.123.123.123:80, 123.123.123.125:80
Yes
policy string
Example Values
rr, wrr, lc, wlc, lblc
Example Default Value
rr
No*
persistent integer
Example Values
0, 300, 1800, 3600
Example Default Value
300
No*
weight_208.69.122.234 integer
Example Default Value
1
No*
weight_node1.testing.com integer
Example Default Value
0
No*
* indicates that it's actually required, but probably already has a valid default value

Action: isRunning (Added in version 4.2.0-260)

Checks if the service is running or not.

Example Output

array (
  'status' => 0,
  'payload' => true,
)

Action: isRunningOnNode (Added in version 4.3.0-290)

Checks if the service is running on a specific node (Clustering only).

Input Parameters

Name Type Notes Required?
node_id string No*
* indicates that it's actually required, but probably already has a valid default value

Action: listCurrentLoadBalancerStatus (Added in version 4.3.0-290)

Lists the current load balancer status.

Example Output

array (
  'status' => 0,
  'payload' => 
  array (
    '4.3.2.1:80' => 
    array (
      'info' => 
      array (
        'protocol' => 'TCP',
        'vip' => '4.3.2.1',
        'port' => '80',
        'pport' => 'http',
        'policy' => 'rr',
        'ppolicy' => '##LG_ROUND_ROBIN##',
        'persistent' => '300',
      ),
      'realservers' => 
      array (
        '208.69.122.234:80' => 
        array (
          'vip' => '208.69.122.234',
          'port' => '80',
          'forward' => 'Local',
          'weight' => '1',
          'active' => '0',
          'inactive' => '0',
        ),
        '69.170.135.92:80' => 
        array (
          'vip' => '69.170.135.92',
          'port' => '80',
          'forward' => 'Route',
          'weight' => '1',
          'active' => '0',
          'inactive' => '0',
        ),
      ),
    ),
    '123.123.123.123:80' => 
    array (
      'info' => 
      array (
        'protocol' => 'TCP',
        'vip' => '123.123.123.123',
        'port' => '80',
        'pport' => 'http',
        'policy' => 'rr',
        'ppolicy' => '##LG_ROUND_ROBIN##',
        'persistent' => '300',
      ),
      'realservers' => 
      array (
        '208.69.122.234:80' => 
        array (
          'vip' => '208.69.122.234',
          'port' => '80',
          'forward' => 'Local',
          'weight' => '1',
          'active' => '0',
          'inactive' => '0',
        ),
        '69.170.135.92:80' => 
        array (
          'vip' => '69.170.135.92',
          'port' => '80',
          'forward' => 'Route',
          'weight' => '1',
          'active' => '0',
          'inactive' => '0',
        ),
      ),
    ),
    '123.123.123.125:80' => 
    array (
      'info' => 
      array (
        'protocol' => 'TCP',
        'vip' => '123.123.123.125',
        'port' => '80',
        'pport' => 'http',
        'policy' => 'rr',
        'ppolicy' => '##LG_ROUND_ROBIN##',
        'persistent' => '300',
      ),
      'realservers' => 
      array (
        '208.69.122.234:80' => 
        array (
          'vip' => '208.69.122.234',
          'port' => '80',
          'forward' => 'Local',
          'weight' => '1',
          'active' => '0',
          'inactive' => '0',
        ),
        '69.170.135.92:80' => 
        array (
          'vip' => '69.170.135.92',
          'port' => '80',
          'forward' => 'Route',
          'weight' => '1',
          'active' => '0',
          'inactive' => '0',
        ),
      ),
    ),
  ),
)

Action: listGeneralName (Added in version 4.2.0-260)

Lists the "normal" name - ie "web server" instead of "httpd".

Example Output

array (
  'status' => 0,
  'payload' => '##LG_LOAD_BALANCER##',
)

Action: listPortNumbers (Added in version 4.2.0-260)

Lists a string of the port numbers that this service uses, comma-seperated.

Example Output

array (
  'status' => 0,
  'payload' => '##LG_NOT_APPLICABLE##',
)

Action: listPortNumbersArray (Added in version 4.2.0-260)

Lists array of port numbers and ranges that this service uses.

Example Output

array (
  'status' => 0,
  'payload' => 
  array (
    0 => '##LG_NOT_APPLICABLE##',
  ),
)

Action: listRequiredPermissions (Added in version 4.2.0-260)

Lists an array of permissions required to control the service.

Example Output

array (
  'status' => 0,
  'payload' => 
  array (
    0 => 'CLUSTERING',
  ),
)

Action: listServiceInfo (Added in version 4.2.0-260)

Lists the service name, ports, page, and status.

Example Output

array (
  'status' => 0,
  'payload' => 
  array (
    'id' => 'ipvsadm',
    'name' => '##LG_LOAD_BALANCER##',
    'ports' => '##LG_NOT_APPLICABLE##',
    'page' => '/nodeworx/cluster/lb',
    'ctrl' => '/nodeworx/cluster/lb',
    'is_running' => 1,
  ),
)

Action: listServiceName (Added in version 4.2.0-260)

Lists the service name - ie "httpd" instead of "web server".

Example Output

array (
  'status' => 0,
  'payload' => 'ipvsadm',
)

Action: listServicePage (Added in version 4.2.0-260)

Lists the page that controls the service.

Example Output

array (
  'status' => 0,
  'payload' => '/nodeworx/cluster/lb',
)

Action: restart (Added in version 4.2.0-260)

Restarts the service.

Action: restartOnNode (Added in version 4.3.0-290)

Restarts the service on a specific node (Clustering only).

Input Parameters

Name Type Notes Required?
node_id string No*
* indicates that it's actually required, but probably already has a valid default value

Action: settings (Added in version 4.2.0-260)

Modify ldirectord variables.

Input Parameters

Name Type Notes Required?
emailalert string
Help Entry
E-mail address that will recieve status changes.
No
emailalertstatus struct (string)
Help Entry
Which status changes should be sent out as alerts.
Example Values
starting, running, stopping, reloading
No

Action: start (Added in version 4.2.0-260)

Starts the service.

Action: startOnBoot (Added in version 4.2.0-260)

Set the loadbalancer start on boot status.

Input Parameters

Name Type Notes Required?
startonboot integer
Help Entry
If set to 'Yes', the Load Balancer will be automatically started when the server starts up
Example Values
1, 0
Example Default Value
1
No*
* indicates that it's actually required, but probably already has a valid default value

Action: startOnNode (Added in version 4.3.0-290)

Starts the service on a specific node (Clustering only).

Input Parameters

Name Type Notes Required?
node_id string No*
* indicates that it's actually required, but probably already has a valid default value

Action: stop (Added in version 4.2.0-260)

Stops the service.

Action: stopOnNode (Added in version 4.3.0-290)

Stops the service on a specific node (Clustering only).

Input Parameters

Name Type Notes Required?
node_id string No*
* indicates that it's actually required, but probably already has a valid default value