Allow to POST and MO directly in the hierarchy#41
Allow to POST and MO directly in the hierarchy#41giovannimeo wants to merge 1 commit intodatacenter:mainfrom
Conversation
- ACI REST API allow to create an MO deep in the hierarchy instead of
allowing to POST the whole subtree starting from topRoot. Taking
advantage of this capability. This is beneficial in cases like this
one, let assume we have a hierarchy like:
<topRoot>
<polUni>
<fvTenant name="foo">
<fvAp name="base">
<fvAEPg name="lab">
<fvCEp name="58:F3:9C:89:3A:98">
<fvIp addr="10.23.143.103">
<tagAnnotation key="DNS" value="host.example.local."/>
</fvIp>
</fvCEp>
</fvAEPg>
</fvAp>
</fvTenant>
</polUni>
</topRoot>
the tagAnnotation can be posted by posting the whole hierarchy under
"api/mo.xml" or by posting only the necessary MO:
<tagAnnotation key="DNS" value="host.example.local."/>
under "api/mo/uni/tn-foo/ap-base/epg-lab/cep-58:F3:9C:89:3A:98/ip-[10.23.143.103].xml"
This helps to avoid to construct a nested tree of configuration. The
reason why this was not working was because the POST method for an MO
was calculating the URL of the MO itself instead of the parent for
doing the POST.
|
@giovannimeo apic = NODE(apicurl) |
@sapshah-cisco, that is correct, but that works only if the objects in the middle can actually be configured. In the example above for example fvCEp cannot be created from outside, hence that POST will actually fail because the fvCEp is an implicit object. |
allowing to POST the whole subtree starting from topRoot. Taking
advantage of this capability. This is beneficial in cases like this
one, let assume we have a hierarchy like:
the tagAnnotation can be posted by posting the whole hierarchy under
"api/mo.xml" or by posting only the necessary MO:
under "api/mo/uni/tn-foo/ap-base/epg-lab/cep-58:F3:9C:89:3A:98/ip-[10.23.143.103].xml"
This helps to avoid to construct a nested tree of configuration. The
reason why this was not working was because the POST method for an MO
was calculating the URL of the MO itself instead of the parent for
doing the POST.