# Interface Management

#### **Configure NPB Interface**

| **Request URL**   | /api/config/opbinterfaces/\<Interface-name>                                                                                      |                                                             |                                        |                                                                          |                                                |                                                                                                                                                                          |                      |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | -------------------------------------- | ------------------------------------------------------------------------ | ---------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- |
| **Description**   | Use this API to configure the opb-interface specific parameters                                                                  |                                                             |                                        |                                                                          |                                                |                                                                                                                                                                          |                      |
| **Method**        | POST                                                                                                                             |                                                             |                                        |                                                                          |                                                |                                                                                                                                                                          |                      |
| **Request Body**  | <p><strong>Nvidia:</strong></p><p>{</p><p>"name" : "Ethernet1\_1"</p><p>"type" : "network                                        | tool",</p><p>"comment" : "test",</p><p>"mode" : "vlan-aware | vlan-unaware"</p><p>"hybrid" : "enable | disable",</p><p>"ingress-vlan" : "100",</p><p>"egress-tagging" : "enable | disable",</p><p>"truncate-offset": "0(disable) | 32-4088 (multiple of 4)"</p><p>}</p><p></p><p><strong>Broadcom:</strong></p><p>{</p><p>"name":"Ethernet1\_1",</p><p>"ingress-vlan":"700",</p><p>"egress-tagging":"enable | disable"</p><p>}</p> |
| **Response Body** | NA                                                                                                                               |                                                             |                                        |                                                                          |                                                |                                                                                                                                                                          |                      |
| **Status code**   | <ul><li>SERVER\_ERROR(500) if there is any error with the server</li><li>OK(200) if the request completes successfully</li></ul> |                                                             |                                        |                                                                          |                                                |                                                                                                                                                                          |                      |

#### **Get NPB Interface Information**

| **Request URL**   | <p>/api/info/opbinterfaces</p><p>/api/info/opbinterfaces/\<interface-name></p>                                                                                                                                                                                                                                                                                                                                 |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Description**   | Use this API to get the interface configuration                                                                                                                                                                                                                                                                                                                                                                |
| **Method**        | GET                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Request Body**  | NA                                                                                                                                                                                                                                                                                                                                                                                                             |
| **Response Body** | <p><strong>Nvidia:</strong></p><p>{</p><p>"name": "Ethernet1\_1",</p><p>"comment": "test",</p><p>"type": "network",</p><p>"mode" : "vlan-aware"</p><p>"egress-tagging": "disable",</p><p>"ingress-vlan": "100",</p><p>"truncate-offset": "0"</p><p>}</p><p></p><p><strong>Broadcom:</strong></p><p>{</p><p>"name": "Ethernet1\_1",</p><p>"egress-tagging": "disable",</p><p>"ingress-vlan": "100",</p><p>}</p> |
| **Status code**   | <ul><li>SERVER\_ERROR(500) if there is any error with the server</li><li>OK(200) if the request completes successfully</li></ul>                                                                                                                                                                                                                                                                               |

#### **Configure Interfaces**

| **Request URL**   | api/config/interfaces/config/\<Interface-name>                                                                                          |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| **Description**   | Use this API to configure the generic interface parameters                                                                              |
| **Method**        | POST                                                                                                                                    |
| **Request Body**  | <p>{</p><p>"admin\_status": "up",</p><p>"speed": "100000",</p><p>"mtu": "9100",</p><p>"fec": "rs"</p><p>}</p>                           |
| **Response Body** | NA                                                                                                                                      |
| **Status code**   | <p></p><ul><li>SERVER\_ERROR(500) if there is any error with the server</li><li>OK(200) if the request completes successfully</li></ul> |

#### **Get interfaces Information**

| **Request URL**   | <p>/api/info/interfaces</p><p>/api/info/interfaces/\<interface\_name></p>                                                                                                                                                                                                                               |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Description**   | Use this GET-API to fetch the interface related information in the system                                                                                                                                                                                                                               |
| **Method**        | GET                                                                                                                                                                                                                                                                                                     |
| **Request Body**  | NA                                                                                                                                                                                                                                                                                                      |
| **Response Body** | <p>{ </p><p>"Ethernet1\_1": { </p><p>"lanes": "13", </p><p>"alias": "tenGigE1", </p><p>"oper\_status": "down", </p><p>"admin\_status": "up", </p><p>"speed": "10000", </p><p>"mtu": "9100", </p><p>"description": "N/A", </p><p>"autoneg": "N/A", </p><p>"TRANSCEIVER": "Present" </p><p>} </p><p>}</p> |
| **Status code**   | <ul><li>SERVER\_ERROR(500) if there is any error with the server</li><li>OK(200) if the request completes successfully</li></ul>                                                                                                                                                                        |

#### **Get Interface Counters**

| **Request URL**   | /api/info/interfaces/stats    or /api/info/interfaces/stats/Ethernet1\_1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Description**   | Use this API to get the interface statistics related information                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| **Method**        | GET                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| **Request Body**  | NA                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| **Response Body** | <p>{</p><p>"Ethernet1\_1": {</p><p>"IF\_IN\_OCTETS": 0,</p><p>"IF\_IN\_UCAST\_PKTS": 0,</p><p>"IF\_IN\_NON\_UCAST\_PKTS": 0,</p><p>"IF\_IN\_DISCARDS": 0,</p><p>"IF\_IN\_ERRORS": 0,</p><p>"IF\_IN\_UNKNOWN\_PROTOS": 0,</p><p>"IF\_OUT\_OCTETS": 0,</p><p>"IF\_OUT\_UCAST\_PKTS": 0,</p><p>"IF\_OUT\_NON\_UCAST\_PKTS": 0,</p><p>"IF\_OUT\_DISCARDS": 0,</p><p>"IF\_OUT\_ERRORS": 0,</p><p>"IF\_OUT\_QLEN": "N/A",</p><p>"IF\_IN\_MULTICAST\_PKTS": 0,</p><p>"IF\_IN\_BROADCAST\_PKTS": 0,</p><p>"IF\_OUT\_MULTICAST\_PKTS": 0,</p><p>"IF\_OUT\_BROADCAST\_PKTS": 0,</p><p>"ETHER\_RX\_OVERSIZE\_PKTS": 0,</p><p>"ETHER\_TX\_OVERSIZE\_PKTS": 0,</p><p>"ETHER\_STATS\_TX\_NO\_ERRORS": 0,</p><p>"IP\_IN\_UCAST\_PKTS": "N/A",</p><p>"ETHER\_IN\_PKTS\_128\_TO\_255\_OCTETS": 0,</p><p>"PFC\_0\_TX\_PKTS": 0,</p><p>"PFC\_1\_TX\_PKTS": 0,</p><p>"PFC\_2\_TX\_PKTS": 0,</p><p>"PFC\_3\_TX\_PKTS": 0,</p><p>"PFC\_4\_TX\_PKTS": 0,</p><p>"PFC\_5\_TX\_PKTS": 0,</p><p>"PFC\_6\_TX\_PKTS": 0,</p><p>"PFC\_7\_TX\_PKTS": 0,</p><p>"PFC\_0\_RX\_PKTS": 0,</p><p>"PFC\_1\_RX\_PKTS": 0,</p><p>"PFC\_2\_RX\_PKTS": 0,</p><p>"PFC\_3\_RX\_PKTS": 0,</p><p>"PFC\_4\_RX\_PKTS": 0,</p><p>"PFC\_5\_RX\_PKTS": 0,</p><p>"PFC\_6\_RX\_PKTS": 0,</p><p>"PFC\_7\_RX\_PKTS": 0</p><p>},</p><p>…</p><p>…</p><p>}</p> |
| **Status code**   | <ul><li>SERVER\_ERROR(500) if there is any error with the server</li><li>OK(200) if the request completes successfully</li></ul>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

#### **Get Interface Transceivers Information**

| **Request URL**   | <p>/api/info/interfaces/transceivers</p><p>/api/info/interfaces/transceivers/Ethernet1\_1</p>                                                                                                                                                                                                |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Description**   | Get interface transceivers information using this API                                                                                                                                                                                                                                        |
| **Method**        | GET                                                                                                                                                                                                                                                                                          |
| **Request Body**  | NA                                                                                                                                                                                                                                                                                           |
| **Response Body** | <p>{ </p><p>"Ethernet1\_1": { </p><p>"type": "SFP/SFP+/SFP28", </p><p>"hardware\_rev": "A", </p><p>"serial": "16CN48200170", </p><p>"manufacturer": "Volex Inc.", </p><p>"model": "700512588", "specification\_compliance": "{'SFP+CableTechnology': 'Passive Cable'}" </p><p>} </p><p>}</p> |
| **Status code**   | <ul><li>SERVER\_ERROR(500) if there is any error with the server</li><li>OK(200) if the request completes successfully</li></ul>                                                                                                                                                             |
