Cisco DCAUTO: Creating a VRF in ACI with Cobra SDK

Creating a VRF in an ACI Tenant using Cobra SDK

Question

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

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B.

The correct answer is C. Vrf(Tenant(uniMo, CustA), CustA_VRF).

The Cobra SDK is a Python library used to interact with Cisco's Application Centric Infrastructure (ACI). It provides a set of classes and methods to create, read, update, and delete objects in ACI.

To create a VRF in an ACI tenant using the Cobra SDK, we need to use the Vrf class and specify the tenant where the VRF will be created. The correct syntax to create a VRF in an ACI tenant using the Cobra SDK is:

Vrf(Tenant(uniMo, CustA), CustA_VRF)

where CustA is the name of the ACI tenant and CustA_VRF is the name of the VRF that we want to create.

Option A is incorrect because the Vrf class should be associated with a Tenant object, not an fvTenant object.

Option B is incorrect because the Ctx class is used to create a context (which is similar to a VRF), but it should be associated with a Tenant object, not a fvTenant object.

Option D is incorrect because the Ctx class should be associated with a Tenant object, not an fvTenant object, and it is used to create a context, not a VRF.

Therefore, the correct answer is C. Vrf(Tenant(uniMo, CustA), CustA_VRF).