Retrieving access rules
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.
Getting ready
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.
How to do it…
Follow these steps to retrieve all access rules associated with your access policy:
- Import the required
requests
library as well as thejson
andsys
modules from the standard library:import requests import json import sys from requests.auth import HTTPBasicAuth
- Specify the required variables such as your...