Update Pattern

Updates the pattern of a specified pattern group.

HTTP Request

PUT /api/sonar/pattern-groups/:guid/patterns/:id
Request using cURL
curl -H "Authorization: Bearer <API_KEY>" \
     -d expr=""/.git/HEAD"" \
     -d expr2="path == ""*/.git/HEAD""" \
     -d rule="/.git/HEAD file scan" \
     -X PUT \
     https://HOSTNAME/api/sonar/pattern-groups/e93dafa7-6215-4e98-8bfc-1e0a67171bf1/patterns/
Request Parameters
KeyRequiredTypeDescriptionNote
guidOStringPattern group GUID36 characters
exprOStringKeyword boolean expressionMinimim 3 to maximum 1,000 characters
expr2XStringValidation expressionMaximum 1,000 characters
ruleOStringPattern nameMaximum 1,000 characters

Success Response

{}

Error Responses

Required argument is missing

HTTP status code 400

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

HTTP status code 400

{
    "error_code": "invalid-argument",
    "error_msg": "'expr' must be less than or equal to 1000 characters."
}
Invalid keyword boolean expression

HTTP status code 400

{
    "error_code": "invalid-argument",
    "error_msg": "expr syntax error: not-quoted"
}
No privileges to update a pattern

HTTP status code 500

{
    "error_code": "illegal-state",
    "error_msg": "no-permission"
}