查找了许多资料,发现对RDBMS支持很少,貌似需要写Rdbms的bridge,这里只介绍通过API方式,将mysql 导入到Atlas,血缘关系,继续改进
请求方式:Post
请求路径:http://localhost:21000/api/atlas/v2/entity
请求验证方式:BaseAuth admin/admin
建立数据库实例:
//3cd3adc7-67cf-4563-9795-ab8cad26271a
{
"entity": {
"typeName": "rdbms_instance",
"attributes": {
"qualifiedName": "10.10.66.29@mysql@instance",
"name": "10.10.66.29@mysql",
"rdbms_type":"MYSQL",
"platform":"win7",
"cloudOrOnPrem":"cloud",
"hostname":"10.10.66.29",
"port":"3306",
"protocol":"http",
"contact_info":"jdbc",
"comment":"rdbms_instance API insert test",
"description":"rdbms_instance描述",
"owner":"caozqa"
}
}
}
创建数据源,并关联数据实例
{
"entity": {
"typeName": "rdbms_db",
"attributes": {
"qualifiedName": "10.10.66.29@mysql@datag",
"owner": "caozqa",
"ownerType":"USER",
"name": "datag",
"emailAddress": "caozqa",
"createdBy": "caozqaAPI",
"createTime": "2017-08-25T13:15:25.369Z",
"updatedBy": "caozqa",
"updateTime": "2017-08-25T14:12:45.246Z",
"description": "rdbms_db datag API input",
"prodOrOther":"44",
"version":0,
"contact_info":"111",
"instance":{
"guid": "3cd3adc7-67cf-4563-9795-ab8cad26271a",
"typeName": "rdbms_instance"
}
}
}
}
创建数据字段
//37e111ad-9336-475e-a39a-d53a771ab1bb
{
"entity": {
"typeName": "rdbms_column",
"attributes": {
"qualifiedName": "id@table_01@datag@10.10.66.29",
"createdBy": "caozqaAPI",
"createTime": "2017-08-25T13:15:25.369Z",
"updatedBy": "caozqaAPI",
"updateTime": "2017-08-25T14:12:45.246Z",
"name": "id",
"comment":"rdbms_column API insert test",
"description":"rdbms_column 手动输入",
"owner":"caozqa",
"data_type":"String",
"length":20,
"default_value":0,
"isNullable":false,
"isPrimaryKey":true,
"contact_info":"id_info"
}
}
}
创建数据表,关联数据源和数据字段
//f438d921-ff4c-4838-bdca-3b868bbed825
{
"entity": {
"typeName": "rdbms_table",
"attributes": {
"qualifiedName": "table_01@datag@10.10.66.29",
"createdBy": "caozqaAPI",
"createTime": "2017-08-25T13:15:25.369Z",
"updatedBy": "caozqaAPI",
"updateTime": "2017-08-25T14:12:45.246Z",
"name": "table_01",
"comment":"rdbms_table API insert test",
"description":"rdbms_table 手动输入",
"owner":"caozqa",
"type":"table",
"contact_info":"table_01_info",
"db": {
"guid": "26fca771-8115-4955-a0d9-54103466c35e",
"typeName": "rdbms_db"
},
"columns": [{
"guid": "37e111ad-9336-475e-a39a-d53a771ab1bb",
"typeName": "rdbms_table"
}]
}
}
}