Child pages
  • WHM API 1 Functions - modsec_assemble_config_text

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function adds text to a ModSecurity™ configuration file.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledWebServerRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleJSON API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/modsec_assemble_config_text?api.version=1&config=modsec_vendor_configs%2Fexample.conf&text=newtext&init=1&final=1&deploy=1



Expand
titleXML API


Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/modsec_assemble_config_text?api.version=1&config=modsec_vendor_configs%2Fexample.conf&text=newtext&init=1&final=1&deploy=1



Expand
titleCommand Line


Code Block
languagebash
whmapi1 modsec_assemble_config_text config=modsec_vendor_configs%5C%2Fexample.conf text=newtext init=1 final=1 deploy=1

Include Page
LIB:_WHMAPI1CLINote
LIB:_WHMAPI1CLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
    "data": {},
    "metadata": {
        "version": 1,
        "reason": "OK",
        "result": 1,
        "command": "modsec_assemble_config_text"
    }
}



Expand
titleOutput (XML)


Code Block
languagetext
linenumberstrue
<result>
  <data></data>
  <metadata>
    <command>modsec_assemble_config_text</command>
    <reason>OK</reason>
    <result>1</result>
    <version>1</version>
  </metadata>
</result>


Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
configstring

Required

The ModSecurity™ configuration file's path and name.

A valid path and filename, relative to the /etc/apache2/conf/ directory. modsec_vendor_configs/example.conf
textstring

The text to add to the configuration file.

This parameter defaults to an empty string.

A valid string.newtext
initBoolean

Whether to add the text as the initial upload to the configuration file.

This value defaults to 0.

Note
titleNotes:
  • You must use this parameter if you wish to add the text as the initial change to the configuration file.
  • You must use the final parameter with this parameter if you wish to only make one change to the configuration file.


  • 1 — Initial upload.
  • 0Not the initial upload.
1
finalBoolean

Whether to add the text as the final upload to the configuration file.

This parameter defaults to 0.

Note
titleNotes:
  • You must use this parameter if you wish to add the text as the final change to the configuration file.
  • You must use the init parameter with this parameter if you wish to only make one change to the configuration file.


  • 1 — Final upload.
  • 0Not the final upload.
1
deployBoolean

Whether to deploy the new text to the system.

This parameter defaults to 0.

  • 1 — Deploy.
  • 0 — Do not deploy.
1

Returns

This function only returns metadata.