You can find our user documentation at docs.cpanel.net.

Check out our new API beta site!

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

Description

This function lists a key's available RPMs. For more information, read our The rpm.versions System documentation.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/get_rpm_version_data?api.version=1&section=rpm_groups&key=3rdparty
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/get_rpm_version_data?api.version=1&section=rpm_groups&key=3rdparty
 Command Line
whmapi1 get_rpm_version_data section=rpm_groups key=3rdparty


Notes:

  • Unless otherwise noted, 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": {
		"3rdparty": [
			"cpanel-pcre",
			"cpanel-pixman",
			"cpanel-analog",
			"cpanel-awstats",
			"cpanel-cgiemail",
			"cpanel-libmcrypt",
			"cpanel-libxml2",
			"cpanel-puttygen",
			"cpanel-re2c",
			"cpanel-splitlogs",
			"cpanel-wwwcount",
			"cpanel-pigz"
		]
	},
	"metadata": {
		"version": 1,
		"reason": "OK",
		"result": 1,
		"command": "get_rpm_version_data"
	}
}
 Output (XML)
<result>
    <data>
         <3rdparty>
             <rpm>cpanel-pcre</rpm>
             <rpm>cpanel-pixman</rpm>
             <rpm>cpanel-analog</rpm>
             <rpm>cpanel-awstats</rpm>
             <rpm>cpanel-cgiemail</rpm>
             <rpm>cpanel-libmcrypt</rpm>
             <rpm>cpanel-libxml2</rpm>
             <rpm>cpanel-puttygen</rpm>
             <rpm>cpanel-re2c</rpm>
             <rpm>cpanel-splitlogs</rpm>
             <rpm>cpanel-wwwcount</rpm>
             <rpm>cpanel-pigz</rpm>
         </3rdparty>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>get_rpm_version_data</command>
    </metadata>
</result>


Note:

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

   

Parameters

ParameterTypeDescriptionPossible valuesExample
sectionstring

Required

The RPM's section.

A valid RPM section.

rpm_groups
keystring

The RPM's key.

If you do not specify a value, the function returns all RPM categories.

A valid RPM key.

3rdparty

Returns

If you specify the key parameter, the function returns the following information:

ReturnTypeDescriptionPossible valuesExample

key-name

array

A list of all available RPMs.

Note:

The system uses the RPM's key name as the return name.

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

If you do not specify the key parameter, the function returns the following information:

ReturnTypeDescriptionPossible valuesExample
rpm_groupshashA hash of arrays that contain RPM information.This hash contains the key-name array.

key-name

array

A list of all available RPMs.

Note:

The system uses the RPM's key name as the return name.

The function returns this value in the rpm_groups array.

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