本文介绍如何查询指定IPsec连接。
# Example Code generated by Beijing Volcanoengine Technology. from __future__ import print_function import volcenginesdkcore import volcenginesdkvpn from pprint import pprint from volcenginesdkcore.rest import ApiException if __name__ == '__main__': configuration = volcenginesdkcore.Configuration() # 设置您的AK信息。 configuration.ak = "AK" # 设置您的SK信息。 configuration.sk = "SK" # 设置您要访问的地域。 configuration.region = "cn-beijing" # 设置默认配置 volcenginesdkcore.Configuration.set_default(configuration) # 使用全局默认配置 api_instance = volcenginesdkvpn.VPNApi() # 配置待查询IPsec连接的参数。 describe_vpn_connection_attributes_request = volcenginesdkvpn.DescribeVpnConnectionAttributesRequest( vpn_connection_id="vgc-2bzvqi8kerd342dx0eg2f****", # 待查询IPsec连接的ID。 ) # 发起请求并处理返回或异常。 try: resp = api_instance.describe_vpn_connection_attributes(describe_vpn_connection_attributes_request) pprint(resp) except ApiException as e: print("Exception when calling api: %s\n" % e)