forked from CLCMacTeam/besapi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add example that uses new functionality
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
""" | ||
get dashboard variable value | ||
requires `besapi` v3.2.6+ | ||
install with command `pip install -U besapi` | ||
""" | ||
|
||
import besapi | ||
|
||
|
||
def main(): | ||
"""Execution starts here""" | ||
print("main()") | ||
|
||
bes_conn = besapi.besapi.get_bes_conn_using_config_file() | ||
bes_conn.login() | ||
|
||
print(bes_conn.last_connected) | ||
|
||
print(bes_conn.get_dashboard_variable_value("WebUIAppAdmin", "Current_Sites")) | ||
|
||
# dashboard_name = "PyBESAPITest" | ||
# var_name = "TestVar" | ||
|
||
# print( | ||
# bes_conn.set_dashboard_variable_value( | ||
# dashboard_name, var_name, "dashboard_variable_get_value.py 12345678" | ||
# ) | ||
# ) | ||
|
||
# print(bes_conn.get_dashboard_variable_value(dashboard_name, var_name)) | ||
|
||
# print(bes_conn.delete(f"dashboardvariable/{dashboard_name}/{var_name}")) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |