cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1048
Views
5
Helpful
2
Replies

CUCM AXL API getLdapSyncStatus

mb2855
Level 1
Level 1

Hi Community,
I have trouble getting the AXLAPI getLdapSyncStatus to work.
Other methods using my "axl_service" work as expected.
I keep getting "TypeError: Choice elements only work with keyword arguments".
Here is the problematic part of my code. Python, and Zeep:

   def getLdapSyncStatus(self):
        ''' Method that makes an AXL request to CUCM Admin and returns
        if LDAP is sync'd to the "enter LDAP Directory Name here" directory.'''
        searchCriteria = {'name' : 'enter LDAP Directory Name here'}

        response = self.axl_service.getLdapSyncStatus(searchCriteria)
        print(response)

Any help is greatly appreciated.
Thanks.
1 Accepted Solution

Accepted Solutions

The code fragment you listed would be how it is defined in the AXL toolkit. You would actually use like this.

client = Client(wsdl=wsdl_file, transport=transport, plugins=[history], settings=settings)
axl = client.create_service(binding_name, axl_address)

ldap_resp = axl.getLdapSyncStatus(name='my-ldap-dir')

View solution in original post

2 Replies 2

The code fragment you listed would be how it is defined in the AXL toolkit. You would actually use like this.

client = Client(wsdl=wsdl_file, transport=transport, plugins=[history], settings=settings)
axl = client.create_service(binding_name, axl_address)

ldap_resp = axl.getLdapSyncStatus(name='my-ldap-dir')

Thanks, Elloit.
To add a bit of context, my other working commands are "list' commands. Thus they take two arguments which can be a dict. However, the "get" command only takes one argument and I guess cannot be a complex data type such as a dict.

So, your answer worked.
In trying to keep my code format consistent, I used  **searchCriteria to allow Python to unpack the dict back to the key:vlaue pair you mentioned.
Thanks again for responding.