Thursday, 11 August 2022

Atlas Client: Delete classification of an entity by entity id

AtlasCleintV2# deleteClassification method is used to delete classification of an entity.

 

Signature

public void deleteClassification(String guid, String classificationName) throws AtlasServiceException

 


 Below snippet delete the classification attached to the entity.

atlasClient.deleteClassification("898c2aa1-d31a-4d0b-a1fd-7a76da6a4071", "sensitive_data");

Find the below working application.

 

Create atlas-application.properties file under src/main/resources folder.

 

atlas-application.properties

atlas.client.readTimeoutMSecs=30000
atlas.client.connectTimeoutMSecs=30000

Define DeleteClassificationOfAnEntity class.

 

DeleteClassificationOfAnEntity.java

package com.sample.app.classifications;

import org.apache.atlas.AtlasClientV2;
import org.apache.atlas.AtlasServiceException;

public class DeleteClassificationOfAnEntity {
	public static void main(String[] args) throws AtlasServiceException {
		AtlasClientV2 atlasClient = new AtlasClientV2(new String[] { "http://localhost:21000" },
				new String[] { "admin", "admin" });

		atlasClient.deleteClassification("898c2aa1-d31a-4d0b-a1fd-7a76da6a4071", "sensitive_data");

	}

}

Run above application and you can observe that the classification ‘sensitive_data’ is removed.





 

  

Previous                                                    Next                                                    Home

No comments:

Post a Comment