Exemplo n.º 1
0
def create_udb_instance_05(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "Quantity": 0,
        "Port": variables.get("Port"),
        "ParamGroupId": funcs.search_value(
            variables.get("DataSet_paramGroup"),
            "DBTypeId",
            variables.get("DBTypeId"),
            "GroupId",
        ),
        "Name": funcs.concat(
            variables.get("DBName"), variables.get("DBTypeId")
        ),
        "MemoryLimit": variables.get("MemoryLimit"),
        "InstanceType": variables.get("InstanceType"),
        "InstanceMode": variables.get("InstanceMode"),
        "DiskSpace": variables.get("DiskSpace"),
        "DBTypeId": variables.get("DBTypeId"),
        "ChargeType": "Month",
        "AdminPassword": "******",
    }

    try:
        resp = client.udb().create_udb_instance(d)
    except exc.RetCodeException as e:
        resp = e.json()

    variables["DBId"] = utest.value_at_path(resp, "DBId")
    return resp
def create_udb_param_group_07(client: utest.Client, variables: dict):
    d = {
        "Zone":
        variables.get("Zone"),
        "SrcGroupId":
        funcs.search_value(
            variables.get("DataSet_paramGroup"),
            "DBTypeId",
            variables.get("DBTypeId"),
            "GroupId",
        ),
        "Region":
        variables.get("Region"),
        "GroupName":
        "auto_config_create",
        "Description":
        "self_create",
        "DBTypeId":
        variables.get("DBTypeId"),
    }

    try:
        resp = client.udb().create_udb_param_group(d)
    except exc.RetCodeException as e:
        resp = e.json()

    variables["create_config_id"] = utest.value_at_path(resp, "GroupId")
    return resp
Exemplo n.º 3
0
def describe_udb_type_01(client: utest.Client, variables: dict):
    d = {"Zone": variables.get("Zone"), "Region": variables.get("Region")}

    try:
        resp = client.udb().describe_udb_type(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
Exemplo n.º 4
0
def promote_udb_instance_to_ha_14(client: utest.Client, variables: dict):
    d = {"Region": variables.get("Region"), "DBId": variables.get("DBId")}

    try:
        resp = client.udb().promote_udb_instance_to_ha(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
Exemplo n.º 5
0
def switch_udb_instance_to_ha_16(client: utest.Client, variables: dict):
    d = {"Region": variables.get("Region"), "DBId": variables.get("DBId")}

    try:
        resp = client.udb().switch_udb_instance_to_ha(d)
    except exc.RetCodeException as e:
        resp = e.json()

    variables["HADBId"] = utest.value_at_path(resp, "DBId")
    return resp
Exemplo n.º 6
0
def check_udb_instance_to_ha_allowance_12(
    client: utest.Client, variables: dict
):
    d = {"Region": variables.get("Region"), "DBId": variables.get("DBId")}

    try:
        resp = client.udb().check_udb_instance_to_ha_allowance(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def describe_udb_backup_blacklist_09(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "DBId": variables.get("DBId"),
    }

    try:
        resp = client.udb().describe_udb_backup_blacklist(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def delete_udb_param_group_20(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "GroupId": variables.get("create_config_id"),
    }

    try:
        resp = client.udb().delete_udb_param_group(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def delete_udb_backup_28(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "BackupId": variables.get("BackupId"),
    }

    try:
        resp = client.udb().delete_udb_backup(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def stop_udb_instance_19(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "DBId": variables.get("DBId_frombf_56"),
    }

    try:
        resp = client.udb().stop_udb_instance(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def start_udb_instance_18(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "DBId": variables.get("slave_dbid"),
    }

    try:
        resp = client.udb().start_udb_instance(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
Exemplo n.º 12
0
def delete_udb_instance_20(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "DBId": variables.get("DBId"),
    }

    try:
        resp = client.udb().delete_udb_instance(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def edit_udb_backup_blacklist_08(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "DBId": variables.get("DBId"),
        "Blacklist": "test.%",
    }

    try:
        resp = client.udb().edit_udb_backup_blacklist(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
Exemplo n.º 14
0
def modify_udb_instance_name_09(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "Name": funcs.concat("rename_", variables.get("DBTypeId")),
        "DBId": variables.get("DBId"),
    }

    try:
        resp = client.udb().modify_udb_instance_name(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def promote_udb_slave_20(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "IsForce": True,
        "DBId": variables.get("slave_dbid"),
    }

    try:
        resp = client.udb().promote_udb_slave(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
Exemplo n.º 16
0
def modify_udb_instance_password_11(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "Password": "******",
        "DBId": variables.get("DBId"),
    }

    try:
        resp = client.udb().modify_udb_instance_password(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def describe_udb_instance_backup_url_14(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "DBId": variables.get("DBId"),
        "BackupId": variables.get("BackupId"),
    }

    try:
        resp = client.udb().describe_udb_instance_backup_url(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def update_udb_param_group_08(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Value": 2,
        "Region": variables.get("Region"),
        "Key": "auto_increment_increment",
        "GroupId": variables.get("create_config_id"),
    }

    try:
        resp = client.udb().update_udb_param_group(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def fetch_udb_instance_earliest_recover_time_21(client: utest.Client,
                                                variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "DBId": variables.get("DBId"),
    }

    try:
        resp = client.udb().fetch_udb_instance_earliest_recover_time(d)
    except exc.RetCodeException as e:
        resp = e.json()

    variables["EarliestTime"] = utest.value_at_path(resp, "EarliestTime")
    return resp
def backup_udb_instance_10(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "UseBlacklist": True,
        "Region": variables.get("Region"),
        "DBId": variables.get("DBId"),
        "BackupName": variables.get("BackupName"),
    }

    try:
        resp = client.udb().backup_udb_instance(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
Exemplo n.º 21
0
def describe_udb_param_group_02(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "Offset": 0,
        "Limit": 100,
    }

    try:
        resp = client.udb().describe_udb_param_group(d)
    except exc.RetCodeException as e:
        resp = e.json()

    variables["DataSet_paramGroup"] = utest.value_at_path(resp, "DataSet")
    return resp
Exemplo n.º 22
0
def describe_udb_instance_00(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "Offset": 0,
        "Limit": 100,
        "ClassType": "sql",
    }

    try:
        resp = client.udb().describe_udb_instance(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def resize_udb_instance_09(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "UseSSD": variables.get("UseSSD"),
        "Region": variables.get("Region"),
        "MemoryLimit": variables.get("MemoryLimit") + 1,
        "DiskSpace": variables.get("DiskSpace") + 1,
        "DBId": variables.get("DBId"),
    }

    try:
        resp = client.udb().resize_udb_instance(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
Exemplo n.º 24
0
def create_udb_replication_instance_04(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "SrcId": variables.get("DBId"),
        "Region": variables.get("Region"),
        "Port": variables.get("Port"),
        "Name": "second-auto",
    }

    try:
        resp = client.udb().create_udb_replication_instance(d)
    except exc.RetCodeException as e:
        resp = e.json()

    variables["secondid"] = utest.value_at_path(resp, "DBId")
    return resp
def update_udb_instance_slave_backup_switch_12(client: utest.Client,
                                               variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "SlaveDBId": variables.get("slave_dbid"),
        "Region": variables.get("Region"),
        "MasterDBId": variables.get("DBId"),
        "BackupSwitch": 1,
    }

    try:
        resp = client.udb().update_udb_instance_slave_backup_switch(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def update_udb_instance_backup_strategy_07(client: utest.Client,
                                           variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "DBId": variables.get("DBId"),
        "BackupTime": 13,
        "BackupDate": 1111110,
    }

    try:
        resp = client.udb().update_udb_instance_backup_strategy(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
def describe_udb_backup_11(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "Offset": 0,
        "Limit": 100,
        "DBId": variables.get("DBId"),
    }

    try:
        resp = client.udb().describe_udb_backup(d)
    except exc.RetCodeException as e:
        resp = e.json()

    variables["BackupId"] = utest.value_at_path(resp, "DataSet.0.BackupId")
    return resp
Exemplo n.º 28
0
def describe_udb_instance_price_03(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "MemoryLimit": variables.get("MemoryLimit"),
        "DiskSpace": variables.get("DiskSpace"),
        "DBTypeId": variables.get("DBTypeId"),
        "Count": 1,
    }

    try:
        resp = client.udb().describe_udb_instance_price(d)
    except exc.RetCodeException as e:
        resp = e.json()

    return resp
Exemplo n.º 29
0
def describe_udb_instance_07(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "Region": variables.get("Region"),
        "Offset": 0,
        "Limit": 100,
        "DBId": variables.get("DBId"),
        "ClassType": "sql",
    }

    try:
        resp = client.udb().describe_udb_instance(d)
    except exc.RetCodeException as e:
        resp = e.json()

    variables["VirtualIP"] = utest.value_at_path(resp, "DataSet.0.VirtualIP")
    return resp
def create_udb_instance_by_recovery_23(client: utest.Client, variables: dict):
    d = {
        "Zone": variables.get("Zone"),
        "SrcDBId": variables.get("DBId"),
        "Region": variables.get("Region"),
        "RecoveryTime": variables.get("EarliestTime"),
        "Quantity": 0,
        "Name": "56-hd-frombf",
        "ChargeType": "Month",
    }

    try:
        resp = client.udb().create_udb_instance_by_recovery(d)
    except exc.RetCodeException as e:
        resp = e.json()

    variables["HD_DBId"] = utest.value_at_path(resp, "DBId")
    return resp