虚拟私有云 VPC-创建子网:请求示例

时间:2024-03-28 19:27:35

请求示例

  • 创建一个子网,所在vpc的id为3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85,命名为subent,设置cidr为192.168.20.0/24,网关IP为192.168.20.1。
    POST https://{Endpoint}/v1/{project_id}/subnets
    
    {
        "subnet": {
            "name": "subnet",
            "description": "",
            "cidr": "192.168.20.0/24",
            "gateway_ip": "192.168.20.1",
            "ipv6_enable": true,
            "dhcp_enable": true,
            "primary_dns": "114.xx.xx.114",
            "secondary_dns": "114.xx.xx.115",
            "dnsList": [
                "114.xx.xx.114",
                "114.xx.xx.115"
            ],
            "availability_zone": "aa-bb-cc",
            "vpc_id": "3ec3b33f-ac1c-4630-ad1c-7dba1ed79d85",
            "extra_dhcp_opts": [
                {
                    "opt_value": "10.100.0.33,10.100.0.34",
                    "opt_name": "ntp"
                },
                {
                    "opt_value": "24h",
                    "opt_name": "addresstime"
                }
            ]
        }
    }
support.huaweicloud.com/api-vpc/vpc_subnet01_0001.html