You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@atlas.apache.org by "Erik Bergenholtz (JIRA)" <ji...@apache.org> on 2015/09/14 22:22:45 UTC

[jira] [Commented] (ATLAS-163) New Trait UI (Tag)

    [ https://issues.apache.org/jira/browse/ATLAS-163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14744182#comment-14744182 ] 

Erik Bergenholtz commented on ATLAS-163:
----------------------------------------

To create a Tag definition, make the following API call [example]:

{code}
POST http://c6401.ambari.apache.org:21000/api/atlas/types
{
  "enumTypes":[

  ],
  "structTypes":[

  ],
  "traitTypes":[
    {
      "superTypes":[

      ],
      "hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.TraitType",
      "typeName”:"PII",
      "attributeDefinitions":[
        {
          "name":"name",
          "dataTypeName":"string",
          "multiplicity":"optional",
          "isComposite":false,
          "isUnique":false,
          "isIndexable":true,
          "reverseAttributeName":null
        },
        {
          "name":"description",
          "dataTypeName":"string",
          "multiplicity":"optional",
          "isComposite":false,
          "isUnique":false,
          "isIndexable":true,
          "reverseAttributeName":null
        }
      ]
    }
  ],
  "classTypes":[

  ]
}

{code}
Another example JSON body which creates a tag that inherits from another tag:
{code}
  "enumTypes":[

  ],
  "structTypes":[

  ],
  "traitTypes":[
    {
      "superTypes":[
          “PII"
      ],
      "hierarchicalMetaTypeName":"org.apache.atlas.typesystem.types.TraitType",
      "typeName":"Sub",
      "attributeDefinitions":[
        {
          "name":"property1",
          "dataTypeName":"string",
          "multiplicity":"optional",
          "isComposite":false,
          "isUnique":false,
          "isIndexable":true,
          "reverseAttributeName":null
        },
        {
          "name":"property2",
          "dataTypeName":"string",
          "multiplicity":"optional",
          "isComposite":false,
          "isUnique":false,
          "isIndexable":true,
          "reverseAttributeName":null
        }
      ]
    }
  ],
  "classTypes":[

  ]
}
{code}

To Associate a trait with an Entity, here’s an example call:

{code}
POST http://c6401.ambari.apache.org:21000/api/atlas/entities/068c092f-7e49-4f48-b34e-86908cd6c3f6/traits
{
  "jsonClass":"org.apache.atlas.typesystem.json.InstanceSerialization$_Struct",
  "typeName":"Sub",
  "values":{
    "name":"Test Traitx",
    "description":"Test Traitx",           
    "property1":"v1",
    "property2":"v2"           
  }
}

> New Trait UI (Tag)
> ------------------
>
>                 Key: ATLAS-163
>                 URL: https://issues.apache.org/jira/browse/ATLAS-163
>             Project: Atlas
>          Issue Type: Improvement
>    Affects Versions: 0.6-incubating
>            Reporter: Erik Bergenholtz
>            Assignee: Vishal Kadam
>             Fix For: 0.6-incubating
>
>         Attachments: TagDefinition.png
>
>
> Atlas needs a UI to create new Tag definitions.
> See attached screen-shots.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)