Edit a Package — editpkg

This function edits all aspects of a specific hosting package.

ALERT! Warning: Editing a package will cause all accounts using that package to be updated to the new values defined in the package.

Calling Functions

Using the XML API

To use the XML API to perform the editpkg function from within your custom script:

  • Append the /xml-api/editpkg function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/xml-api/editpkg

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Using the JSON API

To use the JSON API to perform the editpkg function from within your custom script:

  • Append the /json-api/editpkg function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/json-api/editpkg

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Variables

Input

The editpkg function takes the following variables as input.

The following variable is required:

  • name (string) — Name of the package you wish to edit.

The following variables are optional:

  • featurelist (string) — Name of the feature list to be used for the package.
  • quota (integer) — Disk space quota for the package (in Megabytes). Maximum: unlimited
  • ip (boolean) — Whether or not the account has a dedicated IP.
    • 1 — yes.
    • 0 — no.
  • cgi (boolean) — Whether or not the account has CGI access. * 1 — yes.
    • 0 — no.
  • frontpage (boolean) — Whether or not the account can install FrontPage extensions.
    • 1 — yes.
    • 0 — no.
  • cpmod (string) — The default theme for the package.
  • language (string) — Name of the language to be used for this package by default.
  • maxftp (integer) — The number of FTP accounts a user assigned to the package can create. Maximum: 999
  • maxsql (integer) — The number of SQL databases a user assigned to the package can create. Maximum: 999
  • maxpop (integer) — The number of email accounts a user assigned to the package can create. Maximum: 999
  • maxlists (integer) — The number of email lists a user assigned to the package can create. Maximum: 999
  • maxsub (integer) — The number of subdomains a user assigned to the package can create. Maximum: 999
  • maxpark (integer) — The number of parked domains a user assigned to the package can create. Maximum: 999
  • maxaddon (integer) — The number of addon domains a user assigned to the package can create. Maximum: 999
  • hasshell (boolean) — Whether or not the account has shell access.
    • 1 — yes.
    • 0 — no.
  • bwlimit (integer) — The amount of bandwidth the account can use in a month. Maximum: unlimited

Output

  • editpkg — Root-level XML tag for the output of the editpkg function.
    • result — Container for the result of the package addition function.
      • pkg (string) — Name of the package that was edited.
      • status (boolean) — Whether or not the operation was successful.
        • 1 — yes.
        • 0 — no.
      • statusmsg (string) — Message about the result of the operation.

Examples

XML API

note Note: Submit the entire request as a single string. For display purposes, the example below may be wrapped.

Calling https://example.com:2087/xml-api/editpkg?name=packagename&featurelist=Default&quota=0&ip=1&cgi=1&frontpage=1&cpmod=x3&maxftp=9 &maxsql=99&maxpop=999&maxlst=999&maxsub=888&maxpark=88&maxaddon=888&hasshell=1&bwlimit=9999 in WebHost Manager will produce output similar to:

<editpkg>
     <result>
            <pkg>packagename</pkg>
            <status>1</status>
            <statusmsg>Modified the package packagename</statusmsg>
      </result>
</editpkg>

JSON API

note Note: Submit the entire request as a single string. For display purposes, the example below may be wrapped.

Calling https://example.com:2087/json-api/editpkg?name=packagename&featurelist=Default&quota=0&ip=1&cgi=1&frontpage=1&cpmod=x3&maxftp=9 &maxsql=99&maxpop=999&maxlst=999&maxsub=888&maxpark=88&maxaddon=888&hasshell=1&bwlimit=9999 in WebHost Manager will produce output similar to:

{
   "result":[
      {
         "status":1,
         "statusmsg":"Modified the package packagename",
         "changepackage":[

         ],
         "pkg":"packagename"
      }
   ]
}

Topic revision: r5 - 29 Sep 2009 - 17:58:40 - Main.MelanieSeibert
 

Copyright © cPanel 2000-2009.