Create Procedure
Creates a new procedure.
Required Permissions
Requires the ADMIN role or higher.
HTTP Request
POST /api/sonar/procedures
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d name="test" \
-d 'query=system tables | search table == $("table")' \
-d 'parameters=[{"type": "string", "name": "테이블", "key": "table"}]' \
-d granted_user_guids=b5bc3133-b53e-4b61-96b5-8857015ade0d \
-X POST https://HOSTNAME/api/sonar/procedures
Request Parameters
| Key | Requied | Type | Description | Note |
|---|---|---|---|---|
| guid | X | String | Procedure identifier | 36 characters. If not specified, randomly generated. |
| name | O | String | Procedure name | Minimum 1 to maximum 2,000 characters |
| description | X | String | Procedure description | Maximum 2,000 characters |
| query | O | String | Query string | |
| parameters | X | Object Array | Parameter list | Including type, key, name, description |
| company_public | X | Boolean | Whether the procedure is public | |
| granted_user_guids | X | String Array | List of granted user GUIDs | Comma-separated GUID list |
| granted_group_guids | X | String Array | List of granted user group GUIDs | Comma-separated GUID list |
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 255 characters."
}
User or group identifier is not in valid GUID format
{
"error_code": "invalid-param-type",
"error_msg": "granted_user_guids should be guid type."
}