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

Struct Type API

  • Base resource name: v2/types/structdef

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

Register Struct Type

Request:

POST /v2/types/structdef 

Description:

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

Method Signature:

@POST
@Path("/structdef")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasStructDef createStructDef(AtlasStructDef structDef) throws AtlasBaseException { 

Example Request:

POST /v2/types/structdef 

Example Request Body:

{
    "name": "table_creation_order",
    "typeVersion": "1.0",
    "attributeDefs": [
        {
            "name": "order",
            "typeName": "int",
            "cardinality": "SINGLE",
            "isIndexable": false,
            "isOptional": false,
            "isUnique": false
        },
        {
            "name": "tablename",
            "typeName": "string",
            "cardinality": "SINGLE",
            "isIndexable": false,
            "isOptional": false,
            "isUnique": false
        }
    ]
}

Example Response:

{
  "category": "STRUCT",
  "guid": "9527b5c2-49f7-4e25-bab0-a352d58fc2bf",
  "createTime": 1481887151201,
  "updateTime": 1481887151201,
  "version": 1,
  "name": "table_creation_order",
  "description": "table_creation_order",
  "typeVersion": "1.0",
  "attributeDefs": [
    {
      "name": "order",
      "typeName": "int",
      "isOptional": false,
      "cardinality": "SINGLE",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    },
    {
      "name": "tablename",
      "typeName": "string",
      "isOptional": false,
      "cardinality": "SINGLE",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    }
  ]
}
Get Struct Type Definition Using Name

Request:

GET /v2/types/structdef/name/{name}

Description:

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

Method Signature:

@GET
@Path("/structdef/name/{name}")
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasStructDef getStructDefByName(@PathParam("name") String name) throws AtlasBaseException { 

Example Request:

GET v2/types/structdef/name/table_creation_order

Example Response:

{
  "category": "STRUCT",
  "guid": "9527b5c2-49f7-4e25-bab0-a352d58fc2bf",
  "createTime": 1481887151201,
  "updateTime": 1481887151201,
  "version": 1,
  "name": "table_creation_order",
  "typeVersion": "1.0",
  "attributeDefs": [
    {
      "name": "order",
      "typeName": "int",
      "isOptional": false,
      "cardinality": "SINGLE",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    },
    {
      "name": "tablename",
      "typeName": "string",
      "isOptional": false,
      "cardinality": "SINGLE",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    }
  ]
}
Get Struct Type Definition Using GUID

Request:

GET v2/types/structdef/guid/{guid}

Description:

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

Method Signature:

@GET
@Path("/structdef/guid/{guid}")
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasStructDef getStructDefByGuid(@PathParam("guid") String guid) throws AtlasBaseException { 

Example Request:

GET v2/types/structdef/guid/9527b5c2-49f7-4e25-bab0-a352d58fc2bf

Example Response:

{
  "category": "STRUCT",
  "guid": "9527b5c2-49f7-4e25-bab0-a352d58fc2bf",
  "createTime": 1481887151201,
  "updateTime": 1481887151201,
  "version": 1,
  "name": "table_creation_order",
  "typeVersion": "1.0",
  "attributeDefs": [
    {
      "name": "order",
      "typeName": "int",
      "isOptional": false,
      "cardinality": "SINGLE",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    },
    {
      "name": "tablename",
      "typeName": "string",
      "isOptional": false,
      "cardinality": "SINGLE",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    }
  ]
}
Update Struct Type Using Name

Request:

PUT /v2/types/structdef/name/{name}

Description:

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

Method Signature:

@PUT
@Path("/structdef/name/{name}")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasStructDef updateStructDefByName(@PathParam("name") String name, AtlasStructDef structDef) throws AtlasBaseException { 

Example Request:

PUT v2/types/structdef/name/table_creation_order

Example Request Body:

{
    "name": "table_creation_order",
    "typeVersion": "1.0",
    "attributeDefs": [
        {
            "name": "order",
            "typeName": "int",
            "cardinality": "SINGLE",
            "isIndexable": false,
            "isOptional": false,
            "isUnique": false
        },
        {
            "name": "tablename",
            "typeName": "string",
            "cardinality": "SINGLE",
            "isIndexable": false,
            "isOptional": false,
            "isUnique": false
        },
        {
        	"name": "before_tablename_guid",
            "typeName": "string",
            "cardinality": "SINGLE",
            "isIndexable": false,
            "isOptional": true,
            "isUnique": false
        }
    ]
}

Example Response:

{
  "category": "STRUCT",
  "guid": "9527b5c2-49f7-4e25-bab0-a352d58fc2bf",
  "createTime": 1481887151201,
  "updateTime": 1481887614746,
  "version": 2,
  "name": "table_creation_order",
  "description": "table_creation_order",
  "typeVersion": "1.0",
  "attributeDefs": [
    {
      "name": "order",
      "typeName": "int",
      "isOptional": false,
      "cardinality": "SINGLE",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    },
    {
      "name": "tablename",
      "typeName": "string",
      "isOptional": false,
      "cardinality": "SINGLE",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    },
    {
      "name": "before_tablename_guid",
      "typeName": "string",
      "isOptional": true,
      "cardinality": "SINGLE",
      "valuesMinCount": 0,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    }
  ]
}
Update Struct Type Using GUID

Request:

PUT /v2/types/structdef/guid/{guid}

Description:

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

Method Signature:

@PUT
@Path("/structdef/guid/{guid}")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasStructDef updateStructDefByGuid(@PathParam("guid") String guid, AtlasStructDef structDef) throws AtlasBaseException { 

Example Request:

PUT v2/types/structdef/guid/9527b5c2-49f7-4e25-bab0-a352d58fc2bf

Example Response:

{
  "category": "STRUCT",
  "guid": "9527b5c2-49f7-4e25-bab0-a352d58fc2bf",
  "createTime": 1481887151201,
  "updateTime": 1481887614746,
  "version": 2,
  "name": "table_creation_order",
  "description": "table_creation_order",
  "typeVersion": "1.0",
  "attributeDefs": [
    {
      "name": "order",
      "typeName": "int",
      "isOptional": false,
      "cardinality": "SINGLE",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    },
    {
      "name": "tablename",
      "typeName": "string",
      "isOptional": false,
      "cardinality": "SINGLE",
      "valuesMinCount": 1,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    },
    {
      "name": "before_tablename_guid",
      "typeName": "string",
      "isOptional": true,
      "cardinality": "SINGLE",
      "valuesMinCount": 0,
      "valuesMaxCount": 1,
      "isUnique": false,
      "isIndexable": false
    }
  ]
}
Delete Struct Type Definition Using Name

Request:

DELETE /v2/types/structdef/name/{name}

Description:

Deletes a Struct type definition by referencing its name.

Method Signature:

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

Example Request:

DELETE v2/types/structdef/name/table_creation_order
Delete Struct Type Definition Using GUID

Request:

DELETE /v2/types/structdef/guid/{guid}

Description:

Deletes a Struct type definition by referencing its GUID.

Method Signature:

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

Example Request:

DELETE v2/types/structdef/guid/9527b5c2-49f7-4e25-bab0-a352d58fc2bf