14 functions, invoked through the cpanel_uapi tool.
scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="Mime", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.
This function adds hotlink protection for a site. Hotlink protection will redirect users to another URL if they navigate to a file with a specified extension, but an allowed URL did not refer them.
Important:
When you disable the WebServer role, the system disables this function.
extensionsstringRequired
File types to hotlink protect. Note: To protect multiple file types, use a comma-separated list.
redirect_urlstringRequired
The URL to which the system sends hotlinkers.
urlsstringRequired
The site to hotlink protect. Note: To protect multiple URLs, separate each URL with a newline character.
allow_nullintegerOptional
Whether the domain allows hotlinks. 1 - Allows. 0 - Does not allow.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
When you disable the Web Server role, the system disables this function.
domainstringRequired
The domain from which to redirect.
redirectstringRequired
The URL to which to redirect.
redirect_wildcardintegerOptional
Whether to redirect all files within a directory to the same filename within the destination directory. 1 - Redirect all files within the directory. 0 - Do not redirect all files within the directory.
redirect_wwwintegerOptional
Whether to redirect domains with or without www. 2 - Redirect with www. 1 - Redirect without www. * 0 - Redirect with and without www.
srcstringOptional
A specific page from which to redirect.
typestringOptional
Whether the redirect is temporary. permanenttemp
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
When you disable the Web Server role, the system disables this function.
domainstringRequired
The domain name.
argsstringOptional
An argument string that contains the arguments of a Redirect or RedirectMatch directives.
docrootstringOptional
The absolute file path to the document root containing the .htaccess file to change. If you don't pass this parameter, the system looks up the document root from the domain parameter's value.
srcstringOptional
The specific page that redirects visitors.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
This function lists the redirects in an account's .htaccess files.
Important:
When you disable the Web Server role, the system disables this function.
destinationstringOptional
The string with which to filter results. Note: This will only return results that match the destination parameter exactly.
regexstringOptional
A Perl regular expression that filters the results. The system matches the regular expression to the sourceurl return value.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
destinationstring
The redirect's destination URL.
displaydomainstring
The domain to redirect. * ALL is the only possible value.
One of: ALL
displaysourceurlstring
The path to the file within the domain to test, relative to the home directory.
docrootstring
The absolute file path to the source domain's document root.
domainstring
The domain to redirect.
kindstring
The kind of redirect. rewrite — The request sent a redirect to another path on the server. redirect — The request sent a redirect for the URL. * redirectmatch — The request sent a redirect based on a regular expression match of the URL.
One of: rewriteredirectredirectmatch
matchwwwinteger
Whether the redirect matches www. subdomains. 1 — Matches. 0 — Does not match.