Updated on 2022-09-15 GMT+08:00

Creating a Lookup Table

Function

This API is used to create a lookup table.

URI

POST /v2/{project_id}/design/code-tables

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

id

No

Long

ID

name_en

Yes

String

Table name in English

Maximum: 200

name_ch

Yes

String

Table name in Chinese

Maximum: 200

tb_version

No

Integer

Table version

directory_id

Yes

Long

Catalog ID

directory_path

No

String

Catalog tree

description

No

String

Description

Maximum: 600

create_by

No

String

Creator

status

No

String

Business statuses

Enumeration values:

  • DRAFT

  • PUBLISH_DEVELOPING

  • PUBLISHED

  • OFFLINE_DEVELOPING

  • OFFLINE

  • REJECT

create_time

No

String

Creation time

update_time

No

String

Update time

approval_info

No

ApprovalVO object

Approval information

new_biz

No

BizVersionManageVO object

Business version management

code_table_fields

Yes

Array of CodeTableFieldVO objects

Lookup table attribute information

Table 3 ApprovalVO

Parameter

Mandatory

Type

Description

id

No

Long

ID

tenant_id

No

String

tenant id

name_ch

No

String

Approval name in Chinese

name_en

No

String

Approval name in English

biz_id

No

Long

Business ID

biz_type

No

String

Business types

Enumeration values:

  • ATOMIC_INDEX

  • DERIVATIVE_INDEX

  • DIMENSION

  • DIMENSION_ATTRIBUTE

  • DIMENSION_HIERARCHIES

  • CONDITION_GROUP

  • TIME_CONDITION

  • COMMON_CONDITION

  • FACT_LOGIC_TABLE

  • TABLE_MODEL

  • DIMENSION_LOGIC_TABLE

  • STANDARD_ELEMENT

  • AGGREGATION_LOGIC_TABLE

  • TAG

  • CODE_TABLE

  • TABLE_MODEL_ATTRIBUTE

  • FACT_DIMENSION

  • FACT_ATTRIBUTE

  • FACT_MEASURE

  • SUMMARY_DIMENSION_ATTRIBUTE

  • SUMMARY_TIME

  • DIMENSION_TABLE_ATTRIBUTE

  • QUALITY_RULE

  • BIZ_METRIC

  • COMPOUND_METRIC

  • INFO_ARCH

  • DEGENERATE_DIMENSION

  • TABLE_MODEL_LOGIC

biz_info

No

String

Business information

biz_info_obj

No

Object

Business information object

biz_version

No

Integer

Business version

biz_status

No

String

Business statuses

Enumeration values:

  • DRAFT

  • PUBLISH_DEVELOPING

  • PUBLISHED

  • OFFLINE_DEVELOPING

  • OFFLINE

  • REJECT

approval_status

No

String

Approval statuses

Enumeration values:

  • DEVELOPING

  • APPROVED

  • REJECT

  • WITHDREW

approval_type

No

String

Approval types

Enumeration values:

  • PUBLISH

  • OFFLINE

submit_time

No

String

Submission time

create_by

No

String

Creator

l1

No

String

Subject area group

l2

No

String

Subject area

l3

No

String

Business object

approval_time

No

String

Approval time

approver

No

String

Approver

email

No

String

Approver email address

msg

No

String

Approval message

directory_path

No

String

Directory tree

Table 4 BizVersionManageVO

Parameter

Mandatory

Type

Description

id

No

Long

ID information

biz_type

No

String

Business types

Enumeration values:

  • ATOMIC_INDEX

  • DERIVATIVE_INDEX

  • DIMENSION

  • DIMENSION_ATTRIBUTE

  • DIMENSION_HIERARCHIES

  • CONDITION_GROUP

  • TIME_CONDITION

  • COMMON_CONDITION

  • FACT_LOGIC_TABLE

  • TABLE_MODEL

  • DIMENSION_LOGIC_TABLE

  • STANDARD_ELEMENT

  • AGGREGATION_LOGIC_TABLE

  • TAG

  • CODE_TABLE

  • TABLE_MODEL_ATTRIBUTE

  • FACT_DIMENSION

  • FACT_ATTRIBUTE

  • FACT_MEASURE

  • SUMMARY_DIMENSION_ATTRIBUTE

  • SUMMARY_TIME

  • DIMENSION_TABLE_ATTRIBUTE

  • QUALITY_RULE

  • BIZ_METRIC

  • COMPOUND_METRIC

  • INFO_ARCH

  • DEGENERATE_DIMENSION

  • TABLE_MODEL_LOGIC

biz_id

No

Long

Business ID

biz_info

No

String

Business object information

status

No

String

Business statuses

Enumeration values:

  • DRAFT

  • PUBLISH_DEVELOPING

  • PUBLISHED

  • OFFLINE_DEVELOPING

  • OFFLINE

  • REJECT

biz_version

No

Integer

Business version

create_time

No

String

Creation time

update_time

No

String

Update time

Table 5 CodeTableFieldVO

Parameter

Mandatory

Type

Description

id

No

Long

ID

code_table_id

No

Long

Lookup table ID

ordinal

Yes

Integer

Ordinal

name_en

Yes

String

Field name in English

Maximum: 600

name_ch

Yes

String

Field name in Chinese

Maximum: 200

description

No

String

Description

Maximum: 600

data_type

Yes

String

Data type

domain_type

No

String

Data type domains

Enumeration values:

  • NUMBER

  • STRING

  • DATETIME

  • BLOB

  • OTHER

data_type_extend

No

String

Data type extended field

Maximum: 50

is_unique_key

No

Boolean

Whether the attribute is unique

Default: false

code_table_field_values

No

Array of CodeTableFieldValueVO objects

Lookup table attribute value

count_field_values

No

Integer

Number of lookup table attribute values

Table 6 CodeTableFieldValueVO

Parameter

Mandatory

Type

Description

id

No

Long

ID

fd_id

No

Long

Lookup table attribute ID

fd_value

No

String

Lookup table attribute value

ordinal

No

Integer

Ordinal

description

No

String

Description

Maximum: 600

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

id

Long

ID

name_en

String

Table name in English

Maximum: 200

name_ch

String

Table name in Chinese

Maximum: 200

tb_version

Integer

Table version

directory_id

Long

Catalog ID

directory_path

String

Catalog tree

description

String

Description

Maximum: 600

create_by

String

Creator

status

String

Business statuses

Enumeration values:

  • DRAFT

  • PUBLISH_DEVELOPING

  • PUBLISHED

  • OFFLINE_DEVELOPING

  • OFFLINE

  • REJECT

create_time

String

Creation time

update_time

String

Update time

approval_info

ApprovalVO object

Approval information

new_biz

BizVersionManageVO object

Business version management

code_table_fields

Array of CodeTableFieldVO objects

Lookup table attribute information

Table 8 ApprovalVO

Parameter

Type

Description

id

Long

ID

tenant_id

String

tenant id

name_ch

String

Approval name in Chinese

name_en

String

Approval name in English

biz_id

Long

Business ID

biz_type

String

Business types

Enumeration values:

  • ATOMIC_INDEX

  • DERIVATIVE_INDEX

  • DIMENSION

  • DIMENSION_ATTRIBUTE

  • DIMENSION_HIERARCHIES

  • CONDITION_GROUP

  • TIME_CONDITION

  • COMMON_CONDITION

  • FACT_LOGIC_TABLE

  • TABLE_MODEL

  • DIMENSION_LOGIC_TABLE

  • STANDARD_ELEMENT

  • AGGREGATION_LOGIC_TABLE

  • TAG

  • CODE_TABLE

  • TABLE_MODEL_ATTRIBUTE

  • FACT_DIMENSION

  • FACT_ATTRIBUTE

  • FACT_MEASURE

  • SUMMARY_DIMENSION_ATTRIBUTE

  • SUMMARY_TIME

  • DIMENSION_TABLE_ATTRIBUTE

  • QUALITY_RULE

  • BIZ_METRIC

  • COMPOUND_METRIC

  • INFO_ARCH

  • DEGENERATE_DIMENSION

  • TABLE_MODEL_LOGIC

biz_info

String

Business information

biz_info_obj

Object

Business information object

biz_version

Integer

Business version

biz_status

String

Business statuses

Enumeration values:

  • DRAFT

  • PUBLISH_DEVELOPING

  • PUBLISHED

  • OFFLINE_DEVELOPING

  • OFFLINE

  • REJECT

approval_status

String

Approval statuses

Enumeration values:

  • DEVELOPING

  • APPROVED

  • REJECT

  • WITHDREW

approval_type

String

Approval types

Enumeration values:

  • PUBLISH

  • OFFLINE

submit_time

String

Submission time

create_by

String

Creator

l1

String

Subject area group

l2

String

Subject area

l3

String

Business object

approval_time

String

Approval time

approver

String

Approver

email

String

Approver email address

msg

String

Approval message

directory_path

String

Directory tree

Table 9 BizVersionManageVO

Parameter

Type

Description

id

Long

ID information

biz_type

String

Business types

Enumeration values:

  • ATOMIC_INDEX

  • DERIVATIVE_INDEX

  • DIMENSION

  • DIMENSION_ATTRIBUTE

  • DIMENSION_HIERARCHIES

  • CONDITION_GROUP

  • TIME_CONDITION

  • COMMON_CONDITION

  • FACT_LOGIC_TABLE

  • TABLE_MODEL

  • DIMENSION_LOGIC_TABLE

  • STANDARD_ELEMENT

  • AGGREGATION_LOGIC_TABLE

  • TAG

  • CODE_TABLE

  • TABLE_MODEL_ATTRIBUTE

  • FACT_DIMENSION

  • FACT_ATTRIBUTE

  • FACT_MEASURE

  • SUMMARY_DIMENSION_ATTRIBUTE

  • SUMMARY_TIME

  • DIMENSION_TABLE_ATTRIBUTE

  • QUALITY_RULE

  • BIZ_METRIC

  • COMPOUND_METRIC

  • INFO_ARCH

  • DEGENERATE_DIMENSION

  • TABLE_MODEL_LOGIC

biz_id

Long

Business ID

biz_info

String

Business object information

status

String

Business statuses

Enumeration values:

  • DRAFT

  • PUBLISH_DEVELOPING

  • PUBLISHED

  • OFFLINE_DEVELOPING

  • OFFLINE

  • REJECT

biz_version

Integer

Business version

create_time

String

Creation time

update_time

String

Update time

Table 10 CodeTableFieldVO

Parameter

Type

Description

id

Long

ID

code_table_id

Long

Lookup table ID

ordinal

Integer

Ordinal

name_en

String

Field name in English

Maximum: 600

name_ch

String

Field name in Chinese

Maximum: 200

description

String

Description

Maximum: 600

data_type

String

Data type

domain_type

String

Data type domains

Enumeration values:

  • NUMBER

  • STRING

  • DATETIME

  • BLOB

  • OTHER

data_type_extend

String

Data type extended field

Maximum: 50

is_unique_key

Boolean

Whether the attribute is unique

Default: false

code_table_field_values

Array of CodeTableFieldValueVO objects

Lookup table attribute value

count_field_values

Integer

Number of lookup table attribute values

Table 11 CodeTableFieldValueVO

Parameter

Type

Description

id

Long

ID

fd_id

Long

Lookup table attribute ID

fd_value

String

Lookup table attribute value

ordinal

Integer

Ordinal

description

String

Description

Maximum: 600

Status code: 400

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code, for example, DS.000 which indicates that the request was successfully processed.

error_msg

String

Error message

data

Object

Returned data

Status code: 401

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code, for example, DS.000 which indicates that the request was successfully processed.

error_msg

String

Error message

data

Object

Returned data

Status code: 403

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code, for example, DS.000 which indicates that the request was successfully processed.

error_msg

String

Error message

data

Object

Returned data

Status code: 404

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Error code, for example, DS.000 which indicates that the request was successfully processed.

error_msg

String

Error message

data

Object

Returned data

Example Requests

{
  "name_en" : "demo",
  "name_ch" : "demo",
  "description" : "",
  "code_table_fields" : [ {
    "ordinal" : 1,
    "name_ch" : "Code",
    "name_en" : "code",
    "data_type" : "STRING",
    "description" : "",
    "code_table_field_values" : [ ]
  }, {
    "ordinal" : 2,
    "name_ch" : "Value",
    "name_en" : "value",
    "data_type" : "STRING",
    "description" : "",
    "code_table_field_values" : [ ]
  } ],
  "tb_version" : 0,
  "directory_id" : "793889572823142400"
}

Example Responses

Status code: 200

The operation succeeds. CodeTableVO is returned.

{
  "id" : "1014131824240230400",
  "name_en" : "test",
  "name_ch" : "test",
  "tb_version" : 0,
  "directory_id" : "1012307270173851648",
  "directory_path" : null,
  "description" : "",
  "create_by" : "abc",
  "status" : "DRAFT",
  "create_time" : "2022-08-30T11:17:48.557+08:00",
  "update_time" : "2022-08-30T11:17:48.557+08:00",
  "approval_info" : null,
  "new_biz" : null,
  "code_table_fields" : [ {
    "id" : null,
    "code_table_id" : null,
    "ordinal" : 1,
    "name_en" : "code",
    "name_ch" : "Code",
    "description" : "",
    "data_type" : "STRING",
    "domain_type" : null,
    "data_type_extend" : null,
    "is_unique_key" : false,
    "code_table_field_values" : [ ],
    "count_field_values" : null
  }, {
    "id" : null,
    "code_table_id" : null,
    "ordinal" : 2,
    "name_en" : "value",
    "name_ch" : "Value",
    "description" : "",
    "data_type" : "STRING",
    "domain_type" : null,
    "data_type_extend" : null,
    "is_unique_key" : false,
    "code_table_field_values" : [ ],
    "count_field_values" : null
  } ]
}

Status Codes

Status Code

Description

200

The operation succeeds. CodeTableVO is returned.

400

BadRequest

401

Unauthorized

403

Forbidden

404

Not Found