Ejemplo 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)
Ejemplo 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)
Ejemplo n.º 3
0
 def opget(self, ruri, name, args):
     act = "http://schemas.xmlsoap.org/ws/2004/09/transfer/Get"
     wsm = WsManRequest()
     wsm.set_header(self._proto_endpoint(), ruri, act)
     wsm.add_selectors(args)
     return self._communicate(wsm, name)