Prev Chapter 5: Controller: /nodeworx/cluster
Up Part II: NodeWorx API Spec
Chapter 7: Controller: /nodeworx/cluster/nodes Next
6 Controller: /nodeworx/cluster/lb
Required Permissions "CLUSTERING"
Added in version 4.7.0-339
Description Add load balancing to a service.
Input Parameters
Name | Type | Notes | Required? |
service_port | integer |
Example Values 80, 443, 25, 587, 110, 995, 143, 993 |
Yes |
virtual_ip | string |
Help Entry A virtual IP will be shared and load-balanced among your cluster according to policies set here. Load-balancing IPv6 addresses requires Linux kernel >= 2.6.28-rc3 and ipvsadm >= 1.25. Both are provided by default in RHEL 6 and CentOS 6. Example Values 0.0.0.0, ::, 10.1.15.100, 10.1.15.101, 10.1.15.102, 10.1.15.103, 10.1.15.104, 2001:db8::d:1101 |
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_apidoc.interworx.com | 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 |
Added in version 4.7.0-339
Description Delete loadbalancing of a service.
Input Parameters
Name | Type | Notes | Required? |
services | struct (string) |
Example Values 10.1.15.100:80, 10.1.15.101:80, 10.1.15.102:80, 10.1.15.103:80, 10.1.15.104:80 |
Yes |
Added in version 4.7.0-339
Description Edit a clustered service.
Input Parameters
Name | Type | Notes | Required? |
service | string |
Example Values 10.1.15.100:80, 10.1.15.101:80, 10.1.15.102:80, 10.1.15.103:80, 10.1.15.104: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_apidoc.interworx.com | 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 |
Added in version 4.7.0-339
Description Magic function - test for failure mechanism.
Added in version 4.7.0-339
Description Checks if the service is running or not.
Sample output
array (’status’ => 0,
’payload’ => true,
)
Added in version 4.7.0-339
Description 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 |
Added in version 4.7.0-339
Description Lists the current load balancer status.
Sample output
array (’status’ => 0,
’payload’ =>
array (
’10.1.15.100:80’ =>
array (
’info’ =>
array (
’protocol’ => ’TCP’,
’vip’ => ’10.1.15.100’,
’port’ => ’80’,
’pport’ => ’http’,
’policy’ => ’rr’,
’ppolicy’ => ’##LG_ROUND_ROBIN##’,
’persistent’ => ’300’,
),
’realservers’ =>
array (
’10.1.1.23:80’ =>
array (
’vip’ => ’10.1.1.23’,
’port’ => ’80’,
’forward’ => ’Route’,
’weight’ => ’0’,
’active’ => ’0’,
’inactive’ => ’0’,
),
’10.1.15.200:80’ =>
array (
’vip’ => ’10.1.15.200’,
’port’ => ’80’,
’forward’ => ’Local’,
’weight’ => ’1’,
’active’ => ’0’,
’inactive’ => ’0’,
),
),
),
’10.1.15.101:80’ =>
array (
’info’ =>
array (
’protocol’ => ’TCP’,
’vip’ => ’10.1.15.101’,
’port’ => ’80’,
’pport’ => ’http’,
’policy’ => ’rr’,
’ppolicy’ => ’##LG_ROUND_ROBIN##’,
’persistent’ => ’300’,
),
’realservers’ =>
array (
’10.1.1.23:80’ =>
array (
’vip’ => ’10.1.1.23’,
’port’ => ’80’,
’forward’ => ’Route’,
’weight’ => ’0’,
’active’ => ’0’,
’inactive’ => ’0’,
),
’10.1.15.200:80’ =>
array (
’vip’ => ’10.1.15.200’,
’port’ => ’80’,
’forward’ => ’Local’,
’weight’ => ’1’,
’active’ => ’0’,
’inactive’ => ’0’,
),
),
),
’10.1.15.102:80’ =>
array (
’info’ =>
array (
’protocol’ => ’TCP’,
’vip’ => ’10.1.15.102’,
’port’ => ’80’,
’pport’ => ’http’,
’policy’ => ’rr’,
’ppolicy’ => ’##LG_ROUND_ROBIN##’,
’persistent’ => ’300’,
),
’realservers’ =>
array (
’10.1.1.23:80’ =>
array (
’vip’ => ’10.1.1.23’,
’port’ => ’80’,
’forward’ => ’Route’,
’weight’ => ’0’,
’active’ => ’0’,
’inactive’ => ’0’,
),
’10.1.15.200:80’ =>
array (
’vip’ => ’10.1.15.200’,
’port’ => ’80’,
’forward’ => ’Local’,
’weight’ => ’1’,
’active’ => ’0’,
’inactive’ => ’0’,
),
),
),
’10.1.15.103:80’ =>
array (
’info’ =>
array (
’protocol’ => ’TCP’,
’vip’ => ’10.1.15.103’,
’port’ => ’80’,
’pport’ => ’http’,
’policy’ => ’rr’,
’ppolicy’ => ’##LG_ROUND_ROBIN##’,
’persistent’ => ’300’,
),
’realservers’ =>
array (
’10.1.1.23:80’ =>
array (
’vip’ => ’10.1.1.23’,
’port’ => ’80’,
’forward’ => ’Route’,
’weight’ => ’0’,
’active’ => ’0’,
’inactive’ => ’0’,
),
’10.1.15.200:80’ =>
array (
’vip’ => ’10.1.15.200’,
’port’ => ’80’,
’forward’ => ’Local’,
’weight’ => ’1’,
’active’ => ’0’,
’inactive’ => ’0’,
),
),
),
’10.1.15.104:80’ =>
array (
’info’ =>
array (
’protocol’ => ’TCP’,
’vip’ => ’10.1.15.104’,
’port’ => ’80’,
’pport’ => ’http’,
’policy’ => ’rr’,
’ppolicy’ => ’##LG_ROUND_ROBIN##’,
’persistent’ => ’300’,
),
’realservers’ =>
array (
’10.1.1.23:80’ =>
array (
’vip’ => ’10.1.1.23’,
’port’ => ’80’,
’forward’ => ’Route’,
’weight’ => ’0’,
’active’ => ’0’,
’inactive’ => ’0’,
),
’10.1.15.200:80’ =>
array (
’vip’ => ’10.1.15.200’,
’port’ => ’80’,
’forward’ => ’Local’,
’weight’ => ’1’,
’active’ => ’0’,
’inactive’ => ’0’,
),
),
),
),
)
Added in version 4.7.0-339
Description Lists the "normal" name - ie "web server" instead of "httpd".
Sample output
array (’status’ => 0,
’payload’ => ’##LG_LOAD_BALANCER##’,
)
Added in version 4.7.0-339
Description Lists a string of the port numbers that this service uses, comma-seperated.
Sample output
array (’status’ => 0,
’payload’ => ’##LG_NOT_APPLICABLE##’,
)
Added in version 4.7.0-339
Description Lists array of port numbers and ranges that this service uses.
Sample output
array (’status’ => 0,
’payload’ =>
array (
0 => ’##LG_NOT_APPLICABLE##’,
),
)
Added in version 4.7.0-339
Description Lists an array of permissions required to control the service.
Sample output
array (’status’ => 0,
’payload’ =>
array (
0 => ’CLUSTERING’,
),
)
Added in version 4.7.0-339
Description Lists the service name, ports, page, and status.
Sample 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,
),
)
Added in version 4.7.0-339
Description Lists the service name - ie "httpd" instead of "web server".
Sample output
array (’status’ => 0,
’payload’ => ’ipvsadm’,
)
Added in version 4.7.0-339
Description Lists the page that controls the service.
Sample output
array (’status’ => 0,
’payload’ => ’/nodeworx/cluster/lb’,
)
Added in version 5.1.0-838
Description Displays the information available to the action "editService".
Input Parameters
Name | Type | Notes | Required? |
service | string |
Example Values 10.1.15.100:80, 10.1.15.101:80, 10.1.15.102:80, 10.1.15.103:80, 10.1.15.104:80 |
Yes |
Sample output
array (’status’ => 0,
’payload’ =>
array (
’service_copy’ => ’10.1.15.100:80’,
’policy’ => ’rr’,
’persistent’ => ’300’,
’service’ => ’10.1.15.100:80’,
’port’ => ’80’,
’vip’ => ’10.1.15.100’,
’nodes’ =>
array (
’apidoc.interworx.com’ => ’1’,
’node1.testing.com’ => ’0’,
),
),
)
Added in version 5.1.0-838
Description Displays the information available to the action "settings".
Sample output
array (’status’ => 0,
’payload’ =>
array (
’emailalert’ => ’’,
’emailalertstatus’ =>
array (
),
),
)
Added in version 4.7.0-339
Description Action to re-route from the current controller to a different one.
Input Parameters
Name | Type | Notes | Required? |
controller | string |
Example Values Index, Overview, Users, Lang, Themes, Apikey, Plugins, Twofactorauth, Notice, Siteworx, Shell, Packages, Backup, Import, Simplescripts, Reseller, ResellerPackages, ResellerBandwidthhistory, Http, Ftp, Sshd, MailMta, MailSmtp, MailSmtp2, MailSend, MailMda, MailPop3, MailSpop3, MailImap, MailSimap, MailSpam, MailVirus, MailQueue, Mysql, MysqlRemote, MysqlPhpmyadmin, Dns, DnsZone, DnsRecord, DnsSync, Nfs, NfsExport, NfsMount, Health, Cron, Firewall, Ssl, Logs, Settings, Updates, ... |
Yes |
Added in version 4.7.0-339
Description Restarts the service.
Added in version 4.7.0-339
Description 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 |
Added in version 4.7.0-339
Description Modify ldirectord variables.
Input Parameters
Name | Type | Notes | Required? |
emailalert | string |
Help Entry E-mail address that will receive status changes. |
No |
emailalertstatus | struct (string) |
Help Entry Which status changes should be sent out as alerts. Example Values starting, running, stopping, reloading |
No |
Added in version 4.7.0-339
Description Starts the service.
Added in version 4.7.0-339
Description 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 |
Added in version 4.7.0-339
Description 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 |
Added in version 4.7.0-339
Description Stops the service.
Added in version 4.7.0-339
Description 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 |
Added in version 4.7.0-339
Description Magic function - test for testing success mechanism.
Prev Chapter 5: Controller: /nodeworx/cluster
Up Part II: NodeWorx API Spec
Chapter 7: Controller: /nodeworx/cluster/nodes Next
(C) 2019 by InterWorx LLC