コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
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
コード例 #4
0
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
コード例 #5
0
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
コード例 #6
0
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
コード例 #7
0
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
コード例 #8
0
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
コード例 #9
0
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
コード例 #10
0
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
コード例 #11
0
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
コード例 #12
0
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
コード例 #13
0
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
コード例 #14
0
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
コード例 #15
0
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
コード例 #16
0
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
コード例 #17
0
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
コード例 #18
0
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
コード例 #19
0
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
コード例 #20
0
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
コード例 #21
0
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
コード例 #22
0
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
コード例 #23
0
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
コード例 #24
0
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
コード例 #25
0
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
コード例 #26
0
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
コード例 #27
0
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