Examples of Audit Operations

Some examples of payload submission for audit operations.

An example of creating a Type Definition:


enumDefs:
1.days_of_week
entityDefs:
1.Country
2.State
3.Vehicle
 
relationshipDefs:
1.country_state_rel
curl --location --request POST -u admin:admin 'http://car123.test1234.root.hwx.site:23400/api/atlas/v2/types/typedefs' \
--header 'Content-Type: application/json' \
--data-raw '{
"enumDefs": [
{
"name": "days_of_week",
"typeVersion": "1.0",
"elementDefs": [
{
"ordinal": 1,
"value": "MONDAY"
},
{
"ordinal": 2,
"value": "TUESDAY"
},
{
"ordinal": 3,
"value": "WEDNESDAY"
},
{
"ordinal": 4,
"value": "THURSDAY"
},
{
"ordinal": 5,
"value": "FRIDAY"
},
{
"ordinal": 6,
"value": "SATURDAY"
},
{
"ordinal": 7,
"value": "SUNDAY"
}
]
}
],
"entityDefs": [
{
"category": "ENTITY",
"createdBy": "admin",
"updatedBy": "admin",
"createTime": 1537261952180,
"updateTime": 1537262097732,
"version": 1,
"name": "Vehicle",
"description": "desc Vehicle",
"typeVersion": "1.1",
"attributeDefs": [
{
"name": "no_of_wheels",
"typeName": "int",
"isOptional": true,
"cardinality": "SINGLE",
"valuesMinCount": 1,
"valuesMaxCount": 1,
"isUnique": false,
"isIndexable": false,
"includeInNotification": false
}
]
},
{
"category": "ENTITY",
"createdBy": "admin",
"updatedBy": "admin",
"createTime": 1537261952180,
"updateTime": 1537262097732,
"version": 1,
"name": "Country",
"description": "desc Country",
"typeVersion": "1.1",
"attributeDefs": [
{
"name": "ISD_CODE",
"typeName": "string",
"isOptional": false,
"cardinality": "SINGLE",
"valuesMinCount": 1,
"valuesMaxCount": 1,
"isUnique": false,
"isIndexable": false,
"includeInNotification": false
}
]
},
{
"category": "ENTITY",
"createdBy": "admin",
"updatedBy": "admin",
"createTime": 1537261952180,
"updateTime": 1537262097732,
"version": 1,
"name": "State",
"description": "desc State",
"typeVersion": "1.1",
"attributeDefs": [
{
"name": "STD_CODE",
"typeName": "string",
"isOptional": false,
"cardinality": "SINGLE",
"valuesMinCount": 1,
"valuesMaxCount": 1,
"isUnique": false,
"isIndexable": false,
"includeInNotification": false
}
]
}
],
"relationshipDefs": [
{
"name": "country_state_rel",
"typeVersion": "1.1",
"relationshipCategory": "AGGREGATION",
"endDef1": {
"type": "Country",
"name": "state_st",
"isContainer": false,
"cardinality": "SINGLE",
"isLegacyAttribute": true
},
"endDef2": {
"type": "State",
"name": "country_ct",
"isContainer": true,
"cardinality": "SET"
},
"propagateTags": "NONE"
}
]
}'

An example of updating a Type Definition:


enumDefs:days_of_week
entityDefs:Country
curl --location --request PUT -u admin:admin 'http://car123.car123-1.root.hwx.site:31000/api/atlas/v2/types/typedefs' \
--header 'Content-Type: application/json' \
--data-raw '{
"enumDefs": [
{
"name": "days_of_week",
"typeVersion": "1.0",
"elementDefs": [
{
"ordinal": 1,
"value": "MONDAY"
},
{
"ordinal": 2,
"value": "TUESDAY"
},
{
"ordinal": 3,
"value": "WEDNESDAY"
},
{
"ordinal": 4,
"value": "THURSDAY"
},
{
"ordinal": 5,
"value": "FRIDAY"
},
{
"ordinal": 6,
"value": "SATURDAY"
},
{
"ordinal": 7,
"value": "SUNDAY"
},
{
"ordinal": 8,
"value": "HOLIDAY"
}
]
}
],
"entityDefs": [
{
"category": "ENTITY",
"createdBy": "admin",
"updatedBy": "admin",
"createTime": 1537261952180,
"updateTime": 1537262097732,
"version": 1,
"name": "Country",
"description": "desc Country Updated",
"typeVersion": "1.1",
"attributeDefs": [
{
"name": "ISD_CODE",
"typeName": "string",
"isOptional": false,
"cardinality": "SINGLE",
"valuesMinCount": 1,
"valuesMaxCount": 1,
"isUnique": false,
"isIndexable": false,
"includeInNotification": false
}
]
}
]
}'

An example of deleting a Type Definition:

curl --location --request DELETE -u admin:admin
          'http://car123.car123-1.root.hwx.site:31000/api/atlas/v2/types/typedef/name/Vehicle'

An example of exporting an Atlas entity:

'{
    "itemsToExport": [
            { "typeName": "DB", "uniqueAttributes": { "name": "Sales" }},
            { "typeName": "DB", "uniqueAttributes": { "name": "Reporting" }},
            { "typeName": "DB", "uniqueAttributes": { "name": "Logging" }}
    ],
        "options": { "fetchType": "full" }
    }'

For additional reference related to exporting entities, see https://atlas.apache.org/#/ExportAPI.

An example of importing an Atlas entity:

Performing an import operation should create an entry in the audits tab.

For additional reference related to exporting entities, see https://atlas.apache.org/#/ImportAPI.