CiscoUcs / ucscsdk

Python SDK for Ucs Central
Other
10 stars 16 forks source link

configRemoteResolveDn method not implemented #37

Open vallard opened 6 years ago

vallard commented 6 years ago

Description

I tried to get the FSM from each blade in UCS Central. The XML output tells me to do this I should be doing the call:

<configRemoteResolveDn
dn="sys/chassis-1/blade-3/fsm"
cookie="SECURED"
inHierarchical="false"
inDomainId="1009">
</configRemoteResolveDn>

This method, however, does not show up on any of the libraries that are automatically generated.

What I Did

I looked through the code to see if there was some other way to get around this limitation but after searching and trying for 4-6 hours I'm struggling to find an answer.

vallard commented 6 years ago

It looks like what I'll need is configRemoteResolveChildren as well to get all the FSM status of the systems. As I've been hacking through the call I need to run is:

out = handle.rawXML('''
<configRemoteResolveChildren
    cookie="{3}"
    inDn="sys/chassis-{1}/blade-{2}/fsm"
    inDomainId="{0}"
    inHierarchical="true">
        <inFilter>
        </inFilter>
</configRemoteResolveChildren>'''.format("1009", "1", "3", handle.cookie))

Where I created a subclass of UcscHandle and added the rawXML method.

class EUcscHandle(UcscHandle):

    def rawXML(self, xml):
        # send the XML to UCS Central
        response_str = self.post_xml(xml, dme="resource-mgr")

The response comes back as I'd like, but now I need to format the objects. Since configRemoteResolveChildren is not recognized in the list I need to add the class. Dirty hack, but I seem to be making progress.