Published On: August 6ᵗʰ, 2019 02:11

API Reference for Cisco Enterprise Network Function Virtualization Infrastructure Software

Action

Method

Payload Required

API

To show information about all ports including port channels

GET

No

/api/operational/pnics

/api/operational/pnics?deep

To create a port channel

POST

Yes

/api/config/pnics

To add a port to a port channel

PUT

Yes

/api/config/pnics/pnic/name /member_of

To add a port channel to a new bridge

POST

Yes

/api/config/bridges/

To add a port channel to an existing bridge

PUT

Yes

/api/config/bridges/bridge/bridgename

To configure the LACP mode of a port channel

PUT

Yes

/api/config/pnics/pnic/portchannel_name /lacp_type

To configure the bond mode of a port channel

PUT

Yes

/api/config/pnics/pnic/portchannel_name /bond_mode

To configure trunks on a port channel

PUT

Yes

/api/config/pnics/pnic/portchannelname /trunks

To remove a port from a port channel

DELETE

Yes

/api/config/pnics/pnic/portname /member_of

To remove a port channel from a bridge

PUT

Yes

/api/config/bridges/bridge/bridgename

To delete a port channel

Note 
Before deleting a port channel, you must remove all members assigned to the port channel. If the port channel is configured on the bridge, you must remove the port channel from the bridge.

DELETE

No

/api/config/pnics/pnic/portchannelname

To enable or disable LLDP

PUT

Yes

/api/config/pnics/pnic/portname /lldp

To show LLDP neighbors and stats

GET

No

/api/operational/lldp

/api/operational/lldp?deep

To configure the port admin status

PUT

Yes

/api/config/pnics/pnic/portname /adminstatus

To get information about the admin status of a port

GET

No

/api/config/pnics/pnic/portname /adminstatus

Table 1. Ports and Port Channels APIs Payload Description

Property

Type

Description

Mandatory

Example

pnic name

String

Name of the port or port channel.

Yes

<pnic><name>pc</name>
<type>port_channel</type></pnic>

type

String

Type of the port. Valid values are ethernet and port_channel . To create a port channel, you must specify the value as port_channel .

Yes

lacp_type

String

The LACP type for a port channel. Valid values are off , active , and passive . Default is off .

No

<lacp_type>active</lacp_type>

bond_mode

String

The bond mode for a port channel. Valid values are active-backup , balance-slb , and balance-tcp . Default is balance-tcp

No

<bond_mode>balance-tcp</bond_mode>

trunks

Integer

VLAN IDs. Valid range is from 1 to 4096. Default is VLAN 1. Enter VLANs separated by commas, VLAN ranges separated by dashes, or a combination of both.

No

<trunks>10,20</trunks>

member_of

String

The name of the port channel to which you want to add a port or from which you want to remove a port.

Yes

<member_of>pc</member_of>

port name

String

The name of the port channel that you want to add to the bridge or remove from the bridge.

Yes

<port><name>pc</name></port>

bridge name

String

The name of the bridge from which you want to remove the port channel or to which you want to add the port channel.

Yes

<bridge><name>test-br</name></bridge>

lldp

String

Enables or disables LLDP on a port. Valid values are enable and disable . Default is disable .

No

<lldp>enabled</lldp>

adminstatus

String

Shuts down or brings up a port administratively. Valid values are up and down .

No

<adminstatus>up</adminstatus>

Example: GET Port and Port Channel Information API

curl -v -k -u admin:Admin#123 -X GET https://198.51.100.11/api/operational/pnics
* About to connect() to 198.51.100.11 port 443 (#0)
*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
*       subject: CN=nfvis
*       start date: Dec 05 15:26:32 2017 GMT
*       expire date: Dec 03 15:26:32 2027 GMT
*       common name: nfvis
*       issuer: CN=nfvis
* Server auth using Basic with user 'admin'
> GET /api/operational/pnics HTTP/1.1
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.29.0
> Host: 198.51.100.11
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 06 Dec 2017 17:45:17 GMT
< Content-Type: application/vnd.yang.data+xml
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Pragma: no-cache
< 

<pnics xmlns="http://www.cisco.com/nfvis/pnic" xmlns:y="http://tail-f.com/ns/rest"  xmlns:pnic="http://www.cisco.com/nfvis/pnic">
  <pnic>
    <name>eth0</name>
  </pnic>
  <pnic>
    <name>eth1</name>
  </pnic>
  <pnic>
    <name>eth2</name>
  </pnic>
  <pnic>
    <name>eth3</name>
  </pnic>
  <pnic>
    <name>eth4</name>
  </pnic>
  <pnic>
    <name>eth5</name>
  </pnic>
</pnics>
* Connection #0 to host 198.51.100.11 left intact


curl -v -k -u admin:Admin#123 -X GET https://198.51.100.11/api/operational/pnics?deep
* About to connect() to 198.51.100.11 port 443 (#0)
*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
*       subject: CN=nfvis
*       start date: Dec 05 15:26:32 2017 GMT
*       expire date: Dec 03 15:26:32 2027 GMT
*       common name: nfvis
*       issuer: CN=nfvis
* Server auth using Basic with user 'admin'
> GET /api/operational/pnics?deep HTTP/1.1
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.29.0
> Host: 198.51.100.11
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 06 Dec 2017 17:47:14 GMT
< Content-Type: application/vnd.yang.data+xml
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Pragma: no-cache
< 

<pnics xmlns="http://www.cisco.com/nfvis/pnic" xmlns:y="http://tail-f.com/ns/rest"  xmlns:pnic="http://www.cisco.com/nfvis/pnic">
  <pnic>
    <name>eth0</name>
    <speed>1G</speed>
    <operational-speed>1000</operational-speed>
    <link_state>up</link_state>
    <mac_address>58:ac:78:59:ca:66</mac_address>
    <mtu>9216</mtu>
    <refcnt>0</refcnt>
    <stats>
    <receive>
      <bytes>62837229</bytes>
      <packets>496647</packets>
      <errors>0</errors>
      <dropped>0</dropped>
      <broadcast>60009</broadcast>
      <multicast>408172</multicast>
    </receive>
    <transmit>
      <bytes>517791</bytes>
      <packets>1565</packets>
      <errors>0</errors>
      <dropped>0</dropped>
      <broadcast>1462</broadcast>
      <multicast>12</multicast>
    </transmit>
  </stats>
</pnic>
<pnic>
  <name>eth1</name>
  <speed>1G</speed>
  <operational-speed>0</operational-speed>
  <link_state>down</link_state>
  <mac_address>58:ac:78:59:ca:67</mac_address>
  <mtu>9216</mtu>
  <refcnt>1</refcnt>
  <stats>
  <receive>
    <bytes>0</bytes>
    <packets>0</packets>
    <errors>0</errors>
    <dropped>0</dropped>
    <broadcast>0</broadcast>
    <multicast>0</multicast>
  </receive>
  <transmit>
    <bytes>0</bytes>
    <packets>0</packets>
    <errors>0</errors>
    <dropped>0</dropped>
    <broadcast>0</broadcast>
    <multicast>0</multicast>
  </transmit>
</stats>
</pnic>
<pnic>
  <name>eth2</name>
  <speed>1G</speed>
  <operational-speed>0</operational-speed>
  <link_state>down</link_state>
  <mac_address>a0:36:9f:7b:87:9c</mac_address>
  <mtu>9216</mtu>
  <refcnt>2</refcnt>
  <stats>
  <receive>
    <bytes>0</bytes>
    <packets>0</packets>
    <errors>0</errors>
    <dropped>0</dropped>
    <broadcast>0</broadcast>
    <multicast>0</multicast>
  </receive>
  <transmit>
    <bytes>0</bytes>
    <packets>0</packets>
    <errors>0</errors>
    <dropped>0</dropped>
    <broadcast>0</broadcast>
    <multicast>0</multicast>
  </transmit>
</stats>
</pnic>
<pnic>
  <name>eth3</name>
  <speed>1G</speed>
  <operational-speed>0</operational-speed>
  <link_state>down</link_state>
  <mac_address>a0:36:9f:7b:87:9d</mac_address>
  <mtu>9216</mtu>
  <refcnt>3</refcnt>
  <stats>
  <receive>
    <bytes>0</bytes>
    <packets>0</packets>
    <errors>0</errors>
    <dropped>0</dropped>
    <broadcast>0</broadcast>
    <multicast>0</multicast>
  </receive>
  <transmit>
    <bytes>0</bytes>
    <packets>0</packets>
    <errors>0</errors>
    <dropped>0</dropped>
    <broadcast>0</broadcast>
    <multicast>0</multicast>
  </transmit>
</stats>
</pnic>
<pnic>
  <name>eth4</name>
  <speed>1G</speed>
  <operational-speed>0</operational-speed>
  <link_state>down</link_state>
  <mac_address>a0:36:9f:7b:87:9e</mac_address>
  <mtu>9216</mtu>
  <refcnt>4</refcnt>
  <stats>
  <receive>
    <bytes>0</bytes>
    <packets>0</packets>
    <errors>0</errors>
    <dropped>0</dropped>
    <broadcast>0</broadcast>
    <multicast>0</multicast>
  </receive>
  <transmit>
    <bytes>0</bytes>
    <packets>0</packets>
    <errors>0</errors>
    <dropped>0</dropped>
    <broadcast>0</broadcast>
    <multicast>0</multicast>
  </transmit>
</stats>
</pnic>
<pnic>
  <name>eth5</name>
  <speed>1G</speed>
  <operational-speed>0</operational-speed>
  <link_state>down</link_state>
  <mac_address>a0:36:9f:7b:87:9f</mac_address>
  <mtu>9216</mtu>
  <refcnt>5</refcnt>
  <stats>
  <receive>
    <bytes>0</bytes>
    <packets>0</packets>
    <errors>0</errors>
    <dropped>0</dropped>
    <broadcast>0</broadcast>
    <multicast>0</multicast>
  </receive>
  <transmit>
    <bytes>0</bytes>
    <packets>0</packets>
    <errors>0</errors>
    <dropped>0</dropped>
    <broadcast>0</broadcast>
    <multicast>0</multicast>
  </transmit>
</stats>
</pnic>
</pnics>
* Connection #0 to host 198.51.100.11 left intact

Example: POST Create a Port Channel API


curl -k -v -u admin:Admin#123 -X POST -H Content-type:application/vnd.yang.data+xml https://198.51.100.11/api/config/pnics
 --data '<pnic><name>pc</name><type>port_channel</type></pnic>'
* About to connect() to 198.51.100.11 port 443 (#0)
*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* skipping SSL peer certificate verification
* SSL connection using TLS_DHE_RSA_WITH_AES_256_CBC_SHA
* Server certificate:
*       subject: CN=nfvis
*       start date: Dec 05 15:26:32 2017 GMT
*       expire date: Dec 03 15:26:32 2027 GMT
*       common name: nfvis
*       issuer: CN=nfvis
* Server auth using Basic with user 'admin'
> POST /api/config/pnics HTTP/1.1
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.29.0
> Host: 198.51.100.11
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> Content-Length: 53
> 
* upload completely sent off: 53 out of 53 bytes
< HTTP/1.1 201 Created
< Server: nginx
< Date: Wed, 06 Dec 2017 17:48:44 GMT
< Content-Type: text/html
< Content-Length: 0
< Location: https://198.51.100.11/api/config/pnics/pnic/pc
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 17:48:44 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-582524-631443
< Pragma: no-cache
< 
* Connection #0 to host 198.51.100.11 left intact


curl -k -v -u  admin:Admin#123 -X POST  -H Content-type:application/vnd.yang.data+xml https://198.51.100.11/api/config/
pnics --data '<pnic><name>pc</name><type>port_channel</type><lacp_type>active</lacp_type><bond_mode>balance-tcp</bond_mode>
<trunks>10,20</trunks></pnic>'

Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=nfvis
*  start date: Dec  5 15:26:32 2017 GMT
*  expire date: Dec  3 15:26:32 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> POST /api/config/pnics HTTP/1.1
> Host: 198.51.100.11
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> Content-Length: 138
> 
* upload completely sent off: 138 out of 138 bytes
< HTTP/1.1 201 Created
< Server: nginx
< Date: Wed, 06 Dec 2017 17:59:50 GMT
< Content-Type: text/html
< Content-Length: 0
< Location: https://198.51.100.11/api/config/pnics/pnic/pc
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 17:59:50 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-583190-180622
< Pragma: no-cache
< 
* Connection #0 to host 198.51.100.11 left intact

Example: PUT Add a Port to a Port Channel API


curl -k -v -u  admin:Admin#123 -X PUT -H Content-type:application/vnd.yang.data+xml 
https://198.51.100.11/api/config/pnics/pnic/eth1/member_of --data '<member_of>pc</member_of>'

*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=nfvis
*  start date: Dec  5 15:26:32 2017 GMT
*  expire date: Dec  3 15:26:32 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> PUT /api/config/pnics/pnic/eth1/member_of HTTP/1.1
> Host: 198.51.100.11
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> Content-Length: 25
> 
* upload completely sent off: 25 out of 25 bytes
< HTTP/1.1 204 No Content
< Server: nginx
< Date: Wed, 06 Dec 2017 18:12:42 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 18:12:42 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-583962-225643
< Pragma: no-cache
< 
* Connection #0 to host 198.51.100.11 left intact

Example: PUT Add a Port Channel to an Existing Bridge API


curl -k -v -u  admin:Admin#123 -X PUT -H Content-type:application/vnd.yang.data+xml 
https://198.51.100.11/api/config/bridges/bridge/test-br --data '<bridge><name>test-br</name><port><name>pc</name></port></bridge>'

*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=nfvis
*  start date: Dec  5 15:26:32 2017 GMT
*  expire date: Dec  3 15:26:32 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> PUT /api/config/bridges/bridge/test-br
> Host: 198.51.100.11
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> Content-Length: 66
> 
* upload completely sent off: 66 out of 66 bytes
< HTTP/1.1 204 No Content
< Server: nginx
< Date: Wed, 06 Dec 2017 18:32:49 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 18:32:48 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-734699-373894
< Pragma: no-cache
< 
* Connection #0 to host 198.51.100.11 left intact

Example: PUT Configure the LACP Mode of a Port Channel API


curl -k -v -u  admin:Admin#123 -X PUT -H Content-type:application/vnd.yang.data+xml 
https://198.51.100.11/api/config/pnics/pnic/pc/lacp_type --data '<lacp_type>active</lacp_type>'

*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=nfvis
*  start date: Dec  5 15:26:32 2017 GMT
*  expire date: Dec  3 15:26:32 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> PUT /api/config/pnics/pnic/pc/lacp_type HTTP/1.1
> Host: 198.51.100.11
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> Content-Length: 29
> 
* upload completely sent off: 29 out of 29 bytes
< HTTP/1.1 204 No Content
< Server: nginx
< Date: Wed, 06 Dec 2017 18:40:30 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 18:32:48 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-585168-972196
< Pragma: no-cache
< 
* Connection #0 to host 198.51.100.11 left intact

Example: PUT Configure the Bond Mode of a Port Channel API


curl -k -v -u  admin:Admin#123 -X PUT -H Content-type:application/vnd.yang.data+xml 
https://198.51.100.11/api/config/pnics/pnic/pc/bond_mode --data '<bond_mode>balance-tcp</bond_mode>'

*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=nfvis
*  start date: Dec  5 15:26:32 2017 GMT
*  expire date: Dec  3 15:26:32 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> PUT /api/config/pnics/pnic/pc/bond_mode HTTP/1.1
> Host: 198.51.100.11
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> Content-Length: 34
> 
* upload completely sent off: 34 out of 34 bytes
< HTTP/1.1 204 No Content
< Server: nginx
< Date: Wed, 06 Dec 2017 18:41:11 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 18:32:48 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-585168-972196
< Pragma: no-cache
< 
* Connection #0 to host 198.51.100.11 left intact

Example: PUT Configure Trunks on a Port Channel API


curl -k -v -u  admin:Admin#123 -X PUT -H Content-type:application/vnd.yang.data+xml 
https://198.51.100.11/api/config/pnics/pnic/pc/trunks --data '<trunks>10,20</trunks>'

*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=nfvis
*  start date: Dec  5 15:26:32 2017 GMT
*  expire date: Dec  3 15:26:32 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> PUT /api/config/pnics/pnic/pc/trunks HTTP/1.1
> Host: 198.51.100.11
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> Content-Length: 22
> 
* upload completely sent off: 22 out of 22 bytes
< HTTP/1.1 204 No Content
< Server: nginx
< Date: Wed, 06 Dec 2017 18:54:53 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 18:32:48 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-585168-972196
< Pragma: no-cache
< 
* Connection #0 to host 198.51.100.11 left intact

Example: DELETE Remove a Port from a Port Channel API


curl -k -v -u  admin:Admin#123 -X DELETE -H Content-type:application/vnd.yang.data+xml 
https://198.51.100.11/api/config/pnics/pnic/eth1/member_of --data '<member_of>pc</member_of>'

*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=nfvis
*  start date: Dec  5 15:26:32 2017 GMT
*  expire date: Dec  3 15:26:32 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> DELETE /api/config/pnics/pnic/eth1/member_of HTTP/1.1
> Host: 198.51.100.11
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> Content-Length: 25
> 
* upload completely sent off: 25 out of 25 bytes
< HTTP/1.1 204 No Content
< Server: nginx
< Date: Wed, 06 Dec 2017 18:55:32 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 18:55:32 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-586532-509745
< Pragma: no-cache
< 
* Connection #0 to host 198.51.100.11 left intact

Example: PUT Remove a Port Channel from a Bridge API


curl -k -v -u  admin:Admin#123 -X PUT -H Content-type:application/vnd.yang.data+xml 
https://198.51.100.11/api/config/bridges/bridge/testbridge --data '<bridge><name>test-br</name></bridge>'


*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=nfvis
*  start date: Dec  5 15:26:32 2017 GMT
*  expire date: Dec  3 15:26:32 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> PUT /api/config/bridges/bridge/test-br HTTP/1.1
> Host: 198.51.100.11
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> Content-Length: 37
> 
* upload completely sent off: 37 out of 37 bytes
< HTTP/1.1 204 No Content
< Server: nginx
< Date: Wed, 06 Dec 2017 19:09:06 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 19:09:05 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-587345-710932
< Pragma: no-cache
< 
* Connection #0 to host 198.51.100.11 left intact

Example: DELETE Delete a Port Channel API


curl -k -v -u admin:Admin#123 -X DELETE -H Content-type:application/vnd.yang.data+xml 
https://198.51.100.11/api/config/pnics/pnic/pc

*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=nfvis
*  start date: Dec  5 15:26:32 2017 GMT
*  expire date: Dec  3 15:26:32 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> DELETE /api/config/pnics/pnic/pc HTTP/1.1
> Host: 198.51.100.11
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> 
< HTTP/1.1 204 No Content
< Server: nginx
< Date: Wed, 06 Dec 2017 19:11:24 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 19:11:24 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-587484-283024
< Pragma: no-cache
< 
* Connection #0 to host 198.51.100.11 left intact

Example: GET LLDP Information API


curl -k -v -u admin:Cisco123# -X GET -H Content-type:application/vnd.yang.data+xml 'https://172.19.162.231/api/operational/lldp?deep'
Note: Unnecessary use of -X or --request, GET is already inferred.
*   Trying 172.19.162.231...
* Connected to 172.19.162.231 (172.19.162.231) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* Server certificate:
*  subject: CN=nfvis
*  start date: Jul  2 00:53:36 2017 GMT
*  expire date: Jun 30 00:53:36 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> GET /api/operational/lldp?deep HTTP/1.1
> Host: 172.19.162.231
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
>< HTTP/1.1 200 OK
< Server: nginx
< Date: Mon, 03 Jul 2017 04:30:47 GMT
< Content-Type: application/vnd.yang.data+xml
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Pragma: no-cache
<


<lldp
        xmlns="http://www.cisco.com/nfvis/pnic"
        xmlns:y="http://tail-f.com/ns/rest"
        xmlns:pnic="http://www.cisco.com/nfvis/pnic">
        <neighbors>
                <name>eth0</name>
                <device_id>Switch1623</device_id>
                <holdtime>120</holdtime>
                <caps>Bridge, Router</caps>
                <platform>Cisco IOS Software, Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 15.0(1)EX3, RELEASE SOFTWARE (fc2)</platform>
                <portid>Ifname: Gi1/0/4</portid>
                <description>GigabitEthernet1/0/4</description>
        </neighbors>
        <neighbors>
                <name>eth1</name>
                <device_id>None</device_id>
                <holdtime>0</holdtime>
                <caps>None</caps>
                <platform>None</platform>
                <portid>None</portid>
                <description>None</description>
        </neighbors>
        <neighbors>
                <name>eth2</name>
                <device_id>None</device_id>
                <holdtime>0</holdtime>
                <caps>None</caps>
                <platform>None</platform>
                <portid>None</portid>
                <description>None</description>
        </neighbors>
        <neighbors>
                <name>eth3</name>
                <device_id>None</device_id>
                <holdtime>0</holdtime>
                <caps>None</caps>
                <platform>None</platform>
                <portid>None</portid>
                <description>None</description>
        </neighbors>
        <neighbors>
                <name>eth4</name>
                <device_id>None</device_id>
                <holdtime>0</holdtime>
                <caps>None</caps>
                <platform>None</platform>
                <portid>None</portid>
                <description>None</description>
        </neighbors>
        <neighbors>
                <name>eth5</name>
                <device_id>None</device_id>
                <holdtime>0</holdtime>
                <caps>None</caps>
                <platform>None</platform>
                <portid>None</portid>
                <description>None</description>
        </neighbors>
        <stats>
                <name>eth0</name>
                <tx_frames>10</tx_frames>
                <discard_rx>0</discard_rx>
                <error_rx>0</error_rx>
                <rx_frames>19589</rx_frames>
                <discarded_tlvs>0</discarded_tlvs>
                <unrec_tlvs>0</unrec_tlvs>
                <ageouts>0</ageouts>
        </stats>
        <stats>
                <name>eth1</name>
                <tx_frames>0</tx_frames>
                <discard_rx>0</discard_rx>
                <error_rx>0</error_rx>
                <rx_frames>0</rx_frames>
                <discarded_tlvs>0</discarded_tlvs>
                <unrec_tlvs>0</unrec_tlvs>
                <ageouts>0</ageouts>
        </stats>
        <stats>
                <name>eth2</name>
                <tx_frames>0</tx_frames>
                <discard_rx>0</discard_rx>
                <error_rx>0</error_rx>
                <rx_frames>0</rx_frames>
                <discarded_tlvs>0</discarded_tlvs>
                <unrec_tlvs>0</unrec_tlvs>
                <ageouts>0</ageouts>
        </stats>
        <stats>
                <name>eth3</name>
                <tx_frames>0</tx_frames>
                <discard_rx>0</discard_rx>
                <error_rx>0</error_rx>
                <rx_frames>0</rx_frames>
                <discarded_tlvs>0</discarded_tlvs>
                <unrec_tlvs>0</unrec_tlvs>
                <ageouts>0</ageouts>
        </stats>
        <stats>
                <name>eth4</name>
                <tx_frames>0</tx_frames>
                <discard_rx>0</discard_rx>
                <error_rx>0</error_rx>
                <rx_frames>0</rx_frames>
                <discarded_tlvs>0</discarded_tlvs>
                <unrec_tlvs>0</unrec_tlvs>
                <ageouts>0</ageouts>
        </stats>
        <stats>
                <name>eth5</name>
                <tx_frames>0</tx_frames>
                <discard_rx>0</discard_rx>
                <error_rx>0</error_rx>
                <rx_frames>0</rx_frames>
                <discarded_tlvs>0</discarded_tlvs>
                <unrec_tlvs>0</unrec_tlvs>
                <ageouts>0</ageouts>
        </stats>
</lldp>
* Connection #0 to host 172.19.162.231 left intact

Example: PUT Enable LLDP Configuration API

curl -v -k -u admin:Admin#123 -X PUT  -H Content-type:application/vnd.yang.data+xml 
Content-type:application/vnd.yang.data+xml 'https://198.51.100.1/api/config/pnics/pnic/eth0/lldp --data
'<lldp>enabled</lldp>'

*   Trying 198.51.100.1...
* Connected to 198.51.100.1 (198.51.100.1) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* Server certificate:
*  subject: CN=nfvis
*  start date: Jul  2 00:53:36 2017 GMT
*  expire date: Jun 30 00:53:36 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> PUT /api/config/pnics/pnic/eth0/lldp HTTP/1.1
> Host: 198.51.100.1
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> Content-Length: 20
> 
* upload completely sent off: 20 out of 20 bytes
< HTTP/1.1 204 No Content
< Server: nginx
< Date: Mon, 03 Jul 2017 04:09:38 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Sun, 02 Jul 2017 01:30:26 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1498-959026-423491
< Pragma: no-cache
* Connection #0 to host 198.51.100.1 left intact

Example: GET Port Admin Status API

curl -k -v -u admin:Cisco123# -X GET https://198.51.100.1/api/config/pnics/pnic/eth5/adminstatus 
*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#0)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=nfvis
*  start date: Dec  5 15:26:32 2017 GMT
*  expire date: Dec  3 15:26:32 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> GET /api/config/pnics/pnic/eth5/adminstatus HTTP/1.1
> Host: 198.51.100.11
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> 
< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 06 Dec 2017 19:15:23 GMT
< Content-Type: application/vnd.yang.data+xml
< Transfer-Encoding: chunked
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 19:14:09 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-587649-439226
< Pragma: no-cache
< 

<adminstatus xmlns="http://www.cisco.com/nfvis/pnic" xmlns:y="http://tail-f.com/ns/rest"  xmlns:pnic="http://www.cisco.com/nfvis/
pnic">up</adminstatus>
* Connection #0 to host 198.51.100.11 left intact

Example: PUT Configure Port Admin Status API

curl -v -k -u admin:Admin#123 -X PUT  -H Content-type:application/vnd.yang.data+xml 
Content-type:application/vnd.yang.data+xml 'https://198.51.100.11/api/config/pnics/pnic/eth5/adminstatus --data
'<adminstatus>up</adminstatus>'

*   Trying 198.51.100.11...
* Connected to 198.51.100.11 (198.51.100.11) port 443 (#1)
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* NPN, negotiated HTTP1.1
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Unknown (67):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / DHE-RSA-AES256-SHA
* Server certificate:
*  subject: CN=nfvis
*  start date: Dec  5 15:26:32 2017 GMT
*  expire date: Dec  3 15:26:32 2027 GMT
*  issuer: CN=nfvis
*  SSL certificate verify result: self signed certificate (18), continuing anyway.
* Server auth using Basic with user 'admin'
> PUT /api/config/pnics/pnic/eth5/adminstatus HTTP/1.1
> Host: 198.51.100.11
> Authorization: Basic YWRtaW46Q2lzY28xMjMj
> User-Agent: curl/7.50.1
> Accept: */*
> Content-type:application/vnd.yang.data+xml
> Content-Length: 29
> 
* upload completely sent off: 29 out of 29 bytes
< HTTP/1.1 204 No Content
< Server: nginx
< Date: Wed, 06 Dec 2017 19:14:09 GMT
< Content-Type: text/html
< Content-Length: 0
< Connection: keep-alive
< Last-Modified: Wed, 06 Dec 2017 19:14:09 GMT
< Cache-Control: private, no-cache, must-revalidate, proxy-revalidate
< Etag: 1512-587649-439226
< Pragma: no-cache
< 
* Connection #1 to host 198.51.100.11 left intact

Speed, Autoneg and Duplex APIs

Action

Method

Payload Required

API

To configure speed

PUT

Yes

/api/config/pnics/pnic/GE0-0/speed

To configure duplex

PUT

Yes

/api/config/pnics/pnic/GE0-0/duplex

To configure speed and duplex

PUT

Yes

/api/config/pnics/pnic/GE0-0/

To get the perational speed

GET

No

/api/config/pnics/pnic/GE0-0/operational-speed

To get the operational duplex

GET

No

/api/config/pnics/pnic/GE0-0/operational-duplex

To get the operational autoneg

GET

No

/api/config/pnics/pnic/GE0-0/operational-duplex