Page tree
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. 

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. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 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 (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.