# Imports #-----------------------------------------------------------------------# from axol_api_client import AxolApiClient import sys sys.path.append("/opt/AXOL_Management/AXOL") sys.path.append("C:\Users\kelcey.damage.CORP\Documents\GitHub\AXOL") sys.path.append("D:\GitHub\Payfirma\AXOL") from axol_common.classes.common_timer import CommonTimer # Test metrics || client.test() supports: enable_response=True if you want # to see the raw api output #-----------------------------------------------------------------------# print '----Test metrics-----------------' CT = CommonTimer() client = AxolApiClient('10.100.10.130') api = 'get_processor_usage' data = {'role': 'production_servers'} CT.start() client.test(api, data) api = 'get_memory_usage' data = {'role': 'production_servers'} CT.log('get_processor_usage') client.test(api, data) api = 'get_disk_usage' data = {'role': 'production_servers'} CT.log('get_memory_usage') client.test(api, data)
# Imports #-----------------------------------------------------------------------# from axol_api_client import AxolApiClient import sys sys.path.append("/opt/AXOL_Management/AXOL") sys.path.append("C:\Users\kelcey.damage.CORP\Documents\GitHub\AXOL") from axol_common.classes.common_timer import CommonTimer # Test administration || client.test() supports: enable_response=True if # you want to see the raw api output #-----------------------------------------------------------------------# print '----Admin Tests------------------' CT = CommonTimer() client = AxolApiClient('10.100.10.34', ) api = 'get_all_roles' data = {'network': 'external'} CT.start() client.test(api, data) api = 'get_alert_servers' data = {} CT.log('get_all_roles') client.test(api, data) api = 'remove_alert_server' data = {'server_name': 'live_axol_auto_scheduler_v1.0.0'} CT.log('get_alert_server') client.test(api, data)
#! /usr/bin/env python #-----------------------------------------# # Written by Kelcey Damage, 2013 # Imports #-----------------------------------------------------------------------# from axol_api_client import AxolApiClient # Test scheduler || client.test() supports: enable_response=True if you want # to see the raw api output #-----------------------------------------------------------------------# print '----Test scheduler---------------' client = AxolApiClient('10.100.10.59') api = 'create_scheduled_task' data = { "time": 300, "task_name": 'integration_test', "api_name": 'get_null', "role": 'production_servers' } client.test(api, data, enable_response=True) api = 'get_scheduled_tasks' data = {} client.test(api, data, enable_response=True)
#-----------------------------------------------------------------------# from axol_api_client import AxolApiClient import sys sys.path.append("/opt/AXOL_Management/AXOL") sys.path.append("C:\Users\kelcey.damage.CORP\Documents\GitHub\AXOL") sys.path.append("D:\GitHub\Payfirma\AXOL") from axol_common.classes.common_timer import CommonTimer # Test metrics || client.test() supports: enable_response=True if you want # to see the raw api output #-----------------------------------------------------------------------# print '----Test metrics-----------------' CT = CommonTimer() client = AxolApiClient('10.100.10.130') api = 'get_processor_usage' data = { 'role': 'production_servers' } CT.start() client.test(api, data) api = 'get_memory_usage' data = { 'role': 'production_servers' } CT.log('get_processor_usage') client.test(api, data)
#! /usr/bin/env python #-----------------------------------------# # Written by Kelcey Damage, 2013 # Imports #-----------------------------------------------------------------------# from axol_api_client import AxolApiClient # Test events || client.test() supports: enable_response=True if you want # to see the raw api output #-----------------------------------------------------------------------# print '----Event Tests------------------' client = AxolApiClient('10.100.10.34') api = 'create_event_notice' alert_types = [{ 'alert_type': ['email'] }, { 'alert_type': ['text'] }, { 'alert_type': [] }, { 'alert_type': ['some_other_value'] }, { 'alert_type': 'string_not_in_list' }, { 'alert_type': '' }] sources = [{