Class Script
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclearGlobalCustomVar(String varkey) Clears a global custom variable.clearGlobalVar(String varkey) Clears the global variable with the given key.Clears the global variables.clearScriptCustomVar(String scriptname, String varkey) Clears a script custom variable.clearScriptVar(String scriptname, String varkey) Clears the variable with the given key of the given script.clearScriptVars(String scriptname) Clears the variables of the given script.Disables the script with the given nameEnables the script with the given nameglobalCustomVar(String varkey) Gets the value (string representation) of a global custom variable.Gets all the global custom variables (key/value pairs, the value is the string representation).Gets the value of the global variable with the given key.Gets all the global variables (key/value pairs).Lists the script engines availableLists the scripts available, with its engine, name, description, type and error state.Lists the script types available.load(String scriptname, String scripttype, String scriptengine, String filename, String scriptdescription, Charset charset) Loads a script into ZAP from the given local file, with the given name, type and engine, optionally with a description, and a charset name to read the script (the charset name is required if the script is not in UTF-8, for example, in ISO-8859-1).Removes the script with the given namerunStandAloneScript(String scriptname) Runs the stand alone script with the given namescriptCustomVar(String scriptname, String varkey) Gets the value (string representation) of a custom variable.scriptCustomVars(String scriptname) Gets all the custom variables (key/value pairs, the value is the string representation) of a script.Gets the value of the variable with the given key for the given script.scriptVars(String scriptname) Gets all the variables (key/value pairs) of the given script.setGlobalVar(String varkey, String varvalue) Sets the value of the global variable with the given key.setScriptVar(String scriptname, String varkey, String varvalue) Sets the value of the variable with the given key of the given script.Methods inherited from class org.zaproxy.clientapi.gen.deprecated.ScriptDeprecated
disable, enable, load, load, remove, runStandAloneScript
-
Constructor Details
-
Script
-
-
Method Details
-
listEngines
Lists the script engines availableThis component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
listTypes
Lists the script types available.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
listScripts
Lists the scripts available, with its engine, name, description, type and error state.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
globalVar
Gets the value of the global variable with the given key. Returns an API error (DOES_NOT_EXIST) if no value was previously set.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
globalCustomVar
Gets the value (string representation) of a global custom variable. Returns an API error (DOES_NOT_EXIST) if no value was previously set.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
globalVars
Gets all the global variables (key/value pairs).This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
globalCustomVars
Gets all the global custom variables (key/value pairs, the value is the string representation).This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
scriptVar
Gets the value of the variable with the given key for the given script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists or if no value was previously set.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
scriptCustomVar
Gets the value (string representation) of a custom variable. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists or if no value was previously set.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
scriptVars
Gets all the variables (key/value pairs) of the given script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
scriptCustomVars
Gets all the custom variables (key/value pairs, the value is the string representation) of a script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
enable
Enables the script with the given nameThis component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
disable
Disables the script with the given nameThis component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
load
public ApiResponse load(String scriptname, String scripttype, String scriptengine, String filename, String scriptdescription, Charset charset) throws ClientApiException Loads a script into ZAP from the given local file, with the given name, type and engine, optionally with a description, and a charset name to read the script (the charset name is required if the script is not in UTF-8, for example, in ISO-8859-1).This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
remove
Removes the script with the given nameThis component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
runStandAloneScript
Runs the stand alone script with the given nameThis component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
clearGlobalVar
Clears the global variable with the given key.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
clearGlobalCustomVar
Clears a global custom variable.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
clearGlobalVars
Clears the global variables.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
clearScriptVar
Clears the variable with the given key of the given script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
clearScriptCustomVar
Clears a script custom variable.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
clearScriptVars
Clears the variables of the given script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
setScriptVar
public ApiResponse setScriptVar(String scriptname, String varkey, String varvalue) throws ClientApiException Sets the value of the variable with the given key of the given script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-
setGlobalVar
Sets the value of the global variable with the given key.This component is optional and therefore the API will only work if it is installed
- Throws:
ClientApiException
-