Create Table

Creates a new Logpresso Sonar table. Administrator privileges are required to call this API.

HTTP Request

POST /api/sonar/tables
Request using cURL
curl -H "Authorization: Bearer <API_KEY>" \
     -d table=demo \
     -d company_guid=6fbe27b7-f1ae-4d7a-a1a5-76d8fa9aa311 \
     -X POST \
     https://HOSTNAME/api/sonar/tables
Request Parameters
KeyRequiredTypeDescriptionNote
tableOStringTable nameCase-sensitive. Minimum 1 to maximum 50 characters
company_guidOStringCompany GUID36 characters
compressionXStringCompression algorithmDefault: snappy
layoutXStringBlock layoutDefault: columnar
crypto_profile_guidXStringEncryption profile GUID36 characters
retentionX32-bit integerRetention cycle in daysMinimum: 0 (unlimitied). Maximum: 36500. Default: 0
Note
Table names can only contain numbers, upper and lower case alphabets, and underscores.

Success Response

{}

Error Responses

Required argument is missing

HTTP status code 400

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

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'table' must be shorter than or equal to 50 characters."
}
Invalid table name

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'table' must begin with a letter and may contain alphanumeric and underscore characters: 0123"
}
Identifier is not in valid GUID format

HTTP status code 400

{
  "error_code": "invalid-param-type",
  "error_msg": "company_guid should be guid type."
}
Invalid compression algorithm

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'compression' should be one of deflate or snappy."
}
Invalid block layout

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'layout' should be one of row or columnar."
}
Retention period out of valid range

HTTP status code 400

{
  "error_code": "invalid-argument",
  "error_msg": "'retention' must be less than or equal to 36500."
}
No privilege to create a table

HTTP status code 500

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

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "duplicated table name: demo"
}
Company is not found

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "company not found: 6fbe27b7-f1ae-4d7a-a1a5-76d8fa9aa312"
}
Crypto profile is not found

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "crypto profile not found: 6f238ab0-7c11-4dc3-9543-ebb3d1cdde12"
}