Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to POST and MO directly in the hierarchy #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

giovannimeo
Copy link
Contributor

  • 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:

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.

- 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.
@sapshah-cisco
Copy link
Contributor

sapshah-cisco commented Oct 9, 2019

@giovannimeo
I will let Praveen comment on the feature itself, but it is still possible to create an MO deep down in the hierarchy.

apic = NODE(apicurl)
apic.methods.Login(username, password)
apic.mit.FromDn('uni/tn-foo/ap-base/epg-lab/cep-58:F3:9C:89:3A:98/ip-[10.23.143.103]').tagAnnotation(key="DNS", value="host.example.local").POST()

@giovannimeo
Copy link
Contributor Author

@giovannimeo
I will let Praveen comment on the feature itself, but it is still possible to create an MO deep down in the hierarchy.

apic = NODE(apicurl)
apic.methods.Login(username, password)
apic.mit.FromDn('uni/tn-foo/ap-base/epg-lab/cep-58:F3:9C:89:3A:98/ip-[10.23.143.103]').tagAnnotation(key="DNS", value="host.example.local").POST()

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants