async def eip_batch_bind_and_reserve_ip(ns={}): import aiohttp NETWORK_URL = 'http://cdsapi.capitalonline.net/vpc' action = 'ReserveIPAndBindEIP' method = "POST" param = {} url = get_signature(action, method, NETWORK_URL, param=param) body = { "AvailableZoneCode": ns.get('AvailableZoneCode'), "Ips": [ { "NetId": ns.get('NetId'), "AddressList": json.loads(ns.get('AddressList')), "EIPList": json.loads(ns.get('EIPList')), "Description": ns.get('Description') } ] } async with aiohttp.ClientSession() as session: async with session.request(method, url, json=body) as response: resp = await response.text() result = json.loads(resp) if result['Code'] == 'Success': result['status'] = True result.pop('Code') result['data'] = result.pop('Data') result['msg'] = result.pop('Message') else: result['status'] = False result['msg'] = result.pop('Message') return result ret = await eip_batch_bind_and_reserve_ip(params_kw) return ret