The /topologies/{topologyName}/links
endpoint allows you to create, retrieve and delete one or more links in a topology. You cannot update links, you must delete and re-add them.
To retrieve and delete all links for a node see /topologies/{topologyName}/links/{nodeName}.
Back to Topologies API Endpoint Reference.
Retrieves details of all links for a specified topology.
The GET request takes the following path parameter:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | Name of the topology. You can obtain all topology names by executing a GET request to |
The GET request returns the following response:
Successful requests return an array of JSON objects containing the following:
Name | Type | Description |
---|---|---|
| String | Description of the link between the nodes. |
| String | Name of the source node. Note that topology links in Moogsoft Onprem are bidirectional. |
| String | Name of the sink node. Note that topology links in Moogsoft Onprem are bidirectional. |
The following example demonstrates making a GET request to the /topologies/{topologyName}/links
endpoint.
Example cURL GET request to return link details for the "host" topology:
curl -X GET 'https://example.com/api/v1/topologies/host/links' -u phil:password123
Example response returning the topology's link details:
[
{
"description: "link1",
"sourceNode": "node1",
"sinkNode: "node2"
},
{
"description: "link2",
"sourceNode": "node2",
"sinkNode: "node3"
}
]
Creates one or more links in a topology. Creates the specified source nodes and sink nodes if they do not already exist.
The POST request takes the following request payload:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | Name of the source node. Note that topology links in Moogsoft Onprem are bidirectional. |
| String | Yes | Name of the sink node. Note that topology links in Moogsoft Onprem are bidirectional. |
| String | No | Description of the link between the nodes. |
The POST request returns the following response:
Successful requests return an array of JSON objects containing the following:
Name | Type | Description |
---|---|---|
| String | Name of the source node. Note that topology links in Moogsoft Onprem are bidirectional. |
| String | Name of the sink node. Note that topology links in Moogsoft Onprem are bidirectional. |
| String | Description of the link between the nodes. |
If the supplied link already exists, the HTTP code 200 is returned.
The following example demonstrates making a POST request to the /topologies/{topologyName}/links
endpoint.
Example cURL POST request to create two links in the "host" topology:
curl -X POST 'https://example.com/api/v1/topologies/host/links' \
--header 'Content-Type: application/json; charset=UTF-8' \
-u phil:password123 \
-d '[{"sourceNode":"node1","sinkNode":"node2","description":"link1"},{"sourceNode":"node2","sinkNode":"node3","description":"link2"}]'
Example response returning the new links:
[
{
"description: "link1",
"sourceNode": "node1",
"sinkNode:" "node2"
},
{
"description: "link2",
"sourceNode": "node2",
"sinkNode:" "node3"
}
]
Deletes one or more links in a topology.
The DELETE request takes the following request payload:
Name | Type | Required | Description |
---|---|---|---|
| Array | Yes | One or more links in the format: [
{
"sourceNode" : "node1",
"sinkNode" : "node2"
},
{
"sourceNode" : "node2",
"sinkNode" : "node3"
}
] |
The DELETE request returns the following response:
If the request contains some existing and some non-existing links, the existing links will be deleted and non-existing links will be returned in the response.
The following example demonstrates making a DELETE request to the /topologies/{topologyName}/links
endpoint.
Example cURL request to delete the "link1" and "link2" links in the "host" topology:
curl -X DELETE 'https://example.com/api/v1/topologies/host/links' \
-H 'Content-Type: application/json' \
-d ["link1","link2"] \
-u phil:password123
An example response where link1 and link2 do not exist:
{
"message": "Some of the links could not be deleted as they did not exist","invalidLinks":
[
{
"sourceNode": "node1",
"sinkNode": "node2"
}
]
}