-
Book Overview & Buying
-
Table Of Contents
Python Network Programming Techniques
By :
The access policy resource covered so far in this chapter has, as is very common with REST APIs, more attributes that refer (or link) to another object. Our access policy, for example, also has a list of associated access rules that define which zone is allowed or disallowed from sending traffic to another zone. In this recipe, we will cover the process of retrieving all associated rules for a given access policy.
Open your code editor and start by creating a file called get_access_rules.py. Next, navigate in your terminal to the same directory in which you just created the get_access_rules.py file.
Follow these steps to retrieve all access rules associated with your access policy:
requests library as well as the json and sys modules from the standard library:import requests import json import sys from requests.auth import HTTPBasicAuth