Examples: Interacting with a VSX peer switch

In the following examples, Virtual Switching Extension (VSX) is enabled, the primary VSX switch IP address is 192.0.2.5, and the secondary VSX switch IP address is 192.0.2.6:

  • Getting the list of all VLANS on the connected switch at IP address 192.0.2.5:

    $ curl -k --noproxy 192.0.2.5 GET \
    -b /tmp/primary_auth_cookie \
    "https://192.0.2.5/rest/v1/system/bridge/vlans"

    Getting the list of all VLANs on the peer VSX switch:

    $ curl -k --noproxy 192.0.2.5 GET \
    -b /tmp/primary_auth_cookie \
    "https://192.0.2.5/vsx-peer/rest/v1/system/bridge/vlans"
  • Getting the VSX status of the secondary VSX switch while connected to the primary VSX switch at IP address 192.0.2.5:

    $ curl -k --noproxy 192.0.2.5 GET \
    -b /tmp/primary_auth_cookie \
    “https://192.0.2.5/vsx-peer/rest/v1/system/vsx?attributes?oper_status

    You can also get the VSX status of the primary VSX switch while connected to the secondary VSX switch.