EthernetInterfaces
更新时间: 2026/06/26
在Gitcode上查看源码

ResourceDefinition

uris

  • /redfish/v1/Systems/system_id/EthernetInterfaces/ethernetinterface_id

properties

名称类型是否只读取值范围/枚举值说明
@odata.contextstringtrue-指定网口资源模型的OData描述信息
@odata.idstringtrue-指定网口资源节点的访问路径
@odata.typestringtrue-指定网口资源类型
Idstringtrue-指定网口资源的唯一标识
Namestringtrue-指定网口资源的名称
PermanentMACAddressstringtrue-网口的永久MAC地址
MACAddressstringtrue-网口的当前MAC地址 (未安装IBMA2.0时,默认与永久地址一致)
LinkStatusstringfalse-网口的逻辑连接状态
● LinkUp
● NoLink
● LinkDown
EthernetInterfaceTypestringtrue-接口类型
Portsarraytrue-提供此以太网接口的端口的链接
VLANEnablebooleantrue-指示此VLAN是否已启用用于此VLAN网络接口
VLANIdinttrue-此VLAN的ID
VLANPriorityinttrue-此VLAN的优先级
MTUSizeinttrue-接口当前配置的最大传输单元
SpeedMbpsnumbertrue-网口速率
AutoNegbooleantrue-指定网口是否自动协商
FullDuplexbooleantrue-指定网口是否全双工
Addressstringtrue-IPv4地址
SubnetMaskstringtrue-子网掩码
Gatewaystringtrue-网关
AddressOriginstringtrue-地址来源
● Static
● DHCP
Addressstringtrue-IPv6地址
PrefixLengthnumbertrue-IPv6前缀长度
AddressOriginstringtrue-地址来源
● Static
● DHCPv6
● LinkLocal
● SLAAC
AddressStatestringtrue-地址状态
● Preferred
● Deprecated
● Tentative
● Failed
Gatewayarraytrue-IPv6网关
IPv6DefaultGatewaystringtrue-IPv6默认网关
VLANsobjecttrue-VLANs资源节点的访问路径
InterfaceTypestringtrue-网口类型
● Physical
● Virtual
BandwidthUsagenumbertrue-带宽占用率 说明 已屏蔽该属性值频繁变化导致的事件上报
BDFstringtrue-BDF值
NetworkAdapterNamestringtrue-指定端口从属的网络适配器的名称
RelatedPortobjecttrue-关联的Chassis资源下的网口资源节点的访问路径
IsOnBootbooleanfalse-开机是否自动启用网络连接
AlignmentErrorsstringtrue-一个数据帧尾没有形成一个完整的Byte,即帧长非整数(不能被8bit整除),网管上计为接收 (发送)对齐错误
Up2cosarraytrue-DCB信息中的Up2cos
Pgidarraytrue-DCB信息中的Pgid
PGPCTarraytrue-DCB信息中的PGPCT
PgStrictarraytrue-DCB信息中的PgStrict
Pfcupnumbertrue-DCB信息中的Pfcup
TotalBytesReceivedstringtrue-接收总字节数 说明 已屏蔽该属性值频繁变化导致的事件上报
TotalBytesTransmittedstringtrue-发送总字节数 说明 已屏蔽该属性值频繁变化导致的事件上报
UnicastPacketsReceivedstringtrue-接收到的单播数据包总数 说明 已屏蔽该属性值频繁变化导致的事件上报
MulticastPacketsReceivedstringtrue-接收到的多播数据包总数 说明 已屏蔽该属性值频繁变化导致的事件上报
BroadcastPacketsReceivedstringtrue-接收到的广播数据包总数 说明 已屏蔽该属性值频繁变化导致的事件上报
UnicastPacketsTransmittedstringtrue-发送的单播数据包总数 说明 已屏蔽该属性值频繁变化导致的事件上报
MulticastPacketsTransmittedstringtrue-发送到的多播数据包总数 说明 已屏蔽该属性值频繁变化导致的事件上报
BroadcastPacketsTransmittedstringtrue-发送的广播数据包总数 说明 已屏蔽该属性值频繁变化导致的事件上报
FcsReceiveErrorsstringtrue-接收到的Frame Check Sequence错误数量
RuntPacketsReceivedstringtrue-接收到的超小帧数量
JabberPacketsReceivedstringtrue-接收到的巨型帧(大于1518字节)数量
SingleCollisionTransmitFramesstringtrue-发送的单碰撞帧数量
MultipleCollisionTransmitFramesstringtrue-发送的多碰撞帧数量
LateCollisionFramesstringtrue-发送的late碰撞帧数量
ExcessiveCollisionFramesstringtrue-发送的Excessive碰撞帧数量
SwitchNamestringtrue-交换机名称
SwitchConnectionIDstringtrue-交换机连接ID
SwitchConnectionPortIDstringtrue-交换机连接端口ID
SwitchPortVlanIDnumbertrue-交换机端口VLAN ID
EthernetInterface.Configureobjecttrue-配置指定主机以太网信息操作
targetstringtrue-配置操作的访问路径
Redfish.ActionInfostringtrue-操作信息查询路径

supported_methods

  • GET
  • POST

HTTP methods

GET

命令功能

查询指定主机以太网接口资源信息

命令格式

URL: https://device_ip/redfish/v1/Systems/system_id/EthernetInterfaces/ethernetinterface_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

X-Auth-Token: 123456789***********************

请求消息体:无

响应样例:

json
{
  "@odata.context": "/redfish/v1/$metadata#Systems/Members/1/EthernetInterfaces/Members/$entity",
  "@odata.id": "/redfish/v1/Systems/1/EthernetInterfaces/mainboardNIC1Port1",
  "@odata.type": "#EthernetInterface.v1_2_0.EthernetInterface",
  "Id": "mainboardNIC1Port1",
  "Name": "eth0",
  "PermanentMACAddress": null,
  "MACAddress": null,
  "LinkStatus": "LinkUp",
  "EthernetInterfaceType": "Physical",
  "Links": {
    "Ports": [
      {
        "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/chassisNIC1(SF221Q)/NetworkPorts/2"
      }
    ]
  },
  "VLAN": {
    "VLANEnable": false,
    "VLANId": 100,
    "VLANPriority": 0
  },
  "MTUSize": 1500,
  "SpeedMbps": 10000,
  "AutoNeg": false,
  "FullDuplex": false,
  "IPv4Addresses": [
    {
      "Address": "192.168.100.3",
      "SubnetMask": "255.255.0.0",
      "Gateway": "192.168.100.100",
      "AddressOrigin": "Static"
    }
  ],
  "IPv6Addresses": [
    {
      "Address": "fd00::2488",
      "PrefixLength": 64,
      "AddressOrigin": "Static",
      "AddressState": "Preferred",
      "Oem": {
        "Public": {
          "Gateway": [
            "fd00::1"
          ]
        }
      }
    },
    {
      "Address": "fe80::218:c0ff:fea8:6403",
      "PrefixLength": 64,
      "AddressOrigin": "LinkLocal",
      "AddressState": "Preferred",
      "Oem": {
        "Public": {
          "Gateway": []
        }
      }
    }
  ],
  "IPv6DefaultGateway": "fd00::2586",
  "VLANs": {
    "@odata.id": "/redfish/v1/Systems/1/EthernetInterfaces/mainboardNIC1Port1/VLANs"
  },
  "Oem": {
    "Public": {
      "InterfaceType": "Physical",
      "BandwidthUsage": 10,
      "BDF": "0000:02:00.0",
      "NetworkAdapterName": "SM380",
      "RelatedPort": {
        "@odata.id": "/redfish/v1/Chassis/1/NetworkAdapters/mainboardNIC1/NetworkPorts/1"
      },
      "IsOnBoot": true,
      "AlignmentErrors": "0",
      "Up2cos": [],
      "Pgid": [],
      "PGPCT": [],
      "PgStrict": [],
      "Pfcup": 0,
      "TotalBytesReceived": "0",
      "TotalBytesTransmitted": "0",
      "UnicastPacketsReceived": "0",
      "MulticastPacketsReceived": "0",
      "BroadcastPacketsReceived": "0",
      "UnicastPacketsTransmitted": "0",
      "MulticastPacketsTransmitted": "0",
      "BroadcastPacketsTransmitted": "0",
      "FcsReceiveErrors": "0",
      "RuntPacketsReceived": "0",
      "JabberPacketsReceived": "0",
      "SingleCollisionTransmitFrames": "0",
      "MultipleCollisionTransmitFrames": "0",
      "LateCollisionFrames": "0",
      "ExcessiveCollisionFrames": "0",
      "SwitchName": "0",
      "SwitchConnectionID": "0",
      "SwitchConnectionPortID": "0",
      "SwitchPortVlanID": "0"
    }
  },
  "Actions": {
    "Oem": {
      "Public": {
        "#EthernetInterface.Configure": {
          "target": "/redfish/v1/Systems/1/EthernetInterfaces/mainboardNIC1Port1/Actions/Oem/Public/EthernetInterface.Configure",
          "@Redfish.ActionInfo": "/redfish/v1/Systems/1/EthernetInterfaces/mainboardNIC1Port1/ConfigureActionInfo"
        }
      }
    }
  }
}

响应码:200

POST (ACTION)

Configure

命令功能

配置以太网

命令格式

URL: https://device_ip/redfish/v1/Systems/system_id/EthernetInterfaces/ethernetinterface_id/Actions/Oem/Public/EthernetInterface.Configure

请求头:


X-Auth-Token: 123456789***********************
Content-Type: header_type

请求消息体:

json
{
  "IPv4Addresses": [
    ipv4_value
  ],
  "LinkStatus": status_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侧显示的 网口名
ipv4_valueIPv4地址信息,可选参数 格式为: { "Address":"Address", "SubnetMask":"SubnetM ask", "AddressOrigin":"Address Origin", "Gateway":"Gateway" }● Address:IPv4地址
● SubnetMask:IPv4地 址的子网掩码
● AddressOrigin:IPv4 地址获取模式,可设置 为“Static”或 “DHCP”
● Gateway:IPv4网关地 址
status_valueLink状态取值,可选参数● LinkUp
● LinkDown
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/system_id/EthernetInterfaces/ethernetinterface_id/Actions/Oem/Public/EthernetInterface.Configure

X-Auth-Token: 123456789*********************** Content-Type: header_type

请求消息体:

json
{
  "IPv4Addresses": [
    ipv4_value
  ],
  "LinkStatus": status_value,
  "IsOnBoot": boot_value
}

响应样例:

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 IPv4",
  "Description": "",
  "TaskState": "Running",
  "TaskStatus": "OK",
  "StartTime": "2018-05-23T01:53:51+00:00",
  "Messages": [],
  "PercentComplete": null,
  "Oem": {
    "Public": {
      "TaskPercentage": null
    }
  }
}

响应码:202