Skip to content

Commit

Permalink
added new doc files
Browse files Browse the repository at this point in the history
  • Loading branch information
sj-harrish committed Oct 11, 2023
1 parent ed1c148 commit 71ee32e
Show file tree
Hide file tree
Showing 12 changed files with 475 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/NTP.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ node = opbapi.connect_to('SN2010')
<strong>Configure NTP server</strong>
<p>In order to configure NTP server information, the API, configNTP(), must be invoked with the server IPv4 as input parameters.
```py
node.configSNMPcomm(ip="128.123.123.123")
node.configNTP(ip="128.123.123.123")
```
<table>
<tbody>
Expand Down
7 changes: 4 additions & 3 deletions docs/ZTP.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ node = opbapi.connect_to('SN2010')
```

<strong>Configure ZTP</strong>
<p>In order to configure ZTP enable or disable, the API, configZTP(), must be invoked with dictionary input within the object, 'dt'.
<p>In order to enable or disable ZTP, the API, configZTP(), must be invoked with dictionary input within the object, 'dt'.
```py
node.configZTP("ztp_status": "enable | disable")
node.configZTP(dt = {"ztp_status":"enable | disable"})

<strong>Get/Show ZTP server</strong>
<p> Retrieves ZTP status

Expand All @@ -40,7 +41,7 @@ b'{{"ztp-status": "disabled"}}
</thead>
<tbody>
<tr>
<td>"ztp_status</td>
<td>"ztp_status"</td>
<td>"enable|disable"</td>
<td>indicates whether ztp enable or disable on the system</td>
</tr>
Expand Down
56 changes: 56 additions & 0 deletions docs/boot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Boot

<strong>Import OPBNOS API</strong>

```py
import opb_api as opbapi
```

<strong>Initialize client</strong>
<p>Use the appropriate JSON file that corresponds to the targetted device name. This JSON file should contain request body parameters corresponding to any potential configuration/post requests.

```py
node = opbapi.connect_to('SN2010')
```

<strong>Get System Boot information</strong>

<py> : Retrieves system boot information.

```py
node.execute(['show boot'])
```
<strong>Output</strong>

```py
b'{"BootInfo": {"Next": "OPBNOS-master.192-dirty-20230831.072719", "Available": "OPBNOS-master.192-dirty-20230831.072719", "Current": "OPBNOS-master.192-dirty-20230831.072719"}}'
```

<p> The below table has a list of attributes that pertain to this particular API:
<table>
<tbody>
<thead>
<tr>
<th>Attribute</th>
<th>Values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>"Next"</td>
<td>"OPBNOS-master.192-dirty-20230831.072719"</td>
<td>next boot device</td>
</tr>
<tr>
<td>"Available"</td>
<td>"OPBNOS-master.192-dirty-20230831.072719"</td>
<td>available boot device</td>
</tr>
<tr>
<td>"Current"</td>
<td>"OPBNOS-master.192-dirty-20230831.072719"</td>
<td>current boot device</td>
</tr>
</tbody>
</table>
51 changes: 51 additions & 0 deletions docs/clock.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# System Clock

<strong>Import OPBNOS API</strong>

```py
import opb_api as opbapi
```

<strong>Initialize client</strong>
<p>Use the appropriate JSON file that corresponds to the targetted device name. This JSON file should contain request body parameters corresponding to any potential configuration/post requests.

```py
node = opbapi.connect_to('SN2010')
```

<strong>Get/Show Clock Information</strong>
<p> Retrieves system clock information

```py
node.execute(['show clock'])
```
<strong>Output</strong>
<p> This is an example of the output of the above command:
```py
b'{"currentTime": "Sat 07 Oct 2023 01:12:59 AM UTC"}'
```

<p> The below table lists and describes input and output attributes:
<table>
<tbody>
<thead>
<tr>
<th>Attribute</th>
<th>Values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>"currentTime"</td>
<td>"Sat 07 Oct 2023 01:12:59 AM UTC"</td>
<td>indicates current server clock (time, date, day and timezone)</td>
</tr>
</tbody>
</table>

<strong>Note: Output of clock API</strong>
<p> API will not produce any output unless the below status code in produced, indicating a server error.
```py
Status : 500 -> Response : b'500'
```
52 changes: 41 additions & 11 deletions docs/counters.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,57 @@ node.execute(['show interface counters'])
```
<strong>Output</strong>
```py
{}
b'{"Ethernet1_1": {"IF_IN_OCTETS": 0, "IF_IN_UCAST_PKTS": 0, "IF_IN_NON_UCAST_PKTS": 0, "IF_IN_DISCARDS": 0, "IF_IN_ERRORS": 0, "IF_OUT_OCTETS": 0, "IF_OUT_UCAST_PKTS": 0, "IF_OUT_NON_UCAST_PKTS": 0, "IF_OUT_DISCARDS": 0, "IF_OUT_ERRORS": 0, "IF_IN_MULTICAST_PKTS": 0, "IF_OUT_MULTICAST_PKTS": 0}, "Ethernet2_1":{...}...}
```

<strong>Get/Show SNMP Trap</strong>
<py>: Retrieves SNMP traps
<strong>Clear Interface Counters</strong>
<p>In order to delete all interface counters, the API, configInterfacesCounters(), can be invoked with no paramters.
```py
node.configInterfacesCounters()
```

<strong>Get/Show Interface Counters - Ethernet specific</strong>
<py>: Retrieves Interface counter information as per the specified ethernet

```py
node.execute(['show snmp-trap'])
node.execute(['show interface counters <Ethernet1_1>'])
```
<strong>Output</strong>
```py
b'{"1": {"DestPort": "161","v2TrapDest": "Null","DestIp": "10.4.4.11","vrf": "None","Community": "public"}}
b'{"Ethernet1_1": {"IF_IN_OCTETS": 0, "IF_IN_UCAST_PKTS": 0, "IF_IN_NON_UCAST_PKTS": 0, "IF_IN_DISCARDS": 0, "IF_IN_ERRORS": 0, "IF_OUT_OCTETS": 0, "IF_OUT_UCAST_PKTS": 0, "IF_OUT_NON_UCAST_PKTS": 0, "IF_OUT_DISCARDS": 0, "IF_OUT_ERRORS": 0, "IF_IN_MULTICAST_PKTS": 0, "IF_OUT_MULTICAST_PKTS": 0}}
```
<py> : The API, configReboot(), reboots the system by accepting dictionary request body input to indicate authorization.

<strong>Clear Flow Counters</strong>
<p>In order to clear opb flow counters, the API, clearFlowCounters(), can be invoked with no paramters.
```py
node.configReboot(dt={"reboot":"yes"})
node.clearFlowCounters(flow="flow1", r_id="1")
```
<strong>Output</strong>
<p> Note: Client will receive the below status codes for both deleting funtions to indicate a successful request.
<p> The below table lists and describes input attributes:
<table>
<tbody>
<thead>
<tr>
<th>Attribute</th>
<th>Values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>"flow"</td>
<td>"flow1"</td>
<td>flow identification</td>
</tr>
<tr>
<td>"r_id"</td>
<td>int</td>
<td>rule id number</td>
</tr>
</tbody>
</table>

<strong>Note: Output of clear APIs</strong>
<p> APIs will not produce any output unless the below status code in produced, indicating a server error.
```py
Status : 200 -> Response : b'200'
Status : 500 -> Response : b'500'
```
<p> The status code '500' indicates a server error.
51 changes: 51 additions & 0 deletions docs/cpuUtil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# CPU Utilization

<strong>Import OPBNOS API</strong>

```py
import opb_api as opbapi
```

<strong>Initialize client</strong>
<p>Use the appropriate JSON file that corresponds to the targetted device name. This JSON file should contain request body parameters corresponding to any potential configuration/post requests.

```py
node = opbapi.connect_to('SN2010')
```

<strong>Get/Show CPU Utilization</strong>
<p> Retrieves system CPU utilization

```py
node.execute(['show cpu util'])
```
<strong>Output</strong>
<p> This is an example of the output of the above command:
```py
b'{"%CPU_Util": "14.249999999999998"}'
```

<p> The below table lists and describes input and output attributes:
<table>
<tbody>
<thead>
<tr>
<th>Attribute</th>
<th>Values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>"CPU_Util"</td>
<td>float</td>
<td>indicates average CPU usage</td>
</tr>
</tbody>
</table>

<strong>Note: Output of the API</strong>
<p> API will not produce any output unless the below status code in produced, indicating a server error.
```py
Status : 500 -> Response : b'500'
```
51 changes: 51 additions & 0 deletions docs/memUtil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Memory Utilization

<strong>Import OPBNOS API</strong>

```py
import opb_api as opbapi
```

<strong>Initialize client</strong>
<p>Use the appropriate JSON file that corresponds to the targetted device name. This JSON file should contain request body parameters corresponding to any potential configuration/post requests.

```py
node = opbapi.connect_to('SN2010')
```

<strong>Get/Show Memory Utilization</strong>
<p> Retrieves system memory utilization

```py
node.execute(['show memory utilisation'])
```
<strong>Output</strong>
<p> This is an example of the output of the above command:
```py
b'{"%MEM_Util": "13.5"}'
```

<p> The below table lists and describes input and output attributes:
<table>
<tbody>
<thead>
<tr>
<th>Attribute</th>
<th>Values</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>"MEM_Util"</td>
<td>float</td>
<td>indicates memory usage</td>
</tr>
</tbody>
</table>

<strong>Note: Output of the API</strong>
<p> API will not produce any output unless the below status code in produced, indicating a server error.
```py
Status : 500 -> Response : b'500'
```
28 changes: 28 additions & 0 deletions docs/reboot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Reboot
<p> Initiates Device Reboot
<strong>Import OPBNOS API</strong>

```py
import opb_api as opbapi
```

<strong>Initialize client</strong>
<p>Use the appropriate JSON file that corresponds to the targetted device name. This JSON file should contain request body parameters corresponding to any potential configuration/post requests.

```py
node = opbapi.connect_to('SN2010')
```

<strong>Device Reboot</strong>

<py> : The API, configReboot(), reboots the system by accepting dictionary request body input to indicate authorization.

```py
node.configReboot(dt={"reboot":"yes"})
```
<strong>Output</strong>
<p> Note: Client will receive the below status codes for both deleting funtions to indicate a successful request.
```py
Status : 200 -> Response : b'200'
```
<p> The status code '500' indicates a server error.
Loading

0 comments on commit 71ee32e

Please sign in to comment.