Перейти к содержимому

Start, stop and delete environments

Это содержимое пока не доступно на вашем языке.

queueEnvironmentAction starts, stops, restarts, suspends or deletes a virtual environment. These are the actions of the Actions menu under System Management → Environments. 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.

Name Type Required Description
i_environment int yes ID of the environment
action string yes The action, see Actions
suspend_message string no With suspend: the message the environment’s web interface shows while it is suspended. ${DATE} in the text is replaced with the date of suspension
action What it does Panel action
start Starts a stopped environment, or resumes a suspended one Start, Start Web/API
stop Stops the environment Stop
restart Restarts a running environment Restart
suspend Suspends the web interface and the API of a running environment and shows suspend_message instead Suspend Web/API
delete Deletes the environment with all its data Delete
Name Type Description
result string OK: the action is queued

The action is not done when the call returns. Until it is, listEnvironments and getEnvironmentInfo report it in pending_action; poll until pending_action is empty and check enabled.

request
call("queueEnvironmentAction", {
"i_environment": 4,
"action": "suspend",
"suspend_message": "This switch was suspended on ${DATE}. "
"Please contact the switch administrator.",
})
response
{"result": "OK"}