Update configuration file from backup via POST

This function restores a configuration backup file via HTTP POST method. If the backup file does not contain any changes, the system does not write to the configuration file.

Note:

The format for this command line example differs from our standard format because the function only accepts an HTTP POST request. For more information about how to call this request method, read Mozilla's POST documentation.

SecurityBasicAuth
Request
Request Body schema: multipart/form-data
file
required
string <binary>

The configuration file data, in multipart/form-data format.

Note:

When you call this function on the command line, you must provide the configuration file's filepath. For example, you would use the 'file=@/var/cpanel/cpanel.config' parameter structure to call this function.

module
required
string

The configuration module's name.

Important:

This parameter is case-sensitive. You must enter the parameter in the correct case format; otherwise, the function will fail.

Enum: "Basic" "Main"
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
post/restore_config_from_upload
Request samples
whmapi1 --input=json --output=jsonpretty \
  restore_config_from_upload
Response samples
application/json
{
  • "metadata": {
    • "command": "restore_config_from_upload",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}