06-12-2023 09:02 AM
I'm trying to do a bulk request to create multiple endpoints at once by doing a PUT request to /ers/config/endpoint/bulk/submit using XML. Formatting the XML request or performing the request is not an issue. However, when I try to add the "description" attribute to the bulk request, I get the following error (without this attribute the request works fine):
{
"ERSResponse" : {
"operation" : "PUT-executeBulk-endpoint",
"messages" : [ {
"title" : "XML Schema Validation Failed :: at line 5, column 14 : cvc-complex-type.2.4.a: Invalid content was found starting with element 'description'. One of '{link, customAttributes, groupId, identityStore, identityStoreId, mac, mdmAttributes, portalUser, profileId, staticGroupAssignment}' is expected.",
"type" : "ERROR",
"code" : "Schema validation exception"
} ],
"link" : {
"rel" : "related",
"href" : "https://[SERVER]:9060/ers/config/endpoint/bulk/submit",
"type" : "application/xml"
}
}
}
I saw the following post from this forum which detailed that the order of the fields in the XML mattered. Trying to change the order, however, didn't seem to fix the issue.
The XML I'm using to do the request looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:endpointBulkRequest operationType="create" resourceMediaType="vnd.com.cisco.ise.identity.endpoint.1.0+xml" xmlns:ns4="identity.ers.ise.cisco.com">
<ns4:resourcesList>
<ns4:endpoint>
<description>Test description</description>
<groupId>1be8fbe0-014c-11ee-a619-6afc9fef1d30</groupId>
<mac>11:11:11:11:11:11</mac>
<staticGroupAssignment>true</staticGroupAssignment>
<staticProfileAssignment>false</staticProfileAssignment>
</ns4:endpoint>
</ns4:resourcesList>
</ns4:endpointBulkRequest>
The version of Cisco ISE I'm currently using is version 2.7. Am I doing something wrong, or is adding the "description" attribute through a bulk request only something that is supported on later versions?
Thanks in advance.
Solved! Go to Solution.
08-08-2023 05:03 PM
I stand corrected... I tested this in my lab with ISE 3.2 and, when using the POST method, I get a '405 Method Not Allowed' response. I tested the same with a PUT method and got the same '400 Bad Request' response that was shared above.
Although the syntax is a bit strange, I tested using the example @Arne Bier shared from the API Reference and got a '202 Accepted' response.
Here is the XML body of my PUT request:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:endpointBulkRequest operationType="create" resourceMediaType="vnd.com.cisco.ise.identity.endpoint.1.0+xml" xmlns:ns4="identity.ers.ise.cisco.com">
<ns4:resourcesList>
<ns4:endpoint description="Test description">
<groupId>221a6da0-5fda-11ed-b731-7a988ee57104</groupId>
<mac>11:11:11:11:11:11</mac>
<staticGroupAssignment>true</staticGroupAssignment>
<staticProfileAssignment>false</staticProfileAssignment>
</ns4:endpoint>
</ns4:resourcesList>
</ns4:endpointBulkRequest>
08-08-2023 03:28 PM
Hi @omuller
I had a look at the ISE 3.2 ERS SDK (API Documentation page) and the syntax looks a bit different to the one you used in 2.7 - perhaps it was just a typo?
<ns4:endpoint description="john iphone">
<mac>AA:BB:CC:DD:00:00</mac>
<staticGroupAssignment>false</staticGroupAssignment>
</ns4:endpoint>
08-08-2023 04:04 PM
@omuller , are you trying to use the bulk operation to Update or Create the endpoints? The PUT operation is used to Update existing endpoints, where the POST operation is used to Create new endpoints.
08-08-2023 05:03 PM
I stand corrected... I tested this in my lab with ISE 3.2 and, when using the POST method, I get a '405 Method Not Allowed' response. I tested the same with a PUT method and got the same '400 Bad Request' response that was shared above.
Although the syntax is a bit strange, I tested using the example @Arne Bier shared from the API Reference and got a '202 Accepted' response.
Here is the XML body of my PUT request:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns4:endpointBulkRequest operationType="create" resourceMediaType="vnd.com.cisco.ise.identity.endpoint.1.0+xml" xmlns:ns4="identity.ers.ise.cisco.com">
<ns4:resourcesList>
<ns4:endpoint description="Test description">
<groupId>221a6da0-5fda-11ed-b731-7a988ee57104</groupId>
<mac>11:11:11:11:11:11</mac>
<staticGroupAssignment>true</staticGroupAssignment>
<staticProfileAssignment>false</staticProfileAssignment>
</ns4:endpoint>
</ns4:resourcesList>
</ns4:endpointBulkRequest>
08-09-2023 12:37 AM
Using the XML body you provided, I was indeed able to perform an PUT request to /ers/config/endpoint/bulk/submit to create multiple endpoints with a description using a bulk request. It seems I just overlooked the correct syntax, seeing as the ISE 2.7 ERS SDK also mentions the syntax shown by @Arne Bier to create multiple endpoints with a bulk request. Thanks!
08-08-2023 04:10 PM
Good point - but then I am a bit confused what the SDK means here - how is it used "within" ?:
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide