Enable Stream Rule
Enables a specified stream rule.
Required Permissions
Requires the ADMIN role or higher.
HTTP Request
POST /api/sonar/stream-rules/:guid/enable
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-X POST \
https://HOSTNAME/api/sonar/stream-rules/4f2fe6ea-7c96-4529-88db-2ddf09ce1fa2/enable
Request Parameter
| Key | Required | Type | Description | Note |
|---|---|---|---|---|
| guid | O | String | Stream rule GUID | 36 characters |
Error Responses
Identifier is not in valid GUID format
HTTP status code 400
{
"error_code": "invalid-param-type",
"error_msg": "guid should be guid type."
}
Stream rule is not found
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "stream rule not found: 05efb651-9644-4518-950f-dbd648c973a7"
}
Stream rule is already enabled
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "stream rule is already enabled: 64bf7657-6f0c-4c14-b0b2-d455263d9205"
}
No privileges to enable a stream rule
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}