ルックアップ作成

新しいルックアップを作成します。本操作には管理者権限が必要です。

HTTPリクエスト

POST /api/sonar/lookups
cURL例
curl -H "Authorization: Bearer <API_KEY>" \
     -d name=country_code \
     -d description="国コードの日本語名マッピング" \
     -d fields="[{""field_name"":"country_code",""len"":2,""use_null"":false},{""field_name"":""name"",""len"":255,""use_null"":false}]"
     -X POST https://HOSTNAME/api/sonar/lookups
リクエストパラメータ
キー必須説明備考
guidX文字列ルックアップGUID36文字。デフォルトはランダム生成
nameO文字列ルックアップ名最小0文字、最大240文字。英数字およびアンダースコアのみ使用可
descriptionX文字列ルックアップ説明最大2000文字
fieldsOオブジェクト配列フィールド定義リスト以下のfieldsオブジェクト属性を参照

fieldsオブジェクト属性

キー必須説明
field_nameO文字列フィールド名
lenO32ビット整数値の最大長
use_nullOブール値空値の許容可否

正常レスポンス

{
  "guid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}

エラーレスポンス

必須パラメータが不足している場合

HTTPステータスコード 400 のレスポンス

{
  "error_code": "null-argument",
  "error_msg": "name should be not null"
}
パラメータ値の長さが不正な場合

HTTPステータスコード 400 のレスポンス

{
  "error_code": "invalid-argument",
  "error_msg": "'name' must be shorter than or equal to 240 characters."
}
ルックアップ名に許可されていない文字が含まれている場合

HTTPステータスコード 400 のレスポンス

{
  "error_code": "illegal-state",
  "error_msg": "lookup name must be alphanumeric and underscore characters only: hello-world"
}
ルックアップ名が重複している場合

HTTPステータスコード 500 のレスポンス

{
  "error_code": "illegal-state",
  "error_msg": "duplicated lookup name: country_code"
}
ルックアップ作成権限がない場合

HTTPステータスコード 500 のレスポンス

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