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

Description

This function lists RPMs that the server needs, but the server owner has not yet installed. When you call this function, it performs the same actions as the following command:

/usr/local/cpanel/scripts/check_cpanel_rpms --list-only --targets[target]

For more information, read our The rpm.versions System documentation.

Examples 


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


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" : {
      "rpms" : [
         "cpanel-pcre"
      ]
   }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "list_rpms"
  }
}
 Output (XML)
<result>
    <data>
        <rpms>cpanel-pcre</rpms>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>list_rpms</command>
    </metadata>
</result>


Note:

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

   

Parameters

ParameterTypeDescriptionPossible valuesExample
targetstring

The target that depends on the uninstalled RPMs.

If you do not specify a value, the function will list all of the required but uninstalled RPMs for all RPM targets.

A valid RPM target.

3rdparty

Returns

ReturnTypeDescriptionPossible valuesExample

rpms

array of strings

A list of all RPM dependencies that the server owner has not yet installed.

A valid RPM or list of valid RPMs.cpanel-pcre