You are here: Smart Control > Smart Control Classes > ADC Class (adc)

ADC Class (adc)

Parameters

An ADC class currently has no publicly accessible parameters.

Methods

cli(string command)

 

Description:

Run the provided command exactly as it would be if entered into the CLI.

 

Returns:

Map containing cli_buf string with a status code.  Status code will be 0 if the CLI command was successful and non-zero otherwise. cli_buf string will contain the output that would have been displayed on the screen if this command were typed into the CLI.  Additional message string contains description of the status code.

 

Example:

// if there are fewer than 10 active connections, rebalance the failover peers

$sp = srvpool::getByName(“sp00”);

if ($sp->stats(“ACTIVECONX”) < 10) {

       adc::cli(“rebalance”);

}

getSrvpoolList()

 

Description:

List server pools from the configuration.

 

Returns:

A map with the following keys:

srvpool_list: list of server pool names as strings

message: a status message indicating success or failure of the operation

status: a status code: 0 indicates success, nonzero indicates failure

Example:

// Get list of server pools
$list = adc::getSrvpoolList();

// loop through the names in the “srvpool_list”

for ($counter = 0; $counter < count($list["srvpool_list"]); $counter++) {

       // each name in the list is $list["srvpool_list"][$counter]

}

getServerList()

 

Description:

List servers from the configuration.

 

Returns:

A map with the following keys:

server_list: list of server names as strings

message: a status message indicating success or failure of the operation

status: a status code: 0 indicates success, nonzero indicates failure

Example:

// Get list of servers
$list = adc::getServerList();

// loop through the names in the “server_list”

for ($counter = 0; $counter < count($list["server_list"]); $counter++) {

       // each name in the list is $list["server_list"][$counter]

}