Update Parser

Updates an existing parser. Cluster administrator privileges are required to call this API.

HTTP Request

PUT /api/sonar/parsers/:code
Request using cURL
curl -H "Authorization: Bearer <API_KEY>" \
     -d name=Test \ 
     -d factory_name=fortigate \
     -d configs="{""ver"":""1""}" \
     -X PUT \
     https://HOSTNAME/api/sonar/parsers/test
Request Parameters
KeyRequiredTypeDescriptionNote
codeOStringParser codeMinimum 1 to maximum 50 characters
nameOStringDisplay name of the parserMinimum 1 to maximum 50 characters
factory_nameOStringParser factory name
descriptionXStringParser descriptionMaximum 2,000 characters
schema_codeXStringLog schema code
configsXString key/valuelist of configurationsJSON format String

Success Response

{}

Error Responses

Required argument is missing

HTTP status code 400

{
    "error_code": "null-argument",
    "error_msg": "name should be not null"
}
Invalid argument length

HTTP status code 400

{
    "error_code": "invalid-argument",
    "error_msg": "'name' must be less than or equal to 50 characters."
}
Parser is not found

HTTP status code 500

{
    "error_code": "illegal-state",
    "error_msg": "parser not found: unknown"
}
Parser factory is not found

HTTP status code 500

{
    "error_code": "illegal-state",
    "error_msg": "parser factory not found: unknown"
}
Schema is not found

HTTP status code 500

{
    "error_code": "illegal-state",
    "error_msg": "schema not found: unknown"
}
Invalid configuration value

HTTP status code 400

{
    "error_code": "invalid-argument",
    "error_msg": "parser config [query] should be not null"
}