cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
464
Views
0
Helpful
4
Replies

500 Error when invoking PUT method on ER IP Subnet Calls

Noah Padgett
Level 1
Level 1

I am wanting to use the Emergency Responder API to automate ERL and IP subnet build outs. I have been able to successfully and consistently create ERLs with zero issue it is only when I send a call to the IP subnet side I have been having issues. Specifically, with

POST https://{CER-IP}/cerappservices/service/ipsubnetphone

Originally, we were on version 14SU1, I knew we needed to upgrade to 14SU3 to enable the ability to use the API to create subnets. We just did that and are working on the new version. Once upgraded I went from getting 405 errors to 500 errors. The API documentation indicates a 500 error is an internal server error. The response I am getting is attached along with a sample piece of code and log snippet. I am unsure why I am having this issue and have looked over the sparse documentation to make sure I am not missing anything. My headers are correct, authentication is correct, encoding is UTF-8, JSON is properly transformed, etc. This is back up by the fact that I can create ERLs just fine but subnets are failing with weird errors each time. I wonder if any else has successfully created a python script to create IP subnets and if they have any experience on this front? I tried my requests via PostMan and found the same issue there. I have restarted the publisher and still saw no change. 

 

 

4 Replies 4

Not an expert here, but looking at the logs i there seems to be a null value being accessed at line 1006 of the CerAppServiceImpl addIPSubnet method. This could be a null method parameter or an uninitialized object? Try printing variable values right before the method call may help identify the specific null variable.

Hope this helps.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Thanks for the reply! Following Cisco documentation the call to build a subnet only requires 4 parameters ("SUBNETID", "SUBNETMASK","ERLNAME","DONOTTRACK"). At one point I did have the body of my request printing out before each run and it never showed a blank or Null value. My theory is that parameters named in the API documentation are either misspelled (They are suspiciously in all caps) or missing something else. I have opened a TAC case but I wondered if anyone else has been able to create subnets via REST and I wonder how they were sending it across.

Try doing a "GET" on an known IP subnet. That should return the variable names to you with the appropriate name/case. It is a bit brute force, but it seem like it should work.

Seems to be working for me on CER 14:

POST /cerappservices/service/ipsubnetphone HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Basic QWRtaW5pc3RyYXRvcjpjaXNjb3BzZHQ=
User-Agent: PostmanRuntime/7.35.0
Postman-Token: 24371a89-9791-4ae7-8d3e-06effdfe1fcb
Host: 10.10.20.3
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 146
Cookie: JSESSIONID=312019974250C32867357CBE1A177729
 
{
"SUBNETID": "34.45.35.45",
"SUBNETMASK": "255.255.255.0",
"ERLNAME": "testErl",
"LOCATION": "Nashik",
"DONOTTRACK": false
}
 
HTTP/1.1 200 OK
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=31536000; includeSubdomains
Content-Security-Policy: default-src *; script-src * 'unsafe-inline' 'unsafe-eval';style-src * 'unsafe-inline'; img-src * data: 'unsafe-inline';
x-content-type-options: nosniff
X-XSS-Protection: 1; mode=block
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Date: Wed, 15 Nov 2023 20:25:37 GMT
Keep-Alive: timeout=60
Connection: keep-alive
 
{"status":"SUCCESS","message":"IpSubnet Data Added Successfully"}

If you can provide the raw HTTP request, that might help us spot something