Page tree
Skip to end of metadata
Go to start of metadata

Description

This function lists information about the system's available RPM packages. 

Examples  


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


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)
{  
   "metadata":{  
      "reason":"OK",
      "result":1,
      "command":"package_manager_list_packages",
      "version":1
   },
   "data":{  
      "packages":[  
         {  
            "package":"MariaDB-client"
         },
         {  
            "package":"MariaDB-common"
         },
         {  
            "package":"MariaDB-devel"
         },
         {  
            "package":"MariaDB-server"
         },
         {  
            "package":"MariaDB-shared"
         },
      ]
   }
}
 Output (XML)
<result>
    <data>
        <packages>
           <package>"MariaDB-client"</package>
		   <package>"MariaDB-common"</package>
		   <package>"MariaDB-devel"</package>
		   <package>"MariaDB-server"</package>
		   <package>"MariaDB-shared"</package>     
        </packages>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <command>package_manager_list_packages</command>
        <result>1</result>
    </metadata>
</result>


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
statestring

Return RPM packages that exist in a specified state.

This parameter defaults to any.

  • any
  • installed
  • not_installed
  • updatable
installed

 

Returns

ReturnTypeDescriptionPossible valuesExample
packagesarray of hashesAn array of hashes of RPM packages on the system.This array of hashes includes the package return. 

package

string

The RPM package name.

The function returns this value in the   packages   hash.

An RPM package.ea-apr-util