Create glossary term
Creates a new glossary term. This operation requires administrator role.
Required Permissions
Requires the ADMIN role or higher.
HTTP Request
POST /api/sonar/glossary/terms
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
-d term="Timestamp" \
-d code="_time" \
-d category="field" \
-d type="DATE" \
-d locale="en" \
-d description="Log creation timestamp" \
-X POST "https://HOSTNAME/api/sonar/glossary/terms"
Request Parameters
| Key | Required | Type | Description | Notes |
|---|---|---|---|---|
| term | Y | String | Term | Min 1, max 50 characters. No special characters or spaces allowed |
| code | Y | String | Term identification code | Min 1, max 50 characters. Alphanumeric and underscore only, no digit start |
| category | Y | String | Term usage target category | One of table, field |
| type | - | String | Data type | Required when category is field |
| locale | Y | String | Language | One of ko, en, zh |
| description | N | String | Term description | Max 2,000 characters |
typeis one ofDATE,STRING,IP,PORT,SHORT,INT,LONG,COUNTRY,FLOAT,DOUBLE,BOOL,MD5,SHA1,URL,SHA256,DOMAIN.
Success Response
HTTP status code 200 response
{
"guid": "a07e6bd4-5ca2-11f0-ad90-acde48001122"
}
- guid (String): GUID of the created term
Error Responses
Required argument is missing
HTTP status code 400
{
"error_code": "null-argument",
"error_msg": "term should be not null"
}
term value is invalid
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'term' must be 1 to 50 characters and must not contain special characters or spaces."
}
term is duplicated
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "duplicated-term [term: term, locale: locale]"
}
code value is invalid
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'code' must be 1 to 50 characters, alphanumeric or underscore characters only, and must not start with a number"
}
code is duplicated
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "duplicated-code [code: code, locale: locale]"
}
category value is invalid
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "invalid-category: invalid-category"
}
type value is invalid
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "type should be one of IP, SHA256, BOOL, DATE, INT, URL, STRING, DOUBLE, COUNTRY, SHORT, LONG, FLOAT, MD5, PORT, DOMAIN, SHA1"
}
locale value is invalid
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "unsupported-locale: ru"
}
description is too long
HTTP status code 400
{
"error_code": "invalid-argument",
"error_msg": "'description' must be shorter than or equal to 2000 characters."
}
Permission denied
HTTP status code 500
{
"error_code": "illegal-state",
"error_msg": "no-permission"
}