Create Procedure

Creates a new procedure.

HTTP Request

POST /api/sonar/procedures

Request using cURL

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
guidXStringProcedure identifier36 characters. If not specified, randomly generated.
nameOStringProcedure nameMinimum 1 to maximum 2,000 characters
descriptionXStringProcedure descriptionMaximum 2,000 characters
queryOStringQuery string
parametersXObject ArrayParameter listIncluding type, key, name, description
company_publicXBooleanWhether the procedure is public
granted_user_guidsXString ArrayList of granted user GUIDsComma-separated GUID list
granted_group_guidsXString ArrayList of granted user group GUIDsComma-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."