We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • UAPI Functions - PassengerApps::ensure_deps
Skip to end of metadata
Go to start of metadata

Description

This function installs the dependencies for a Passenger application.

Note:

This function starts the installation process. This may take a long time to complete.

Important:

In cPanel & WHM version 80 and later, when you disable the Web Server role, the system disables this function.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/PassengerApps/ensure_deps?type=npm&app_path=hello


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.
 
 // Ensure dependencies are installed.
$poll = $cpanel->uapi(
    'PassengerApps', 'ensure_deps',
    array(
        'type' 			  => 'npm',
        'app_path' 		  => 'hello',
  )
);


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.
 
#  Ensure dependencies are installed.
my $poll = $cpliveapi->uapi(
    'PassengerApps', 'ensure_deps',
    {
        'type'    		  => 'npm',
        'app_path'    	  => 'hello',
  }
);


Note:

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

 Command Line
uapi --user=username PassengerApps ensure_deps type="npm" app_path="hello"


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)
{
   "module" : "PassengerApps",
   "func" : "ensure_deps",
   "apiversion" : 3,
   "result" : {
      "messages" : null,
      "status" : 1,
      "metadata" : {},
      "data" : {
         "sse_url" : "/sse/UserTasks/00000000_5c6b12981f623d/ensure_deps.log"
      },
      "errors" : null,
      "warnings" : null
   }
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
typestring

Required

The application's type.

npm

Important:

This function currently only supports npm.

npm
app_pathstring

Required

The application's filepath.

A valid filepath, relative to the user's home directory.

hello

Returns

ReturnTypeDescriptionPossible valuesExample
sse_urlstring

The SSE interface to track the progress of the process.

A valid SSE URL.

/sse/UserTasks/00000000_5c6c8b18228a35/ensure_deps.log

task_idstringThe task id of the process.A valid task id.

00000000/5c76ec5566332c