DX NetOps

 View Only
  • 1.  [RESTful API] Linking 2 ports together

    Posted Oct 02, 2017 12:30 PM

    Hello community,

     

    I made a bit of reverse engineering to determine what Spectrum needs so that a link is set up between two network devices like:

     

    With the CLI and the Modeling Gateway I found that at least 4 actions are needed:

    1. Link the 2 ports models with relation Links_with (0x10023) -> this does nothing visible in the OneClick topological view but you can see the two ports associated to each other in the interface tab of both devices
    2. Link one port model with the opposite device model with relation Connects_to (0x10005) -> this creates a yellow link
    3. Do the same with the other port and the other device (seems that the relations are incomplete if not done)
    4. Set the ok_to_poll (0x11dd8) attribute to Yes (1) for both port models -> the link goes Green.

     

    My question is : is it enough? Did I miss something ?

     

    Unfortunately I am not able to test this modelization on test devices on which I could unplug a cable...

     

    === ADDITION ===

     

    As the documentation is not as detailed as it should be and to spare time to those who want to do the same, here are the requests used:

     

    To set a relation between two models

     

     

     

    To set an attribute value to multiple models

     

    REQUESTPUT
    URLhttp://OC_HOST:OC_PORT/spectrum/restful/models
    XML

    <?xml version="1.0" encoding="UTF-8"?>

    <rs:update-models-request throttlesize="0"
    xmlns:rs="http://www.ca.com/spectrum/restful/schema/request"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.ca.com/spectrum/restful/schema/request ../../../xsd/Request.xsd ">

       <rs:target-models>
          <rs:model mh="MODELHANDLE1" />
          <rs:model mh="MODELHANDLE2" />
       </rs:target-models>

       <!-- ok_to_poll attribute -->

       <rs:attribute-value id="0x11dd8">1</rs:attribute-value>
    </rs:update-models-request>



  • 2.  Re: [RESTful API] Linking 2 ports together
    Best Answer

    Broadcom Employee
    Posted Oct 03, 2017 01:59 AM

    I think that is enough and good.



  • 3.  Re: [RESTful API] Linking 2 ports together

    Posted Oct 03, 2017 03:42 AM

    Thank you for your feedback



  • 4.  Re: [RESTful API] Linking 2 ports together

    Posted Oct 03, 2017 08:22 AM

    The last step "ok_to_poll" change is part of what is needed to turn the "Live Link" feature On. So, it's not absolutely necessary if you want to manage that through the Policy Manager for instance. But if that's intended, I confirm, this is fine!



  • 5.  Re: [RESTful API] Linking 2 ports together

    Posted Oct 05, 2017 03:23 PM

    I was finally able to validate the configuration in a test environment with 2 switches.

    Alarms behave as expected when unplugging a cable or powering off one of the two switches.