The following are Server Pool parameters. Refer to Server Pool and Server Instance Commands for descriptions.
name (string)
acvq (string)
probe_maxtries (int)
probe_dto (int)
custom_actconn (int)
policy (string)
acvr (string)
probe_gto (int)
custom_hc (int)
probe_ssl (bool)
respv (int)
probe_interval (int)
probe_cto (int)
custom_delay (int)
disable (bool)
getByName(string name)
Description: Fetch the server pool named ‘name’ from the configuration.
Returns: On success: server pool object populated with all of its properties. On failure: An exception with a message and an error code.
Example: // Fetch a server pool named ‘sp00’ $sp = srvpool::getByName("sp00"); |
getInstanceByName(string name)
Description: Fetch the server instance named ‘name’ which is part of this server pool from the configuration.
Returns: On success: server instance object populated with all of its properties. On failure: An exception with a message and an error code.
Example: // Fetch a server pool named ‘sp00’ and then fetch its server instance ‘si00’ $sp = srvpool::getByName("sp00"); $si = $sp->getInstanceByName("si00"); |
getInstanceList()
Description: List server instances for this server pool from the configuration.
Returns: A map with the following keys:
Example: // Get list of server instances from server pool ‘sp00’ $sp = srvpool::getByName(“sp00”); $list = $sp->getInstanceList(); // loop through the names in the “si_list” for ($counter = 0; $counter < count($list["si_list"]); $counter++) { // each name in the list is $list["si_list"][$counter] } |
getStatusDescription()
Description: Get the status of this server pool as a string.
Returns: A string containing the status of this server pool.
Example: $sp = srvpool::getByName(“sp00”); // print the status – accessible using ‘lastrun’ command. echo $sp->getStatusDescription(); |
getStatusResp()
Description: Get the status of this server pool as a numeric value.
Returns: A numeric value indicating the status:
Example: // If there is a problem with this pool, print the status (accessible using ‘lastrun’ command). $sp = srvpool::getByName(“sp00”); if ($sp->getStatusResp() == 2) { echo $sp->getStatusDescription(); } |
stats(string statName)
Description: Get the value of the statistic named ‘
Returns: On success, the last-measured value of this statistic. On failure, an exception describing what went wrong: invalid statistic name or no statistic specified.
Example: $sp = srvpool::getByName(“sp00”); if ($sp->stats(“TOTALPRCSD”) > 100) { echo “Processed more than 100 requests through sp00”; } |
delete(optional Boolean forceFlag)
Description: Delete this server pool. Can only be used on a server pool object which has been retrieved using
Returns: Map containing message string with a status code. Status code will be 0 if the deletion was successful and non-zero otherwise.
Example: $sp = srvpool::getByName(“sp00”); // Try to delete it, if it fails, force the deletion. $value = $sp->delete(); if ($value[“status”] != 0) { // Print out the reason for the failure, accessible using ‘lastrun’ command echo “Failed to delete because: “, $value[“message”]; $value = $sp->delete(TRUE); } |
commit()
Description: Push the changes to this server pool into the permanent configuration. If this server pool object was created using
Returns: Map containing message string with a
Example: // Create a new server pool, then modify it $sp = new srvpool; $sp->name = "newsp"; $sp->commit();
// If we don’t do getByName(), the commit() below would fail with ‘object already exists’ error because the system will try to add this object instead of modify it. $sp = srvpool::getByName("newsp"); $sp->probe_maxtries = 2; $sp->commit(); |