</port>
<port>
<portid>3</portid>
<name>Data2</name>
<ipver>IPv4</ipver>
<ipv4addr>192.168.1.3</ipv4addr>
<ipv4mask>24</ipv4mask>
<ipv4defgw>192.168.1.254</ipv4defgw>
<phymode>Auto</phymode>
</port>
</eth>
</devicectl>
Show a single port information in XML format:
curl -k -H "X-SESSION-ID: $token" "https://192.168.0.1/ws/v2/device_ctl/eth/port?portid=1"
Expected output (values are for example purposes only):
<?xml version="1.0" encoding="ISO-8859-1" ?>
<devicectl>
<eth>
<port>
<portid>1</portid>
<name>Management</name>
<ipver>IPv4</ipver>
<ipv4addr>192.168.0.1</ipv4addr>
<ipv4mask>24</ipv4mask>
<ipv4defgw>192.168.0.254</ipv4defgw>
<phymode>Auto</phymode>
</port>
</eth>
</devicectl>
Show a single port item in JSON format:
curl -k -H "X-SESSION-ID: $token"
"https://192.168.0.1/ws/v2/device_ctl/eth/port?portid=2&ipv4addr&js=1"
Expected output (values are for example purposes only):
{
"devicectl": {
"eth": {
"port": {
"portid": "2",
"ipv4addr": "192.168.1.2"
}
}
}
}
POST Method Examples:
Configure physical Ethernet Port. When the Management Port IP is changed the connection will be immediately
lost and user have to re-login the system, this will also result in the token not being returned. In order to avoid
mixing the command with other commands together, IP control port configurations is only supported from
HTTP POST body.
Management port:
curl -k -X POST -H "X-SESSION-ID: $token"
"https://192.168.0.1/ws/v2/device_ctl/eth/port?portid=1&ipv4addr=192.168.0.0&js=1"
If successful, the following is an example of the return body:
"response": {
"code": "10",
"result": "success",
"message": ""
}
Data Port:
curl -k -X POST -H "X-SESSION-ID: $token"
"https://192.168.0.1/ws/v2/device_ctl/eth/port?portid=2&ipv4addr=192.131.244.7&js=1"
Cisco D9800 Network Transport Receiver Version 2.75 RESTful Web Services API Reference Guide
268
API Definitions
Ethernet Device Control Command