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

Description

This function matches the server's hosting plans (packages) against your criteria.

Examples


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


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",
      "MAX_EMAILACCT_QUOTA": "unlimited",
      "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"
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "matchpkgs"
  }
}
 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>
			<MAX_EMAILACCT_QUOTA>unlimited</MAX_EMAILACCT_QUOTA>
            <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>
        </pkg>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>matchpkgs</command>
    </metadata>
</result>


Note:

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

Parameters

Note:

If you do not include any input parameters, the function lists all of the server's packages. 

ParameterTypeDescriptionPossible valuesExample

MAXSUB

string

The hosting plan's maximum number of subdomains.

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

MAXADDON

string

The hosting plan's maximum number of addon domains.

  • 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.

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

The maximum size that the hosting plan can define when it creates an email account.

Note:

We introduced this return in cPanel & WHM version 70.

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

_PACKAGE_EXTENSIONS

string

The hosting plan's package extensions.

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

CPMOD

string

The hosting plan's cPanel interface theme.

  • 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.

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

LANG

string

The hosting plan's locale.

The ISO code for any locale on the server.en

MAXLST

string

The hosting plan's maximum number of mailing lists.

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

MAXPARK

string

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

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

MAXSQL

string

The hosting plan's maximum number of SQL databases.

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

FEATURELIST

string

The hosting plan's featurelist.

A valid feature list name.default

CGI

Boolean

Whether CGI is enabled for the hosting plan.

  • 1 — Enabled.
  • 0 — Disabled.
1

MAXFTP

string

The hosting plan's maximum number of FTP accounts.

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

BWLIMIT

string

The hosting plan's bandwidth limit.

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

QUOTA

string

The hosting plan's disk space limit.

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

DIGESTAUTH

string

Whether the hosting plan enables Digest Authentication.

  • y — Enable.
  • n — Disable.
n

IP

string

Whether the hosting plan grants accounts a dedicated IP address.

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

 

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, MAX_EMAILACCT_QUOTA,_PACKAGE_EXTENSIONSCPMOD, MAX_EMAIL_PER_HOURLANG, MAXLSTMAXPARKMAXSQL, FEATURELISTCGIMAXFTP, BWLIMITQUOTADIGESTAUTH, 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

MAX_EMAILACCT_QUOTA

integer

The maximum size that the account can define when it creates an email account.

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 allowable maximum size of an email account, in Megabytes (MB).
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

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.

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