GET /api/subnets
子网列表

GET /api/domains/:domain_id/subnets
域的子网列表

GET /api/locations/:location_id/subnets
每个位置的子网列表

GET /api/organizations/:organization_id/subnets
每个机构的子网列表

参数

参数名字 描述
domain_id
选填

域 ID

Validations:

  • Must be a String

location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

search
选填

过滤结果

Validations:

  • Must be a String

order
选填

排序项和顺序,例如 ‘id DESC’

Validations:

  • Must be a String

page
选填

页号,从 1 开始

Validations:

  • Must be a number.

per_page
选填

每页中显示的返回结果数

Validations:

  • Must be a number.

搜索字段

字段名 类型 可能的值
boot_mode
dns_primary
dns_secondary
domain
gateway
ipam
location
location_id
mask
mtu
name
network
nic_delay
organization
organization_id
params
type
vlanid

GET /api/subnets/:id
显示子网

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

show_hidden_parameters
选填

显示隐藏的参数值

Validations:

  • Must be one of: true, false, 1, 0.


POST /api/subnets
创建子网

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

subnet
必填

Validations:

  • Must be a Hash

subnet[name]
必填

子网名

Validations:

  • Must be a String

subnet[description]
选填 , 允许空值

子网描述

Validations:

  • Must be a String

subnet[network_type]
选填 , 允许空值

类型或协议,值为 IPv4 或 IPv6,默认为 IPv4

Validations:

  • Must be one of: IPv4, IPv6.

subnet[network]
必填

子网网络

Validations:

  • Must be a String

subnet[cidr]
选填 , 允许空值

Network prefix in CIDR notation

Validations:

  • Must be a String

subnet[mask]
选填 , 允许空值

子网掩码

Validations:

  • Must be a String

subnet[gateway]
选填 , 允许空值

子网网关

Validations:

  • Must be a String

subnet[dns_primary]
选填 , 允许空值

这个子网的主 DNS

Validations:

  • Must be a String

subnet[dns_secondary]
选填 , 允许空值

这个子网的辅 DNS

Validations:

  • Must be a String

subnet[ipam]
选填 , 允许空值

IP Address auto suggestion mode for this subnet.

Validations:

  • Must be one of: DHCP, Internal DB, Random DB, EUI-64, External IPAM, None.

subnet[from]
选填 , 允许空值

IP 自动提示的起始 IP 地址

Validations:

  • Must be a String

subnet[to]
选填 , 允许空值

为 IP 自动提示功能提供 IP 地址结尾

Validations:

  • Must be a String

subnet[vlanid]
选填 , 允许空值

这个子网的 VLAN ID

Validations:

  • Must be a String

subnet[mtu]
选填 , 允许空值

这个子网的 MTU

Validations:

  • Must be a Integer

subnet[domain_ids]
选填 , 允许空值

该部分子网的域名

Validations:

  • Must be an array of any type

subnet[dhcp_id]
选填 , 允许空值

要在此子网中使用的 DHCP 代理 ID

Validations:

  • Must be a number.

subnet[tftp_id]
选填 , 允许空值

要在此子网中使用的 TFTP 代理 ID

Validations:

  • Must be a number.

subnet[httpboot_id]
选填 , 允许空值

要在此子网中使用的 HTTPBoot 代理 ID

Validations:

  • Must be a number.

subnet[externalipam_id]
选填 , 允许空值

External IPAM Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[dns_id]
选填 , 允许空值

要在此子网中使用的 DNS 代理 ID

Validations:

  • Must be a number.

subnet[template_id]
选填 , 允许空值

要在此子网中使用的模板 HTTP 代理服务器 ID

Validations:

  • Must be a number.

subnet[boot_mode]
选填 , 允许空值

Default boot mode for interfaces assigned to this subnet.

Validations:

  • Must be one of: Static, DHCP.

subnet[subnet_parameters_attributes]
选填 , 允许空值

参数阵列(name,value)

Validations:

  • Must be an array of any type

subnet[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

subnet[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type


PUT /api/subnets/:id
更新子网

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

id
必填

子网数字识别符

Validations:

  • Must be a number.

subnet
必填

Validations:

  • Must be a Hash

subnet[name]
选填

子网名

Validations:

  • Must be a String

subnet[description]
选填 , 允许空值

子网描述

Validations:

  • Must be a String

subnet[network_type]
选填 , 允许空值

类型或协议,值为 IPv4 或 IPv6,默认为 IPv4

Validations:

  • Must be one of: IPv4, IPv6.

subnet[network]
选填

子网网络

Validations:

  • Must be a String

subnet[cidr]
选填 , 允许空值

Network prefix in CIDR notation

Validations:

  • Must be a String

subnet[mask]
选填 , 允许空值

子网掩码

Validations:

  • Must be a String

subnet[gateway]
选填 , 允许空值

子网网关

Validations:

  • Must be a String

subnet[dns_primary]
选填 , 允许空值

这个子网的主 DNS

Validations:

  • Must be a String

subnet[dns_secondary]
选填 , 允许空值

这个子网的辅 DNS

Validations:

  • Must be a String

subnet[ipam]
选填 , 允许空值

IP Address auto suggestion mode for this subnet.

Validations:

  • Must be one of: DHCP, Internal DB, Random DB, EUI-64, External IPAM, None.

subnet[from]
选填 , 允许空值

IP 自动提示的起始 IP 地址

Validations:

  • Must be a String

subnet[to]
选填 , 允许空值

为 IP 自动提示功能提供 IP 地址结尾

Validations:

  • Must be a String

subnet[vlanid]
选填 , 允许空值

这个子网的 VLAN ID

Validations:

  • Must be a String

subnet[mtu]
选填 , 允许空值

这个子网的 MTU

Validations:

  • Must be a Integer

subnet[domain_ids]
选填 , 允许空值

该部分子网的域名

Validations:

  • Must be an array of any type

subnet[dhcp_id]
选填 , 允许空值

要在此子网中使用的 DHCP 代理 ID

Validations:

  • Must be a number.

subnet[tftp_id]
选填 , 允许空值

要在此子网中使用的 TFTP 代理 ID

Validations:

  • Must be a number.

subnet[httpboot_id]
选填 , 允许空值

要在此子网中使用的 HTTPBoot 代理 ID

Validations:

  • Must be a number.

subnet[externalipam_id]
选填 , 允许空值

External IPAM Proxy ID to use within this subnet

Validations:

  • Must be a number.

subnet[dns_id]
选填 , 允许空值

要在此子网中使用的 DNS 代理 ID

Validations:

  • Must be a number.

subnet[template_id]
选填 , 允许空值

要在此子网中使用的模板 HTTP 代理服务器 ID

Validations:

  • Must be a number.

subnet[boot_mode]
选填 , 允许空值

Default boot mode for interfaces assigned to this subnet.

Validations:

  • Must be one of: Static, DHCP.

subnet[subnet_parameters_attributes]
选填 , 允许空值

参数阵列(name,value)

Validations:

  • Must be an array of any type

subnet[location_ids]
选填 , 允许空值

使用给定 id 替换位置

Validations:

  • Must be an array of any type

subnet[organization_ids]
选填 , 允许空值

使用给定 id 替换机构

Validations:

  • Must be an array of any type


DELETE /api/subnets/:id
删除子网

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

id
必填

子网数字识别符

Validations:

  • Must be a number.


GET /api/subnets/:id/freeip
提供此子网中未用的 IP 地址

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

id
必填

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

mac
选填

用于重复使用此主机 IP 的 MAC 地址

Validations:

  • Must be a String

excluded_ips
选填

应从建议中排除的 IP 地址

Validations:

  • Must be an array of any type