def tearDown(self): """Clear the test environment""" super(TestLicenseAPI, self).tearDown() # Create Instance(DB Client) db_delete = delete.DeleteClient(config.JobConfig()) db_list = list.ListClient(config.JobConfig()) # Get Endpoint(DB Client) db_endpoint_license = base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_LICENSE) db_endpoint_msa_vlan = base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_MSA_VLAN) db_endpoint_port = base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_PORT) # Delete from NAL_LICENSE_MNG params = {} params['create_id'] = JOB_INPUT['operation_id'] db_list.set_context(db_endpoint_license, params) db_list.execute() delete_list = db_list.get_return_param() for delete_res in delete_list: key = delete_res['ID'] db_delete.set_context(db_endpoint_license, [key]) db_delete.execute() # Delete from NAL_MSA_VLAN_MNG params = {} params['create_id'] = JOB_INPUT['operation_id'] db_list.set_context(db_endpoint_msa_vlan, params) db_list.execute() delete_list = db_list.get_return_param() for delete_res in delete_list: key = delete_res['ID'] db_delete.set_context(db_endpoint_msa_vlan, [key]) db_delete.execute() # Delete from NAL_PORT_MNG params = {} params['create_id'] = JOB_INPUT['operation_id'] db_list.set_context(db_endpoint_port, params) db_list.execute() delete_list = db_list.get_return_param() for delete_res in delete_list: key = delete_res['ID'] db_delete.set_context(db_endpoint_port, [key]) db_delete.execute()
def tearDown(self): """Clear the test environment""" super(TestSetupDeviceBigIpApi, self).tearDown() # Create Instance(DB Client) db_delete = delete.DeleteClient(config.JobConfig()) db_list = list.ListClient(config.JobConfig()) # Get Endpoint(DB Client) db_endpoint_apl = base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_APL) db_endpoint_port = base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_PORT) # Delete from NAL_APL_MNG params = {} params['create_id'] = JOB_INPUT['operation_id'] db_list.set_context(db_endpoint_apl, params) db_list.execute() delete_list = db_list.get_return_param() for delete_res in delete_list: key = delete_res['ID'] db_delete.set_context(db_endpoint_apl, [key]) db_delete.execute() # Delete from NAL_PORT_MNG params = {} params['create_id'] = JOB_INPUT['operation_id'] db_list.set_context(db_endpoint_port, params) db_list.execute() delete_list = db_list.get_return_param() for delete_res in delete_list: key = delete_res['ID'] db_delete.set_context(db_endpoint_port, [key]) db_delete.execute()
def tearDown(self): """Clear the test environment""" super(TestTenatAPI, self).tearDown() # Create Instance(DB Client) db_delete = delete.DeleteClient(config.JobConfig()) db_list = list.ListClient(config.JobConfig()) # Get Endpoint(DB Client) db_endpoint_tenant = base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_TENANT) # Delete from NAL_TENANT_MNG params = {} params['create_id'] = JOB_INPUT['operation_id'] db_list.set_context(db_endpoint_tenant, params) db_list.execute() delete_pod_list = db_list.get_return_param() for delete_pod in delete_pod_list: key = delete_pod['ID'] db_delete.set_context(db_endpoint_tenant, [key]) db_delete.execute()
def tearDown(self): """Clear the test environment""" super(TestAutoVlbThrough, self).tearDown() # Create Instance(DB Client) db_list = list.ListClient(config.JobConfig()) db_delete = delete.DeleteClient(config.JobConfig()) # Get Endpoint(DB Client) db_endpoint_apl = \ base.JobAutoBase().get_db_endpoint(config.JobConfig().REST_URI_APL) db_endpoint_pod = \ base.JobAutoBase().get_db_endpoint(config.JobConfig().REST_URI_POD) db_endpoint_tenant = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_TENANT) db_endpoint_valn = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_VLAN) db_endpoint_port = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_PORT) db_endpoint_msa_vlan = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_MSA_VLAN) db_endpoint_vlan = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_VLAN) db_endpoint_license = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_LICENSE) # Delete from NAL_APL_MNG params = {} params['create_id'] = JOB_INPUT_CREATE['operation_id'] db_list.set_context(db_endpoint_apl, params) db_list.execute() delete_apl_list = db_list.get_return_param() for delete_apl in delete_apl_list: key = delete_apl['ID'] db_delete.set_context(db_endpoint_apl, [key]) db_delete.execute() # Delete from NAL_POD_MNG params = {} params['create_id'] = JOB_INPUT_CREATE['operation_id'] db_list.set_context(db_endpoint_pod, params) db_list.execute() delete_pod_list = db_list.get_return_param() for delete_pod in delete_pod_list: key = delete_pod['ID'] db_delete.set_context(db_endpoint_pod, [key]) db_delete.execute() # Delete from NAL_TENANT_MNG params = {} params['create_id'] = JOB_INPUT_CREATE['operation_id'] db_list.set_context(db_endpoint_tenant, params) db_list.execute() delete_tenant_list = db_list.get_return_param() for delete_tenant in delete_tenant_list: key = delete_tenant['ID'] db_delete.set_context(db_endpoint_tenant, [key]) db_delete.execute() # Delete from NAL_MSA_VLAN_MNG params = {} params['create_id'] = JOB_INPUT_CREATE['operation_id'] db_list.set_context(db_endpoint_valn, params) db_list.execute() delete_port_list = db_list.get_return_param() for delete_port in delete_port_list: key = delete_port['ID'] db_delete.set_context(db_endpoint_valn, [key]) db_delete.execute() # Delete from NAL_PORT_MNG params = {} params['create_id'] = JOB_INPUT_CREATE['operation_id'] db_list.set_context(db_endpoint_port, params) db_list.execute() delete_port_list = db_list.get_return_param() for delete_port in delete_port_list: key = delete_port['ID'] db_delete.set_context(db_endpoint_port, [key]) db_delete.execute() # Delete from NAL_MSA_VLAN_MNG params = {} params['create_id'] = JOB_INPUT_CREATE['operation_id'] db_list.set_context(db_endpoint_msa_vlan, params) db_list.execute() delete_msa_vlan_list = db_list.get_return_param() for delete_msa_vlan in delete_msa_vlan_list: key = delete_msa_vlan['ID'] db_delete.set_context(db_endpoint_msa_vlan, [key]) db_delete.execute() # Delete from NAL_VLAN_MNG params = {} params['create_id'] = JOB_INPUT_CREATE['operation_id'] db_list.set_context(db_endpoint_vlan, params) db_list.execute() delete_vlan_list = db_list.get_return_param() for delete_vlan in delete_vlan_list: key = delete_vlan['ID'] db_delete.set_context(db_endpoint_vlan, [key]) db_delete.execute() # Delete from NAL_LICENSE_MNG params = {} params['create_id'] = JOB_INPUT_CREATE['operation_id'] db_list.set_context(db_endpoint_license, params) db_list.execute() delete_license_list = db_list.get_return_param() for delete_license in delete_license_list: key = delete_license['ID'] db_delete.set_context(db_endpoint_license, [key]) db_delete.execute()
from job.conf import config from job.lib.db import delete end_point = 'http://localhost:80/index.py/pnfs' ids = [62] client = delete.DeleteClient(config.JobConfig()) client.set_context(end_point, ids) client.execute() result = client.get_return_param() print(type(result)) print(result)
def delete_nal_db(self): # Create Instance(DB Client) db_list = list.ListClient(config.JobConfig()) db_delete = delete.DeleteClient(config.JobConfig()) # Get Endpoint(DB Client) db_endpoint_apl = \ base.JobAutoBase().get_db_endpoint(config.JobConfig().REST_URI_APL) db_endpoint_port = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_PORT) db_endpoint_global_ip = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_GLOBAL_IP) db_endpoint_vlan = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_VLAN) # Delete from NAL_APL_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_apl, params) db_list.execute() delete_apl_list = db_list.get_return_param() for delete_apl in delete_apl_list: key = delete_apl['ID'] db_delete.set_context(db_endpoint_apl, [key]) db_delete.execute() # Delete from NAL_PORT_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_port, params) db_list.execute() delete_port_list = db_list.get_return_param() for delete_port in delete_port_list: key = delete_port['ID'] db_delete.set_context(db_endpoint_port, [key]) db_delete.execute() # Delete from NAL_GLOBAL_IP_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_global_ip, params) db_list.execute() delete_global_ip_list = db_list.get_return_param() for delete_global_ip in delete_global_ip_list: key = delete_global_ip['ID'] db_delete.set_context(db_endpoint_global_ip, [key]) db_delete.execute() # Delete from NAL_VIRTUAL_LAN_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_vlan, params) db_list.execute() delete_vlan_list = db_list.get_return_param() for delete_vlan in delete_vlan_list: key = delete_vlan['ID'] db_delete.set_context(db_endpoint_vlan, [key]) db_delete.execute()
def tearDown(self): """Clear the test environment""" super(TestAutoDcCreateAPI, self).tearDown() # Create Instance(DB Client) db_list = list.ListClient(config.JobConfig()) db_delete = delete.DeleteClient(config.JobConfig()) # Get Endpoint(DB Client) db_endpoint_apl = \ base.JobAutoBase().get_db_endpoint(config.JobConfig().REST_URI_APL) db_endpoint_pod = \ base.JobAutoBase().get_db_endpoint(config.JobConfig().REST_URI_POD) db_endpoint_port = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_PORT) db_endpoint_msa_vlan = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_MSA_VLAN) db_endpoint_global_ip = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_GLOBAL_IP) db_endpoint_vlan = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_VLAN) db_endpoint_license = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_LICENSE) db_endpoint_dc_segment = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_WIM_DC_SEGMENT_MNG) db_endpoint_dc_member = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_WIM_DC_CON_MEMBER) db_endpoint_dc_group = \ base.JobAutoBase().get_db_endpoint( config.JobConfig().REST_URI_WIM_DC_CON_GROUP) # Delete from NAL_APL_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_apl, params) db_list.execute() delete_apl_list = db_list.get_return_param() for delete_apl in delete_apl_list: key = delete_apl['ID'] db_delete.set_context(db_endpoint_apl, [key]) db_delete.execute() # Delete from NAL_POD_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_pod, params) db_list.execute() delete_pod_list = db_list.get_return_param() for delete_pod in delete_pod_list: key = delete_pod['ID'] db_delete.set_context(db_endpoint_pod, [key]) db_delete.execute() # Delete from NAL_PORT_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_port, params) db_list.execute() delete_port_list = db_list.get_return_param() for delete_port in delete_port_list: key = delete_port['ID'] db_delete.set_context(db_endpoint_port, [key]) db_delete.execute() # Delete from NAL_MSA_VLAN_MNG params = {} params['create_id'] = 'TestAutoDcUser' params['delete_flg'] = 0 db_list.set_context(db_endpoint_msa_vlan, params) db_list.execute() delete_msa_vlan_list = db_list.get_return_param() for delete_msa_vlan in delete_msa_vlan_list: key = delete_msa_vlan['ID'] db_delete.set_context(db_endpoint_msa_vlan, [key]) db_delete.execute() # Delete from NAL_GLOBAL_IP_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_global_ip, params) db_list.execute() delete_global_ip_list = db_list.get_return_param() for delete_global_ip in delete_global_ip_list: key = delete_global_ip['ID'] db_delete.set_context(db_endpoint_global_ip, [key]) db_delete.execute() # Delete from NAL_VIRTUAL_LAN_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_vlan, params) db_list.execute() delete_vlan_list = db_list.get_return_param() for delete_vlan in delete_vlan_list: key = delete_vlan['ID'] db_delete.set_context(db_endpoint_vlan, [key]) db_delete.execute() # Delete from NAL_LICENSE_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_license, params) db_list.execute() delete_license_list = db_list.get_return_param() for delete_license in delete_license_list: key = delete_license['ID'] db_delete.set_context(db_endpoint_license, [key]) db_delete.execute() # Delete from WIM_DC_SEGMENT_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_dc_segment, params) db_list.execute() delete_segment_list = db_list.get_return_param() for delete_segment in delete_segment_list: key = delete_segment['ID'] db_delete.set_context(db_endpoint_dc_segment, [key]) db_delete.execute() # Delete from WIM_DC_CONNECT_MEMBER_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_dc_member, params) db_list.execute() delete_dc_member_list = db_list.get_return_param() for delete_dc_member in delete_dc_member_list: key = delete_dc_member['ID'] db_delete.set_context(db_endpoint_dc_member, [key]) db_delete.execute() # Delete from WIM_DC_CONNECT_GROUP_MNG params = {} params['create_id'] = 'TestAutoDcUser' db_list.set_context(db_endpoint_dc_group, params) db_list.execute() delete_dc_group_list = db_list.get_return_param() for delete_dc_group in delete_dc_group_list: key = delete_dc_group['ID'] db_delete.set_context(db_endpoint_dc_group, [key]) db_delete.execute()