List environments
Цей контент ще не доступний вашою мовою.
listEnvironments returns the virtual environments of the switch, the same list as System Management → Environments. Use it to find an i_environment and to watch an action queued with queueEnvironmentAction. Only the root customer of the root environment can call it.
The method supports trusted mode with i_customer, the ID of the root customer.
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
limit |
int | no | Return at most this many environments. Without it, all are returned |
offset |
int | no | Skip this many environments first. Used only together with limit |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
result |
string | OK |
environments |
array | One struct per environment, see below |
Each struct in environments has these members. They have the same meaning as in createEnvironment and getEnvironmentInfo.
| Name | Type | Description |
|---|---|---|
i_environment |
int | ID of the environment. The root environment is 1 |
name |
string | Environment Name |
https_cname |
string | Web Address |
description |
string | Description |
max_cps |
int | Max CPS, nil when unlimited |
max_sessions |
int | Max Sessions, nil when unlimited |
expiration_date |
string | Expiration Date, nil when it never expires |
enabled |
boolean | True when the environment is started |
suspend_date |
string | When the environment was suspended, nil when it is not |
pending_action |
string | The queued action still in progress (start, stop, restart, suspend, delete), empty or nil when none |
db_info |
struct | Databases of the environment, or the string N/A. Members main_master, main_slave, balances_master, balances_slave, cdrs_master, cdrs_slave, each a struct with size (bytes) and node_id, or N/A. The panel adds them up for the DB Size column |
Example
Section titled “Example”call("listEnvironments", {}){ "result": "OK", "environments": [ { "i_environment": 1, "name": "root", "https_cname": "panel.example.com", "description": "", "max_cps": None, "max_sessions": None, "expiration_date": None, "enabled": True, "suspend_date": None, "pending_action": "", # … db_info }, { "i_environment": 4, "name": "partner-a", "https_cname": "partner-a.example.com", "description": "Partner A wholesale", "max_cps": 20, "max_sessions": 200, "expiration_date": "23:59:59.000 GMT Fri Dec 31 2027", "enabled": True, "suspend_date": None, "pending_action": "restart", # … db_info }, ],}Related
Section titled “Related”- Virtual environments: the Environments screen
- Get environment information: all attributes of one environment
- Start, stop and delete environments
- Create an environment