Modifying Ethernet Interface Resource Information

Function

Configure an Ethernet interface. Only IPv4 addresses can be modified. A maximum of four IP addresses can be configured for the same network port.

Syntax

Operation type: PATCH

URL: https://device_ip/redfish/v1/Systems/EthernetInterfaces/<eth_Id>

Request header:

X-Auth-Token: auth_value
Content-Type: header_type

Request message body:

{
    "IPv4Addresses": [{
        "Address": Address,
        "SubnetMask": SubnetMask,
        "AddressOrigin": AddressOrigin,
        "VlanId": VlanId,
        "Gateway": Gateway,
        "Tag": Tag,
        "ConnectTest": ConnectTest,
        "RemoteTestIp": RemoteTestIp
    }]
}

URL Parameters

Table 1 URL parameters

Parameter

Mandatory/Optional

Parameter Description

Value

<eth_Id>

Mandatory

ID of a network port resource.

Network port name displayed on the OS. The value can be GMAC0 or GMAC1.

Request Parameters

Table 2 Request parameters

Parameter

Mandatory/Optional

Parameter Description

Value

IPv4Addresses

Mandatory

IPv4 address information.

List type. The value is a string of 1 to 4 characters and contains information about other fields in an IPv4 address.

Address

Mandatory

IPv4 address.

IPv4 address. The value is a string.

SubnetMask

Mandatory

Subnet mask of an IPv4 address.

Subnet mask of an IPv4 address. The value is a string.

AddressOrigin

Mandatory

Mode for obtaining an IPv4 address.

The value is a string and can be set to Static.

VlanId

Optional

Virtual local area network ID.

The value is null or a number ranging from 1 to 4094.

Gateway

Mandatory

IPv4 gateway address.

IPv4 gateway address. The value is a string or null.

Tag

Mandatory

IPv4 address usage flag.

The value is a string of a maximum of 32 characters and can contain uppercase letters, lowercase letters, digits, and underscores (_). It cannot be null.

ConnectTest

Optional

Whether to test the connectivity of the added or modified IP addresses and gateways.

Boolean value. The value can be true or false.

RemoteTestIp

Optional

Remote IP address for the connectivity test on the added or modified IP address.

IPv4 address. The value is a string. Note: The value of this parameter cannot be the same as that of the Address.

NOTE:

If you want to set ConnectTest and RemoteTestIp, you must set both of them. This parameter is valid only when ConnectTest is set to True. When an IP address is added on the web client, the connectivity test is required by default.

Usage Guidelines

None

Example

Request:

PATCH https://10.10.10.10/redfish/v1/Systems/EthernetInterfaces/GMAC0

Request header:

X-Auth-Token: auth_value 
Content-Type: application/json

Request message body:

{
    "IPv4Addresses":[{
        "Address":"xx.xx.xx.xx",
        "SubnetMask":"255.255.0.0",
        "AddressOrigin":"Static",
        "Gateway":"",
        "VlanId":null,
        "Tag":"net"
    },
    {
        "Address":"10.10.10.xx",
       "SubnetMask":"255.255.0.0",
       "Gateway":"10.10.10.xx",
       "VlanId":null,
       "Tag":"test",
       "ConnectTest":true,
       "RemoteTestIp":"xx.xx.xx.xx",
       "AddressOrigin":"Static"
    }]
}

Response:

{
    "@odata.context": "/redfish/v1/$metadata#Systems/Members/1/EthernetInterfaces/Members/$entity",
    "@odata.type": "#EthernetInterface.v1_8_0.EthernetInterface",
    "@odata.id": "/redfish/v1/Systems/1/EthernetInterfaces/GMAC0",
    "Id": "GMAC0",
    "Name": "eth0",
    "IPv4Addresses": [{
            "Address": "xx.xx.xx.xx",
            "SubnetMask": "255.255.0.0",
            "AddressOrigin": "Static",
            "Gateway": "xx.xx.xx.xx",
            "VlanId": null,
            "Tag": "net"
        },
        {
            "Address": "xx.xx.xx.xx",
            "SubnetMask": "255.255.0.0",
            "AddressOrigin": "Static",
            "Gateway": "xx.xx.xx.xx",
            "VlanId": null,
            "Tag": "test"
        }],
    "Oem": {
        "StartTime": "2020-11-12T20:17:03+0000",
        "TaskState": "Running",
        "TaskPercentage": "ok"
    }
}

Response code: 202

Output Description

Table 3 Operation output description

Field

Type

Description

@odata.context

Character string

OData description of an Ethernet task resource model.

@odata.id

Character string

Path to access the resource.

NOTE:

You can access the resource to obtain the details of the task.

@odata.type

Character string

Type of an Ethernet task resource.

Id

Character string

ID of an Ethernet task resource.

Name

Character string

Name of an Ethernet task resource.

IPv4Addresses

Object

IPv4 address table of an Ethernet task.

Address

Character string

IPv4 address of an Ethernet task.

SubnetMask

Character string

Subnet mask of an Ethernet task.

AddressOrigin

Character string

Address source of an Ethernet task.
  • Static
  • DHCP

Gateway

Character string

Gateway of an Ethernet task.

VlanId

Character string

VLAN ID of an Ethernet task.

Tag

Character string

IP address usage label of an Ethernet task.

Oem

Object

Customized field.

StartTime

Character string

Start time of an Ethernet task.

TaskState

Character string.

Status of an Ethernet task resource:

  • New
  • Starting
  • Running
  • Suspended
  • Interrupted
  • Pending
  • Stopping
  • Completed
  • Killed
  • Exception
  • Service

TaskPercentage

Character string

Progress of an Ethernet task.