Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

I want to retreive the entity definition for a specified table through rest API in atlas .

I want to retreive the entity definition for a specified table through rest API in atlas .

New Contributor

I want to retreive the entity definition for a specified table through rest API in atlas .

http://localhost:21000/api/atlas/entities?type=hive_table&value=atlas.employee@clus1

I should get the properties of the entity.But If I run the above query all the GUIDs are displayed.Iam using 0.7 version.

Please suggest.

4 REPLIES 4
Highlighted

Re: I want to retreive the entity definition for a specified table through rest API in atlas .

@Venkiteela Vishnu

The REST API you are using has missing query param. You should use something like below.

http://localhost:21000/api/atlas/entities?type=hive_table& property=qualifiedName&value=atlas.employee@clus1

You can check the API documentation here: http://atlas.apache.org/0.7.0-incubating/api/resource_EntityResource.html#GET

Re: I want to retreive the entity definition for a specified table through rest API in atlas .

New Contributor

The output of above query gives the list of all the GUID's .But I i need to get the definition and all the properties of a specified entity.

Re: I want to retreive the entity definition for a specified table through rest API in atlas .

@Venkiteela Vishnu

I am getting proper entity definition using the above api call. Please check the below example

http://ctr-e133-1493418528701-21268-01-000002.hwx.site:21000/api/atlas/entities?type=hive_table &property=qualifiedName &value=default.s3vzcqqehzpi@cl1
{
    "definition": {
        "id": {
            "id": "89179193-be7e-4ee7-a03f-c537ef095c7d",
            "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
            "state": "ACTIVE",
            "typeName": "hive_table",
            "version": 0
        },
        "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
        "systemAttributes": {
            "createdBy": "hrt_qa",
            "createdTime": "2017-05-06T05:28:19.734Z",
            "modifiedBy": "hrt_qa",
            "modifiedTime": "2017-05-06T05:28:24.658Z"
        },
        "traitNames": [],
        "traits": {},
        "typeName": "hive_table",
        "values": {
            "aliases": null,
            "columns": [
                {
                    "id": {
                        "id": "059d5fd7-97b5-45c4-a583-9e5ce800211f",
                        "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                        "state": "ACTIVE",
                        "typeName": "hive_column",
                        "version": 0
                    },
                    "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
                    "systemAttributes": {
                        "createdBy": "hrt_qa",
                        "createdTime": "2017-05-06T05:28:19.734Z",
                        "modifiedBy": "hrt_qa",
                        "modifiedTime": "2017-05-06T05:28:24.658Z"
                    },
                    "traitNames": [],
                    "traits": {},
                    "typeName": "hive_column",
                    "values": {
                        "comment": null,
                        "description": null,
                        "name": "c1",
                        "owner": "hrt_qa",
                        "position": 0,
                        "qualifiedName": "default.s3vzcqqehzpi.c1@cl1",
                        "table": {
                            "id": "89179193-be7e-4ee7-a03f-c537ef095c7d",
                            "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                            "state": "ACTIVE",
                            "typeName": "hive_table",
                            "version": 0
                        },
                        "type": "int"
                    }
                },
                {
                    "id": {
                        "id": "cb248c43-cc6c-4a70-93c2-46fa9d8cdc89",
                        "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                        "state": "ACTIVE",
                        "typeName": "hive_column",
                        "version": 0
                    },
                    "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
                    "systemAttributes": {
                        "createdBy": "hrt_qa",
                        "createdTime": "2017-05-06T05:28:19.734Z",
                        "modifiedBy": "hrt_qa",
                        "modifiedTime": "2017-05-06T05:28:24.658Z"
                    },
                    "traitNames": [],
                    "traits": {},
                    "typeName": "hive_column",
                    "values": {
                        "comment": null,
                        "description": null,
                        "name": "c2",
                        "owner": "hrt_qa",
                        "position": 1,
                        "qualifiedName": "default.s3vzcqqehzpi.c2@cl1",
                        "table": {
                            "id": "89179193-be7e-4ee7-a03f-c537ef095c7d",
                            "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                            "state": "ACTIVE",
                            "typeName": "hive_table",
                            "version": 0
                        },
                        "type": "int"
                    }
                },
                {
                    "id": {
                        "id": "6dff9346-e30b-4825-bb18-f28f4fd901c4",
                        "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                        "state": "ACTIVE",
                        "typeName": "hive_column",
                        "version": 0
                    },
                    "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Reference",
                    "systemAttributes": {
                        "createdBy": "hrt_qa",
                        "createdTime": "2017-05-06T05:28:19.734Z",
                        "modifiedBy": "hrt_qa",
                        "modifiedTime": "2017-05-06T05:28:24.658Z"
                    },
                    "traitNames": [],
                    "traits": {},
                    "typeName": "hive_column",
                    "values": {
                        "comment": null,
                        "description": null,
                        "name": "c3",
                        "owner": "hrt_qa",
                        "position": 2,
                        "qualifiedName": "default.s3vzcqqehzpi.c3@cl1",
                        "table": {
                            "id": "89179193-be7e-4ee7-a03f-c537ef095c7d",
                            "jsonClass": "org.apache.atlas.typesystem.json.InstanceSerialization$_Id",
                            "state": "ACTIVE",
                            "typeName": "hive_table",
                            "version": 0
                        },
                        "type": "date"
                    }
                }
.
.
.
}

Re: I want to retreive the entity definition for a specified table through rest API in atlas .

New Contributor

Iam running below two cmds in CLI.Getting same output for the below two API calls.

1)curl -u admin:admin http://localhost:21000/api/atlas/entities?type=hive_table &property={qualifiedName} &value={atlas.employee@bidw}

2) curl -u admin:admin http://localhost:21000/api/atlas/entities?type=hive_table

Output:

{"requestId":"qtp1324989951-15 - 3364045a-07fc-4983-8497-0d57b8a84071","typeName":"hive_table","results":["2af695eb-5984-44df-83f3-874c128c4345","3533ac18-4c0b-48a6-a367-309ef6da056d","8eada122-9072-4100-b778-8fbb00ed1a5e","a82d6583-d4c6-4dbd-b77c-8544da5352ff","f8164ea0-a91f-4ea6-9f27-ed70e8c2bccd","8028a311-4ac7-4995-9ad8-4b95f3dc4f04","36e138ea-8400-4b2c-be09-ba1754ca885c","73bdf2f9-3acf-4976-b5c6-bf41082f5dd7","03a7c172-1401-4c2d-b2a8-b7fada7d1dbe","2f115ab6-3e6c-465d-90fe-03441bc93d45","965432c3-a911-4fdd-a8b4-3dcf6b210d88","88a6edf3-7453-4e7f-81c3-0f8cf5da7641","44c81d71-64a6-46aa-bd24-006a9673d052","814d3c0f-436c-4e40-aef1-8195dad2289b","c1f1fe54-98f2-483a-ba66-a41a3a3305ed","58809f2c-672b-4fce-8b57-f761880d20b1","37b772e4-4cca-448a-9b66-7b9c850756ae","1573852a-f2d4-4a35-8778-4b5be2d41e95","70f82863-25b1-4a70-bf8b-b5a9fa7add20","d618a75f-59fc-4a24-bdec-8231e929e1a4","bd3d865d-0d4b-4e54-85d4-782cc5039726","e3734f83-2b80-40bf-b109-ad3030d3af84","c8b518ad-41ba-4e36-9a50-dda78297b0d2","fefbe977-0276-4834-b0ea-7a64b0e5dd9c","647105bd-3163-434d-98ec-174cd8db9bea","d73e5cba-a580-4317-a978-6098dd7ecb5b","36627115-1c60-4ca5-8a8b-f79da6a67cf0","f0ce7536-43f0-4964-977f-47b704059c36","5c89938d-3917-4063-99ec-4dc27baa5ea0","92bd4ccf-8543-46ab-9993-8956734df3d8","cde6bda8-42d7-4f34-b5ba-8063abc07438","cae6592b-a765-45e3-ac1a-692155db4134","4793f329-346b-4883-bfce-d4e4b0025a25","43a55714-d5cd-4760-a2e1-fe9642ae7a12","75d03874-b010-482f-bdd4-f5c3fec76d8a","2a4b88b7-e325-4a31-9780-68e836ddee8d","01b72d0f-2eb4-4bb7-841c-f683c712497f","897fd65f-0dce-40d2-909d-3cc7f552d0c6","227822fa-6b35-45e1-95d3-52751263b816","221e3e5c-d6d7-42c6-b646-6ef6891e33b4","a1921273-cfdd-49a7-b125-aea188368000","33ef58fb-9477-4eb1-8f33-22a1314a39c1","8f6d7627-0e02-42b7-9e6f-6f7a5cc3de87","2ea794b4-bae8-406e-9936-46a0ec6e4092","7fa839c2-d1cc-4c32-84eb-030de53f6791","eceb26c6-a170-45e2-8e12-051280aab0b9","62fdf89e-6948-4a68-8a6b-c0c712f01adf","7993ac32-f83f-40a4-ae95-4bcd94144763","4920cd6b-88c0-47bc-904b-96bea209338d","9def67be-7515-4292-b1cb-e982b83647a5","fa572055-c16d-4eda-b0ba-63c2bd0d83cf","54ac5f7b-7807-4e8a-831d-8f13b16ba7cc","ed544822-a4f9-4edc-8c81-4f7fdd9e1e78","6b5dba35-ade9-4d9b-a6bd-c16ab33c06ae","49c2e25c-8c7c-483f-a0c9-4a977dccb34b","69f00335-2d3a-4b34-9f80-47e2ec33b1f8","78b1f360-5322-4bba-b27e-45516e47f4cc","aaf9f67c-eb34-43cd-a345-d2d675d22318","a3b463a5-1726-4f7e-845e-80d655c78aaa","57b65f4c-4bfc-4703-9d0a-b7efe897f9cd","9f5d680c-02fe-4ab0-a112-fb223534373f","0663d051-930a-4bdf-a331-51031820b899","e473279b-21ef-404a-9b0e-8acaf4aace60","4238b498-e23e-4daf-be4c-7b89525e0240","5702fc13-3fa7-4537-870c-1eb2f99c20c9","2d4e0b0d-202a-430a-acda-1e7a2939d44b","3d72ee0c-83c9-47b1-bf90-5472e43cb81e","c8805e6a-d2d7-499c-b6dc-233e5d9d740c","a8af5e0e-3aa1-4ae0-be1f-3a5e5d269362","ff203d60-fc3a-458a-9f81-49967e270064","49e45453-00ab-4222-9e4c-cbb0f3a36398","8193a9c8-de52-40f3-8946-0ceaa7bf76ba","d8c9f6dc-c0d9-4499-a344-c20cc18e503c","bb4d0feb-0a0c-4a77-8e66-27fdaf6f691a","0254945a-f54b-4a18-814f-4f0bfb62a753","24bf983a-5ef2-4205-b77c-3da60a38ec9c","cbf61445-b17a-489a-a45d-e52f0a350c11","0b829dac-6052-4dd5-82af-c024a26edf49","a09f8de7-4f2a-4a0f-aee9-a8ed682c5bfa","36eb9b08-9ce2-4d2e-92f9-caedca02ca15","72bcd2e5-5970-4858-858b-83632f35a069","5b336dcd-6a8f-4b63-ac0e-9743c46c56dd","d08ba090-b518-4b54-a273-e07de5cd2a85","db67227a-b880-4585-a33b-c3a4d914cd3a","aa72c703-dfbf-4905-9b2c-d17b69ea5041","96dacebd-215a-402b-a4f6-2b61e5407c1b","8c8e8fb0-7479-481c-93d7-f32b1699edd8","156ec419-05ce-4750-a026-ad384bd75476","510fc17e-794a-4366-9a7c-53f6a01ba677"],"count":89}