VLANs
更新时间: 2026/06/26
在Gitcode上查看源码ResourceDefinition
uris
/redfish/v1/Systems/system_id/EthernetInterfaces/ethernetinterface_id/VLANs/vlan_id
properties
| 名称 | 类型 | 是否只读 | 取值范围/枚举值 | 说明 |
|---|---|---|---|---|
| @odata.context | string | true | - | 指定VLAN资源的资源模型OData描述信息 |
| @odata.id | string | true | - | 指定VLAN资源的资源访问路径 |
| @odata.type | string | true | - | 指定VLAN资源的资源类型 |
| Id | string | true | - | 指定VLAN资源的资源ID |
| Name | string | true | - | 指定VLAN资源的资源名称 |
| VLANEnable | boolean | false | - | VLAN使能 |
| VLANId | number | true | - | VLAN标识符 |
| PriorityEnabled | boolean | true | - | VLAN优先级使能 |
| Address | string | true | - | IPv4地址 |
| SubnetMask | string | false | - | 子网掩码 |
| Gateway | string | false | - | 网关 |
| AddressOrigin | string | true | - | 地址来源 ● Static ● DHCP |
| Address | string | true | - | IPv6地址 |
| PrefixLength | number | true | - | IPv6前缀长度 |
| AddressOrigin | string | true | - | 地址来源 ● Static ● DHCPv6 ● LinkLocal ● SLAAC |
| AddressState | string | true | - | 地址状态 ● Preferred ● Deprecated ● Tentative ● Failed |
| IsOnBoot | boolean | false | - | 开机是否自动启用网络连接 |
supported_methods
- GET
- POST
HTTP methods
GET
命令功能
查询 VLAN 资源信息
命令格式
URL: https://device_ip/redfish/v1/Systems/system_id/EthernetInterfaces/ethernetinterface_id/VLANs/vlan_id
请求头:
X-Auth-Token: 123456789***********************请求消息体: 无
参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| device_ip | 登录设备的IP地址 | IPv4或IPv6地址 |
| system_id | 系统资源的ID | 参见源文件参数说明 |
| auth_value | 请求消息的鉴权参数 | 可通过/redfish/v1/SessionService/Sessions创建会话时获得 |
使用指南
无
使用实例
请求样例:
http
GET https://device_ip/redfish/v1/Systems/system_id/EthernetInterfaces/ethernetinterface_id/VLANs/vlan_idX-Auth-Token: 123456789***********************
请求消息体:无
响应样例:
json
{
"@odata.context": "/redfish/v1/$metadata#Systems/Members/1/EthernetInterfaces/Members/mainboardNIC1Port1/VLANs/Members/$entity",
"@odata.id": "/redfish/v1/Systems/1/EthernetInterfaces/mainboardNIC1Port1/VLANs/20",
"@odata.type": "#VLanNetworkInterface.v1_0_2.VLanNetworkInterface",
"Id": "20",
"Name": "VLAN Network Interface",
"VLANEnable": false,
"VLANId": 20,
"Oem": {
"Public": {
"PriorityEnabled": false,
"IPv4Addresses": [
{
"Address": "192.168.2.100",
"SubnetMask": "255.255.255.0",
"Gateway": null,
"AddressOrigin": "Static"
}
],
"IPv6Addresses": [
{
"Address": "fe80::22f1:7cff:fec4:fc4b",
"PrefixLength": 64,
"AddressOrigin": "LinkLocal",
"AddressState": "Preferred"
}
],
"IsOnBoot": true
}
}
}响应码:200
POST (ACTION)
Configure
命令功能
配置 VLAN
命令格式
URL: https://device_ip/redfish/v1/Systems/system_id/EthernetInterfaces/ethernetinterface_id/VLANs/vlan_id/Actions/Oem/Public/VLanNetworkInterface.Configure
请求头:
X-Auth-Token: 123456789***********************
Content-Type: header_type请求消息体:
json
{
"VLANEnable": vlan_enable,
"IPv4Addresses": [
ipv4_value
],
"IsOnBoot": boot_value
}请求头参数说明
参见 请求头参数说明
请求体参数说明
| 参数 | 参数说明 | 取值 |
|---|---|---|
| system_id | 系统资源的ID | ● 针对机架服务器,取值 为1 ● 针对高密服务器,取值 为BladeN(N表示节点 槽位号),例如 “Blade1” ● 针对刀片服务器,取值 可以为BladeN(N表示 计算节点槽位号)或 SwiN(N表示交换模块 槽位号),例如 “Swi1” ● 针对X6800 V5,X6000 V5,G5500,XA320 V2服务器,取值还可以 为Enc,表示计算节点 所在的机框资源 ● 针对设备U位信息,取 值可以为UN(N表示设 备U位号),例如"U1" ● 针对机柜资源,取值为 Rack |
| ethernetinterface_id | 网口资源的ID | ● 对于BMC管理的物理网 口为Location +DeviceName+Port+ silknum(丝印号) ● 其他的为OS侧显示的 网口名 |
| vlan_id | VLAN资源的ID | 合法的VLAN ID值 |
| vlan_enable | VLAN使能,可选参数 | 布尔类型 |
| ipv4_value | IPv4地址信息,可选参数 格式为: { "Address":"Address", "SubnetMask":"SubnetM ask", "AddressOrigin":"Address Origin", "Gateway":"Gateway" } | ● Address:IPv4地址 ● SubnetMask:IPv4地 址的子网掩码 ● AddressOrigin:IPv4 地址获取模式,可设置 为“Static”或 “DHCP” ● Gateway:IPv4网关地 址 |
| boot_value | 是否开机激活网口取值, 可选参数 | 布尔类型 |
使用指南
仅支持Atlas系列产品,且需配合iBMA使用,iBMA版本号需大于或等于1.50.831。X86系统是EulerOS且内核版本是3.10.0-327或3.10.0-514。
使用实例
请求样例:
http
POST https://device_ip/redfish/v1/Systems/1/EthernetInterfaces/mainboardNIC1Port1/VLANs/20/
Actions/Oem/Public/VLanNetworkInterface.ConfigureX-Auth-Token: 123456789*********************** Content-Type: header_type
请求消息体:
json
{
"VLANEnable": true,
"IPv4Addresses": [
{
"Address": "10.10.10.1",
"SubnetMask": "255.255.0.0",
"Gateway": "10.10.10.2",
"AddressOrigin": "Static"
}
],
"IsOnBoot": true
}响应样例:
json
{
"@odata.context": "/redfish/v1/$metadata#TaskService/Tasks/Members/$entity",
"@odata.type": "#Task.v1_0_2.Task",
"@odata.id": "/redfish/v1/TaskService/Tasks/1",
"Id": "1",
"Name": "Set mainboardNIC1Port1 VLAN 10 information",
"Description": "",
"TaskState": "Running",
"TaskStatus": "OK",
"StartTime": "2018-05-23T01:53:51+00:00",
"Messages": [],
"PercentComplete": null,
"Oem": {
"Public": {
"TaskPercentage": null
}
}
}响应码:202