DX NetOps

 View Only
Expand all | Collapse all

[RESTful API] How to list all associations related to a specific model

  • 1.  [RESTful API] How to list all associations related to a specific model

    Posted Jan 17, 2018 10:45 AM

    Hello community,

     

    I would like to perform a Restful request so that I could know all relations a specific model has, regardless the relation type.

     

    I am able to know whether a relation exists given a relation type, for instance a GET with

    http://OC_HOST:OC_PORT/spectrum/restful/associations/relation/0x10023/model/0xa54048?side=left 

     

    Spectrum replies with

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <association-response-list
        xmlns="http://www.ca.com/spectrum/restful/schema/response">
        <association-responses>
            <association rightmh="0xa5281f" leftmh="0xa54048" rh="0x10023"/>
        </association-responses>
    </association-response-list>

     

    But how to make the equivalent of

    > show associations mh=0xa54048
    LMHandle    LMName                            Relation                         RMHandle    RMName
    0xa53ffd    SUB-ROUTER-2                      HASPART                          0xa54048    SUB-ROUTER-2_GigabitEthernet1/0/
    0xa54048    SUB-ROUTER-2_GigabitEthernet1/0/  Links_with                       0xa5281f    ROUTER-2_Gi0/0/2
    0xa54048    SUB-ROUTER-2_GigabitEthernet1/0/  Connects_to                      0xa527f6    ROUTER-2
    0xa5282e    ROUTER-2_ChassisFaultDomain       CORRELATES                       0xa54048    SUB-ROUTER-2_GigabitEthernet1/0/

    ?



  • 2.  Re: [RESTful API] How to list all associations related to a specific model
    Best Answer

    Broadcom Employee
    Posted Feb 02, 2018 10:32 AM

    Hi Yann,


    The REST call for retrieving a model’s relations requires you to specify the handle of the relation you’re looking for. Unfortunately, there is not a way to get all of the relations for a given model using REST.

     

    Best regards,

    Glenn