Child pages
  • WHM API 1 Functions - ea4_save_profile

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function creates an EasyApache 4 profile.

 This function only writes files to the /etc/cpanel/ea4/profiles/custom/ directory.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledWebServerRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/ea4_save_profile?api.version=1&version=1.3&desc=This%20is%20my%20new%20profile.&filename=new_profile.json&name=New%20Profile&pkg=ea%3Dapache24&pkg=ea-php-cli&tag=Apache%202.4&tag=PHP%205.6&overwrite=0



Expand
titleXML API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/ea4_save_profile?api.version=1&version=1.3&desc=This%20is%20my%20new%20profile.&filename=new_profile.json&name=New%20Profile&pkg=ea%3Dapache24&pkg=ea-php-cli&tag=Apache%202.4&tag=PHP%205.6&overwrite=0



Expand
titleCommand Line


Code Block
languagebash
whmapi1 ea4_save_profile filename=new_profile.json name=New%20Profile pkg=ea-apache24 desc=This%20is%20my%20new%20profile. version=1.3 tag=Apache%202.4 overwrite=1

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
   "data":{
      "path":"/etc/cpanel/ea4/profiles/custom/new_profile.json"
   },
   "metadata":{
      "result":1,
      "reason":"OK",
      "version":1,
      "command":"ea4_save_profile"
   }
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<result>
    <data>
        <path>/etc/cpanel/ea4/profiles/custom/new_profile.json</path>
    </data>
    <metadata>
        <result>1</result>
        <reason>OK</reason>
        <version>1</version>
        <command>ea4_save_profile</command>
    </metadata>
</result>


Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
filenamestring

Required

The profile's file name.

A valid file name.

Note
titleNote:

This file must use the .json extension.


new_profile.json
namestring

Required

The profile's display name.

A valid profile name.New Profile
pkgstring

Required

The packages that the profile contains.

Note
titleNote:

You can pass this parameter multiple times.


A valid package name.ea-apache24
descstring

A description of the profile.

This value defaults to a blank string.

A valid string.This is my new profile.
versionstring

The profile's version number.

This value defaults to 0.1.

A valid string.1.3
tagstring

The profile's tags.

This parameter has no default value. The function sets the profile's tag list to an empty list if you do not pass it.

Note
titleNote:

You can pass this parameter multiple times.


A valid string.Apache 2.4
overwriteBoolean

Whether to overwrite the file, if it exists.

This value defaults to 0.

  • 1 — Overwrite the file.
  • 0 — Do not overwrite the file.
1

Returns

ReturnTypeDescriptionPossible valuesExample
path string

The new profile's path.

Note
titleNote:

The function only returns this value if it succeeds.


A valid path.

/etc/cpanel/ea4/profiles/custom/new_profile.json
already_existsBoolean

Whether the filename value already exists.

Note
titleNote:

The function only returns this value if the overwrite value is 0, and the specified filename value already exists.


  • 1 — Exists.
  • 0 — Does not exist.
1