User-Defined Links

User-defined links (UDLs) for the enlinkd topology can be be queried, added, modified, or deleted via REST endpoints.

GETs (reading UDLs)

User-defined link API GET functions
Resource Description

api/v2/userdefinedlinks

Get the list of UDLs.

api/v2/userdefinedlinks/{id}

Retrieve a specific UDL by database ID.

POST (Creating UDLs)

User-defined link API POST function
Resource Description

api/v2/userdefinedlinks

Add a new UDL.

Use examples with cURL

Create a new UDL between node with ID 1 and node with ID 2.
curl -v -X POST -u admin:admin -H "Content-Type: application/json" -d '{"node-id-a": 1, "node-id-z": 2, "component-label-a": "tp1", "component-label-z": "tp2", "link-id": "n1:tp1->n2:tp2", "owner": "me"}' http://localhost:8980/opennms/api/v2/userdefinedlinks

PUT (modifying UDLs)

PUT property updates use form data with application/x-www-form-urlencoded as the Content-Type.

User-defined link API PUT functions
Resource Description

api/v2/userdefinedlinks

Bulk-update: set the supplied properties on every UDL matched by the query.

api/v2/userdefinedlinks/{id}

Update the supplied properties on the UDL with the given database ID.

Use examples with cURL

Update the owner of the UDL with ID 1.
curl -v -X PUT -u admin:admin -H "Content-Type: application/x-www-form-urlencoded" -d "owner=someoneelse" http://localhost:8980/opennms/api/v2/userdefinedlinks/1

DELETE (removing UDLs)

User-defined link API DELETE function
Resource Description

api/v2/userdefinedlinks

Bulk-delete: remove every UDL matched by the query.

api/v2/userdefinedlinks/{id}

Delete a UDL by database ID.