cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3048
Views
15
Helpful
8
Replies

How to perform a bulk read/get via Cisco ISE ERS API's

pn2020
Level 1
Level 1

Hi,

 

I can get bulk create, bulk delete and bulk status (using a bulk ID) to work, but not bulk read.  What is the format?  ISE documentation on SDK is bad, nothing on bulk read and delete.  

 

I tried operationType="get", and operationType="read", with PUT and GET. Nothing works.  I use ISE 2.4.

 

Thanks for your help!  Below is what I used in POSTMAN.

 

ACCEPT: application/vnd.com.cisco.ise.network.networkdevicebulkrequest.1.1+xml

Content-Type: application/vnd.com.cisco.ise.network.networkdevicebulkrequest.1.1+xml

 

GET https://<ise-server-ip>:9060/ers/config/networkdevice/bulk

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns8:networkDeviceBulkRequest operationType="get" resourceMediaType="vnd.com.cisco.ise.network.networkdevice.1.1+xml" xmlns:ns6="sxp.ers.ise.cisco.com" xmlns:ns5="trustsec.ers.ise.cisco.com" xmlns:ns8="network.ers.ise.cisco.com" xmlns:ns7="anc.ers.ise.cisco.com" xmlns:ers="ers.ise.cisco.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns4="identity.ers.ise.cisco.com">
:ns8="network.ers.ise.cisco.com" xmlns:ns7="anc.ers.ise.cisco.com" xmlns:ers="ers.ise.cisco.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns4="identity.ers.ise.cisco.com">
<idList>
<id>id_1</id>
<id>id_2</id>
</idList>
</ns8:networkDeviceBulkRequest>

1 Accepted Solution

Accepted Solutions

I don't see anything about bulk read in the ERS documentation.  The whole bulk concept is to allow you make additions, updates and deletions.  They already have bulk read concept limited to 100 results per page. 

 

From the ERS SDK on bulk operations:

 

"After a successful Bulk Request, The server responding with 202 + bulkid in the Location header. This bulkid can be used to fetch a Bulk Execution Status. The BulkStatus object holds for each item in the bulk request" a status entry which describe the execution status. The status is kept in the server for two hours and after that its deleted"

 

So you can do a GET request with the Bulk ID to monitor status of your bulk request.

View solution in original post

8 Replies 8

pn2020
Level 1
Level 1

Here is the error response message in postman, btw. Same for operationType="read", and operationType="get".

 

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<ns3:ersResponse operation="GET-get-networkdevice" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns3="ers.ise.cisco.com">
    <link rel="related" href="https://<ise-server-ip>:9060/ers/config/networkdevice/bulk" type="application/xml"/>
    <messages>
        <message type="ERROR" code="Application resource validation exception">
            <title>Resource Initialization Failed(10)</title>
        </message>
    </messages>
</ns3:ersResponse>

 

 

If you're trying to retrieve a list of the Network Devices, use the Get-All operation listed in the online API Reference Guide

GET https://<ip>:9060/ers/config/networkdevice

Thanks for the response.  Yes, I was able to do what you said.  I just wanted to see the difference that and the bulk read request. 

 

Sounds like, I shouldn't bother using the bulk read then.

I haven't tested this with network devices and REST but you may need to adjust the results per query and then make multiple queries to get all the data. Last time I checked the max page size was 100:

 

https://<ip>:9060/ers/config/networkdevice?size=100

 

Once you do that query then you get the total count of how many elements there are and know how many pages to call up.  If there were 280 network devices you would need to make 3 calls:

 

Original- https://<ip>:9060/ers/config/networkdevice?size=100

Page 2- https://<ip>:9060/ers/config/networkdevice?size=100&page=2

Page 3- https://<ip>:9060/ers/config/networkdevice?size=100&page=3

 

The default page size I think is 20, but I haven't checked in 2.6 or 2.7 to see if that has changed.

 

 

Thanks Paul.  Like I communicated before, I got that (individual/non-bulk get) working like what you shared, but not the bulk read.  

 

Do you have any success with a bulk read?

I don't see anything about bulk read in the ERS documentation.  The whole bulk concept is to allow you make additions, updates and deletions.  They already have bulk read concept limited to 100 results per page. 

 

From the ERS SDK on bulk operations:

 

"After a successful Bulk Request, The server responding with 202 + bulkid in the Location header. This bulkid can be used to fetch a Bulk Execution Status. The BulkStatus object holds for each item in the bulk request" a status entry which describe the execution status. The status is kept in the server for two hours and after that its deleted"

 

So you can do a GET request with the Bulk ID to monitor status of your bulk request.

That sounds logical.  I am moving on now :)  Thanks.


@paul wrote:

I don't see anything about bulk read in the ERS documentation. 


The first line in the bulk operations documentation states "Bulk request will allow client to send up to 500 (or 5000 for 'id type') CRUD operations in a single request.".

CRUD includes Read...  just lazy documentation on Cisco's part?