Set an application's run mode.
Changed onThis function sets an application's run mode, applies it to the container's environment (for example, NODE_ENV for a Node.js application), and recreates the container so the change takes effect immediately.
Important:
This function only applies to applications in the server category. Calling it on a static application fails with the invalid_category error category. It also requires the application to have finished at least one deploy; calling it before then fails with the not_deployed error category.
Request
- Base URLhttps://cpanel-server.tld:2083/execute
- AuthHTTP basic
Query parameters
The run mode to set.
The application's unique name (slug).
Response
HTTP Request was successful.
Example response
{
"apiversion": 3,
"func": "set_mode",
"module": "WebApp",
"result": {
"data": {
"mode": "development",
"restarted": 1
},
"status": 1
}
}Changes
- warning
added the new
0.00enum value to the//response property for the response status - warning
added the new
not_deployedenum value to the//response property for the response status
- warning
- info
api operation id
WebApp_set_moderemoved and replaced withWebApp-set_mode
- info