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 - DirectoryIndexes::get_indexing
Skip to end of metadata
Go to start of metadata

Description

This function returns the directory indexing settings for a directory on the cPanel account and its subdirectories.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/DirectoryIndexes/get_indexing?dir=2Fhome%2Fexample%2Fexample.com


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.
 
// Check the /home/example/example.com directory's indexing settings.
$is_directory_indexed = $cpanel->uapi(
    'DirectoryIndexes', 'get_indexing',
    array(
        'dir'    => '/home/example/example.com',
  	)
);


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.
 
# Check the /home/example/example.com directory indexing settings.
my $is_directory_indexed = $cpliveapi->uapi(
    'DirectoryIndexes', 'get_indexing',
    {
        'dir'      => '/home/example/example.com',
    }
);


Note:

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

 

 Command Line
uapi --user=username DirectoryIndexes get_indexing dir=2Fhome%2Fexample%2Fexample.com 


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)
{
  "result": {
    "data": "standard",
    "errors": null,
    "messages": null,
    "metadata": {},
    "status": 1,
    "warnings": null
  }
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
dirstring

Required

The directory for which to check the indexing type.

A valid directory path on the cPanel account./home/example/example.com

Returns

ReturnTypeDescriptionPossible valuesExample
data stringThe directory's indexing type.
  • standard — The directory uses directory indexing with standard formatting.
  • disabled — The directory doesn't use directory indexing.
  • inherit — The directory uses the system's default settings.
  • fancy —  The directory uses directory indexing with Apache® FancyIndexing directive. The directory will include additional information such as file size and the date of the file's last update.
disabled