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

Description

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

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/package_manager_get_package_info?api.version=1&package=ea-php55&package=ea-apr-util
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/package_manager_get_package_info?api.version=1&package=ea-php55&package=ea-apr-util
 Command Line
whmapi1 package_manager_get_package_info package=ea-php55 package=ea-apr-util


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":{
      "packages":[
         {
            "version":"1.5.2",
            "short_description":"Apache Portable Runtime Utility library",
            "more_info_url":"http://apr.apache.org/",
            "state":"installed",
            "release":"11.11.2.cpanel",
            "pkg_dep":{
               "requires":[
                  "libdb",
                  [
                     "apr",
                     "ea-apr"
                  ],
                  "glibc",
                  "libuuid",
                  "expat"
               ],
               "conflicts":[

               ]
            },
            "pkg_group":"System Environment/Libraries",
            "license":"ASL 2.0",
            "repo_name":"NYI",
            "version_installed":"1.5.2-11.11.2.cpanel",
            "version_latest":"1.5.2-11.11.2.cpanel",
            "architecture":"x86_64",
            "size":198703,
            "package":"ea-apr-util",
            "long_description":"The mission of the Apache Portable Runtime (APR) is to provide a\nfree library of C data structures and routines.  This library\ncontains additional utility interfaces for APR; including support\nfor XML, LDAP, database interfaces, URI parsing and more."
         },
         {
            "state":"not_installed",
            "release":"1.1.2.cpanel",
            "pkg_group":"Development/Languages",
            "pkg_dep":{
               "requires":[
                  "ea-php55-pear",
                  "ea-php55-php-cli",
                  "ea-php55-php-common"
               ],
               "conflicts":[

               ]
            },
            "version":"5.5.38",
            "more_info_url":null,
            "short_description":"Package that installs PHP 5.5",
            "package":"ea-php55",
            "long_description":"This is the main package for ea-php55 Software Collection,\nthat install PHP 5.5 language.",
            "size":0,
            "license":"GPLv2+",
            "version_latest":"5.5.38-1.1.2.cpanel",
            "architecture":"x86_64",
            "version_installed":"",
            "repo_name":"NYI"
         }
      ]
   },
   "metadata":{
      "result":1,
      "reason":"OK",
      "command":"package_manager_get_package_info",
      "version":1
   }
}
 Output (XML)
<result>
    <data>
        <packages>
            <pkg_dep>
                <requires>
                    <anon>ea-apr</anon>
                    <anon>apr</anon>
                </requires>
                <requires>libdb</requires>
                <requires>expat</requires>
                <requires>libuuid</requires>
                <requires>glibc</requires>
            </pkg_dep>
            <architecture>x86_64</architecture>
            <short_description>Apache Portable Runtime Utility library</short_description>
            <repo_name>NYI</repo_name>
            <more_info_url>http://apr.apache.org/</more_info_url>
            <pkg_group>System Environment/Libraries</pkg_group>
            <release>11.11.2.cpanel</release>
            <long_description>
                The mission of the Apache Portable Runtime (APR) is to provide a free library of C data structures and routines. This library contains additional utility interfaces for APR; including support for XML, LDAP, database interfaces, URI parsing and more.
            </long_description>
            <state>installed</state>
            <version>1.5.2</version>
            <version_latest>1.5.2-11.11.2.cpanel</version_latest>
            <license>ASL 2.0</license>
            <version_installed>1.5.2-11.11.2.cpanel</version_installed>
            <package>ea-apr-util</package>
            <size>198703</size>
        </packages>
        <packages>
            <version_latest>5.5.38-1.1.2.cpanel</version_latest>
            <package>ea-php55</package>
            <size>0</size>
            <license>GPLv2+</license>
            <version_installed/>
            <long_description>
                This is the main package for ea-php55 Software Collection, that install PHP 5.5 language.
            </long_description>
            <state>not_installed</state>
            <version>5.5.38</version>
            <pkg_group>Development/Languages</pkg_group>
            <more_info_url/>
            <release>1.1.2.cpanel</release>
            <architecture>x86_64</architecture>
            <pkg_dep>
                <requires>ea-php55-php-common</requires>
                <requires>ea-php55-pear</requires>
                <requires>ea-php55-php-cli</requires>
            </pkg_dep>
            <repo_name>NYI</repo_name>
            <short_description>Package that installs PHP 5.5</short_description>
        </packages>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <command>package_manager_get_package_info</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

Note:

You must use either the ns or the package parameters.

ParameterTypeDescriptionPossible valuesExample
nsstring

An available RPM package namespace.

Note:

We added this parameter in cPanel & WHM version 58. 

ea

Note:

ea is the only possible value.

ea
package string

An RPM package name on the system.

Note:

$body

A valid RPM package name.ea-apr-util
disable-excludesBoolean

Whether the system will disable yum's exclude behavior.

This parameter defaults to 0.

  • 1 — Disable yum's exclude behavior
  • 0 — Do not disable yum's exclude behavior
1

Returns

ReturnTypeDescriptionPossible valuesExample
packagesarray of hashesAn array of hashes of information about the RPM packages on the system.This array of hashes includes the architecture, license, long_description, more_info_url, package, pkg_grp, release, repo_name, short_description, size, state, version, version_installed, and version_latest returns and the pkg_dep array.  

architecture

string

The required system architecture.

The function returns this value in the packages hash.

A valid system architecture.x86_64

license

string

The RPM package's license.

The function returns this value in the   packages   hash.

A valid distribution license.ASL 2.0

long_description

string

A detailed description of the RPM package.

The function returns this value in the   packages   hash.

A valid string.This is a long description of the package.

more_info_url

string

The RPM package developer's URL, if available.

The function returns this value in the   packages   hash.

  • Any valid URL.
  • null
http://apr.apache.org

package

string

The RPM package name.

The function returns this value in the   packages   hash.

Any valid string.ea-apr-util

pkg_dep

hash

The RPM package's dependencies and conflicts.

The function returns this value in the   packages   hash.

This hash includes the conflicts and requires arrays. 

conflicts

array

A hash of the RPM package's conflicts, if any exist.

The function returns this value in the   pkg_dep   hash.

Any valid RPM package name.ea-php55-php-ioncube5

requires

array

A hash of the RPM package's requirements, if any exist.

The function returns this value in the   pkg_dep   hash.

Any valid RPM package name.glibc

pkg_grp

string

The RPM package's group.

The function returns this value in the   packages   hash.

A valid string.System Environment/Libraries

release

string

The RPM package's cPanel release number.

The function returns this value in the   packages   hash.

A valid string.11.11.2.cpanel

repo_name

string

The repository where the RPM package resides.

The function returns this value in the   packages   hash.

A valid string.NYI

short_description

string

A short description of the RPM package.

The function returns this value in the   packages   hash.

A valid string.This is a short description.

size

integer

The RPM package's size.

The function returns this value in the   packages   hash.

A positive integer.198703

state

string

The install state of the RPM package.

The function returns this value in the   packages   hash.

  • installed
  • not_installed
  • updatable
installed

version

string

The version of the RPM package's software.

The function returns this value in the   packages   hash.

A valid string.1.5.2

version_installed

string

The currently installed version of an RPM package.

The function returns this value in the   packages   hash.

  • A valid string.
  • A blank string.
1.5.2-11.11.2.cpanel

version_latest

string

The latest available version of an RPM package.

The function returns this value in the   packages   hash.

A valid string.1.5.2-11.11.2.cpanel