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

Creating or Modifying a Subject

Function

This API is used to create or modify a subject.

URI

POST /v2/{project_id}/design/subjects

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

entity

Yes

CatalogEntityVO object

Catalog entity

Table 3 CatalogEntityVO

Parameter

Mandatory

Type

Description

typeName

No

String

Type name. Enter BusinessCatalog.

Default: BusinessCatalog

attributes

Yes

CatalogAttributeVO object

Attribute list

Table 4 CatalogAttributeVO

Parameter

Mandatory

Type

Description

path

Yes

String

Path

qualifiedName

Yes

String

Name

level

Yes

String

Subject level

name

Yes

String

Name

nameEng

Yes

String

English Name

alias

No

String

Alias

description

Yes

String

Description

dataOwner

Yes

String

Data owner

owner

No

String

Owner

dataOwnerList

Yes

Array of strings

Data owner list

createTime

No

String

Creation time (timestamp)

createBy

No

String

Creator

updateTime

No

String

Update time, which is a timestamp

updateBy

No

String

Updated by

parent

No

parent object

Parent node

parentId

No

String

ID of the parent node

l1

No

Boolean

Whether the level is L1

l2

No

Boolean

Whether the level is L2

l3

No

Boolean

Whether the level is L3

ordinal

No

Integer

Ordinal

tenantId

No

String

Tenant ID

self_defined_fields

No

Array of SelfDefinedFieldVO objects

Custom fields

Table 5 parent

Parameter

Mandatory

Type

Description

id

No

String

ID of the parent node

Table 6 SelfDefinedFieldVO

Parameter

Mandatory

Type

Description

fd_name_ch

No

String

Custom field name in Chinese

Maximum: 200

fd_name_en

No

String

Custom field name in English

Maximum: 200

not_null

No

Boolean

Whether the field is mandatory

fd_value

No

String

Field value

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

id

String

ID

nameCh

String

Name

nameEn

String

English name

alias

String

Alias

path

String

Path

qualifiedName

String

Unified name

ordinal

Integer

Ordinal

owner

String

Owner

dataOwner

String

Data subject

tenantId

String

Tenant ID

level

Integer

Level

levelStr

String

Level

l1

Boolean

Whether the level is L1

l2

Boolean

Whether the level is L2

l3

Boolean

Whether the level is L3

description

String

Description

createTime

String

Creation time (timestamp)

createBy

String

Creator

updateTime

String

Update time (timestamp)

updateBy

String

Updated by

selfDefinedFields

Array of SelfDefinedFieldVO objects

Custom fields

Table 8 SelfDefinedFieldVO

Parameter

Type

Description

fd_name_ch

String

Custom field name in Chinese

Maximum: 200

fd_name_en

String

Custom field name in English

Maximum: 200

not_null

Boolean

Whether the field is mandatory

fd_value

String

Field value

Status code: 400

Table 9 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 10 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 11 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 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

Example Requests

{
  "entity" : {
    "attributes" : {
      "path" : "we",
      "qualifiedName" : "wewe@Business",
      "level" : "L3",
      "name" : "wewe",
      "nameEng" : "wewe",
      "alias" : "demo",
      "description" : "",
      "dataOwner" : "",
      "dataOwnerList" : [ "ei_dlg" ],
      "parent" : {
        "id" : "864523016602812416"
      }
    },
    "typeName" : "BusinessCatalog"
  }
}

Example Responses

Status code: 200

The operation succeeds. The entity details are returned.

{
  "alias" : "",
  "createBy" : "6273052b7ea44765a51304972c2dbaa3",
  "createTime" : 1661828377965,
  "dataOwner" : "",
  "description" : "",
  "id" : 873232498044411900,
  "l1" : true,
  "l2" : false,
  "l3" : false,
  "level" : 1,
  "levelStr" : "1",
  "nameCh" : "City traffic",
  "nameEn" : "city_traffic",
  "ordinal" : "3,",
  "owner" : "6273052b7ea44765a51304972c2dbaa3",
  "path" : "City traffic",
  "qualifiedName" : "city_traffic@Business.0cf68da0ba80f2962ff7c01ba8c0b7f7-workspace-f7eee36e67e541a59679f9b1b7f4eab0",
  "selfDefinedFields" : null,
  "tenantId" : "0cf68da0ba80f2962ff7c01ba8c0b7f7-workspace-f7eee36e67e541a59679f9b1b7f4eab0",
  "updateBy" : "6273052b7ea44765a51304972c2dbaa3",
  "updateTime" : 1661828378452
}

Status Codes

Status Code

Description

200

The operation succeeds. The entity details are returned.

400

BadRequest

401

Unauthorized

403

Forbidden

404

Not Found