Child pages
  • WHM API 1 Functions - ea4_recommendations
Skip to end of metadata
Go to start of metadata

Description

This function returns any recommendations attached to your installed EasyApache 4 packages. For more information about the recommendation system, read our EasyApache 4 Recommendations documentation. 

Important:

In cPanel & WHM version 76 and later, when you disable the WebServer role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/ea4_recommendations?api.version=1
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/ea4_recommendations?api.version=1
 Command Line
whmapi1 ea4_recommendations


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
   "data":{
      "ea-php55-php":[
         {
            "url":"https://www.example.com",
            "name":"PHP DSO",
            "on":"add",
			"desc":"PHP DSO runs as the user by default. In a shared hosting environment, this is a security issue.",
			"level":"danger",
            "options":[
               {
                  "items":[
                     "ea-apache24-mod_ruid2",
                     "ea-apache24-mod_mpm_itk"
                  ],
                  "recommended":"true",
				  "level":"success",
                  "text":"We strongly recommend that you install one of the following packages unless this is a single-user system:"
               },
               {
                  "recommended":"false",
                  "text":"If you use suPHP, you will add some security, but may experience performance issues on your server.",
                  "level":"warning"
               }
            ]
         }
      ],
      },
   "metadata":{
      "command":"ea4_recommendations",
      "result":1,
      "version":1,
      "reason":"OK"
   }
}
 Output (XML)
<result>
  <data>
    <ea-php55-php>
      <url>https://www.example.com</url>
      <name>PHP DSO</name>
      <on>add</on>
	  <level>danger</level>
      <desc>PHP DSO runs as the user by default. In a shared hosting environment, this is a security issue.</desc>
      <options>
        <items>ea-apache24-mod_ruid2</items>
        <items>ea-apache24-mod_mpm_itk</items>
        <recommended>true</recommended>
		<level>success</level>
        <text>We strongly recommend that you install one of the following packages unless this is a single-user system:</text>
      </options>
      <options>
        <recommended>false</recommended>
        <text>If you use suPHP, you will add some security, but may experience performance issues on your server.</text>
        <level>warning</level>
      </options>
    </ea-php55-php>
  </data>
  <metadata>
    <command>ea4_recommendations</command>
    <result>1</result>
    <version>1</version>
    <reason>OK</reason>
  </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible valuesExample

package_name

 

Note:

The function uses the name of the referenced package as the return name.  For example, ea-php56-php.


array of hashes

A hash that contains recommendation information about a package.

This hash includes the name, desc, on, level, and url returns and the options hash.

 

name

string

The recommendation's name.

The function returns this value in the package_name hash.

A valid string.DSO

desc

string

The recommendation's description.

The function returns this value in the package_name hash.

Note:

The function only returns this value if it exists.  


A valid string.

PHP DSO runs as the user by default.

on

string

The action that triggers a recommendation.

The function returns this value in the package_name hash.

  • add
  • remove
add

url

string

A URL to provide more information.

The function returns this value in the package_name hash.

Note:

The function only returns this value if it exists.  


A valid URL.http://www.example.com

level

string

The level that triggers a recommendation to appear, based on Bootstrap 3 alert components.

The function returns this value in the package_name hash.

Notes:

  • The function only returns this value if it exists.  
  • This return's value only affects the UI if set to danger.
  • primary
  • success
  • info
  • warning
  • danger
danger

options

array of hashes

A hash that contains each option for the package's recommendations.

The function returns this value in the package_name hash.

This hash includes the level, items, recommended, text, and url returns. 

level

string

The level that triggers a recommendation to appear, based on Bootstrap 3 alert components.

The function returns this value in the options hash.

Notes:

  • The function only returns this value if it exists.  
  • This return's value only affects the UI if set to danger.
  • primary
  • success
  • info
  • warning
  • danger
danger

items

array

An array of information that corresponds with a text value.

The function returns this value in the options hash.

Note:

The function only returns this value if it exists.  

A valid array.
ea-apache24-mod_ruid2

recommended

Boolean

The type of recommendation that the interface will return.

The function returns this value in the options hash.

Notes:

  • The function only returns this value if it exists.
  • If the function does not return this value, then the text displayed in the interface is informational.
  • true — Recommended
  • false — Not recommended.


true

url

string

A URL that provides more information.

The function returns this value in the options hash.

Note:

The function only returns this value if it exists.

A valid URL.http://www.example.com

text

string

The text returned in the user interface.

The function returns this value in the options hash.

A valid string.If you use suPHP, you will add some security, but may experience performance issues.