diff options
| author | Roberto Berto <roberto.berto@gmail.com> | 2023-11-21 11:31:15 -0300 |
|---|---|---|
| committer | Roberto Berto <roberto.berto@gmail.com> | 2023-11-21 11:31:15 -0300 |
| commit | 10949e4fd6360babf61c2ccdf44ab5e24b512226 (patch) | |
| tree | e9886661280b523df17a0d3ef7f74d767d814f72 /test_show.py | |
| parent | c724a620bd5e2b5233b2b3518bc47164a5fd562b (diff) | |
| download | pyvyos-10949e4fd6360babf61c2ccdf44ab5e24b512226.tar.gz pyvyos-10949e4fd6360babf61c2ccdf44ab5e24b512226.zip | |
Initial commit for retrieve_config feature
Diffstat (limited to 'test_show.py')
| -rw-r--r-- | test_show.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test_show.py b/test_show.py new file mode 100644 index 0000000..a58b656 --- /dev/null +++ b/test_show.py @@ -0,0 +1,34 @@ +#import warnings +#warnings.filterwarnings("ignore", category=RuntimeWarning) + +import sys +import os + +# Adicione o diretório raiz do projeto ao sys.path para que possa importar vyapi +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__)))) + + +import unittest +from vyapi.device import VyDevice +from vyapi.device import ApiResponse +from dotenv import load_dotenv +import pprint + +load_dotenv() + +hostname = os.getenv('VYDEVICE_HOSTNAME') +key = os.getenv('VYDEVICE_KEY') +port = os.getenv('VYDEVICE_PORT') +protocol = os.getenv('VYDEVICE_PROTOCOL') +verify = os.getenv('VYDEVICE_VERIFY_SSL') +if verify == "False": + verify = False + +else: + verify = True + +if __name__ == '__main__': + device = VyDevice(hostname=hostname, key=key, port=port, protocol=protocol, verify=verify) + response = device.retrieve_show_config(['system']) + pprint.pprint(response) + |
