Modifying a Topology Using the Topology API

You can update your topology by sending information about new nodes and links to a Topology API endpoint. You can also use the Topology API to get information about nodes and links in your system.


Modify your network topology by adding additional nodes and links.

  1. Use the /topologies/{topologyName}/links API endpoint to add two database servers, RDB05 and RDB06, to the network topology. Link them to the Switch05 and Switch06 subnets respectively.

  2. Use the /topologies/{topologyName}/links and /topologies/{topologyName}/nodes endpoints to verify that the new nodes and links have been added.

Step-by-Step Instructions

  1. Suppose you recently added two database servers to your network, RDB05 and RDB06. RDB05 is connected to the Switch05 subnet, and RDB06 is connected to the Switch06 subnet. You can update your network topology by sending the new link details to your instance. From your terminal, send the following cURL command using the HTTPS protocol and the Topology API links endpoint.

    curl --insecure -X POST 'https://localhost/api/v1/topologies/network/links' --header 'Content-Type: application/json; charset=UTF-8' -u graze:graze --verbose --data '[{"sourceNode":"RDB05","sinkNode":"Switch05"},{"sourceNode":"RDB06","sinkNode":"Switch06"}]'

    There are several things to note about this command:

    • ‘'graze:graze' is the default username and password for the Moogsoft API user created during installation.

    • Even though the two nodes are labeled source and sink, the link is bidirectional. Either node in a link can be the source (or sink).

    • When you define a link that includes new nodes, Moogsoft Enterprise will automatically add them to the topology.

    • The topology API accepts uppercase or lowercase topology and node names. For consistency, it will change them to lowercase internally.

  2. Verify that the nodes have been added by with an HTTPS GET command using the Topology API nodes endpoint.

    curl --insecure -X GET 'https://localhost/api/v1/topologies/network/nodes' -u graze:graze
  3. Verify that the new links have been defined by calling the links endpoint.

    curl --insecure -X GET 'https://localhost/api/v1/topologies/network/links' -u graze:graze
  4. Close any open Situations in the UI, and then resend one of the sample events from your terminal.

    curl http://localhost:8888 -H 'Content-Type: application/json' --insecure -v --data '{events:[{"signature":"Switch07::Network fault","source_id":"sw07","external_id":"4955","manager":"BNT","source":"Switch07","class":"network","agent_location":"White Plains","type":"Network fault","severity":5,"description":"Error detected"}]}'
  5. Go to Workbench > Open Situations in the UI, and then go to the Topology tab for the Situation.

  6. Expand the display to show 4 neighbor nodes, and verify that your new nodes and links appear in the topology visualization.

This concludes the lab section