def query(self, query_type, msg_body=None): session = Session(self.peer.connect_str, service="Manager") session.authorize(self.peer.domain.user, self.peer.domain.password) pwd_response = session.doRequest(attributes={"Type": "GetDatabaseCredentials", "Database": self.database.name}) pwd_xml = ElementTree.fromstring(pwd_response) pwd = pwd_xml.find("Password").text.strip() return queryEngine(self.address, self.port, query_type, pwd, msg_body)
def query(self, type, msgBody=None): s = Session(self.getPeer().getConnectStr(), service="Manager") s.authorize(self.getPeer().getDomain().getUser(), self.getPeer().getDomain().getPassword()) pwdResponse = s.doRequest(attributes={"Type": "GetDatabaseCredentials", "Database": self.getDbName()}) pwdXml = ElementTree.fromstring(pwdResponse) pwd = pwdXml.find("Password").text.strip() return queryEngine(self.getAddress(), self.getPort(), type, pwd, msgBody)
def query(self, query_type, msg_body=None): session = Session(self.peer.domain.entry_peer.connect_str, service="Manager") session.authorize(self.peer.domain.user, self.peer.domain.password) pwd_response = session.doRequest(attributes={"Type": "GetDatabaseCredentials", "Database": self.database.name}) pwd_xml = ElementTree.fromstring(pwd_response) pwd = pwd_xml.find("Password").text.strip() return queryEngine(self.address, self.port, query_type, pwd, msg_body)