Data Governance
Also available as:
PDF
loading table of contents...

Classification Type API

  • Base resource name: v2/types/classificationdef

  • Full URL: http://<atlas-server-host:port>/api/atlas/v2/types/classificationdef

Register Classification Type

Request:

POST /v2/types/classificationdef 

Description:

This request is used to register a Classification type with the Atlas type system.

Method Signature:

@POST
@Path("/classificationdef")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasClassificationDef createClassificationDef(AtlasClassificationDef classificationDef) throws AtlasBaseException { 

Example Request:

POST v2/types/classificationdef 

Example Request Body:

{
    "name": "Secured_Data",
    "typeVersion": "1.0",
    "superTypes" : [],
    "attributeDefs": [
        {
            "name": "allowed_groups",
            "typeName": "array<string>",
            "cardinality": "LIST",
            "isIndexable": true,
            "isOptional": true,
            "isUnique": false
        }
    ]
}

Example Response:

{
  "category": "CLASSIFICATION",
  "guid": "c8011ad1-bf60-4e9c-a77c-b1f947435ece",
  "createTime": 1481979168876,
  "updateTime": 1481979168876,
  "version": 1,
  "name": "Secured_Data",
  "description": "Secured_Data",
  "typeVersion": "1.0",
  "attributeDefs": [
    {
      "name": "allowed_groups",
      "typeName": "array<string>",
      "isOptional": true,
      "cardinality": "LIST",
      "valuesMinCount": 0,
      "valuesMaxCount": 2147483647,
      "isUnique": false,
      "isIndexable": true
    }
  ],
  "superTypes": []
}

Get Classification Type Definition Using Name

Request:

GET /v2/types/classificationdef/name/{name}

Description:

Returns the definition of the Classification type with the given name.

Method Signature:

@GET
@Path("/classificationdef/name/{name}")
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasClassificationDef getClassificationDefByName(@PathParam("name") String name) throws AtlasBaseException {

Example Request:

GET v2/types/classificationdef/name/Secured_Data

Example Response:

{
  "category": "CLASSIFICATION",
  "guid": "c8011ad1-bf60-4e9c-a77c-b1f947435ece",
  "createTime": 1481979168876,
  "updateTime": 1481979168876,
  "version": 1,
  "name": "Secured_Data",
  "typeVersion": "1.0",
  "attributeDefs": [
    {
      "name": "allowed_groups",
      "typeName": "array<string>",
      "isOptional": true,
      "cardinality": "LIST",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": true
    }
  ],
  "superTypes": []
}

Get Classification Type Definition Using GUID

Request:

GET /v2/types/classificationdef/guid/{guid}

Description:

Returns the definition of the Classification type by referencing its GUID.

Method Signature:

@GET
@Path("/classificationdef/guid/{guid}")
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasClassificationDef getClassificationDefByGuid(@PathParam("guid") String guid) throws AtlasBaseException { 

Example Request:

GET v2/types/classificationdef/guid/c8011ad1-bf60-4e9c-a77c-b1f947435ece

Example Response:

{
  "category": "CLASSIFICATION",
  "guid": "c8011ad1-bf60-4e9c-a77c-b1f947435ece",
  "createTime": 1481979168876,
  "updateTime": 1481979168876,
  "version": 1,
  "name": "Secured_Data",
  "typeVersion": "1.0",
  "attributeDefs": [
    {
      "name": "allowed_groups",
      "typeName": "array<string>",
      "isOptional": true,
      "cardinality": "LIST",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": true
    }
  ],
  "superTypes": []
}

Update Classification Type Using Name

Request:

PUT /v2/types/classificationdef/name/{name}

Description:

This request is used to update a Classification type definition by referencing its name.

Method Signature:

@PUT
@Path("/classificationdef/name/{name}")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasClassificationDef updateClassificationDefByName(@PathParam("name") String name, AtlasClassificationDef classificationDef)throws AtlasBaseException { 

Example Request:

PUT /v2/types/name/Secured_Data

Example Request Body:

{
    "name": "Secured_Data",
    "typeVersion": "1.0",
    "superTypes" : [],
    "attributeDefs": [
        {
            "name": "allowed_groups",
            "typeName": "array<string>",
            "cardinality": "LIST",
            "isIndexable": true,
            "isOptional": true,
            "isUnique": false
        },
        {
            "name": "partial_access_group",
            "typeName": "array<string>",
            "cardinality": "LIST",
            "isIndexable": true,
            "isOptional": true,
            "isUnique": false
        }
    ]
}

Example Response:

{
  "category": "CLASSIFICATION",
  "guid": "c8011ad1-bf60-4e9c-a77c-b1f947435ece",
  "createTime": 1481979168876,
  "updateTime": 1482124162350,
  "version": 3,
  "name": "Secured_Data",
  "description": "Secured_Data",
  "typeVersion": "1.0",
  "attributeDefs": [
    {
      "name": "allowed_groups",
      "typeName": "array<string>",
      "isOptional": true,
      "cardinality": "LIST",
      "valuesMinCount": 0,
      "valuesMaxCount": 2147483647,
      "isUnique": false,
      "isIndexable": true
    },
    {
      "name": "partial_access_group",
      "typeName": "array<string>",
      "isOptional": true,
      "cardinality": "LIST",
      "valuesMinCount": 0,
      "valuesMaxCount": 2147483647,
      "isUnique": false,
      "isIndexable": true
    }
  ],
  "superTypes": []
}

Update Classification Type Using GUID

Request:

PUT /v2/types/classificationdef/guid/{guid}

Description:

This request is used to update a Classification type by referencing its GUID.

Method Signature:

@PUT
@Path("/classificationdef/guid/{guid}")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasClassificationDef updateClassificationDefByGuid(@PathParam("guid") String guid, AtlasClassificationDef classificationDef) throws AtlasBaseException { 

Example Request:

PUT /v2/types/guid/c8011ad1-bf60-4e9c-a77c-b1f947435ece

Example Response:

{
  "category": "CLASSIFICATION",
  "guid": "c8011ad1-bf60-4e9c-a77c-b1f947435ece",
  "createTime": 1481979168876,
  "updateTime": 1482124162350,
  "version": 3,
  "name": "Secured_Data",
  "description": "Secured_Data",
  "typeVersion": "1.0",
  "attributeDefs": [
    {
      "name": "allowed_groups",
      "typeName": "array<string>",
      "isOptional": true,
      "cardinality": "LIST",
      "valuesMinCount": 0,
      "valuesMaxCount": 2147483647,
      "isUnique": false,
      "isIndexable": true
    },
    {
      "name": "partial_access_group",
      "typeName": "array<string>",
      "isOptional": true,
      "cardinality": "LIST",
      "valuesMinCount": 0,
      "valuesMaxCount": 2147483647,
      "isUnique": false,
      "isIndexable": true
    }
  ],
  "superTypes": []
}

Delete Classification Type Definition Using Name

Request:

DELETE /v2/types/classificationdef/name/{name}

Description:

Deletes a Classification type definition by referencing its name.

Method Signature:

@DELETE
@Path("/classificationdef/name/{name}")
@Produces(Servlets.JSON_MEDIA_TYPE)
public void deleteClassificationDefByName(@PathParam("name") String name) throws AtlasBaseException { 

Example Request:

DELETE /v2/types/classificationdef/name/Secured_Data

Delete Classification Type Definition Using GUID

Request:

DELETE /v2/types/classificationdef/guid/{guid}

Description:

Deletes a Classification type definition by referencing its GUID.

Method Signature:

@DELETE
@Path("/classificationdef/guid/{guid}")
@Produces(Servlets.JSON_MEDIA_TYPE)
public void deleteClassificationDefByGuid(@PathParam("guid") String guid) throws AtlasBaseException {

Example Request:

DELETE /v2/types/classificationdef/guid/c8011ad1-bf60-4e9c-a77c-b1f947435ece

Get All Classification Type Definitions

Request:

GET /v2/types/classificationdef

Description:

Returns all Classification type definitions.

Method Signature:

@GET
@Path("/classificationdef")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasClassificationDefs searchClassificationDefs() throws AtlasBaseException { 

Example Request:

GET /v2/types/classificationdef

Example Response:

{
  "list": [
    {
      "category": "CLASSIFICATION",
      "guid": "4697914e-fa53-4776-a54a-1deadf8f477f",
      "createTime": 1480595851386,
      "updateTime": 1480595851386,
      "version": 1,
      "name": "Data",
      "description": "kmf",
      "typeVersion": "1.0",
      "attributeDefs": [],
      "superTypes": []
    },
    {
      "category": "CLASSIFICATION",
      "guid": "c8011ad1-bf60-4e9c-a77c-b1f947435ece",
      "createTime": 1481979168876,
      "updateTime": 1482124162350,
      "version": 3,
      "name": "Secured_Data",
      "description": "Secured_Data",
      "typeVersion": "1.0",
      "attributeDefs": [
        {
          "name": "allowed_groups",
          "typeName": "array<string>",
          "isOptional": true,
          "cardinality": "LIST",
          "valuesMinCount": 0,
          "valuesMaxCount": 2147483647,
          "isUnique": false,
          "isIndexable": true
        },
        {
          "name": "partial_access_group",
          "typeName": "array<string>",
          "isOptional": true,
          "cardinality": "LIST",
          "valuesMinCount": 0,
          "valuesMaxCount": 2147483647,
          "isUnique": false,
          "isIndexable": true
        }
      ],
      "superTypes": []
    },
    {
      "category": "CLASSIFICATION",
      "guid": "0c2edbcc-c993-4071-95b0-4e831d1cca49",
      "createTime": 1480595843527,
      "updateTime": 1480595843527,
      "version": 1,
      "name": "PII",
      "description": "secure",
      "typeVersion": "1.0",
      "attributeDefs": [],
      "superTypes": []
    }
  ],
  "startIndex": 0,
  "pageSize": 3,
  "totalCount": 3,
  "sortType": "NONE"
}