cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1938
Views
0
Helpful
1
Replies

Filtering on Cisco Prime API v3

fredrik@skne.se
Level 1
Level 1

I'm trying to use cisco prime v3 to and get data AccessPointDetails with filter on CDP Neighbor.

I tried https://xxx/webacs/api/v3/data/AccessPointDetails?cdpNeighbors.cdpNeighbor="X.X.X.X" but it gives error

<?xml version="1.0" ?>
<errorDocument>
    <httpResponseCode>400</httpResponseCode>
    <httpMethod>GET</httpMethod>
    <message>Unexpected query parameters [cdpNeighbors.cdpNeighbor].-PRS-115</message>
    <id>presentation.PRS-115</id>
    <uriPath>data/AccessPointDetails</uriPath>
    <queryParams>{cdpNeighbors.cdpNeighbor=[&amp;quot;X.X.X.X&amp;quot;]}</queryParams>
</errorDocument>

and in documentation it says to use ../webacs/api/v3/data/WlanProfiles?hotspotGeneral.heSsid="000000000000" when to filter on properties

Response from https://xxx/webacs/api/v3/data/AccessPointDetails/7387381 looks like this

<?xml version="1.0" ?>
<queryResponse type="AccessPointDetails" responseType="getEntity" requestUrl="https://xxx/webacs/api/v3/data/AccessPointDetails/7387381" rootUrl="https://xxx/webacs/api/v3/data">
    <entity dtoType="accessPointDetailsDTO" type="AccessPointDetails" url="https://xxx/webacs/api/v3/data/AccessPointDetails/7387381">
        <accessPointDetailsDTO displayName="7387381" id="7387381">
            <adminStatus>ENABLE</adminStatus>
            <apType>AP2700I</apType>
            <cdpNeighbors>
                <cdpNeighbor>
                    <capabilities>Switch IGMP </capabilities>
                    <duplex>Full Duplex</duplex>
                    <interfaceSpeed>1Gbps</interfaceSpeed>
                    <localPort>2</localPort>
                    <neighborIpAddress>X.X.X.X</neighborIpAddress>
                    <neighborName>XXX</neighborName>
                    <neighborPort>GigabitEthernet1/0/25</neighborPort>
                    <platform>cisco WS-C2960X-48FPS-L</platform>
                </cdpNeighbor>
            </cdpNeighbors>
            <clientCount>0</clientCount>
            <clientCount_2_4GHz>0</clientCount_2_4GHz>
            <clientCount_5GHz>0</clientCount_5GHz>
            <ethernetMac>AA:BB:CC:DD:EE:FF</ethernetMac>
            <ipAddress>X.X.X.X</ipAddress>
            <locationHierarchy>XX &gt; XX &gt; XX</locationHierarchy>
            <macAddress>AA:BB:CC:DD:EE:FF</macAddress>
            <mapLocation>XX - XX</mapLocation>
            <model>AIR-CAP2702I-E-K9</model>
            <name>XXXX</name>
            <reachabilityStatus>REACHABLE</reachabilityStatus>
            <serialNumber>XXX</serialNumber>
            <softwareVersion>8.5.124.34</softwareVersion>
            <status>CLEARED</status>
            <type>UnifiedAp</type>
            <unifiedApInfo>
                <apCertType>1</apCertType>
                <apGroupName>XX</apGroupName>
                <apMode>0</apMode>
                <apStaticEnabled>0</apStaticEnabled>
                <bootVersion>15.2.4.5</bootVersion>
                <capwapJoinTakenTime>1700</capwapJoinTakenTime>
                <capwapUpTime>809211472</capwapUpTime>
                <controllerIpAddress>X.X.X.X</controllerIpAddress>
                <controllerName>XXXX</controllerName>
                <contryCode>SE</contryCode>
                <encryptionEnabled>false</encryptionEnabled>
                <flexConnectMode>false</flexConnectMode>
                <iosVersion>15.3(20180323:033237)$</iosVersion>
                <linkLatencyEnabled>false</linkLatencyEnabled>
                <poeStatus>4</poeStatus>
                <poeStatusEnum>NORMAL</poeStatusEnum>
                <portNumber>8</portNumber>
                <powerInjectorState>1</powerInjectorState>
                <preStandardState>0</preStandardState>
                <primaryMwar>XXX</primaryMwar>
                <rogueDetectionEnabled>true</rogueDetectionEnabled>
                <secondaryMwar>XXX</secondaryMwar>
                <sshEnabled>true</sshEnabled>
                <statisticsTimer>180</statisticsTimer>
                <telnetEnabled>false</telnetEnabled>
                <WIPSEnabled>0</WIPSEnabled>
                <wlanProfiles>
                    <wlanProfile>
                        <broadcastSsidEnabled>true</broadcastSsidEnabled>
                        <profileName>XX</profileName>
                        <ssid>XX</ssid>
                    </wlanProfile>
                    <wlanProfile>
                        <broadcastSsidEnabled>true</broadcastSsidEnabled>
                        <profileName>XX</profileName>
                        <ssid>XX</ssid>
                    </wlanProfile>
                </wlanProfiles>
                <wlanVlanMappings></wlanVlanMappings>
            </unifiedApInfo>
            <upTime>809222772</upTime>
        </accessPointDetailsDTO>
    </entity>
</queryResponse>

Anyone who has succeded with this?

 

 

1 Accepted Solution

Accepted Solutions

Spencer Zier
Cisco Employee
Cisco Employee

In this case, the filter parameter should be:

cdpNeighbor.neighborIpAddress="X.X.X.X"

 

The "cdpNeighbor" parameter itself is what we call a collection.  By filtering directly on it with an IP address, the Prime Infrastructure API framework won't be able to figure out how to go from an IP address datatype to the datatype of the collection.  That said, there are a few filters that can be applied to collection parameters, like isEmpty(), and notIsEmpty(), which would help you find APs without and with CDP neighbors, respectively.

 

I hope that helps!

View solution in original post

1 Reply 1

Spencer Zier
Cisco Employee
Cisco Employee

In this case, the filter parameter should be:

cdpNeighbor.neighborIpAddress="X.X.X.X"

 

The "cdpNeighbor" parameter itself is what we call a collection.  By filtering directly on it with an IP address, the Prime Infrastructure API framework won't be able to figure out how to go from an IP address datatype to the datatype of the collection.  That said, there are a few filters that can be applied to collection parameters, like isEmpty(), and notIsEmpty(), which would help you find APs without and with CDP neighbors, respectively.

 

I hope that helps!