def kill(self, channel, agentUri): req = Messages.Request(method = "KILL", uri = agentUri, protocol = "XA", version = Versions.getXaVersion()) resp = self.executeRequest(channel, req) if not resp: raise XaException("Timeout while waiting for KILL response from agent %s" % req.getUri()) if resp.getStatusCode() != 200: raise XaException("KILL from agent %s returned %d %s" % (req.getUri(), resp.getStatusCode(), resp.getReasonPhrase()))
def triUnmap(self, channel, uri): """ Constructs a reset request, execute it. """ req = Messages.Request(method = "TRI-UNMAP", uri = uri, protocol = "XA", version = Versions.getXaVersion()) resp = self.executeRequest(channel, req) if not resp: raise XaException("Timeout while waiting for TRI-UNMAP response from probe %s" % req.getUri()) if resp.getStatusCode() != 200: raise XaException("TRI-UNMAP from probe %s returned %d %s" % (req.getUri(), resp.getStatusCode(), resp.getReasonPhrase()))
def undeploy(self, channel, agentUri, probeName): req = Messages.Request(method = "UNDEPLOY", uri = agentUri, protocol = "XA", version = Versions.getXaVersion()) req.setApplicationBody({'probe-name': probeName}) resp = self.executeRequest(channel, req) if not resp: raise XaException("Timeout while waiting for UNDEPLOY response from agent %s" % req.getUri()) if resp.getStatusCode() != 200: raise XaException("UNDEPLOY from agent %s returned %d %s" % (req.getUri(), resp.getStatusCode(), resp.getReasonPhrase()))