NetworkSubnetCreate【基于交换机新建子网】¶
基于交换机新建子网:可以指定交换机ID,创建交换机下的子网。如果不指定必要创建条件,则会返回错误信息。
Request Parameters
Parameter name | Type | Description | Required |
---|---|---|---|
action | String | API 标识符 | Yes |
network_id | String | 交换机ID | Yes |
subnet_id | String | 要创建的子网ID | No |
subnet_name | String | 子网名称 | Yes |
cidr | String | 子网网段 | Yes |
ip_version | Integer | IP协议版本,(默认值:4) | Yes |
gateway_ip | String | 网关 IP(和no_gateway配合使用,默认值:空) | Yes |
enable_dhcp | Integer | 是否使用 DHCP 获取 IP(默认值:1) | Yes |
allocation_pools | String | IP 地指池分配 | No |
host_routers | String | 主机路由 | No |
dns_nameservers | String | DNS 服务器 | Yes |
is_create | Integer | 是否新建(默认值:1) | Yes |
ip_1 | String | IPV4 地址左起第一个数值 | Yes |
ip_2 | String | IPV4 地址左起第二个数值 | Yes |
ip_3 | String | IPV4 地址左起第三个数值 | Yes |
ip_5 | String | 子网掩码位数 | Yes |
Response Elements
Name | Type | Description |
---|---|---|
message | String | 执行结果信息 |
code | Integer | HTTP Resonpe响应状态码 |
Example
Example Request:
Request Headers:
POST /api/ HTTP/1.1
Origin: https://console.plcloud.com
X-CSRFToken: 6An6xEuOJqW6dVDtlgzZr6FqgkSbJmqp
Content-Type: application/json
JSON Data:
{
"action": "NetworkSubnetCreate",
"network_id": "34207f38-23c3-4715-a3b1-2727ebffed96",
"subnet_id": "",
"subnet_name": "subnet",
"cidr": "10.8.8.0/24",
"ip_version": 4,
"no_gateway": 0,
"gateway_ip": "",
"enable_dhcp": 1,
"allocation_pools": "",
"host_routers": "",
"dns_nameservers": "114.114.114.114",
"is_create": 1,
"ip_1": "10",
"ip_2": "8",
"ip_3": "8",
"ip_5": "24"
}
Example Response:
{
"message": "成功",
"code": 200
}