cPanel/DirectoryIndexes
cPanel module

DirectoryIndexes

3 functions, invoked through the cpanel_uapi tool.

scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="DirectoryIndexes", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.

get_indexing GET#

Return directory indexing settings

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

dirstringRequired
The directory for which to check the indexing type.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

The 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.

list_directories GET#

Return subdirectories directory indexing settings

This function returns the directory indexing settings of the subdirectories in a directory.

dirstringRequired
The absolute path of the directory for which to return indexing information.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

childrenarray<object>
Subdirectories and their indexing information. Note: The function returns an object for each subdirectory in a directory.
pathstring
The subdirectory's absolute path.
stateobject
The subdirectory's indexing information.
index_typeany
currentobject
The user's current directory and its indexing information.
pathstring
The current directory's absolute path.
stateobject
The current directory's indexing information.
index_typeany
homeobject
The user's home directory and its indexing information.
pathstring
The home directory's absolute path.
stateobject
An object containing the home directory's indexing information.
index_typeany
parentobject
The current directory’s parent directory and its indexing information.
pathstring
The parent directory's absolute path.
stateobject
The parent directory's indexing information.
index_typeany

set_indexing GET#

Update directory indexing settings

This function configures the directory indexing settings for a directory on the cPanel account.

dirstringRequired
The directory for which to manage directory indexing.
typestringRequired
The type of directory indexing. 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.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

The 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.