diff options
author | Roberto Bertó <roberto.berto@gmail.com> | 2023-12-14 13:20:42 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-14 13:20:42 -0300 |
commit | 067511871fc6f870aadb16be1ec108427d7881cd (patch) | |
tree | 9794e3b896f8a9247f7922d0cfea6bbfc0c99502 | |
parent | 83cb4938726ab21a4cb913db670f8508c554b44e (diff) | |
download | pyvyos-067511871fc6f870aadb16be1ec108427d7881cd.tar.gz pyvyos-067511871fc6f870aadb16be1ec108427d7881cd.zip |
Update README.md
improved markdown
-rw-r--r-- | README.md | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -38,29 +38,30 @@ class ApiResponse: #### Configuring Your Environment for VyDevice -# Rename the file .env.example to .env. -# Open the .env file in a text editor. -# Replace the placeholder values with your VyOS device credentials: - -``` -VYDEVICE_HOSTNAME: Your device's hostname or IP address. -VYDEVICE_APIKEY: Your API key for authentication. -VYDEVICE_PORT: The port number for the API. Default 443 -VYDEVICE_PROTOCOL: The protocol (e.g., http or https). Default https -VYDEVICE_VERIFY_SSL: Set to True or False for SSL verification. -``` +1. Rename the file .env.example to .env. +1. Open the .env file in a text editor. +1. Replace the placeholder values with your VyOS device credentials: + - **VYDEVICE_HOSTNAME**: Your device's hostname or IP address. + - **VYDEVICE_APIKEY**: Your API key for authentication. + - **VYDEVICE_PORT**: The port number for the API. Default 443 + - **VYDEVICE_PROTOCOL**: The protocol (e.g., http or https). Default https + - **VYDEVICE_VERIFY_SSL**: Set to True or False for SSL verification. ``` # Retrieve VyOS device connection details from environment variables and configure VyDevice from dotenv import load_dotenv load_dotenv() + hostname = os.getenv('VYDEVICE_HOSTNAME') apikey = os.getenv('VYDEVICE_APIKEY') port = os.getenv('VYDEVICE_PORT') protocol = os.getenv('VYDEVICE_PROTOCOL') verify_ssl = os.getenv('VYDEVICE_VERIFY_SSL') -verify = verify_ssl.lower() == "true" if verify_ssl else True # Convert the verify_ssl value to a boolean + +# Convert the verify_ssl value to a boolean +verify = verify_ssl.lower() == "true" if verify_ssl else True + device = VyDevice(hostname=hostname, apikey=apikey, port=port, protocol=protocol, verify=verify) ``` |