def create_uhost_instance_01(client: utest.Client, variables: dict): d = { "Zone": variables.get("Zone"), "TimemachineFeature": "No", "Tag": "Default", "StorageType": "LocalDisk", "Region": variables.get("Region"), "Quantity": 1, "Password": "******", "NetCapability": "Normal", "Name": variables.get("Name"), "Memory": variables.get("CreateMem"), "LoginMode": "Password", "ImageId": variables.get("ImageID"), "HotplugFeature": False, "GPU": False, "DiskSpace": variables.get("CreateDiskspace"), "ChargeType": variables.get("ChargeType"), "CPU": variables.get("CreateCPU"), "BootDiskSpace": variables.get("CreateBootDisk"), } try: resp = client.uhost().create_uhost_instance(d) except exc.RetCodeException as e: resp = e.json() variables["hostId"] = utest.value_at_path(resp, "UHostIds.0") return resp
def create_uhost_instance_11(client: utest.Client, variables: dict): d = { "Zone": variables.get("Zone"), "UHostType": variables.get("UHostType"), "TimemachineFeature": "No", "Tag": "Default", "Region": variables.get("Region"), "Quantity": 1, "Password": "******", "NetCapability": "Normal", "Name": variables.get("HostName"), "Memory": variables.get("CreateMem"), "LoginMode": "Password", "ImageId": variables.get("ImageId"), "HotplugFeature": False, "GPU": False, "Disks": [ { "BackupType": variables.get("BootBackup"), "IsBoot": True, "Size": variables.get("BootSize"), "Type": variables.get("BootType"), } ], "ChargeType": variables.get("ChargeType"), "CPU": variables.get("CreateCPU"), } try: resp = client.uhost().create_uhost_instance(d) except exc.RetCodeException as e: resp = e.json() variables["uhost_id"] = utest.value_at_path(resp, "UHostIds.0") return resp
def create_udb_instance_04(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 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_ulb_simple_02(client: utest.Client, variables: dict): d = {"Region": variables.get("Region")} try: resp = client.invoke("DescribeULBSimple", d) except exc.RetCodeException as e: resp = e.json() return resp
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
def describe_uhost_lite_02(client: utest.Client, variables: dict): d = {"Zone": variables.get("Zone"), "Region": variables.get("Region")} try: resp = client.invoke("DescribeUHostLite", d) except exc.RetCodeException as e: resp = e.json() return resp
def delete_vpc_16(client: utest.Client, variables: dict): d = {"VPCId": variables.get("vpc_id"), "Region": variables.get("Region")} try: resp = client.vpc().delete_vpc(d) except exc.RetCodeException as e: resp = e.json() return resp
def describe_uredis_backup_06(client: utest.Client, variables: dict): d = {"Region": variables.get("Region")} try: resp = client.umem().describe_uredis_backup(d) except exc.RetCodeException as e: resp = e.json() return resp
def batch_describe_new_ucdn_domain_04(client: utest.Client, variables: dict): d = {} try: resp = client.ucdn().batch_describe_new_ucdn_domain(d) except exc.RetCodeException as e: resp = e.json() return resp
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
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 get_ucdn_domain_prefetch_enable_18(client: utest.Client, variables: dict): d = {"DomainId": variables.get("domainId")} try: resp = client.ucdn().get_ucdn_domain_prefetch_enable(d) except exc.RetCodeException as e: resp = e.json() return resp
def describe_snapshot_20(client: utest.Client, variables: dict): d = {"Zone": variables.get("Zone"), "Region": variables.get("Region")} try: resp = client.invoke("DescribeSnapshot", 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_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 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 describe_ucdn_domain_02(client: utest.Client, variables: dict): d = {"DomainId": [variables.get("domainId")]} try: resp = client.invoke("DescribeUcdnDomain", d) except exc.RetCodeException as e: resp = e.json() return resp
def get_bandwidth_sum_10(client: utest.Client, variables: dict): d = {"Region": variables.get("Region")} try: resp = client.invoke("GetBandwidthSum", d) except exc.RetCodeException as e: resp = e.json() return resp
def switch_ucdn_charge_type_19(client: utest.Client, variables: dict): d = {"ChargeType": "traffic"} try: resp = client.ucdn().switch_ucdn_charge_type(d) except exc.RetCodeException as e: resp = e.json() return resp
def delete_bucket_22(client: utest.Client, variables: dict): d = {"BucketName": variables.get("BucketName_test")} try: resp = client.invoke("DeleteBucket", d) except exc.RetCodeException as e: resp = e.json() return resp
def get_ucdn_domain_traffic_17(client: utest.Client, variables: dict): d = {"AccountType": "top"} try: resp = client.ucdn().get_ucdn_domain_traffic(d) except exc.RetCodeException as e: resp = e.json() return resp
def delete_ulb_10(client: utest.Client, variables: dict): d = {"ULBId": variables.get("ULBId"), "Region": variables.get("Region")} try: resp = client.ulb().delete_ulb(d) except exc.RetCodeException as e: resp = e.json() return resp
def get_ucdn_traffic_16(client: utest.Client, variables: dict): d = {} try: resp = client.ucdn().get_ucdn_traffic(d) except exc.RetCodeException as e: resp = e.json() return resp
def get_ucdn_pass_bandwidth_13(client: utest.Client, variables: dict): d = {"Type": variables.get("time_granule_type")} try: resp = client.ucdn().get_ucdn_pass_bandwidth(d) except exc.RetCodeException as e: resp = e.json() return resp
def delete_ssl_12(client: utest.Client, variables: dict): d = {"SSLId": variables.get("SSLId_02"), "Region": variables.get("Region")} try: resp = client.ulb().delete_ssl(d) except exc.RetCodeException as e: resp = e.json() return resp
def describe_vserver_04(client: utest.Client, variables: dict): d = {"ULBId": variables.get("ULBId"), "Region": variables.get("Region")} try: resp = client.ulb().describe_vserver(d) except exc.RetCodeException as e: resp = e.json() variables["VServerId"] = utest.value_at_path(resp, "DataSet.0.VServerId") 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 prefetch_new_ucdn_domain_cache_08(client: utest.Client, variables: dict): d = {"UrlList": [funcs.concat("http://", variables.get("domain"), "/")]} try: resp = client.ucdn().prefetch_new_ucdn_domain_cache(d) except exc.RetCodeException as e: resp = e.json() variables["PrefetchCache_TaskId"] = utest.value_at_path(resp, "TaskId") return resp
def describe_ucdn_domain_03(client: utest.Client, variables: dict): d = {"DomainId": [variables.get("domainId")]} try: resp = client.invoke("DescribeUcdnDomain", d) except exc.RetCodeException as e: resp = e.json() variables["domain"] = utest.value_at_path(resp, "DomainSet.0.Domain") return resp