Entity Relationships (Beta)
Last updated
Was this helpful?
Last updated
Was this helpful?
Use these operations to interact with entity relationships in Cortex.
Create and Update Relationships: Your API key must have the Edit entities
permission.
Your tenant must also have the Entity relationships
feature enabled.
List all entity destinations for a certain relationship type. Optional depth parameter to limit the depth of the relationship tree.
The tag (x-cortex-tag
) or unique, auto-generated identifier for the entity.
Maximum depth to traverse in the relationship hierarchy. Defaults to 1 (i.e., direct relationships only).
2
If true will include relationships that traverse archived entities
false
Example: false
GET /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/destinations HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Accept: */*
{
"destinations": [
{
"description": "text",
"id": "en2da8159dbeefb974",
"name": "My Favorite Entity",
"tag": "my-favorite-entity",
"type": "service"
}
]
}
List all entity sources for a certain relationship type. Optional depth parameter to limit the depth of the relationship tree.
The tag (x-cortex-tag
) or unique, auto-generated identifier for the entity.
Maximum depth to traverse in the relationship hierarchy. Defaults to 1 (i.e., direct relationships only).
2
If true will include relationships that traverse archived entities
false
Example: false
GET /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/sources HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Accept: */*
{
"sources": [
{
"description": "text",
"id": "en2da8159dbeefb974",
"name": "My Favorite Entity",
"tag": "my-favorite-entity",
"type": "service"
}
]
}
List all entity relationships for a certain relationship type.
Number of results to return per page, between 1 and 1000. Default 250.
250
Page number to return, 0-indexed. Default 0.
0
GET /api/v1/relationships/{relationshipTypeTag} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Accept: */*
{
"page": 1,
"relationships": [
{
"destinationEntity": {
"description": "text",
"id": "en2da8159dbeefb974",
"name": "My Favorite Entity",
"tag": "my-favorite-entity",
"type": "service"
},
"providerType": "WORKDAY",
"relationshipTypeTag": "depends-on",
"sourceEntity": {
"description": "text",
"id": "en2da8159dbeefb974",
"name": "My Favorite Entity",
"tag": "my-favorite-entity",
"type": "service"
}
}
],
"total": 1,
"totalPages": 1
}
Update all direct destinations for a given entity and entity relationship type
The tag (x-cortex-tag
) or unique, auto-generated identifier for the entity.
When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.
Updates to entity relationship destinations
List of code tags for the entities to add as sources
["entity-1","entity-2"]
PUT /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/destinations HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 40
{
"destinations": [
"entity-1",
"entity-2"
]
}
{
"destinations": [
{
"description": "text",
"id": "en2da8159dbeefb974",
"name": "My Favorite Entity",
"tag": "my-favorite-entity",
"type": "service"
}
]
}
Add direct destinations for a given entity and entity relationship type
The tag (x-cortex-tag
) or unique, auto-generated identifier for the entity.
When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.
Updates to entity relationship destinations
List of code tags for the entities to add as sources
["entity-1","entity-2"]
POST /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/destinations HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 40
{
"destinations": [
"entity-1",
"entity-2"
]
}
{
"destinations": [
{
"description": "text",
"id": "en2da8159dbeefb974",
"name": "My Favorite Entity",
"tag": "my-favorite-entity",
"type": "service"
}
]
}
Update all direct sources for a given entity and entity relationship type
The tag (x-cortex-tag
) or unique, auto-generated identifier for the entity.
When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.
Updates to entity relationship sources
List of code tags for the entities to add as sources
["entity-1","entity-2"]
PUT /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/sources HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 35
{
"sources": [
"entity-1",
"entity-2"
]
}
{
"sources": [
{
"description": "text",
"id": "en2da8159dbeefb974",
"name": "My Favorite Entity",
"tag": "my-favorite-entity",
"type": "service"
}
]
}
Add direct sources for a given entity and entity relationship type
The tag (x-cortex-tag
) or unique, auto-generated identifier for the entity.
When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.
Updates to entity relationship sources
List of code tags for the entities to add as sources
["entity-1","entity-2"]
POST /api/v1/catalog/{tagOrId}/relationships/{relationshipTypeTag}/sources HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 35
{
"sources": [
"entity-1",
"entity-2"
]
}
{
"sources": [
{
"description": "text",
"id": "en2da8159dbeefb974",
"name": "My Favorite Entity",
"tag": "my-favorite-entity",
"type": "service"
}
]
}
Update all entity relationships for a certain relationship type.
When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.
Updates to entity relationships
PUT /api/v1/relationships/{relationshipTypeTag} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 68
{
"relationships": [
{
"destination": "service-b",
"source": "service-a"
}
]
}
{
"errors": [
{
"destinationEntityTag": "service-b",
"errorMessage": "Source entity not found",
"relationshipTypeTag": "depends-on",
"sourceEntityTag": "service-a"
}
],
"relationships": [
{
"destinationEntityTag": "service-b",
"providerType": "WORKDAY",
"relationshipTypeTag": "depends-on",
"sourceEntityTag": "service-a"
}
]
}
Add all entity relationships for a certain relationship type.
When true, overrides values that were defined in the catalog descriptor. Will be overwritten the next time the catalog descriptor is processed.
Updates to entity relationships
POST /api/v1/relationships/{relationshipTypeTag} HTTP/1.1
Host: api.getcortexapp.com
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 68
{
"relationships": [
{
"destination": "service-b",
"source": "service-a"
}
]
}
{
"errors": [
{
"destinationEntityTag": "service-b",
"errorMessage": "Source entity not found",
"relationshipTypeTag": "depends-on",
"sourceEntityTag": "service-a"
}
],
"relationships": [
{
"destinationEntityTag": "service-b",
"providerType": "WORKDAY",
"relationshipTypeTag": "depends-on",
"sourceEntityTag": "service-a"
}
]
}