05-03-2022 09:33 AM
Hey all,
I am currently trying to develop a script for automating some tasks within ISE, one of those tasks involves creating a network access rule within a policy set. This is where I've hit a hurdle, when trying to create a rule I get:
{ "message": "request has bad input format in the body", "code": 400 }
Which is most unhelpful. This happens even when I pass in the example from Swagger. any ideas?
Request body:
{ "link": { "href": "https://ise-svr.example.com/api/v1/policy/network-access/policy-set/8bcd18db-3102-4fac-8765-1064f880cdbe", "rel": "self", "type": "application/json" }, "profile": "[\"PermitAccess\",\"NSP_Onboard\"]", "rule": { "condition": { "conditionType": "ConditionAttributes", "isNegate": false, "link": { "href": "https://ise-svr.example.com/api/v1/policy/network-access/policy-set/8bcd18db-3102-4fac-8765-1064f880cdbe", "rel": "self", "type": "application/json" } }, "default": false, "name": "MyRuleName_1", "rank": 1, "state": "enabled" }, "securityGroup": "BYOD" }
Solved! Go to Solution.
05-21-2022 05:59 PM
Hello @TheNetRunner,
You might want to check out these for some ideas:
Cisco DevNet Code Exchange
https://developer.cisco.com/codeexchange/
Cisco DevNet Automation Exchange
05-21-2022 05:59 PM
Hello @TheNetRunner,
You might want to check out these for some ideas:
Cisco DevNet Code Exchange
https://developer.cisco.com/codeexchange/
Cisco DevNet Automation Exchange
05-23-2022 01:37 AM
Hello Alexstev,
Thank you for the responses, the the pages you've linked look very interesting I shall give them a look now.
Apologies for not updating this thread sooner I realized my mistake the day after I posted this and I now have it working. I was writing the application in TS and in the end I created a bunch of interfaces to prevent myself from making mistakes in the body of the request object.
For those interested you can go to the swagger docs (https://example.com/api/swagger-ui/index.html) for the ISE server and look at the schemas below all the API resources. From the schemas it's a pretty easy process to create interfaces.
02-01-2024 07:02 AM
Are we good to close this?
02-01-2024 07:48 AM
@ruban
Yes, feel free to close this off, I was able to fix this in the end.
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