Changing access policies
Now that we have seen how to retrieve information about our access policy, what about changing it? Maybe we want to automatically carry out a workflow that checks all access policies against a list of valid policies and either automatically deactivates the policy or at least marks it for someone to have a look at it. We have seen the automatic retrieval of all lists in the previous recipe, Retrieving access policies. This recipe will cover the part about changing an access policy based on the policy ID.
Getting ready
Open your code editor and start by creating a file called change_access_policies.py
. Next, navigate in your terminal to the same directory in which you just created the change_access_policies.py
file.
How to do it…
Follow these steps to change one of your access policies using the FMC REST API:
- Import the required
requests
library as well as thejson
andsys
modules from the standard library:import requests import...