kboss/b/capital/describe_virtual_gateway.dspy
2025-07-16 14:27:17 +08:00

30 lines
1.1 KiB
Plaintext

async def describe_virtual_gateway(ns={}):
import aiohttp
NETWORK_URL = 'http://cdsapi.capitalonline.net/vpc'
action = 'DescribeVirtualGateWay'
method = "POST"
param = {}
url = get_signature(action, method, NETWORK_URL, param=param)
body = {
"RegionCode": ns.get('RegionCode'),
"Keyword": ns.get('Keyword'),
"PageNumber": ns.get('PageNumber'),
"VPCId": ns.get('VPCId'),
"AvailableZoneCode": ns.get('AvailableZoneCode')
}
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 describe_virtual_gateway(params_kw)
return ret