cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
706
Views
5
Helpful
3
Replies

How to search for multiple CUCM huntPilot in Python?

Young2020
Level 1
Level 1

I can get a single huntPilot OK with the following API call

resp = axl_service.getHuntPilot(pattern='70001920', routePartitionName='PT-INTERNAL')

But I got errors when trying to seach for multiple huntPilots by the following API call

resp = axl_service.getHuntPilot(pattern='7%', routePartitionName='PT-INTERNAL')

 

Traceback (most recent call last):
File "/Users/python/cucm/PILOT/hp.py", line 88, in <module>
resp = axl_service.getHuntPilot(pattern='7%', routePartitionName='PT-INTERNAL')
File "/Users/opt/anaconda3/lib/python3.9/site-packages/zeep/proxy.py", line 46, in __call__
return self._proxy._binding.send(
File "/Users/opt/anaconda3/lib/python3.9/site-packages/zeep/wsdl/bindings/soap.py", line 135, in send
return self.process_reply(client, operation_obj, response)
File "/Users/opt/anaconda3/lib/python3.9/site-packages/zeep/wsdl/bindings/soap.py", line 229, in process_reply
return self.process_error(doc, operation)
File "/Users/opt/anaconda3/lib/python3.9/site-packages/zeep/wsdl/bindings/soap.py", line 329, in process_error
raise Fault(
zeep.exceptions.Fault: Item not valid: The specified the specified pattern or routePartition not found was not found

 

if I try

 

axl_service.getHuntPilot(searchCriteria={'pattern': '7%'}, routePartitionName='PT-INTERNAL')

 

I got the following error

 

TypeError: {http://www.cisco.com/AXL/API/12.5}GetHuntPilotReq() got an unexpected keyword argument 'searchCriteria'. Signature: `({uuid: {http://www.cisco.com/AXL/API/12.5}XUUID} | {pattern: xsd:string, routePartitionName: {http://www.cisco.com/AXL/API/12.5}XFkType}), returnedTags: {http://www.cisco.com/AXL/API/12.5}RHuntPilot, sequence: xsd:unsignedLong`

1 Accepted Solution

Accepted Solutions

npetrele
Cisco Employee
Cisco Employee

The 7% wild card is not a valid search parameter for getHuntPilot. If you want to get a list of hunt pilots matching 7%, then use listHuntPilot, instead.

 

View solution in original post

3 Replies 3

npetrele
Cisco Employee
Cisco Employee

The 7% wild card is not a valid search parameter for getHuntPilot. If you want to get a list of hunt pilots matching 7%, then use listHuntPilot, instead.

 

Great! listHuntPilot works. But is there a way to tell retuenTags to return all the values?

Here's a tip that should help you with all your AXL work:  Try the request with SoapUI first (click on the link to download the free, open source version), and then apply what you learned to your Python code.