def get_num_ssd(): out = cli.list_device() numSSD = 0 for device in json_parser.get_data(out)['devicelist']: if device['type'] == "SSD": numSSD += 1 return numSSD
def first_task(): url = 'https://jsonplaceholder.typicode.com/users' response = json_parser.get_data(url) json_parser.submit_headers(response) json_parser.submit_json(response) json_parser.print_free_space() json_parser.parse_json_data(response)
def get_checkpoint_status(arrayId=0): out = cli.send_request("wbt get_journal_status --array " + TEST_SETUP_POS.get_arrayname(arrayId)) if json_parser.get_response_code(out) != 0: return -1 else: total_info = json_parser.get_data(out) return total_info["journalStatus"]["checkpointStatus"]["status"]
def get_log_buffer_size(arrayId=0): out = cli.send_request("wbt get_journal_status --array " + TEST_SETUP_POS.get_arrayname(arrayId)) if json_parser.get_response_code(out) != 0: return -1 else: total_info = json_parser.get_data(out) return total_info["journalStatus"]["logBufferStatus"][ "logBufferSizeInBytes"]
import data_values import json_parser import json_parser_individuals import json import values_cleaner import datetime today = datetime.datetime.now() file_date = "_" + str(today.day) + "_" + str(today.month) + "_" + str(today.year) foldername = file_date[1:] data = dict() try: data["adityabirla"] = values_cleaner.clean_aditya(json_parser.get_data(fund_name = "adityabirla", file_type = ".xlsx", index = 2, start = 0, end = 12, values = data_values.aditya_values , date_filter = None, data_filter = None)) except: data["adityabirla"] = [] try: data["axis"] = values_cleaner.clean_axis(json_parser.get_data_4(fund_name = "axis", file_type = ".html", index = 1, index2 = 0, values = data_values.axis_values, filter = "yes")) except: data["axis"] = [] try: data["baroda"] = values_cleaner.clean_baroda(json_parser.get_data_3(fund_name = "baroda", file_type = ".xls", index = 5, values = data_values.baroda_values, name_filter = None, r_b_filter = "yes", size = 12)) except: data["baroda"] = [] try: data["bnpparibas"] = values_cleaner.clean_bnp(json_parser.get_data(fund_name = "bnpparibas", file_type = ".xls", index = 2, start = 0, end = 12, values = data_values.bnp_values , date_filter = None, data_filter = None))