Child pages
  • WHM API 0 Functions - addpkg

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function creates a hosting plan (package).


Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/addpkg?name=package1&featurelist=default&quota=unlimited



Expand
titleXML API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/addpkg?name=package1&featurelist=default&quota=unlimited



Expand
titleCommand Line


Code Block
languagebash
whmapi0 addpkg name=package1 featurelist=default quota=unlimited

Include Page
LIB:_WHMAPI0CLINote
LIB:_WHMAPI0CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
   "result":[
      {
         "status":1,
         "statusmsg":"Created the package package1",
         "pkg":"package1"
      }
   ]
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<addpkg>
     <result>
            <pkg>package1</pkg>
            <status>1</status>
            <statusmsg>Created the package package1</statusmsg>
      </result>
</addpkg>




Parameters

ParameterTypeDescriptionPossible valuesExample
namestring

Required

The new hosting plan's name.

A valid hosting plan name.

Note
titleNotes:
  • You cannot use the name extensions.
  • You cannot modify hosting plan names after creation. Do not include details that may change over time, such as price.


package1
featureliststring

The hosting plan's feature list.

If you do not use this parameter, the function assigns the default feature list to the account.

A valid feature list name on the server.feature_list
quotainteger

The hosting plan's disk space quota.

This parameter defaults to 0 (unlimited).

  • A positive integer between one and 999,999 that represents the maximum disk space that the account may use, in Megabytes (MB).
  • 0 — The hosting plan's disk space is unlimited.
500
ipstring

Whether the account has a dedicated IP address.

This parameter defaults to n.

  • y — The account possesses a dedicated IP address.
  • n — The account does not possess a dedicated IP address.
n
cgiBoolean

Whether CGI access is enabled for the account.

This parameter defaults to 1.

  • 1 — Enabled.
  • 0 — Disabled.
1
frontpageBoolean

Whether Microsoft® FrontPage Extensions are enabled for the account.

Note
titleNote:

cPanel & WHM will ignore all FrontPage settings and parameters if either of the following statements is true:

  • The server runs cPanel & WHM version 11.44 and FrontPage Extensions are not installed.
  • The server runs cPanel & WHM version 11.46 or later.


  • 1 — Enabled.
  • 0 — Disabled.
0
cpmodstring

The hosting plan's cPanel theme.

This parameter defaults to the server's default cPanel theme.

  • paper_lantern
  • A valid theme on the server.
paper_lantern
languagestring

The hosting plan's default locale.

This value defaults to the server's default locale.

A two-letter ISO-3166 code. en
maxftpstring

The hosting plan's maximum number of FTP accounts.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0, unlimited, or null — The account possesses unlimited FTP accounts.
unlimited
maxsqlstring

The hosting plan's maximum number of each available type of SQL database.

For example, if you set this value to 5 and the system administrator allows MySQL® and PostgreSQL® databases , users can create up to five MySQL databases and up to five PostgreSQL databases.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0, unlimited, or null — The account possesses unlimited databases.
unlimited
maxpopstring

The hosting plan's maximum number of email accounts.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0, unlimited, or null — The account possesses unlimited email accounts.
unlimited
maxlistsstring

The hosting plan's maximum number of mailing lists.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0, unlimited, or null — The account possesses unlimited mailing lists.
unlimited
maxsubstring

The hosting plan's maximum number of subdomains.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999.
  • 0, unlimited, or null — The account possesses unlimited subdomains.
unlimited
maxparkstring

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

This parameter defaults to 0.

  • An integer between zero and 999,999.
  • unlimited or null — The account possesses unlimited possesses domains.
unlimited
maxaddonstring

The hosting plan's maximum number of addon domains.

This parameter defaults to 0.

  • An integer between zero and 999,999.
  • unlimited or null — The account possesses unlimited addon domains.
unlimited
hasshellBoolean

Whether the account has shell access.

This parameter defaults to 0.

  • 1 — The account has shell access.
  • 0 — No shell access.
1
bwlimitstring

The hosting plan's maximum bandwidth use.

This parameter defaults to unlimited.

  • A positive integer between one and 999,999 that represents the maximum bandwidth use, in Megabytes (MB).
  • 0, unlimited, or null — The account possesses unlimited bandwidth.
unlimited
MAX_EMAIL_PER_HOURinteger

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

This parameter defaults to unlimited.

Note
titleNote:

We added this parameter in cPanel & WHM version 11.32. 


  • A positive integer.
  • 0 or unlimited — The account can send an unlimited number of emails.
unlimited
MAX_DEFER_FAIL_PERCENTAGEinteger

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

Note
titleNote:

We added this parameter in cPanel & WHM version 11.32. 


  • A positive integer.
  • 0 or unlimited — The account can send an unlimited number of failed or deferred messages.
unlimited
digestauthBoolean

Whether to enable Digest Authentication for accounts on the hosting plan.

Note
titleNote:

We added this parameter in cPanel & WHM version 11.34.

This parameter defaults to 0.

  • 1 — Enable.
  • 0 — Disable.
1
_PACKAGE_EXTENSIONSstring

The hosting plan's package extensions.

If you do not provide a value, the hosting plan will not include package extensions.

Note
titleNote:

We added this parameter in cPanel & WHM version 11.40.


A space-delimited list of one or more package extensions on the server.

Note
titleNotes:
  • You can also include the extension's variables in your function call, in key=value format. Consult the extension's documentation for a list of possible variables.
  •  Extension names and variables are case-sensitive.


extension1 extension2 extension3

Returns

ReturnTypeDescriptionPossible valuesExample
resultarray of hashesA hash of function information.This hash includes the status, statusmsg, and pkg returns. 

status

Boolean

Whether the function succeeded.

The function returns this value in the result hash.

  • 1 — Success.
  • 0 — Failure.
1

statusmsg

string

A message of success or a reason for failure.

The function returns this value in the result hash.

  • Created the package package1
  • An error message.
Created the package package1

pkg

string

The new hosting plan's name.

The function returns this value in the result hash.

The name input parameter's value.package1