DX NetOps

 View Only
  • 1.  OpenAPI vs Rest which to use and how?

    Posted Feb 06, 2017 11:33 AM

    I want to create a query on each device and show what SNMP Profile is being used to discover and to poll that device. Which of the choices that CA has is the appropriate one? And how would that be completed. 



  • 2.  Re: OpenAPI vs Rest which to use and how?

    Broadcom Employee
    Posted Feb 06, 2017 02:37 PM

    No perfect way to do it that i can see, but if you use a rest client to do a post with the following syntax in the body:

     

     

    <FilterSelect xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="filter.xsd">

    <Select use="exclude" isa="exclude">
    <Item use="exclude">
    <Name use="include"/>
    </Item>

    <Device use="exclude">
    <PrimaryIPAddress use="include"/>
    </Device>

    <ManageableDevice>
    <SNMPProfileID use="include"/>
    </ManageableDevice>

    </Select>
    </FilterSelect>

     

     

    This will only give you the snmp profile id along with the ip address

     

    You would then have to go to http://<da>:8581/rest/profiles/snmpv1/   (or snmpv3) and match up the id's to the profile names

     

    You could also add an id on to the end of the url.  For example:

     

    http://<da>:8581/rest/profiles/snmpv1/4980

     

    That gives me this

     

    <SNMPv1Profile version="1.0.0">
    <ID>4980</ID>
    <CommunityName>h8i7KBJK72U=</CommunityName>
    <PortNumber>161</PortNumber>
    <IsAlso>
    <IsA name="CommunicationProfile" rootURL="profiles"/>
    </IsAlso>
    <CommunicationProfile version="1.0.0">
    <UseForWrite>false</UseForWrite>
    <Rank>1</Rank>
    <ProfileName>default</ProfileName>
    </CommunicationProfile>
    <CommunicationFailurePolicy version="1.0.0">
    <Retries>2</Retries>
    <Timeout>3000</Timeout>
    </CommunicationFailurePolicy>
    </SNMPv1Profile>

     

     

    You could probably do the same sort of thing with openapi, and it might be a little more intuitive given you can build the query

     

    HTH,

    Joe



  • 3.  Re: OpenAPI vs Rest which to use and how?

    Posted Feb 06, 2017 03:36 PM

    Thanks Joseph!



  • 4.  Re: OpenAPI vs Rest which to use and how?

    Posted Mar 07, 2017 02:28 PM

    Joe for the post what should I have for the rest/"service" name, i post this and get 

    405 Method Not Allowed 145.00 ms