nerdexam
Cisco

300-635 · Question #59

Refer to the exhibit. Which action fixes the code to access a child managed object? `` 1 dnQuery = DnQuery( 'uni/tn-companyXYZ') 2 dnQuery.subtree = 'parent' 3 tenantMo = moDir.query(dnQuery) 4…

The correct answer is D. Change parent to children in line 2. Setting dnQuery.subtree = 'children' tells the ACI Cobra SDK to include child managed objects (like Bridge Domains) in the query response - without it, only the tenant MO itself is returned, making line 4's .BD['default'] lookup fail because no child objects were fetched…

Cisco Application Centric Infrastructure

Question

Refer to the exhibit. Which action fixes the code to access a child managed object?
1 dnQuery = DnQuery( 'uni/tn-companyXYZ')
2 dnQuery.subtree = 'parent'
3 tenantMo = moDir.query(dnQuery)
4 defaultBDMo = tenantMo.BD['default']

Options

  • ADelete line 2.
  • BChange dnQuery to classQuery in line 1.
  • CMove line 2 to the last line.
  • DChange parent to children in line 2.

How the community answered

(36 responses)
  • A
    14% (5)
  • B
    3% (1)
  • C
    8% (3)
  • D
    75% (27)

Explanation

Setting dnQuery.subtree = 'children' tells the ACI Cobra SDK to include child managed objects (like Bridge Domains) in the query response - without it, only the tenant MO itself is returned, making line 4's .BD['default'] lookup fail because no child objects were fetched. Option A (deleting line 2) fails for the same reason: the subtree scope is needed, just with the correct value. Option B (switching to ClassQuery) changes the query type entirely - a ClassQuery fetches all objects of a given class across the fabric, breaking the DN-scoped lookup and returning a flat list rather than a navigable object hierarchy. Option C (moving line 2 to last) is nonsensical because the query executes on line 3; setting subtree after the query has already run has zero effect on what was returned.

Memory tip: Think "to get the kids, ask for children" - subtree = 'children' fetches downward in the MIT (Management Information Tree), which is exactly what you need when navigating from a parent MO to its children.

Topics

#ACI Queries#Managed Objects#DN Query#Object Hierarchy

Community Discussion

No community discussion yet for this question.

Full 300-635 Practice