-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed1c148
commit 71ee32e
Showing
12 changed files
with
475 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Oops, something went wrong.