DX NetOps

 View Only
  • 1.  Vlan Spotlight

    Posted Oct 18, 2016 03:55 AM

    Hi,

     

    I have mentioned before we are developing a single plain of glass for all our NM solutions. Part of this is we would like to pull down the VLAN spotlight table to replicate this information.

     

    However after looking at the XML's for example table-vlanport-config

     

    We can not see how this is built. So for example in spotlight you highlight a VLAN, press the I and it shows you the associated ports. What we would like to know is the attribute ID on the interface that says which VLAN it is associated to and can not see it.

     

    Can anyone help ?

     

    Thanks 



  • 2.  Re: Vlan Spotlight
    Best Answer

    Posted Oct 18, 2016 04:58 AM

    It's not attribute, it's a relation. Each Vlan has its own model. Then the models have relations with the ports. 

     

    [nms@nms-mls vnmsh]$ ./show models mth=0x3390001 |grep -i vlan
    0xa0051d1 VLAN1400 0x3390001 vLan
    0xa0051d0 VLAN1399 0x3390001 vLan
    0xa0051cf VLAN1398 0x3390001 vLan
    0xa0051ce VLAN1397 0x3390001 vLan
    0xa0051cd VLAN1396 0x3390001 vLan
    0xa0051cc VLAN1395 0x3390001 vLan
    0xa0051cb VLAN1394 0x3390001 vLan
    0xa0051ca VLAN1393 0x3390001 vLan
    0xa0051c9 VLAN1392 0x3390001 vLan
    0xa0051c8 VLAN1391 0x3390001 vLan

     

    [nms@nms-mls vnmsh]$ ./show associations mh=0xa0051d1
    LMHandle LMName Relation RMHandle RMName
    0xa004653 LABORATOR vLanContains 0xa0051d1 VLAN1400
    0xa0051d1 VLAN1400 vLanSpans 0xa004659 7600_PE 
    0xa0051d1 VLAN1400 vLanHasSwitchPort 0xa004b0f 7600_PE_BR2/170
    0xa0051d1 VLAN1400 vLanHasPort 0xa004b0f 7600_PE_BR2/170
    [nms@nms-mls vnmsh]$

     

     

    [nms@nms-mls vnmsh]$ ./show relations |grep -i vlan
    vLanContains 0x03390000 MANY_TO_MANY
    vLanHasPort 0x03390001 MANY_TO_MANY
    vLanIsBoundedBy 0x03390002 MANY_TO_MANY
    vLanSpans 0x03390003 MANY_TO_MANY
    vLanHasSwitchPort 0x03390004 MANY_TO_MANY
    vLanPortHasUser 0x03390005 MANY_TO_MANY
    vLanCollects 0x03390006 ONE_TO_MANY
    [nms@nms-mls vnmsh]$

     

    Keep in mind that each vlan refers to only one container. 



  • 3.  Re: Vlan Spotlight

    Posted Oct 18, 2016 05:13 AM

    Thanks a lot to this and this is very useful 



  • 4.  Re: Vlan Spotlight

    Posted Oct 19, 2016 06:56 AM

    What we really would like to do is query the VLANs via the REST API, filtered to a specific container.

    Is this possible, as I cant see any information related to VLANs in the Rest API docs?



  • 5.  Re: Vlan Spotlight

    Posted Oct 21, 2016 04:23 AM

    I did not try it, but it should work. Basically it's just some reading of associations of a certain model. As long as you can identify the model handle of the vlan, you can read its associations.

    You should get the model handle of the container, based on which you can see using the vLanContains relation which are the vlans on that container. 

     

    I would say that the REST API documentation is generic. If there;s not specified any restriction, then there probably isn't. 



  • 6.  Re: Vlan Spotlight

    Posted Oct 21, 2016 11:12 AM

    Catalin - Thanks for the response .

     

    The main problem is the REST API requires three arguments:

       

    /spectrum/restful/associations/relation/<rel_handle>/model/<model_handle>?side=[left|right]

    and I cannot find a: rel_handle.

     

    I've looked on the Container, Devices, and Ports, for a relationship handle that will return the Vlans, and the other way round, I've looked on the Vlan for the same, but cannot find anything.

     

    Ideally the model_handle would be that of the container for the set of devices, and the result would be a list of Vlans for said container.

     

    Do you know the bit I'm missing?

     

    Thanks



  • 7.  Re: Vlan Spotlight

    Posted Oct 21, 2016 11:24 AM

    ---

    [nms@nms-mls vnmsh]$ ./show relations |grep -i vlan
    vLanContains 0x03390000 MANY_TO_MANY
    vLanHasPort 0x03390001 MANY_TO_MANY
    vLanIsBoundedBy 0x03390002 MANY_TO_MANY
    vLanSpans 0x03390003 MANY_TO_MANY
    vLanHasSwitchPort 0x03390004 MANY_TO_MANY
    vLanPortHasUser 0x03390005 MANY_TO_MANY
    vLanCollects 0x03390006 ONE_TO_MANY
    [nms@nms-mls vnmsh]$

    ---

     Here's how you find out the relation_handle.

     

    As per side of the relation, if you're searching for a left side for a container, you would require to search for a vLanContains relations. This is how you identify what vlans are associated with the container.

     

    Next, based on the model_handle of the vlan, you would go to read the ports with the vlans using vLanHasPort and vLanHasSwitchPort relations, using the same algorithm.

     

    So basically left side is the master in the association and the right side is the slave. As you well see, you can specify a model as being on the left side of the relation, thus being slave.



  • 8.  Re: Vlan Spotlight

    Posted Oct 24, 2016 06:06 AM

    Catalin, this was right on the money!!  It gets me everything i need, and I now understand a little more about how to get other relationship information.

     

    Thanks!  Appreciate you help.