datacenter / acitoolkit

A basic toolkit for accessing the Cisco APIC
Other
350 stars 266 forks source link

Associate VMM domain to EPG #297

Closed arikgelman closed 7 years ago

arikgelman commented 7 years ago

Hi,

How do I associate VMM domain (already configured) to an EPG?

Thanks!

richardstrnad commented 7 years ago

Hi Arikgelman,

You can attach the VMM domain through the attach method, example below.

from acitoolkit.acitoolkit import *

url = 'https://IP'
user = 'admin'
pw = 'pw'

session = Session(url, user, pw)
session.login()

vmm = VmmDomain.get_by_name(session, 'VMM_NAME')

tenant = Tenant('TENANT_NAME')
app = AppProfile('APP_NAME', tenant)
epg = EPG('EPG_NAME', app)

epg.attach(vmm)

x = tenant.push_to_apic(session)
print(x.text)

Regards Richy

arikgelman commented 7 years ago

Thank you!! Didn't know about the get_by_name function.

arikgelman commented 6 years ago

@richardstrnad Hi, The example you provide associate VMM domain to an EPG, But I was unable to find a way to set parameters like primary vlan, secondary vlan in the association?

Thanks