Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

API request to make a child tag/classification

avatar
Rising Star

There's documentation for creating a child/parent relationship for classifications in the UI. What would be the equivalent script for creating the same relationship in the API?

Let's say I have a parent classification named 'security_protection'. I want to create child classifications via API request named 'disk_encryption' and field_encryption'. What would be the v2 API request to do this?

Thanks in advance.

Version 2.6.3

1 ACCEPTED SOLUTION

avatar
Expert Contributor

Thank you for your patience. Attached is a sample from one of the internal environments. The attached zip (tag0.zip) has 2 files:

  • tag0.json: Top-level tag containing 1000+ sub-types.
  • tag0_207.json: One of the child tags that do not have sub-types, but has tag0 as parent.

You can use entity creation APIs to add these types to the Atlas server.

Bulk APIs can be used to add multiple type definitions at the same time. Note that the bulk APIs takes AtlasTypesDef as input, ensure that the posted JSON is in that format.

curl -X POST -u admin:admin -H 'Content-Type: application/json' -d @tags.json http://localhost:21000/api/atlas/v2/types/typedefs

Hope this helps.

View solution in original post

2 REPLIES 2

avatar
Expert Contributor

Thank you for your patience. Attached is a sample from one of the internal environments. The attached zip (tag0.zip) has 2 files:

  • tag0.json: Top-level tag containing 1000+ sub-types.
  • tag0_207.json: One of the child tags that do not have sub-types, but has tag0 as parent.

You can use entity creation APIs to add these types to the Atlas server.

Bulk APIs can be used to add multiple type definitions at the same time. Note that the bulk APIs takes AtlasTypesDef as input, ensure that the posted JSON is in that format.

curl -X POST -u admin:admin -H 'Content-Type: application/json' -d @tags.json http://localhost:21000/api/atlas/v2/types/typedefs

Hope this helps.

avatar
Super Collaborator

@Laura Ngo

Once you have the super tag "security_protection"created , following can be POSTed to API to create Types REST v2 API sub classifications. Note that the superTypes list contains the security_protection classification.

http://localhost:21000/api/atlas/v2/types/typedefs?type=classification
{ 
    "classificationDefs":[    
    	{          
	 "name":"disk_encryption",         
	 "description":"",        
	 "superTypes":["security_protection" ],        
	 "attributeDefs":[]      
        },
        {          
	 "name":"field_encryption",         
	 "description":"",        
	 "superTypes":["security_protection" ],        
	 "attributeDefs":[]      
        }
 ]
}