Difference between revisions of "F5 sdk snippets"
Jump to navigation
Jump to search
(Created page with "``` import requests import os requests.packages.urllib3.disable_warnings() url = "https://foo.example.com/mgmt/tm/ltm/virtual" AD_USER = os.getenv('AD_USER') AD_PASS = os.env...") |
|||
Line 4: | Line 4: | ||
requests.packages.urllib3.disable_warnings() | requests.packages.urllib3.disable_warnings() | ||
− | + | ||
+ | F5_HOST = os.getenv('AD_HOST') | ||
AD_USER = os.getenv('AD_USER') | AD_USER = os.getenv('AD_USER') | ||
AD_PASS = os.environ.get('AD_PASS') | AD_PASS = os.environ.get('AD_PASS') | ||
+ | url = f"https://{F5_HOST}/mgmt/tm/ltm/virtual" | ||
session = requests.Session() | session = requests.Session() |
Revision as of 18:03, 10 September 2023
import requests import os requests.packages.urllib3.disable_warnings() F5_HOST = os.getenv('AD_HOST') AD_USER = os.getenv('AD_USER') AD_PASS = os.environ.get('AD_PASS') url = f"https://{F5_HOST}/mgmt/tm/ltm/virtual" session = requests.Session() session.auth = (AD_USER, AD_PASS) r = session.get(url, verify=False) r.json()['entries']['https://localhost/mgmt/tm/ltm/virtual/~QA~vs_qa.mktp.io_int_https/stats']['nestedStats']['entries']