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.

Atlas REST API: Create new attribute in AtlasGlossaryTerm

Highlighted

Atlas REST API: Create new attribute in AtlasGlossaryTerm

New Contributor

Hi experts,


I have been working with Atlas REST API.

http://atlas.apache.org/api/v2/index.html


I created a new attribute in AtlasGlossaryTerm with the command:

curl -X PUT   http://localhost:21000/api/atlas/v2/types/typedefs   -u <atlas_username>:<password>   -H 'content-type: application/json'   -d '{
 "entityDefs": [
{
    "category":"ENTITY",
    "guid":"7bf1502f-9c3d-45b6-bf13-484937e768be",
    "createdBy":"atlas",
    "updatedBy":"atlas",
    "createTime":1554315790156,
    "updateTime":1554315790156,
    "version":2,
    "name":"AtlasGlossaryTerm",
    "description":"AtlasGlossaryTerm",
    "typeVersion":"2.1",
    "attributeDefs":[
        {
          "name":"AREA_RESPONSAVEL",
          "typeName":"string",
          "isOptional":true,
          "cardinality":"SINGLE",
          "valuesMinCount":0,
          "valuesMaxCount":1,
          "isUnique":false,
          "isIndexable":false,
          "includeInNotification":false,
          "defaultValue":"teste"
       },
       {
          "name":"FONTE_DE_ORIGEM",
          "typeName":"string",
          "isOptional":true,
          "cardinality":"SINGLE",
          "valuesMinCount":0,
          "valuesMaxCount":1,
          "isUnique":false,
          "isIndexable":false,
          "includeInNotification":false
       },
       {  
          "name":"qualifiedName",
          "typeName":"string",
          "isOptional":false,
          "cardinality":"SINGLE",
          "valuesMinCount":1,
          "valuesMaxCount":1,
          "isUnique":true,
          "isIndexable":true,
          "includeInNotification":false
       },
       {  
          "name":"name",
          "typeName":"string",
          "isOptional":false,
          "cardinality":"SINGLE",
          "valuesMinCount":1,
          "valuesMaxCount":1,
          "isUnique":false,
          "isIndexable":true,
          "includeInNotification":false
       },
       {  
          "name":"shortDescription",
          "typeName":"string",
          "isOptional":true,
          "cardinality":"SINGLE",
          "valuesMinCount":0,
          "valuesMaxCount":1,
          "isUnique":false,
          "isIndexable":false,
          "includeInNotification":false
       },
       {  
          "name":"longDescription",
          "typeName":"string",
          "isOptional":true,
          "cardinality":"SINGLE",
          "valuesMinCount":0,
          "valuesMaxCount":1,
          "isUnique":false,
          "isIndexable":false,
          "includeInNotification":false
       },
       {  
          "name":"examples",
          "typeName":"array<string>",
          "isOptional":true,
          "cardinality":"SINGLE",
          "valuesMinCount":0,
          "valuesMaxCount":1,
          "isUnique":false,
          "isIndexable":false,
          "includeInNotification":false
       },
       {  
          "name":"abbreviation",
          "typeName":"string",
          "isOptional":true,
          "cardinality":"SINGLE",
          "valuesMinCount":0,
          "valuesMaxCount":1,
          "isUnique":false,
          "isIndexable":false,
          "includeInNotification":false
       },
       {  
          "name":"usage",
          "typeName":"string",
          "isOptional":true,
          "cardinality":"SINGLE",
          "valuesMinCount":0,
          "valuesMaxCount":1,
          "isUnique":false,
          "isIndexable":false,
          "includeInNotification":false
       },
       {
          "name":"TESTE_ATT01",
          "typeName":"string",
          "isOptional":true,
          "cardinality":"SINGLE",
          "valuesMinCount":0,
          "valuesMaxCount":1,
          "isUnique":false,
          "isIndexable":false,
          "includeInNotification":false
       },
       {
          "name":"teste_att02",
          "typeName":"array<string>",
          "isOptional":true,
          "cardinality":"SINGLE",
          "valuesMinCount":0,
          "valuesMaxCount":1,
          "isUnique":false,
          "isIndexable":false,
          "includeInNotification":false
       }
    ],
    "superTypes":[  
       "__internal"
    ],
    "subTypes":[
    ]
    }
]
}'

I can not update the values of this new attribute. I tried two ways:


[1] I tried to create a new term with the command:

curl -X POST   http://localhost:21000/api/atlas/v2/glossary/term   -u <atlas_username>:<password>   -H 'content-type: application/json'   -d '{
  "anchor" : {
    "glossaryGuid" : "3cd42e82-7871-4395-b3fc-dd7cb2931efa"
  },
  "longDescription" : "Nome completo do cliente",
  "name" : "NM_NOME",
  "AREA_RESPONSAVEL" :"Cadastro",
  "FONTE_DE_ORIGEM" :"Fonte Cadastro"
}'

The term is created, however the display is empty.

108347-atlasglossaryterm-created.png


[2] I also tried updating the term created:

curl -X PUT   http://localhost:21000/api/atlas/v2/glossary/term/78d9e76b-e57a-421e-b71b-fdaa067ad6ba   -u <atlas_username>:<password>   -H 'content-type: application/json'   -d '{
  "AREA_RESPONSAVEL":"new value updated",
  "anchor" : {
    "glossaryGuid" : "3cd42e82-7871-4395-b3fc-dd7cb2931efa"
  },
  "longDescription" : "Nome completo do cliente",
  "name" : "NM_NOME"
}'

108366-atlasglossaryterm-updated.png


How can I solve this?


Thank you.

Best Regards.


José Nilson