- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2019 04:33 PM
Here is a rough approximation of what I'm doing:
var envelope = new XmlDocument(); var ns = new XmlNamespaceManager(envelope.NameTable); ns.AddNamespace("ns3", "identity.ers.ise.cisco.com"); var requestNode = envelope.CreateElement("ns3", "endpointBulkRequest", "identity.ers.ise.cisco.com"); var mtAttr = envelope.CreateAttribute("resourceMediaType"); mtAttr.InnerText = "vnd.com.cisco.ise.ers.identity.endpoint.1.0+xml"; requestNode.Attributes.Append(mtAttr); var otAttr = envelope.CreateAttribute("operationType"); otAttr.InnerText = "create"; requestNode.Attributes.Append(otAttr); var resourceList = envelope.CreateElement("ns3","resourcesList", "identity.ers.ise.cisco.com"); var i = 0; foreach (var mac in macs) { var description = descriptions[i]; i++; var resource = envelope.CreateElement("ns3", "endpoint", "identity.ers.ise.cisco.com"); // Add attributes to the endpoint element var descAttr = envelope.CreateAttribute("description"); descAttr.InnerText = description; resource.Attributes.Append(descAttr); var nameAttr = envelope.CreateAttribute("name"); nameAttr.InnerText = $"Device MAC: {mac}"; resource.Attributes.Append(nameAttr); // Add child elements to the endpoint element var groupId = envelope.CreateElement("groupId"); groupId.InnerText = _config.IseGroupId; resource.AppendChild(groupId); var identityStore = envelope.CreateElement("identityStore"); resource.AppendChild(identityStore); var identityStoreId = envelope.CreateElement("identityStoreId"); resource.AppendChild(identityStoreId); var macElem = envelope.CreateElement("mac"); macElem.InnerText = mac; resource.AppendChild(macElem); var staticGroupAssignment = envelope.CreateElement("staticGroupAssignment"); staticGroupAssignment.InnerText = "true"; resource.AppendChild(staticGroupAssignment); var staticProfileAssignment = envelope.CreateElement("staticProfileAssignment"); staticProfileAssignment.InnerText = "false"; resource.AppendChild(staticProfileAssignment); resourceList.AppendChild(resource); } requestNode.AppendChild(resourceList); envelope.AppendChild(requestNode);
And that is being sent to `https://{my-instance}:9060/ers/config/endpoint/bulk`
And it works fine, except when a MAC address (endpoint) is already in the system (perhaps in another identity group, perhaps just unattached, I haven't checked), in which case it will not be added to the current identity group. How can I overcome this?
Solved! Go to Solution.
- Labels:
-
Identity Services Engine (ISE)
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 05:05 AM
xx/ers/config/endpoint?filter=mac.EQ."+ {MAC} -- for your retrieve/get
xx/ers/config/endpoint/"+ {variable that stores endpoint ID} -- for your update/put
Good luck & HTH!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2019 08:13 PM
You can check if the endpoint exists and update it and if not (else) you create it like your doing.
You can insert that condition if else in your loop where you check mac in macs.
Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2019 05:05 AM
xx/ers/config/endpoint?filter=mac.EQ."+ {MAC} -- for your retrieve/get
xx/ers/config/endpoint/"+ {variable that stores endpoint ID} -- for your update/put
Good luck & HTH!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019 06:43 AM
Can you paste in the XML document you use for the update? And I'm wondering:
1. does that move the endpoint out of any other identity group(s) - which is not objectionable in my case but good-to-know, and
2. can an update be done in bulk?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019 11:50 AM
2: I have not attempted bulk. I developed a script for single endpoints. However, I do not see why you couldnt loop through a csv file for your MACs, use requests.get, and store the results to later reference in your "updating of the group assignment" requests.put.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2019 07:43 PM
I did it for a customer looping on an sql db.
Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question
