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

Description

This function lists a hosting plan's (package's) settings.

Examples


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


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": {
    "pkg": {
      "FEATURELIST": "default",
      "QUOTA": "100",
      "MAXSUB": "5",
      "MAXADDON": "1",
      "MAX_DEFER_FAIL_PERCENTAGE": "10",
      "CGI": 1,
      "HASSHELL": 1,
      "DIGESTAUTH": "y",
      "MAX_EMAIL_PER_HOUR": "100",
      "LANG": "en",
      "MAXFTP": "2",
      "CPMOD": "paper_lantern",
      "MAXLST": "5",
      "MAXPARK": "1",
      "BWLIMIT": null,
      "FRONTPAGE": 0,
      "IP": 0,
      "MAXPOP": "20",
      "MAXSQL": "1"
      "MAX_EMAILACCT_QUOTA:": "unlimited"
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "getpkginfo"
  }
}
 Output (XML)
<result>
    <data>
        <pkg>
            <FEATURELIST>default</FEATURELIST>
            <QUOTA>100</QUOTA>
            <MAXSUB>5</MAXSUB>
            <MAXADDON>1</MAXADDON>
            <MAX_DEFER_FAIL_PERCENTAGE>10</MAX_DEFER_FAIL_PERCENTAGE>
            <CGI>1</CGI>
            <HASSHELL>1</HASSHELL>
            <DIGESTAUTH>y</DIGESTAUTH>
            <MAX_EMAIL_PER_HOUR>100</MAX_EMAIL_PER_HOUR>
            <LANG>en</LANG>
            <MAXFTP>2</MAXFTP>
            <CPMOD>paper_lantern</CPMOD>
            <MAXLST>5</MAXLST>
            <MAXPARK>1</MAXPARK>
            <BWLIMIT/>
            <FRONTPAGE>0</FRONTPAGE>
            <IP>0</IP>
            <MAXPOP>20</MAXPOP>
            <MAXSQL>1</MAXSQL>
            <MAX_EMAILACCT_QUOTA>unlimited</MAX_EMAILACCT_QUOTA>
        </pkg>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>getpkginfo</command>
    </metadata>
</result>


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
pkgstring

Required

The hosting plan's name.

A valid hosting plan name on the server.package1

Returns

ReturnTypeDescriptionPossible valuesExample
pkghashA hash of hosting plan settings.

This function contains one or more of the following returns: name, MAXSUB, MAXADDON, MAX_DEFER_FAIL_PERCENTAGE, _PACKAGE_EXTENSIONS, CPMOD, MAX_EMAIL_PER_HOUR, MAX_EMAILACCT_QUOTA, LANG, MAXLST, MAXPARK, MAXSQL, FEATURELIST, CGI, MAXFTP, BWLIMIT, QUOTA, DIGESTAUTH, IP.

Note:

If the hosting plan uses package extensions, the pkg hash will also include the extension's variables.

 

MAXSUB

string

The hosting plan's maximum number of subdomains.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of subdomains.
unlimited  

MAXADDON

string

The hosting plan's maximum number of addon domains.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of addon domains.
unlimited

MAX_DEFER_FAIL_PERCENTAGE

string

The percentage of failed or deferred email messages that the hosting plan can send per hour before outgoing mail is rate-limited.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a percentage of messages.
unlimited

_PACKAGE_EXTENSIONS

string

The hosting plan's package extensions.

The function returns this value in the pkg hash.

A space-separated list of one or more package extension names.ext1 ext2 ext3

CPMOD

string

The hosting plan's cPanel interface theme.

The function returns this value in the pkg hash.

  • paper_lantern
  • Another valid theme on the server.
paper_lantern

MAX_EMAIL_PER_HOUR

string

The maximum number of emails that the hosting plan can send in one hour.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of sent emails.
unlimited

MAX_EMAILACCT_QUOTA

string

The hosting plan's maximum email account quota size, in Megabytes (MB).

Note:

We introduced this return in cPanel & WHM version 70.

This function returns this value in the pkg hash.

  • unlimited
  • A positive integer that represents the maximum email account quota size, in Megabytes (MB).
unlimited

LANG

string

The hosting plan's locale.

The function returns this value in the pkg hash.

The ISO code for any locale on the server.en

MAXLST

string

The hosting plan's maximum number of mailing lists.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of mailing lists.
unlimited

MAXPARK

string

The hosting plan's maximum number of parked domains (aliases).

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of parked domains.
unlimited  

MAXSQL

string

The hosting plan's maximum number of SQL databases.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of SQL databases.
unlimited  

FEATURELIST

string

The hosting plan's featurelist.

The function returns this value in the pkg hash.

A valid feature list name.default

CGI

Boolean

Whether CGI is enabled for the hosting plan.

The function returns this value in the pkg hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

MAXFTP

string

The hosting plan's maximum number of FTP accounts.

The function returns this value in the pkg hash.

  • unlimited
  • An integer that represents a number of FTP accounts.
unlimited

BWLIMIT

string

The hosting plan's bandwidth limit.

The function returns this value in the pkg hash.

  • unlimited
  • A maximum amount of bandwidth, in Megabytes (MB).
unlimited

QUOTA

string

The hosting plan's disk space limit.

The function returns this value in the pkg hash.

  • unlimited
  • A maximum amount of disk space, in Megabytes (MB).
unlimited

DIGESTAUTH

string

Whether the hosting plan enables Digest Authentication.

The function returns this value in the pkg hash.

  • y — Enable.
  • n — Disable.
n

IP

string

Whether the hosting plan grants accounts a dedicated IP address.

The function returns this value in the pkg hash.

  • y — Dedicated IP address.
  • n — Shared IP address.
n