I am trying to write a simple code to get the device registration using Python
here is my code
result= client.service.SelectCmDevice('',{'SelectBy':'Name', 'Status':'Registered', 'Class':'Phone', 'SelectItems':{'SelectItem':{'Item':SEPXXXXXXXX}}})
everytime I run it I am receiving
MethodNotFound: Method not found: 'RISService70.RisPort70.SelectCmDevice'
now sure what is the problem
I am facign exactly the same issue. Could you tell me how did you resolved it?
When I try tu run my Python code I got following:
Traceback (most recent call last):
File "C:/Users/pdukat/Documents/GitHub/siptrunk/RisPort.py", line 33, in <module>
result = client.service.SelectCmDevice('',{'SelectBy':'Name', 'Status':'Registered', 'Class':'Phone'})
File "C:\Python34\lib\site-packages\suds\client.py", line 283, in __getattr__
return getattr(port, name)
File "C:\Python34\lib\site-packages\suds\client.py", line 387, in __getattr__
return getattr(m, name)
File "C:\Python34\lib\site-packages\suds\client.py", line 478, in __getattr__
return self[name]
File "C:\Python34\lib\site-packages\suds\client.py", line 491, in __getitem__
raise MethodNotFound(qn)
suds.MethodNotFound: Method not found: 'RISService70.RisPort70.SelectCmDevice'
Here's a sample that works with my CUCM 10.5 system (Python 2.7.12):
# Installing a root/CA Certificate # (Tested on Ubuntu 16.10) # Retrieve certificate from CUCM # - openssl s_client -showcerts -connect cucm-node.example.com:443 </dev/null 2>/dev/null|openssl x509 >cucm-node.example.com.crt # Store certificate on the client # - Create a directory for extra CA certificates in /usr/share/ca-certificates: # $ sudo mkdir /usr/share/ca-certificates/extra # - Copy the CA .crt file to this directory: # $ sudo cp foo.crt /usr/share/ca-certificates/extra/foo.crt # - Append the certificate path (relative to /usr/share/ca-certificates) # to /etc/ca-certificates.conf: # $ sudo dpkg-reconfigure ca-certificates # In case of a .pem file, it must first be converted to a .crt file: # $ openssl x509 -in foo.pem -inform PEM -out foo.crt # import logging # logging.basicConfig(level=logging.INFO) # logging.getLogger("suds.transport").setLevel(logging.DEBUG) from suds.client import Client url = 'file:///home/dstaudt/Documents/Serviceability/v10.5(1)/RISService70.wsdl' client = Client(url, location='https://ds-ucm105.cisco.com:8443/realtimeservice2/services/RISService70/', username='Administrator', password='ciscopsdt') stateInfo = None criteria = client.factory.create('CmSelectionCriteria') item = client.factory.create('SelectItem') mod = client.factory.create('CmSelectionCriteria.Model') criteria.MaxReturnedDevices = 500 criteria.DeviceClass = 'Phone' criteria.Model = 255 criteria.Status = 'Any' criteria.NodeName = '' criteria.SelectBy = 'Name' item.Item = 'IPCMRAEU5UCM5X7' criteria.SelectItems.item.append(item) criteria.Protocol = 'Any' criteria.DownloadStatus = 'Any' result = client.service.selectCmDevice(stateInfo, criteria) print result
Thank You!
With some minor changes it started working for me!
Comments
0 comments
Please sign in to leave a comment.