Book Image

OpenStack Networking Cookbook

Book Image

OpenStack Networking Cookbook

Overview of this book

Table of Contents (19 chapters)
OpenStack Networking Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Processing API requests for a Port


We will conclude this chapter with a recipe that shows you how to process API requests for a Port. In real-world applications, the Port-related operations are used more frequently when compared to a Network or Subnet. As there are different types of Ports, this recipe will show you how to identify the Port type from the API requests.

Getting ready

Ensure that your DevStack setup is up and running, with cookbook as one of the mechanism drivers, as shown in the earlier recipe.

How to do it…

  1. With the appropriate credentials, SSH into your DevStack setup.

  2. Open /opt/stack/neutron/neutron/plugins/ml2/drivers/ ch10_ml2_mech_driver.py using an editor.

  3. Add a new import statement, as highlighted in the following image:

  4. Update the class declaration statement to include the Port mechanism driver class, as follows:

  5. CookbookMechanismDriver now extends the CookbookPortMechanismDriver, CookbookSubnetMechanismDriver, and CookbookNetworkMechanismDriver classes. Hence, it inherits...