nerdexam
Cisco

300-635 · Question #41

Which Python code creates a VRF in an ACI tenant using the Cobra SDK?

The correct answer is B. Ctx(Tenant(uniMo, 'CustA'), 'CustA_VRF'). Option B is correct because the Cobra SDK uses Ctx (short for "Context") as the Python class name for a VRF - ACI internally models VRFs as fvCtx objects, and Cobra exposes this as Ctx - and Tenant as the proper SDK class for fvTenant. A fails on two counts: Vrf is not a valid…

Cisco Application Centric Infrastructure

Question

Which Python code creates a VRF in an ACI tenant using the Cobra SDK?

Options

  • AVrf(fvTenant(uniMo, 'CustA'), 'CustA_VRF')
  • BCtx(Tenant(uniMo, 'CustA'), 'CustA_VRF')
  • CVrf(Tenant(uniMo, 'CustA'), 'CustA_VRF')
  • DCtx(fvTenant(uniMo, 'CustA'), 'CustA_VRF')

How the community answered

(49 responses)
  • A
    2% (1)
  • B
    92% (45)
  • C
    2% (1)
  • D
    4% (2)

Explanation

Option B is correct because the Cobra SDK uses Ctx (short for "Context") as the Python class name for a VRF - ACI internally models VRFs as fvCtx objects, and Cobra exposes this as Ctx - and Tenant as the proper SDK class for fvTenant.

  • A fails on two counts: Vrf is not a valid Cobra SDK class (ACI never uses "VRF" as an object name), and fvTenant is the raw ACI managed object name, not the SDK's Python class.
  • C uses the correct Tenant class but still uses the non-existent Vrf class; ACI/Cobra has no such identifier.
  • D uses the correct Ctx class but passes fvTenant(...) instead of Tenant(...); in Cobra SDK you use the shortened Python class names (Tenant, Ctx), not the raw MO names like fvTenant.

Memory tip: ACI calls a VRF a "Context," so in Cobra SDK it's always Ctx, never Vrf. If you see Vrf in an answer, eliminate it immediately.

Topics

#ACI Cobra SDK#VRF/Context object#Python API syntax#Tenant model

Community Discussion

No community discussion yet for this question.

Full 300-635 Practice