弹性云服务器 ECS-更新云服务器指定网卡属性:请求示例

时间:2024-06-20 09:17:12

请求示例

  • 更新云服务器网卡,并指定IPv4地址。
    POST  https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/os-interface/{port_id}/change-network-interface
    
    {
        "subnet_id": "7bf939cc-167f-49d5-a933-9cca504210ab",
        "ip_address":"192.168.1.159"
    }
  • 更新云服务器网卡,随机分配IPv4地址。
    POST  https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/os-interface/{port_id}/change-network-interface
    
    {
        "subnet_id": "7bf939cc-167f-49d5-a933-9cca504210ab",
        "ip_address":""
    }
  • 更新云服务器网卡,并指定IPv6地址。
    POST  https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/os-interface/{port_id}/change-network-interface
    
    {
        "subnet_id": "7bf939cc-167f-49d5-a933-9cca504210ab",
        "ipv6_address":"2001:db8:a583:578:2840:2d9f:27d4:2713"
    }
  • 更新云服务器网卡,随机分配IPv6地址。
    POST  https://{endpoint}/v1/{project_id}/cloudservers/{server_id}/os-interface/{port_id}/change-network-interface
    
    {
        "subnet_id": "7bf939cc-167f-49d5-a933-9cca504210ab",
        "ipv6_address":""
    }
support.huaweicloud.com/api-ecs/zh-cn_topic_0000001239079777.html