- Created by Documentation, last modified on Oct 05, 2018
disable_authentication_provider
disable_failing_authentication_providers
enable_authentication_provider
get_available_authentication_providers
get_provider_client_configurations
get_provider_configuration_fields
get_provider_display_configurations
get_users_authn_linked_accounts
set_provider_client_configurations
set_provider_display_configurations
twofactorauth_generate_tfa_config
twofactorauth_get_user_configs
cpgreylist_is_server_netblock_trusted
cpgreylist_list_entries_for_common_mail_provider
cpgreylist_load_common_mail_providers_config
cpgreylist_save_common_mail_providers_config
cpgreylist_trust_entries_for_common_mail_provider
cpgreylist_untrust_entries_for_common_mail_provider
create_cpgreylist_trusted_host
delete_cpgreylist_trusted_host
Description
This function updates a vendor with the current version of the rule set.
Important:
WebServer
role, the system disables this function. For more information, read our How to Use Server Profiles documentation.Examples
https://hostname.example.com:2087/cpsess##########/json-api/modsec_update_vendor?api.version=1&url=http%3A%2F%2Fexample.com%2Fupdate%2Fmeta_MyVendor.yaml
https://hostname.example.com:2087/cpsess##########/xml-api/modsec_update_vendor?api.version=1&url=http%3A%2F%2Fexample.com%2Fupdate%2Fmeta_MyVendor.yaml
whmapi1 modsec_update_vendor url=http%3A%2F%2Fexample.com%2Fupdate%2Fmeta_MyVendor.yaml%20
Notes:
- You must URI-encode values.
- For more information and additional output options, read our Guide to WHM API 1 documentation or run the
whmapi1 --help
command. If you run CloudLinux™, you must use the full path of the
whmapi1
command:/usr/local/cpanel/bin/whmapi1
{ "data": { "diagnostics": { "deleted_configs": [ "modsec_vendor_configs/MyVendor/one.conf" ], "new_configs": [ { "vendor_id": "MyVendor", "active": 0, "config": "modsec_vendor_configs/MyVendor/two.conf" }, { "vendor_id": "MyVendor", "active": 1, "config": "modsec_vendor_configs/MyVendor/three.conf" } ], "added_configs": [ "modsec_vendor_configs/MyVendor/three.conf" ], "prev_configs": [ { "config": "modsec_vendor_configs/MyVendor/one.conf" }, { "config": "modsec_vendor_configs/MyVendor/two.conf" } ] }, "vendor": { "locked": 0, "vendor_url": "http://www.example.com/", "inst_dist": "MyVendor-2", "vendor_id": "MyVendor", "installed": 1 "cpanel_provided": 0 "name": "My Vendor", "path": "/usr/local/apache/conf/modsec_vendor_configs/MyVendor", "installed_from": "http://example.com/update/meta_MyVendor.yaml", "description": "This is an example of a custom vendor set (updated)", "archive_url": "http://example.com/update/MyVendor.zip", "dist_md5": "ecafce1bf148532250a8d4743a8374d1", "enabled": 1 } }, "metadata": { "version": 1, "reason": "OK", "result": 1, "command": "modsec_update_vendor" } }
<result> <data> <diagnostics> <deleted_configs>modsec_vendor_configs/MyVendor/one.conf</deleted_configs> <new_configs> <vendor_id>MyVendor</vendor_id> <active>0</active> <config>modsec_vendor_configs/MyVendor/two.conf</config> </new_configs> <new_configs> <vendor_id>MyVendor</vendor_id> <active>1</active> <config>modsec_vendor_configs/MyVendor/three.conf</config> </new_configs> <added_configs>modsec_vendor_configs/MyVendor/three.conf</added_configs> <prev_configs> <config>modsec_vendor_configs/MyVendor/one.conf</config> </prev_configs> <prev_configs> <config>modsec_vendor_configs/MyVendor/two.conf</config> </prev_configs> </diagnostics> <vendor> <archive_url>http://example.com/update/MyVendor.zip</archive_url> <cpanel_provided>0</cpanel_provided> <description>This is an example of a custom vendor set (updated)</description> <dist_md5>ecafce1bf148532250a8d4743a8374d1</dist_md5> <enabled>1</enabled> <inst_dist>MyVendor-2</inst_dist> <installed>1</installed> <installed_from>http://example.com/update/meta_MyVendor.yaml</installed_from> <name>My Vendor</name> <path>/usr/local/apache/conf/modsec_vendor_configs/MyVendor</path> <vendor_id>MyVendor</vendor_id> <vendor_url>http://www.example.com</vendor_url> </vendor> </data> <metadata> <version>1</version> <reason>OK</reason> <result>1</result> <command>modsec_update_vendor</command> </metadata> </result>
Note:
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
| string | Required The vendor metadata file's URL. | A valid URL. |
|
Returns
Return | Type | Description | Possible values | Example |
---|---|---|---|---|
| hash | A hash of updated vendor information. | This hash includes the |
|
| Boolean | Whether the vendor is installed. The function returns this value in the |
|
|
| string | The URL to the vendor's website. The function returns this value in the | A valid URL. |
|
| string | The unique identifier for the rule set version. The function returns this parameter in the | A valid string. |
|
| string | The vendor's unique short name. The function returns this parameter in the | A valid string. |
|
| string | The vendor's name. The function returns this parameter in the | A valid string. |
|
| string | The file path to the vendor's ModSecurity configuration files. The function returns this value in the | An absolute file path. | Click to view...
|
| string | The URL to the vendor's metadata file. The function returns this value in the | A valid URL. | Click to view...
|
| string | The vendor's description. The function returns this value in the | A valid string. | Click to view...
|
| string | The URL to download the vendor rules. The function returns this value in the | A valid URL. | Click to view...
|
| string | The download's MD5 checksum value. The function returns this value in the | A valid checksum. |
|
| Boolean | Whether the vendor is enabled. The function returns this value in the |
|
|
| hash | A hash of diagnostic information about the update. | This hash includes the |
|
| array | A list of configuration files that the update added. The function returns this array in the | A list of added ModSecurity configuration files. | Click to view...
|
| array | A list of configuration files that the update removed. The function returns this array in the | An array of deleted ModSecurity configuration files. | Click to view...
|
| array of hashes | A complete list of configuration files that the update modified. The function returns this array in the | Each hash includes the |
|
| Boolean | Whether the configuration file is active. The function returns this value in the |
|
|
| string | The file path to the configuration file. The function returns this value in the | A path to the configuration file, relative to the | Click to view...
|
| string | The vendor's unique name. The function returns this value in the | A valid string. |
|
| array of hashes | A complete list of configuration files in the old version. The function returns this array in the | Each hash includes the |
|
| string | The file path of the configuration file. The function returns this value in the | A path to the configuration file, relative to the | Click to view...
|
Function information
API Version:
Available in:
WHM 11.48+
Methods:
GET, POST
Required Parameters:
url
Return Formats:
About WHM API 1
WHM API 1 performs functions and accesses data in WHM.
Notes:
- Some functions and parameters may require that you authenticate as the
root
user. - You must use the appropriate WHM ports (
2086
or2087
) to call WHM API functions.
Find a function
Related functions
-
Page:WHM API 1 Sections - ModSecurity — ModSecurity functions allow you to manage ModSecurity rules and vendors on your server.
-
Page:WHM API 1 Functions - modsec_add_rule — This function adds a new rule to a ModSecurity™ configuration staging file.
-
Page:WHM API 1 Functions - modsec_assemble_config_text — This function adds text to a ModSecurity™ configuration file.
-
Page:WHM API 1 Functions - modsec_add_vendor — This function adds a new ModSecurity™ vendor rule set to the server.
-
Page:WHM API 1 Functions - modsec_clone_rule — This function copies a ModSecurity™ rule with a new rule ID.