Skip to content

Unified Catalog Entity Creation



POST /api/v1/unified_catalog/entity/create

Overview

Create a unified catalog entity.

Body Request Parameters

Parameter Name Type Required Description
entityType string Y Entity type code
Allow empty: False
Example: database
name string Y Entity name
Allow empty: False
Example: demo
attributes json Entity attributes object
Allow empty: False
Example: {'project': 'demo', 'env': 'prod', 'custom_tags': ['mysql']}
telemetrySelectors array Associated query information configuration
Allow empty: False

Parameter Supplementary Description

Request Parameter Description

Parameter Name type Required Description
entityType string Yes Entity type code
name string Yes Entity name
attributes json No Entity attributes object
telemetrySelectors array No Entity association query configuration

Common Extended Field Descriptions for attributes

Field Name type Description
depends_on array[string] Dependency relationship, will be converted to links upon writing.
component_of array[string] Belonging relationship, will be converted to contains upon writing, direction is parent/system -> current entity.
components array[json/string] Component entity list, will also be converted to contains upon writing, direction is current entity -> component.
custom_tags array/string Custom tags, if the tag does not exist, it will be created automatically.
owner string/array Team name, the backend will resolve team information based on the team name.

Call Notes

  • Relationship fields should be uniformly placed in attributes for passing, there is no need to pass relations separately.
  • attributes.components supports passing an array of strings, or an array of objects containing entity; other fields within the object will be retained in the entity attributes.
  • If passing custom_tags, it is recommended to use an array of tag names.

Request Example

curl 'https://openapi.truewatch.com/api/v1/unified_catalog/entity/create' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"entityType":"system","name":"core","attributes":{"project":"demo","env":"prod","components":[{"entity":"service:kodo-inner","health_impact_mode":"inherit"}]},"telemetrySelectors":[]}'

Response

{
    "code": 200,
    "content": {
        "urn": "urn:mysql:default:demo"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-XXXX"
}