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

Bulk Type System API

  • Base resource name: v2/types/typedefs

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

Get Entity Type Definition Headers

Request:

GET /v2/types/typedefs/headers

Description:

Returns headers (with minimal information) for all type definitions.

Method Signature:

@GET
@Path("/typedefs/headers")
@Produces(Servlets.JSON_MEDIA_TYPE)
public List<AtlasTypeDefHeader> getTypeDefHeaders() throws AtlasBaseException {

Example Request:

GET v2/types/typedefs/headers

Example Response:

[
  {
    "guid": "b3fd4d06-2a10-4722-9419-8210b00fddd0",
    "name": "hive_principal_type",
    "category": "ENUM"
  },
  {
    "guid": "c5642d55-9f8e-45b1-b4a9-709c97b46233",
    "name": "creation_order1",
    "category": "ENUM"
  },
  {
    "guid": "2ba8a2e0-63e6-4d5c-bc26-140fa95eb241",
    "name": "creation_order",
    "category": "ENUM"
  },
  {
    "guid": "011fe1e9-78a0-41bb-b7cf-6091a3e40424",
    "name": "file_action",
    "category": "ENUM"
  },
  {
    "guid": "a9547d7a-bee1-49af-a4f0-fcd8a128091f",
    "name": "hive_order",
    "category": "STRUCT"
  },
  {
    "guid": "18114653-958d-41c2-ac2c-5f7f5b5d181d",
    "name": "hive_serde",
    "category": "STRUCT"
  },
  {
    "guid": "191c0a7a-e4e7-4fac-9f60-d08b54c34ecb",
    "name": "fs_permissions",
    "category": "STRUCT"
  },
  {
    "guid": "63d0755e-8e54-4f5f-9266-fa8d5df20969",
    "name": "creation_order2",
    "category": "STRUCT"
  },
  {
    "guid": "4697914e-fa53-4776-a54a-1deadf8f477f",
    "name": "Data",
    "category": "CLASSIFICATION"
  },
  {
    "guid": "c8011ad1-bf60-4e9c-a77c-b1f947435ece",
    "name": "Secured_Data",
    "category": "CLASSIFICATION"
  },
  {
    "guid": "0c2edbcc-c993-4071-95b0-4e831d1cca49",
    "name": "PII",
    "category": "CLASSIFICATION"
  },
  {
    "guid": "be6f7de1-73f6-41c4-b73d-96bc7840c0a4",
    "name": "hive_column_lineage",
    "category": "ENTITY"
  },
  {
    "guid": "1c4699e8-d441-45f4-a5ef-49663d7bdaf1",
    "name": "Asset",
    "category": "ENTITY"
  },
  {
    "guid": "0402c8c7-b052-4299-a38b-337b3a16aa8c",
    "name": "DataSet",
    "category": "ENTITY"
  },
  {
    "guid": "8e9478a6-9d07-4775-a3af-5090367caba4",
    "name": "hive_process",
    "category": "ENTITY"
  },
  {
    "guid": "30a85b88-ea84-4cc7-b8e2-e63f6ca053cd",
    "name": "storm_bolt",
    "category": "ENTITY"
  },
  {
    "guid": "9694b576-b93a-4a06-90b5-84df684d9387",
    "name": "hdfs_path",
    "category": "ENTITY"
  },
  {
    "guid": "e703d827-9974-4e83-a310-b412992f56f1",
    "name": "falcon_cluster",
    "category": "ENTITY"
  },
  {
    "guid": "f88a3b11-0049-4fed-9c2a-7e453610e395",
    "name": "storm_spout",
    "category": "ENTITY"
  },
  {
    "guid": "fd47c0e9-7a06-488a-9831-8ebc92d7f332",
    "name": "spark_dataframe",
    "category": "ENTITY"
  },
  {
    "guid": "60c93610-36d4-4e93-8e0d-98c26f387ac8",
    "name": "sqoop_process",
    "category": "ENTITY"
  },
  {
    "guid": "5ed52a18-9053-47eb-808b-15078f0660fd",
    "name": "Infrastructure",
    "category": "ENTITY"
  },
  {
    "guid": "7b6e53bd-1fd7-4952-bb27-b81feb8e1b5f",
    "name": "Referenceable",
    "category": "ENTITY"
  },
  {
    "guid": "cac1bf5b-0212-4655-885e-0343ef716776",
    "name": "falcon_feed_replication",
    "category": "ENTITY"
  },
  {
    "guid": "fd9f7e57-5335-44b0-acd0-85fb89d97616",
    "name": "Process",
    "category": "ENTITY"
  },
  {
    "guid": "3f6671de-5fd9-4057-a2f4-1a4dc5e85674",
    "name": "falcon_feed_creation",
    "category": "ENTITY"
  },
  {
    "guid": "64f91e28-9194-4146-8894-415677a0a12b",
    "name": "storm_topology",
    "category": "ENTITY"
  },
  {
    "guid": "3cacd545-d31a-4c95-ae76-ebb674a27486",
    "name": "kafka_topic",
    "category": "ENTITY"
  },
  {
    "guid": "a8514f62-9bd6-4457-960e-95a32b92757d",
    "name": "hive_table",
    "category": "ENTITY"
  },
  {
    "guid": "1280de4a-6187-43b2-b32b-2f742cbd5ffa",
    "name": "hive_storagedesc",
    "category": "ENTITY"
  },
  {
    "guid": "a26eec40-d6df-456a-9dbc-06c942822a4e",
    "name": "sqoop_dbdatastore",
    "category": "ENTITY"
  },
  {
    "guid": "6a417c47-1f3e-4f7e-b0b5-f26c85a238c5",
    "name": "hbase_table",
    "category": "ENTITY"
  },
  {
    "guid": "904f79d3-725a-4385-8124-75c0b7d937ec",
    "name": "hive_db",
    "category": "ENTITY"
  },
  {
    "guid": "b15ff0e3-da16-489d-b0ae-7ca903f7421b",
    "name": "jms_topic",
    "category": "ENTITY"
  },
  {
    "guid": "441137db-4758-4c00-ae1b-5a5e5079a8ef",
    "name": "hbase_namespace",
    "category": "ENTITY"
  },
  {
    "guid": "bba56230-ed46-4311-a481-d4686d06b1d2",
    "name": "storm_node",
    "category": "ENTITY"
  },
  {
    "guid": "ee9cb57d-66b1-4568-9294-c9e779ecb054",
    "name": "fs_path",
    "category": "ENTITY"
  },
  {
    "guid": "d9c84e2b-d014-48a5-b294-93b10b9cb68a",
    "name": "hive_column",
    "category": "ENTITY"
  },
  {
    "guid": "9bfce300-1b70-4b6c-9a7c-edf9cedee0d2",
    "name": "falcon_feed",
    "category": "ENTITY"
  },
  {
    "guid": "b57449c9-cd6f-4969-b334-9337739b69b8",
    "name": "falcon_process",
    "category": "ENTITY"
  }
]
Get All Type Definitions

Request:

GET /v2/types/typedefs

Description:

Returns the complete definition of all types.

Method Signature:

@GET
@Path("/typedefs")
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasTypesDef getAllTypeDefs() throws AtlasBaseException { 

Example Request:

GET /v2/types/typedefs

Example Response:

This request returns an extremely long response – not shown here due to space constraints.

Bulk Create Type Definitions

Request:

POST /v2/types/typedefs

Description:

Bulk creates Atlas type definitions. Only new definitions are created. Any changes to existing definitions are ignored.

Method Signature:

@POST
@Path("/typedefs")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasTypesDef createAtlasTypeDefs(final AtlasTypesDef typesDef) throws AtlasBaseException { 

Example Request:

POST /v2/types/typedefs

Example Request Body:

{
	"enumDefs" : [],
	"structDefs" : [],
	"classificationDefs": [],
	"entityDefs" : [{
    "name": "spark_mysql_dataframe",
    "superTypes": [
        "DataSet",
        "spark_dataframe"
    ],
    "typeVersion": "1.0",
    "attributeDefs": [
        {
            "name": "database_url",
            "typeName": "string",
            "cardinality": "SINGLE",
            "isIndexable": false,
            "isOptional": false,
            "isUnique": false
        }
    ]
}]
}

Example Response:

{
  "enumDefs": [],
  "structDefs": [],
  "classificationDefs": [],
  "entityDefs": [
    {
      "category": "ENTITY",
      "guid": "30690807-ddec-432d-8641-8199e8cd57de",
      "createTime": 1482138649298,
      "updateTime": 1482138649298,
      "version": 1,
      "name": "spark_mysql_dataframe",
      "description": "spark_mysql_dataframe",
      "typeVersion": "1.0",
      "attributeDefs": [
        {
          "name": "database_url",
          "typeName": "string",
          "isOptional": false,
          "cardinality": "SINGLE",
          "valuesMinCount": 1,
          "valuesMaxCount": 1,
          "isUnique": false,
          "isIndexable": false
        }
      ],
      "superTypes": [
        "DataSet",
        "spark_dataframe"
      ]
    }
  ]
}
Bulk Update Type Definitions

Request:

PUT /v2/types/typedefs

Description:

Bulk updates all Atlas type definitions. Changes to existing definitions are persisted.

Method Signature:

@PUT
@Path("/typedefs")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
@Experimental
public AtlasTypesDef updateAtlasTypeDefs(final AtlasTypesDef typesDef) throws Exception { 

Example Request:

In this example we add one more attribute to the spark_mysql_dataframe type that we registered in the POST request in the previous section.

PUT /v2/types/typedefs

Example Request Body:

{
"enumDefs" : [],
"structDefs" : [],
"classificationDefs": [],
"entityDefs" : [{
"name": "spark_mysql_dataframe",
"superTypes": [
    "DataSet",
    "spark_dataframe"
],
"typeVersion": "1.0",
"attributeDefs": [
    {
        "name": "database_url",
        "typeName": "string",
        "cardinality": "SINGLE",
        "isIndexable": false,
        "isOptional": false,
        "isUnique": false
    },
    {
    	"name" : "instance_size",
    	"typeName": "string",
        "cardinality": "SINGLE",
        "isIndexable": false,
        "isOptional": true,
        "isUnique": false
    }
]
}]
}

Example Response:

{
  "enumDefs": [],
  "structDefs": [],
  "classificationDefs": [],
  "entityDefs": [
    {
      "category": "ENTITY",
      "guid": "30690807-ddec-432d-8641-8199e8cd57de",
      "createTime": 1482138649298,
      "updateTime": 1482140154378,
      "version": 2,
      "name": "spark_mysql_dataframe",
      "description": "spark_mysql_dataframe",
      "typeVersion": "1.0",
      "attributeDefs": [
        {
          "name": "database_url",
          "typeName": "string",
          "isOptional": false,
          "cardinality": "SINGLE",
          "valuesMinCount": 1,
          "valuesMaxCount": 1,
          "isUnique": false,
          "isIndexable": false
        },
        {
          "name": "instance_size",
          "typeName": "string",
          "isOptional": true,
          "cardinality": "SINGLE",
          "valuesMinCount": 0,
          "valuesMaxCount": 1,
          "isUnique": false,
          "isIndexable": false
        }
      ],
      "superTypes": [
        "DataSet",
        "spark_dataframe"
      ]
    }
  ]
}
Bulk Delete Type Definitions

Request:

DELETE /v2/types/typedefs

Description:

Bulk deletes all Atlas type definitions provided in the request body.

Method Signature:

@DELETE
@Path("/typedefs")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
@Experimental
public void deleteAtlasTypeDefs(final AtlasTypesDef typesDef) { 

Example Request:

DELETE /v2/types/typedefs

Example Request Body:

{
"enumDefs" : [],
"structDefs" : [],
"classificationDefs": [],
"entityDefs" : [{
"name": "spark_mysql_dataframe",
"superTypes": [
    "DataSet",
    "spark_dataframe"
],
"typeVersion": "1.0",
"attributeDefs": [
    {
        "name": "database_url",
        "typeName": "string",
        "cardinality": "SINGLE",
        "isIndexable": false,
        "isOptional": false,
        "isUnique": false
    },
    {
    	"name" : "instance_size",
    	"typeName": "string",
        "cardinality": "SINGLE",
        "isIndexable": false,
        "isOptional": true,
        "isUnique": false
    }
]
}]
}