Cloudera Unified Data Fabric API request and response format
Cloudera Unified Data Fabric REST requests use JSON bodies, identify types by namespace and name, and place the entity URN in the path. Percent-encode each colon and slash in that path segment.
Request and response format
Requests and responses follow these rules:
- Request and response bodies are JSON. Field names and schemas are in the REST API reference.
- A POST, PUT, or PATCH request that includes a body must set the
Content-Typeheader toapplication/json. - Entities are identified by their URN, for example,
urn:hive:table::hms:prod:sales:orders. Operations that act on one entity take the URN as the last path segment before any sub-resource. - Type names use the
[***NAMESPACE***]:[***NAME***]format, for example,hive:table.
URN path encoding
Percent-encode the URN as one path segment. The API accepts colons that are left unencoded.
- Encode each colon (
:) as%3Aand each slash (/) as%2F. - Pass a column to lineage as the
fieldPathquery parameter. A number sign (#) is not part of the URN path.
For example, the URN urn:hive:table::hms:prod:sales:orders is the
following path:
/udf/registry/api/v1/entity/urn%3Ahive%3Atable%3A%3Ahms%3Aprod%3Asales%3Aorders
Column-level lineage for that entity uses the fieldPath query
parameter:
/udf/registry/api/v1/entity/urn%3Ahive%3Atable%3A%3Ahms%3Aprod%3Asales%3Aorders/lineage?fieldPath=[***FIELD PATH***]
Example request
The following request creates or updates one entity. The example is a Hive table,
which requires the name and tableType
attributes. Attribute requirements depend on the entity type.
POST /udf/registry/api/v1/entity HTTP/1.1
Host: [***CLUSTER DOMAIN***]
Content-Type: application/json
{
"urn": "urn:hive:table::hms:prod:sales:orders",
"parentUrn": "urn:hive:database::hms:prod:sales",
"entityType": "hive:table",
"attributes": {
"name": "orders",
"tableType": "MANAGED"
}
}
