Child pages
  • UAPI Functions - UserTasks::retrieve
Skip to end of metadata
Go to start of metadata

Description

This function retrieves a cPanel account's user task queue information.

Each cPanel account uses a separate user task queue in order to ensure that processes for one user do not impede another user on the server.

 

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/UserTasks/retrieve


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieve the user task queue.
$templates = $cpanel->uapi(
    'UserTasks', 'retrieve',
);


Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieve the user task queue.
my $templates = $cpliveapi->uapi(
    'UserTasks', 'retrieve',
);


Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Template Toolkit
<!-- Retrieve the user task queue. -->
[% execute( 'UserTasks', 'retrieve' ); %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 

 Command Line
uapi --user=username UserTasks retrieve


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{  
   "errors":null,
   "metadata":{  
      "transformed":1
   },
   "status":1,
   "data":[
      {
          "id": "00000000/5a9ec8dd4c345d",
          "subsystem": "VersionControl",
          "action": "create",
          "args": {}
      },
      {
          "id": "00000000/h39dnn27suc13l",
          "subsystem": "VersionControl",
          "action": "create",
          "args": {
              "repository_root": "/home/user/public_html/example"
          }
      },
],
   "messages":null
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

This function does not accept parameters. 

Returns

ReturnTypeDescriptionPossible valuesExample

 

array of hashesAn unnamed array of hashes of data for a task in the user task queue.This array of hashes includes the id, subsystem, and action parameters and the args hash. 

id

string

The task's ID number.

The function returns this value in the task's hash.

A valid task ID.00000000/5a9ec8dd4c345d

subsystem

string

The subsystem that will handle the process.

The function returns this value in the task's hash.

VersionControl is the only possible value.

VersionControl

action

string

The task's action.

The function returns this value in the task's hash.

create is the only possible value.

create

args

hash

A hash of action- and subsystem-specific arguments.

The function returns this value in the task's hash.

One or more arguments for the specific action and subsystem.

For example, a task that returns an action value of create and a subsystem value of VersionControl will include the repository_root argument.