O'Reilly logo

Cisco ACI Cookbook by Stuart Fordham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

  1. Create a new Python file (on Linux, this can be done using the command vi aciNewTenant.py).
  2. In the VI editor, switch to insert mode by pressing i on the keyboard
  3. Enter the following:
      import cobra.model.pol      import cobra.model.fv      import cobra.mit.request       polUniMo = cobra.model.pol.Uni('')      tenantMo = cobra.model.fv.Tenant(polUniMo, 'TenantC')      config = cobra.mit.request.ConfigRequest()       config.addMo(tenantMo)       md.commit(config)
  1. Save the file by pressing the Esc key and then pressing :wq!.
  2. Make the file executable using the command chmod a+x aciLogin.py.
  3. Run the file using the command python ./aciLogin.py.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required