Configuring Layer 1/Layer 2 Policy-Based Redirect

This procedure shows you how to use the APIC REST API to configure Layer 1/Layer 2 policy-based redirect. This procedure performs the same operation as the GUI procedure of the same name in the Cisco APIC Layer 4 to Layer 7 Services Deployment Guide.

Procedure

Step 1

Configure Layer 1/Layer 2 policy-based redirect.

Example:

POST https://<apic-ip-address>/api/node/mo/uni.xml

<polUni>
    <fvTenant name="tenant1" >

        <!—If L1/L2 device in active-active mode -- >
        <vnsLDevVip name="N1"  activeActive="yes" funcType="L1" managed="no">
        </vnsLDevVip>
        <!—If L1/L2 device in active-standby mode -- >
        <vnsLDevVip name="N1"  activeActive="no" funcType="L1" managed="no">
        </vnsLDevVip>

        <vnsAbsGraph descr="" dn="uni/tn-tenant1/AbsGraph-WebGraph"
          name="WebGraph" uiTemplateType="UNSPECIFIED">

            <!—For L2 device -- >
            <vnsAbsNode funcTemplateType="OTHER" funcType="L2" isCopy="no"
              managed="no" name="N1" routingMode="Redirect" sequenceNumber="0"
              shareEncap="no">
            </vnsAbsNode>

            <!—For L1 device -- >
            <vnsAbsNode descr="" funcTemplateType="OTHER" funcType="L1"
              isCopy="no" managed="no" name="N1" routingMode="Redirect"
              sequenceNumber="0" shareEncap="no">
            </vnsAbsNode>

        </vnsAbsGraph>

        <fvIPSLAMonitoringPol name="Pol2" slaType="l2ping"/>
        <vnsSvcCont>
            <vnsRedirectHealthGroup name="2" />
            <vnsSvcRedirectPol name="N1Ext" destType="L2">
                <vnsRsIPSLAMonitoringPol
                  tDn="uni/tn-tenant1/ipslaMonitoringPol-Pol2"/>      
                <vnsL1L2RedirectDest destName="1">
                    <vnsRsL1L2RedirectHealthGroup
                      tDn="uni/tn-tenant1/svcCont/redirectHealthGroup-2"/>
                    <vnsRsToCIf
                      tDn="uni/tn-tenant1/lDevVip-N1/cDev-ASA1/cIf-[Gig0/0]"/>
                </vnsL1L2RedirectDest>
            </vnsSvcRedirectPol>

            <vnsSvcRedirectPol name="N1Int" destType="L2">
                <vnsRsIPSLAMonitoringPol tDn="uni/tn-tenant1/ipslaMonitoringPol-Pol2"/>       
                <vnsL1L2RedirectDest destName="2">
                    <vnsRsL1L2RedirectHealthGroup
                      tDn="uni/tn-tenant1/svcCont/redirectHealthGroup-2"/>
                    <vnsRsToCIf
                      tDn="uni/tn-tenant1/lDevVip-N1/cDev-ASA1/cIf-[Gig0/1]"/>
                </vnsL1L2RedirectDest>
            </vnsSvcRedirectPol>
        </vnsSvcCont>
    </fvTenant>
</polUni>

When the POST succeeds, the object that you created appears in the response.