def describe_bandwidth_package_08(client: utest.Client, variables: dict): d = {"Region": variables.get("Region"), "Offset": 0, "Limit": 1} try: resp = client.unet().describe_bandwidth_package(d) except exc.RetCodeException as e: resp = e.json() return resp
def release_eip_11(client: utest.Client, variables: dict): d = {"Region": variables.get("Region"), "EIPId": variables.get("eip_id")} try: resp = client.unet().release_eip(d) except exc.RetCodeException as e: resp = e.json() return resp
def delete_firewall_16(client: utest.Client, variables: dict): d = {"Region": variables.get("Region"), "FWId": variables.get("fw_id1")} try: resp = client.unet().delete_firewall(d) except exc.RetCodeException as e: resp = e.json() return resp
def describe_eip_13(client: utest.Client, variables: dict): d = {"Region": variables.get("Region"), "Limit": 1} try: resp = client.unet().describe_eip(d) except exc.RetCodeException as e: resp = e.json() return resp
def describe_firewall_01(client: utest.Client, variables: dict): d = {"Region": variables.get("Region")} try: resp = client.unet().describe_firewall(d) except exc.RetCodeException as e: resp = e.json() return resp
def describe_firewall_11(client: utest.Client, variables: dict): d = {"Region": variables.get("Region"), "Offset": 0, "Limit": 20} try: resp = client.unet().describe_firewall(d) except exc.RetCodeException as e: resp = e.json() variables["fw_dataset"] = utest.value_at_path(resp, "DataSet") return resp
def describe_share_bandwidth_06(client: utest.Client, variables: dict): d = { "ShareBandwidthIds": [variables.get("sbw_id")], "Region": variables.get("Region"), } try: resp = client.unet().describe_share_bandwidth(d) except exc.RetCodeException as e: resp = e.json() return resp
def delete_bandwidth_package_09(client: utest.Client, variables: dict): d = { "Region": variables.get("Region"), "BandwidthPackageId": variables.get("bwp_id2"), } try: resp = client.unet().delete_bandwidth_package(d) except exc.RetCodeException as e: resp = e.json() return resp
def describe_eip_15(client: utest.Client, variables: dict): d = { "Region": variables.get("Region"), "EIPIds": [variables.get("EIPId_01")], } try: resp = client.unet().describe_eip(d) except exc.RetCodeException as e: resp = e.json() return resp
def release_share_bandwidth_12(client: utest.Client, variables: dict): d = { "ShareBandwidthId": variables.get("sbw_id"), "Region": variables.get("Region"), "EIPBandwidth": 2, } try: resp = client.unet().release_share_bandwidth(d) except exc.RetCodeException as e: resp = e.json() return resp
def get_eip_price_05(client: utest.Client, variables: dict): d = { "Region": variables.get("Region"), "OperatorName": "Bgp", "Bandwidth": 2, } try: resp = client.unet().get_eip_price(d) except exc.RetCodeException as e: resp = e.json() return resp
def modify_eip_weight_10(client: utest.Client, variables: dict): d = { "Weight": 100, "Region": variables.get("Region"), "EIPId": variables.get("EIPId_01"), } try: resp = client.unet().modify_eip_weight(d) except exc.RetCodeException as e: resp = e.json() return resp
def modify_eip_bandwidth_08(client: utest.Client, variables: dict): d = { "Region": variables.get("Region"), "EIPId": variables.get("EIPId_01"), "Bandwidth": 3, } try: resp = client.unet().modify_eip_bandwidth(d) except exc.RetCodeException as e: resp = e.json() return resp
def update_firewall_08(client: utest.Client, variables: dict): d = { "Rule": [variables.get("fw_rule_2")], "Region": variables.get("Region"), "FWId": variables.get("fw_id1"), } try: resp = client.unet().update_firewall(d) except exc.RetCodeException as e: resp = e.json() return resp
def un_bind_eip_10(client: utest.Client, variables: dict): d = { "ResourceType": "uhost", "ResourceId": variables.get("UHostId"), "Region": variables.get("Region"), "EIPId": variables.get("eip_id"), } try: resp = client.unet().un_bind_eip(d) except exc.RetCodeException as e: resp = e.json() return resp
def set_eip_pay_mode_09(client: utest.Client, variables: dict): d = { "Region": variables.get("Region"), "PayMode": "Traffic", "EIPId": variables.get("EIPId_01"), "Bandwidth": 2, } try: resp = client.unet().set_eip_pay_mode(d) except exc.RetCodeException as e: resp = e.json() return resp
def describe_eip_09(client: utest.Client, variables: dict): d = { "Region": variables.get("Region"), "Offset": 0, "Limit": 100, "EIPIds": [variables.get("eip_id")], } try: resp = client.unet().describe_eip(d) except exc.RetCodeException as e: resp = e.json() return resp
def grant_firewall_06(client: utest.Client, variables: dict): d = { "ResourceType": "UHost", "ResourceId": variables.get("uhost_id1"), "Region": variables.get("Region"), "FWId": variables.get("fw_id1"), } try: resp = client.unet().grant_firewall(d) except exc.RetCodeException as e: resp = e.json() return resp
def associate_eip_with_share_bandwidth_02(client: utest.Client, variables: dict): d = { "ShareBandwidthId": variables.get("sbw_id"), "Region": variables.get("Region"), "EIPIds": [variables.get("eip_id")], } try: resp = client.unet().associate_eip_with_share_bandwidth(d) except exc.RetCodeException as e: resp = e.json() return resp
def update_eip_attribute_04(client: utest.Client, variables: dict): d = { "Tag": "huangchao", "Remark": "test-gai", "Region": variables.get("Region"), "Name": "eip-auto-gai", "EIPId": variables.get("EIPId_01"), } try: resp = client.unet().update_eip_attribute(d) except exc.RetCodeException as e: resp = e.json() return resp
def create_bandwidth_package_07(client: utest.Client, variables: dict): d = { "TimeRange": 1, "Region": variables.get("Region"), "EIPId": variables.get("eip_id"), "Bandwidth": variables.get("bwp2_bw"), } try: resp = client.unet().create_bandwidth_package(d) except exc.RetCodeException as e: resp = e.json() variables["bwp_id2"] = utest.value_at_path(resp, "BandwidthPackageId") return resp
def allocate_share_bandwidth_00(client: utest.Client, variables: dict): d = { "ShareBandwidth": variables.get("sbw_bw"), "Region": variables.get("Region"), "Name": variables.get("sbw_name"), "ChargeType": variables.get("sbw_chargetype"), } try: resp = client.unet().allocate_share_bandwidth(d) except exc.RetCodeException as e: resp = e.json() variables["sbw_id"] = utest.value_at_path(resp, "ShareBandwidthId") return resp
def update_firewall_attribute_09(client: utest.Client, variables: dict): d = { "Tag": variables.get("tag_2"), "Remark": variables.get("remark_2"), "Region": variables.get("Region"), "Name": funcs.concat(variables.get("fw_name_2"), variables.get("Zone")), "FWId": variables.get("fw_id1"), } try: resp = client.unet().update_firewall_attribute(d) except exc.RetCodeException as e: resp = e.json() return resp
def create_firewall_03(client: utest.Client, variables: dict): d = { "Tag": variables.get("tag"), "Rule": [variables.get("fw_rule_1")], "Remark": variables.get("remark"), "Region": variables.get("Region"), "Name": funcs.concat(variables.get("fw_name_1"), variables.get("Zone")), } try: resp = client.unet().create_firewall(d) except exc.RetCodeException as e: resp = e.json() variables["fw_id1"] = utest.value_at_path(resp, "FWId") return resp
def allocate_eip_01(client: utest.Client, variables: dict): d = { "Region": variables.get("Region"), "PayMode": "Traffic", "OperatorName": variables.get("eip_operatorname"), "Name": "eip_auto", "ChargeType": "Month", "Bandwidth": variables.get("eip_bw"), } try: resp = client.unet().allocate_eip(d) except exc.RetCodeException as e: resp = e.json() variables["eip_id"] = utest.value_at_path(resp, "EIPSet.0.EIPId") return resp
def allocate_eip_02(client: utest.Client, variables: dict): d = { "Tag": "Default", "Remark": "test", "Region": variables.get("Region"), "Quantity": 1, "PayMode": "Bandwidth", "OperatorName": "Bgp", "Name": "eip-bgp-01", "ChargeType": "Dynamic", "Bandwidth": 2, } try: resp = client.unet().allocate_eip(d) except exc.RetCodeException as e: resp = e.json() variables["EIPId_01"] = utest.value_at_path(resp, "EIPSet.0.EIPId") return resp
def grant_firewall_12(client: utest.Client, variables: dict): d = { "ResourceType": "UHost", "ResourceId": variables.get("uhost_id1"), "Region": variables.get("Region"), "FWId": funcs.search_value( variables.get("fw_dataset"), "Type", variables.get("recommend_web"), "FWId", ), } try: resp = client.unet().grant_firewall(d) except exc.RetCodeException as e: resp = e.json() return resp