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

Description

This function lists an account's Passenger applications.

Important:

In cPanel & WHM version 76 and later, when you disable the WebServer role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples


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


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.
 
// List the applications for the cPanel account.
$poll = $cpanel->uapi(
    'PassengerApps', 'list_applications',
);


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.
 
#  List the applications for the cPanel account.
my $poll = $cpliveapi->uapi(
    'PassengerApps', 'list_applications',
);


Note:

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

 Command Line
uapi --user=username PassengerApps list_applications


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)
{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
      
  },
	"data": {
	  "slippers" => {
		"domain" : "dorothy.com",
		"base_uri" : "/ruby",
		"enabled" : 1,
        "deps" : {
             "npm" : "cd /home/dorothy/slippers && /opt/cpanel/ea-nodejs10/bin/npm install"
         },
		"envvars" : {},
		"name" : "slippers",
		"path" : "/home/dorothy/slippers",
		"deployment_mode" : "production",
  },
	 "toto" => {
		"domain" : "notinkansas.com",
		"base_uri" : "/littledog",
		"enabled" : 1,
        "deps" : {
             "npm" : "cd /home/dorothy/toto && /opt/cpanel/ea-nodejs10/bin/npm install"
         },
		"envvars" : {},
		"name" : "toto",
		"path" : "/home/dorothy/toto",
		"deployment_mode" : "production",
    }
  }
}


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
application namehash

A hash of application data.

Note:

The hash's name is the application name.

This hash contains the deps hash and the base_uri, domain, enabled, envvars, name, path, and deployment_mode returns.


base_uri

string

The application's base URI.

The function returns this value in the application name hash.

A valid base URI./ruby

domain

string

The domain on which the function created the application.

The function returns this value in the application name hash.

A valid domain on the cPanel account.dorthy.com

enabled

Boolean

Whether the application is enabled or disabled.

The function returns this value in the application name hash.

  • 1 — Enabled.
  • 0 — Disabled.
1

envvars

hash

A hash of application environment variables and their values.

The function returns this value in the application name hash.

A hash of valid environment variables and their values.

name

string

The application's name.

The function returns this value in the application name hash.

A valid application name.slippers

path

string

The application's filepath.

The function returns this value in the application name hash.

A valid filepath./home/dorthy/slippers

deployment_mode

string

The application's environment type.

The function returns this value in the application name hash.

  • development
  • production
production

deps

hash

A hash of application types and the command to install an application's dependencies, if needed.

The function returns this value in the application name hash.

Note:

We added this return in cPanel & WHM version 80.

This hash includes the apptype return.
                

apptype

string

The command to install an application's dependencies, if needed.

The function returns this value in the deps hash.

Notes:

  • We added this return in cPanel & WHM version 80.
  • The return's name is the application type.

A valid shell command.

Note:

If an application does not use the specified application type, this value returns a 0.

cd /home/username/hello && /opt/cpanel/ea-nodejs10/bin/npm install