Description

This function lists the server's available scripting languages.

Examples


https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=LangMods&cpanel_jsonapi_func=langlist

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieve list of available languages.
$get_lang_list = $cpanel->api2(
    'LangMods', 'langlist'
		
 );

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Retrieve list of available languages.
my $get_lang_list = $cpliveapi->api2(
    'LangMods', 'langlist',

		)
  );

 

cpapi2 --user=username LangMods langlist

{
  "cpanelresult": {
    "apiversion": 2,
    "func": "langlist",
    "data": [
      {
        "lang": "perl",
        "name": "Perl Module"
      },
      {
        "lang": "php-pear",
        "name": "PHP Extensions and Applications Package"
      },
      {
        "lang": "ruby",
        "name": "Ruby Gem"
      },
      {
        "lang": "php-pecl",
        "name": "PHP Pecl"
      }
    ],
    "event": {
      "result": 1
    },
    "module": "LangMods"
  }
}

Parameters

This function does not accept parameters.

 

Returns

ReturnTypeDescriptionPossible valuesExample
lang string

The language system's short name.

The language system's short name.

perl
namestringThe language system's long name.The language system's long name.Perl Module
reasonstring

A reason for failure.

This function only returns a value if there was an error.

A string that describes the error.This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1