Skip to content

Instantly share code, notes, and snippets.

@rajkrrsingh rajkrrsingh/Atlas_Rest_API
Last active Nov 27, 2016

Embed
What would you like to do?
quick reference guide of ATLAS REST API
[root@rksnode ~]# curl http://rksnode:21000/api/atlas/admin/version
{"Version":"0.5.0.2.4.2.0-258-r375e15d6e3442c484b3a095a80127e41abef40b5","Name":"apache-atlas","Description":"Metadata Management and Data Governance Platform over Hadoop"}[root@rksnode ~]#
[root@rksnode ~]#
[root@rksnode ~]#
[root@rksnode ~]# curl http://rksnode:21000/api/atlas/types
{"results":["DataSet","hive_order","Process","hive_table","hive_db","hive_process","hive_principal_type","hive_resource_type","hive_object_type","Infrastructure","hive_index","hive_column","hive_resourceuri","hive_storagedesc","hive_role","hive_partition","hive_serde","hive_type"],"count":18,"requestId":"qtp1286783232-60 - 0128be6a-076e-4ad3-972a-58783a1f7180"}[root@rksnode ~]#
[root@rksnode ~]#
[root@rksnode ~]# curl http://rksnode:21000/api/atlas/types/hive_process
{"typeName":"hive_process","definition":"{\n \"enumTypes\":[\n \n ],\n \"structTypes\":[\n \n ],\n \"traitTypes\":[\n \n ],\n \"classTypes\":[\n {\n \"superTypes\":[\n \"Process\"\n ],\n \"hierarchicalMetaTypeName\":\"org.apache.atlas.typesystem.types.ClassType\",\n \"typeName\":\"hive_process\",\n \"attributeDefinitions\":[\n {\n \"name\":\"startTime\",\n \"dataTypeName\":\"long\",\n \"multiplicity\":\"required\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"endTime\",\n \"dataTypeName\":\"long\",\n \"multiplicity\":\"required\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"userName\",\n \"dataTypeName\":\"string\",\n \"multiplicity\":\"required\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"queryText\",\n \"dataTypeName\":\"string\",\n \"multiplicity\":\"required\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"queryPlan\",\n \"dataTypeName\":\"string\",\n \"multiplicity\":\"required\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"queryId\",\n \"dataTypeName\":\"string\",\n \"multiplicity\":\"required\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"queryGraph\",\n \"dataTypeName\":\"string\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n }\n ]\n }\n ]\n}","requestId":"qtp1286783232-17 - 6a57bd73-1b12-47f9-871d-7de227b0a2d4"}[root@rksnode ~]#
[root@rksnode ~]#
[root@rksnode ~]#
[root@rksnode ~]#
[root@rksnode ~]# curl http://rksnode:21000/api/atlas/types/hive_table
{"typeName":"hive_table","definition":"{\n \"enumTypes\":[\n \n ],\n \"structTypes\":[\n \n ],\n \"traitTypes\":[\n \n ],\n \"classTypes\":[\n {\n \"superTypes\":[\n \"DataSet\"\n ],\n \"hierarchicalMetaTypeName\":\"org.apache.atlas.typesystem.types.ClassType\",\n \"typeName\":\"hive_table\",\n \"attributeDefinitions\":[\n {\n \"name\":\"tableName\",\n \"dataTypeName\":\"string\",\n \"multiplicity\":\"required\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"db\",\n \"dataTypeName\":\"hive_db\",\n \"multiplicity\":\"required\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"owner\",\n \"dataTypeName\":\"string\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"createTime\",\n \"dataTypeName\":\"long\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"lastAccessTime\",\n \"dataTypeName\":\"long\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"comment\",\n \"dataTypeName\":\"string\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"retention\",\n \"dataTypeName\":\"int\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"sd\",\n \"dataTypeName\":\"hive_storagedesc\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"partitionKeys\",\n \"dataTypeName\":\"array<hive_column>\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"columns\",\n \"dataTypeName\":\"array<hive_column>\",\n \"multiplicity\":\"optional\",\n \"isComposite\":true,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"parameters\",\n \"dataTypeName\":\"map<string,string>\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"viewOriginalText\",\n \"dataTypeName\":\"string\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"viewExpandedText\",\n \"dataTypeName\":\"string\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"tableType\",\n \"dataTypeName\":\"string\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n },\n {\n \"name\":\"temporary\",\n \"dataTypeName\":\"boolean\",\n \"multiplicity\":\"optional\",\n \"isComposite\":false,\n \"isUnique\":false,\n \"isIndexable\":true,\n \"reverseAttributeName\":null\n }\n ]\n }\n ]\n}","requestId":"qtp1286783232-12 - 714e5ae5-9713-4586-a95e-e41ac1f359a8"}[root@rksnode ~]#
[root@rksnode ~]#
[root@rksnode ~]#
[root@rksnode ~]# curl http://rksnode:21000/api/atlas/entities?type=hive_process
{"requestId":"qtp1286783232-17 - 92e1013c-bdd3-44c0-88f2-6737dc7ea894","typeName":"hive_process","results":["99384734-a633-4f68-a9ac-ee92569ed91f","9eca4941-709e-448e-aa2c-6a60626e2de2","e605c4a5-605c-4272-8336-27ce081396e0","c3a50fdd-533f-4f1a-8c08-00f41e0c085d","fdce4509-bdf8-4178-a098-3f8a216ffb82","cac105d4-6e93-49bc-afed-89a4f2541a59","2d35fca3-6d94-4432-bf1d-54dd21e2c8dd","cca730bf-04a9-495d-8bbc-bf352c808db1","5a608311-11c7-4922-b692-53af862484d1","3b85b114-ea29-46c5-8ad1-795653b3bc8e","286c19b2-a47a-4d79-90b6-5fe9157229b9","7c220500-c3bc-48b8-a729-2fd9a0eb003e","7f3446b0-6252-4731-b4f4-685231dfa07c"],"count":13}[root@rksnode ~]#
[root@rksnode ~]#
[root@rksnode ~]#
[root@rksnode ~]# curl http://rksnode:21000/api/atlas/entities/7f3446b0-6252-4731-b4f4-685231dfa07c
{"requestId":"qtp1286783232-12 - 974e6fce-585e-4c2f-aabe-36c885af400f","GUID":"7f3446b0-6252-4731-b4f4-685231dfa07c","definition":"{\n \"jsonClass\":\"org.apache.atlas.typesystem.json.InstanceSerialization$_Reference\",\n \"id\":{\n \"jsonClass\":\"org.apache.atlas.typesystem.json.InstanceSerialization$_Id\",\n \"id\":\"7f3446b0-6252-4731-b4f4-685231dfa07c\",\n \"version\":0,\n \"typeName\":\"hive_process\"\n },\n \"typeName\":\"hive_process\",\n \"values\":{\n \"queryId\":\"hive_20161121064440_64dc96f3-9759-4fa1-a480-1bf7f3b1af75\",\n \"name\":\"QUERY\",\n \"startTime\":1479710680004,\n \"queryPlan\":\"{\\\"STAGE DEPENDENCIES\\\":{\\\"Stage-0\\\":{\\\"ROOT STAGE\\\":\\\"TRUE\\\"}},\\\"STAGE PLANS\\\":{\\\"Stage-0\\\":{\\\"Fetch Operator\\\":{\\\"Processor Tree:\\\":{\\\"TableScan\\\":{\\\"alias:\\\":\\\"t1\\\",\\\"children\\\":{\\\"Select Operator\\\":{\\\"children\\\":{\\\"ListSink\\\":{}},\\\"outputColumnNames:\\\":[\\\"_col0\\\",\\\"_col1\\\",\\\"_col2\\\",\\\"_col3\\\"],\\\"expressions:\\\":\\\"a (type: string), b (type: string), c (type: string), d (type: string)\\\"}}}},\\\"limit:\\\":\\\"-1\\\"}}}}\",\n \"description\":null,\n \"outputs\":null,\n \"endTime\":1479710683751,\n \"inputs\":[\n {\n \"jsonClass\":\"org.apache.atlas.typesystem.json.InstanceSerialization$_Id\",\n \"id\":\"2236a084-74f8-41a8-be8b-e1b214755cfe\",\n \"version\":0,\n \"typeName\":\"DataSet\"\n }\n ],\n \"queryText\":\"select * from t1\",\n \"queryGraph\":\"queryGraph\",\n \"userName\":\"hive\"\n },\n \"traitNames\":[\n \n ],\n \"traits\":{\n \n }\n}"}[root@rksnode ~]#
[root@rksnode ~]#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.