Create EasyApache 4 profile

This function creates an EasyApache 4 profile. This function only writes files to the /etc/cpanel/ea4/profiles/custom/ directory.

Important:

When you disable the Web Server role, the system disables this function.

SecurityBasicAuth
Request
query Parameters
filename
required
string

The profile's file name.

Example: filename=new_profile.json
name
required
string

The profile's display name.

Example: name=New Profile
pkg
required
Array of strings

The packages that the profile contains.

Example: pkg=ea-apache24&pkg=ea-apache24-foo
desc
string
Default: ""

The description of the profile.

Example: desc=This is my new profile.
overwrite
integer
Default: 0

Whether to overwrite the file, if it exists.

  • 1 — Overwrite the file.
  • 0 — Do not overwrite the file.
Enum: 0 1
Example: overwrite=1
tag
Array of strings
Default: []

Tags that are appropriate for the profile.

Example: tag=Apache 2.4&tag=Optimized for static content
version
string
Default: "0"

The profile's version number.

Example: version=1.3
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/ea4_save_profile
Request samples
whmapi1 --output=jsonpretty \
  ea4_save_profile \
  filename='new_profile.json' \
  name='New Profile' \
  pkg='ea-apache24' pkg='ea-apache24-foo'
Response samples
application/json
{
  • "data": {
    • "already_exists": 1,
    • "path": "/etc/cpanel/ea4/profiles/custom/new_profile.json"
    },
  • "metadata": {
    • "command": "ea4_save_profile",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}