Esempio n. 1
0
def get_status(test):
    api = ReachabilityTestAPI()
    status = ''
    with bsn_api.Session.begin(subtransactions=True):
        last_result = api.getLastReachabilityTestResult(
            test.tenant_id, test.test_id, bsn_api.Session)
        if last_result:
            status = last_result.test_result
    return status
Esempio n. 2
0
def get_last_run(test):
    api = ReachabilityTestAPI()
    timestamp = None
    with bsn_api.Session.begin(subtransactions=True):
        last_result = api.getLastReachabilityTestResult(
            test.tenant_id, test.test_id, bsn_api.Session)
        if last_result:
            timestamp = last_result.test_time
    return timestamp
Esempio n. 3
0
def get_status(test):
    api = ReachabilityTestAPI()
    status = ''
    with bsn_api.Session.begin(subtransactions=True):
        last_result = api.getLastReachabilityTestResult(test.tenant_id,
                                                        test.test_id,
                                                        bsn_api.Session)
        if last_result:
            status = last_result.test_result
    return status
Esempio n. 4
0
def get_last_run(test):
    api = ReachabilityTestAPI()
    timestamp = None
    with bsn_api.Session.begin(subtransactions=True):
        last_result = api.getLastReachabilityTestResult(test.tenant_id,
                                                        test.test_id,
                                                        bsn_api.Session)
        if last_result:
            timestamp = last_result.test_time
    return timestamp
Esempio n. 5
0
 def get_data(self):
     test_data = None
     test_id = self.kwargs['reachability_test_id'].encode('ascii', 'ignore')
     api = ReachabilityTestAPI()
     with bsn_api.Session.begin(subtransactions=True):
         test = api.getReachabilityTest(
             self.request.user.project_id, test_id, bsn_api.Session)
         result = api.getLastReachabilityTestResult(
             self.request.user.project_id, test_id, bsn_api.Session)
         test_data = ReachabilityTestData(test, result)
     return test_data
Esempio n. 6
0
 def get_data(self):
     test_data = None
     test_id = self.kwargs['reachability_test_id'].encode('ascii', 'ignore')
     api = ReachabilityTestAPI()
     with bsn_api.Session.begin(subtransactions=True):
         test = api.getReachabilityTest(self.request.user.project_id,
                                        test_id, bsn_api.Session)
         result = api.getLastReachabilityTestResult(
             self.request.user.project_id, test_id, bsn_api.Session)
         test_data = ReachabilityTestData(test, result)
     return test_data