async def ecs_modify_security_groups_priority(ns={}): import aiohttp NETWORK_URL = 'http://api.capitalonline.net/sg/v1' action = 'ModifySecurityGroupsPriority' method = "POST" param = {} url = get_signature(action, method, NETWORK_URL, param=param) body = { "InstanceId": ns.get("InstanceId"), "RegionCode": ns.get("RegionCode"), "SecurityGroupSet": json.loads(ns.get("SecurityGroupSet")), } 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 ecs_modify_security_groups_priority(params_kw) return ret