1. Home
  2. API
  3. Snapt One Load Balancer: Pause and Resume a backend Server

Snapt One Load Balancer: Pause and Resume a backend Server

Soft Stopping and Starting a backend server

Command-line example for soft stopping and starting a backend server in a virtual Load Balancer group or backend. This is useful for maintenance periods, etc. You will be calling the snaptHA.soft_stop method and snaptHA.soft_start methods with the argument array of (BackendName, ServerName). The change takes immediate effect.

The XmlRpc URL for these requests is http://snapt/api/key/secret/snaptHA/

Code Example

$backend = 'WebGroup'; // Group or backend name
$server = 'www01'; // Server name in group/backend

$api = 'snaptHA'; // Balancer
$method = 'soft_stop'; // soft_stop method being called

$call = $api . '.' . $method;
$args = array($backend, $server); // group or backend and server to pause
$result = getClient($api)->call($call, $args); // Send your XMLRPC request

This uses the Zend XmlRpc client, with a custom function getClient as shown below:

Updated on December 4, 2019


Was this article helpful?

Related Articles