Esempio n. 1
0
    def operation(self, wsmancmds, cmdname, *args):
        ruri = wsmancmds[cmdname]["ResourceURI"]
        act = wsmancmds[cmdname]["Action"]
        sset = {}
        tset = wsmancmds[cmdname]["SelectorSet"]
        for i in tset["w:Selector"]:
            sset[i['@Name']] = i['#text']
        toargs = self._build_ops(wsmancmds, cmdname, *args)

        wsm = WsManRequest()
        wsm.set_header(self._proto_endpoint(), ruri, (ruri + "/" + act))
        wsm.add_selectors(sset)
        wsm.add_body(ruri, act, toargs['retval'])
        return self._communicate(wsm)
Esempio n. 2
0
    def operation(self, wsmancmds, cmdname, *args):
        ##########################Below are redfish codes, need to be removed once prtocol issue is addressed#####################
        cmmd = str(cmdname)
        if cmmd.endswith("_redfish"):
            return self.redfish_operation(wsmancmds, cmdname, *args)
        ##########################Above are redfish codes, need to be removed once prtocol issue is addressed#####################
        ruri = wsmancmds[cmdname]["ResourceURI"]
        act = wsmancmds[cmdname]["Action"]
        sset = {}
        tset = wsmancmds[cmdname]["SelectorSet"]
        for i in tset["w:Selector"]:
            sset[i['@Name']] = i['#text']
        toargs = self._build_ops(wsmancmds, cmdname, *args)

        wsm = WsManRequest()
        wsm.set_header(self._proto_endpoint(), ruri, (ruri + "/" + act))
        wsm.add_selectors(sset)
        wsm.add_body(ruri, act, toargs['retval'])
        return self._communicate(wsm)