nerdexam
Cisco

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…

Cisco Application Centric Infrastructure

Question

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.

Options

  • AfvTenant = NewTenant(name='Cisco')
  • Btenant = Tenant(topMo, name='Cisco')
  • CfvTenant = Tenant(topMo, name='Cisco')
  • DfvTenant = Tenant('Cisco')

How the community answered

(26 responses)
  • A
    15% (4)
  • B
    4% (1)
  • C
    73% (19)
  • D
    8% (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 tenant instead of fvTenant; since the exhibit's subsequent code references fvTenant, this would cause a NameError at 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 a TypeError.

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

#Cobra SDK#ACI Tenant Creation#APIC Management#topMo Context

Community Discussion

No community discussion yet for this question.

Full 300-635 Practice