You need to enable JavaScript to run this app.
导航

辅助网卡从ECS卸载

最近更新时间2023.06.09 11:20:33

首次发布时间2023.06.09 11:20:33

本文介绍如何将辅助网卡从云服务器卸载。

示例代码

# Example Code generated by Beijing Volcanoengine Technology.
from __future__ import print_function
import volcenginesdkcore
import volcenginesdkvpc
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 = volcenginesdkvpc.VPCApi()

    # 将辅助网卡从云服务器卸载
    detach_network_interface_request = volcenginesdkvpc.DetachNetworkInterfaceRequest(
        instance_id="i-wijfn35c****",               # 云服务器的ID
        network_interface_id="eni-bp1fgn8xyz9****", # 辅助网卡的ID
    )

		# 发起请求并处理返回或异常
    try:
        resp = api_instance.detach_network_interface(detach_network_interface_request)
        pprint(resp)
    except ApiException as e:
        print("Exception when calling api: %s\n" % e)

相关文档