Ethernet
Configures the admin-status, port-speed, duplex, and clock mode of an Ethernet interface. Also, retrieves the operational and admin status, ifindex, total traffic, unicast, broadcast, multicast, and total discard packet details for the ingress and egress interfaces. The URI to configure data for Ethernet interface is:
/interfaces/interface/ethernet
Supported HTTP Operations
URL: https://<host>/restconf/data/openconfig-interfaces:interfaces/interface/ethernet 1%2F1%2F1
Request body: None
Response body: {
"openconfig-interfaces:interface": [
{
"name": "ethernet 1/1/1",
"config": {
"name": "ethernet 1/1/1",
"type": "iana-if-type:ethernetCsmacd",
"description": "",
"enabled": true
},
"state": {
"name": "ethernet 1/1/1",
"type": "iana-if-type:ethernetCsmacd",
"description": "",
"enabled": true,
"ifindex": 1,
"admin-status": "UP",
"oper-status": "DOWN",
"counters": {
"in-octets": "0",
"in-pkts": "0",
"in-unicast-pkts": "0",
"in-broadcast-pkts": "0",
"in-multicast-pkts": "0",
"in-discards": "0",
"in-errors": "0",
"in-unknown-protos": "0",
"in-fcs-errors": "0",
"out-octets": "0",
"out-pkts": "0",
"out-unicast-pkts": "0",
"out-broadcast-pkts": "0",
"out-multicast-pkts": "0",
"out-discards": "0",
"out-errors": "0"
}
},
"openconfig-if-ethernet:ethernet": {
"config": {
"auto-negotiate": true,
"duplex-mode": "FULL",
"icx-openconfig-if-ethernet-aug:ethernet-clock": "none"
},
"state": {
"auto-negotiate": true,
"duplex-mode": "FULL",
"negotiated-duplex-mode": "FULL",
"negotiated-port-speed": "openconfig-if-ethernet:SPEED_UNKNOWN",
"icx-openconfig-if-ethernet-aug:negotiated-clock": "none"
},
"openconfig-vlan:switched-vlan": {
"state": {}
},
"openconfig-if-poe:poe": {
"config": {
"enabled": true
}
}
}
}
]
}
PUT or PATCH method to set the speed to duplex mode:
URL: https://<host>/restconf/data/openconfig-interfaces:interfaces/interface/ ethernet1%2F1%2F8/ethernet/config
Request body:For setting the speed, duplex mode and auto-negotiation of ethernet interface.
{
"config": {
"auto-negotiate": false,
"duplex-mode": "FULL",
"port-speed": "openconfig-if-ethernet:SPEED_100MB"
}
}
Response body: None
PUT or PATCH method to set the admin status of the port:
URL: https://<host>/restconf/data/openconfig-interfaces:interfaces/interface/ethernet 1%2F1%2F8/config
Request Body:For setting the admin-status of the ethernet port:
{
"config": {
"enabled":false
}
}
Response Body: None
URL: https://<host>/restconf/data/openconfig-interfaces:interfaces/interface/ethernet 3%2F1%2F2/ethernet
Request body: {
"config": {
"auto-negotiate": false,
"duplex-mode": FULL,
"port-speed": "openconfig-if-ethernet:SPEED_1GB"
}
}
Response body: None