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

Description


This function adds a package extension to a hosting plan (package).

Note:

If you need to edit a package extension's parameters, call this function again with the same package extension name and the updated package extension variables. 

Examples


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


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": "package1"
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "addpkgext"
  }
}
 Output (XML)
<result>
    <data>
        <pkg>package1</pkg>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>addpkgext</command>
    </metadata>
</result>


Note:

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

   

Parameters

ParameterTypeDescriptionPossible valuesExample
namestring

Required

The hosting plan's name.

A valid hosting plan name.

Note:

You cannot use the name extensions.

package1
_PACKAGE_EXTENSIONSstring

Required

The hosting plan's package extensions.

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

Notes:

  • 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

Returns

ReturnTypeDescriptionPossible valuesExample

pkg

string

The hosting plan's name.

The name input parameter's value.package1