300-635 · Question #47
Refer to the exhibit. The code should create a new tenant named Cisco via the Cobra SDK, which shows up after the execution of this script in the APIC dashboard.
The correct answer is C. fvTenant = Tenant(topMo, name='Cisco'). Option C is correct because in the Cisco ACI Cobra SDK, a Tenant object must be instantiated with the Tenant class (imported from cobra.model.fv), passing the parent managed object (topMo) as the first argument and the name as a keyword argument - and the variable must be named…
Question
Options
- AfvTenant = NewTenant(name='Cisco')
- Btenant = Tenant(topMo, name='Cisco')
- CfvTenant = Tenant(topMo, name='Cisco')
- DfvTenant = Tenant('Cisco')
How the community answered
(26 responses)- A15% (4)
- B4% (1)
- C73% (19)
- D8% (2)
Explanation
Option C is correct because in the Cisco ACI Cobra SDK, a Tenant object must be instantiated with the Tenant class (imported from cobra.model.fv), passing the parent managed object (topMo) as the first argument and the name as a keyword argument - and the variable must be named fvTenant to match the ACI object model class reference expected by the rest of the script shown in the exhibit.
Why the distractors are wrong:
- A uses
NewTenant, which is not a valid Cobra SDK class or function - no such constructor exists. - B has correct syntax and arguments but uses the generic Python variable name
tenantinstead offvTenant; since the exhibit's subsequent code referencesfvTenant, this would cause aNameErrorat runtime. - D omits the required parent managed object (
topMo) as the first argument - Cobra SDK constructors always require the parent MO to establish the object hierarchy, so this would raise aTypeError.
Memory tip: Think "Parent first, name second" - Cobra SDK always takes (parentMo, name='...'), and name your variable after the ACI class prefix: fv + Tenant = fvTenant.
Topics
Community Discussion
No community discussion yet for this question.