catalog.relationEdges.add
Add a relation edge between two entities in your software catalog.
Facts
| HTTP Method | POST https://api.getdx.com/catalog.relationEdges.add |
| Scope | catalog:write:entities |
Arguments
Required arguments
| Parameter | Type | Description |
|---|---|---|
relation_identifier |
string |
The identifier of the relation type. |
source_entity_identifier |
string |
The identifier of the source entity. |
target_entity_identifier |
string |
The identifier of the target entity. |
All entities specified in the parameters must exist for the account — the request fails if any are not found.
Each entity must also be of the correct entity type for its role in the relation. For example, if a relation is defined between service (source) and api (target), supplying a datastore for either side returns an invalid_entity_type error.
Cardinality rules
The newly created edge must not violate the cardinality configured for the relation type. If a violation occurs, the endpoint responds with an invalid_cardinality error.
Example request
This is a typical request:
curl -X POST https://api.getdx.com/catalog.relationEdges.add \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer xxxx-xxxxxxxxx-xxxx' \
--data '{
"relation_identifier": "service-depends-on-service",
"source_entity_identifier": "login-frontend",
"target_entity_identifier": "authn-backend"
}'
Example response
This is a typical success response:
{
"ok": true
}
Errors
| Error | Description |
|---|---|
not_authed |
No authentication token provided. |
invalid_auth |
Some aspect of authentication cannot be validated. |
invalid_arguments |
Missing required parameters or malformed request body. Error details will indicate the specific issue. |
relation_not_found |
The relation identifier does not exist for the account. |
entity_not_found |
The source or target entity identifier does not exist for the account. |
invalid_cardinality |
Adding this edge would violate the cardinality configured on the relation type. |
invalid_entity_type |
The source or target entity identifier is of the wrong entity type for the relation (e.g. passing a widget identifier where a service is expected). |
This table lists only the common expected errors for this method. You should also expect standard service availability errors.