Import Data

Common interface for importing entities. Supports FileSet, Measure and custom data type.

Request Format

POST https://{apigw-address}/data-catalog/v2.0/entities/import

Request Parameters(URI)

Name

Location(Path/Query)

Mandatory/Optional

Data Type

Description

orgId

Query

Mandatory

String

The OU ID

checkFlag

Query

Optional

boolean

Whether to enable rule check (The default value is “false”, which means it is disabled.)

Request Parameters(Body)

Name

Mandatory/Optional

Data Type

Description

objects

Mandatory

jsonArray

The list of imported data objects

objects

Name

Mandatory/Optional

Data Type

Description

typeId

Mandatory

String

The type identifier. Supports FileSet, Measure and custom data type.

attributes

Mandatory

json

The object attribute. Expressed in the form of <key, value>. The value of key is determined according to the specific type definition represented by the type identifier, and the type of key is “String”, and the type of value is determined according to the specific type definition represented by the type identifier.

tags

Optional

jsonArray

The tags associated

terms

Optional

jsonArray

The business terms associated

tags

Name

Mandatory/Optional

Data Type

Description

tagId

Optional

String

The tag ID

atrributes

Optional

json

The tag attributes. Expressed in the form of <key, value>. The value of key is determined according to the specific type definition represented by the type identifier, and the type of key is “String”, and the type of value is determined according to the specific type definition represented by the type identifier.

terms

Name

Mandatory/Optional

Data Type

Description

termId

Optional

String

The term ID

Response Parameters

data:null

Samples

Request Sample

url:    https://{apigw-address}/data-catalog/v2.0/entities/import?orgId=yourOrgId&checkFlag=false

method: POST

Content-Type: application/json

{
    "objects": [{
        "typeId": "FileSet",
        "attributes": {
            "id": "fsr",
            "name": "fdsfa",
            "description": "",
            "filePattern": [{
                "sourceId": "-1",
                "sourceType": "S3",
                "pattern": "fsdf",
                "sourceName": "yourSourcName"
            }],
            "fileType": "Tracelog File"
        },
        "tags": [{
            "tagId": "test:test",
            "attributes": {
                "attr_name": "attr_value"
            }
        }],
        "terms": [{
            "termId": "test:test2"
        }]
    }, {
        "typeId": "Measure",
        "attributes": {
            "id": "kiuy",
            "i18nName": {
                "default": "yourName",
                "zh_CN": "中文名字",
                "en_US": "",
                "es_ES": "",
                "ja_JP": ""
            },
            "dataType": "INT",
            "unit": "m"
        },
        "tags": [{
            "tagId": "test:test",
            "attributes": {
                "attr_name": "attr_value"
            }
        }],
        "terms": [{
            "termId": "test:test2"
        }]
    }, {
        "typeId": "UD_test2",
        "attributes": {
            "siteId": "ffff",
            "name": "haha"
        },
        "tags": [{
            "tagId": "test:test",
            "attributes": {
                "attr_name": "attr_value"
            }
        }],
        "terms": [{
            "termId": "test:test2"
        }]
    }]
}

Note

When typeId is FileSet, you need to go to the Data Source Registration page to get the corresponding data source information, such as sourceId, etc.

When the data source is S3, you need to specify the pattern as s3a://dataide/xia_s3/TEST/LC.

Return Sample

{
    "code": 0,
    "message": "",
    "data": {
        "create": ["LGGw8HDXvSonqnhxx02foerYWrQEAvBg"],
        "update": []
    }
}

Error Code

Code

Message

41001

Parameters [%s] required.

41090

Atlas detail error msg: %s.

41108

Tag[%s] is not exists.

41134

The maximum number of tags or terms for each entity is {%s}, current max number is {%s}.

41135

The limit of the number of entities imported at a time is [%s], and the current number of entities is [%s].

41136

[%s]’s attribute [%s] is required.

41137

[%s] does not contain attribute [%s].

41138

Entity does not have any attributes. typeId is [%s].

41143

[%s] not supported import.

42002

Term[%s] is not exists.

42039

Attribute[%s] value does not match type.

42052

[%s] type not exit!

41071

Type [%s] does not support import!

99000

Internal Server Error.