Skip to content

Instantly share code, notes, and snippets.

@roulette6
Last active October 1, 2024 17:32
Show Gist options
  • Save roulette6/7b6c2d9077a2c49b0dff880ff22e223e to your computer and use it in GitHub Desktop.
Save roulette6/7b6c2d9077a2c49b0dff880ff22e223e to your computer and use it in GitHub Desktop.
ACI API calls

ACI API calls

ToC

Authenticate

When you send this authentication request, you'll get the token. Postman will continue sending the token automatically when you make subsequent requests.

  • Method: POST
  • URL: https://{{apic}}/api/aaaLogin.json
  • Body:
{
  "aaaUser": {
    "attributes": {
      "name": "{{apic_username}}",
      "pwd": "{{apic_password}}"
    }
  }
}

Back to ToC

Get all tenants

  • Method: GET
  • URL: https://{{apic}}/api/class/fvTenant.json

Back to ToC

Create / delete tenant

Create tenant

  • Method: POST
  • URL: https://{{apic}}/api/mo/uni/tn-{{tenant}}.json
  • Body:
{
    "fvTenant": {
        "attributes": {
            "descr": "{{descr}}",
            "dn": "uni/tn-{{tenant}}",
            "name": "{{tenant}}",
            "rn": "tn-{{tenant}}",
            "status": "created,modified"
        }
    }
}

Delete tenant

  • Method: DELETE
  • URL: https://{{apic}}/api/mo/uni/tn-{{tenant}}.json

Back to ToC

Create / delete application profile

Create application profile

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/tn-{{tenant}}/ap-{{ap_name}}.json
  • Body:
{
    "fvAp":
    {
        "attributes":
        {
            "dn": "uni/tn-{{tenant}}/ap-{{ap_name}}",
            "name": "{{ap_name}}",
            "descr": "{{ap_name_descr}}",
            "rn": "ap-{{ap_name}}",
            "status": "created"
        },
        "children":
        [
            {
                "fvRsApMonPol":
                {
                    "attributes":
                    {
                        "tnMonEPGPolName": "{{monit_pol}}",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Delete application profile

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/tn-{{tenant}}/ap-{{ap_name}}.json
  • Body:
{
    "fvAp":
    {
        "attributes":
        {
            "dn": "uni/tn-{{tenant}}/ap-{{ap_name}}",
            "status": "deleted"
        },
        "children":
        []
    }
}

Back to ToC

Create / delete EPG

Create EPG

  • method: POST
  • url: https://{{apic}}/api/node/mo/uni/tn-{{tenant}}/ap-{{ap_name}}/epg-{{epg_name}}.json
  • Body:
{
    "fvAEPg":
    {
        "attributes":
        {
            "dn": "uni/tn-Heroes/ap-{{ap_name}}/epg-{{epg_name}}",
            "name": "{{epg_name}}",
            "descr": "{{descr}}",
            "rn": "epg-{{epg_name}}",
            "status": "created"
        },
        "children":
        [
            {
                "fvRsBd":
                {
                    "attributes":
                    {
                        "tnFvBDName": "{{bd_name}}",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Delete EPG

  • method: POST
  • url: https://{{apic}}/api/node/mo/uni/tn-{{tenant}}/ap-{{ap_name}}/epg-{{epg_name}}.json
  • Body:
{
    "fvAEPg":
    {
        "attributes":
        {
            "dn": "uni/tn-{{tenant}}/ap-{{ap_name}}/epg-{{epg_name}}",
            "status": "deleted"
        },
        "children":
        []
    }
}

Back to ToC

Create / delete VRF

Create VRF

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/tn-{{tenant}}/ctx-{{vrf}}.json
  • Body:
{
    "fvCtx":
    {
        "attributes":
        {
            "dn": "uni/tn-{{tenant}}/ctx-{{vrf}}",
            "name": "{{vrf}}",
            "rn": "ctx-{{vrf}}",
            "status": "created"
        },
        "children":
        []
    }
}

Delete VRF

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/tn-{{tenant}}/ctx-{{vrf}}.json
  • Body:
{
    "fvCtx":
    {
        "attributes":
        {
            "dn": "uni/tn-{{tenant}}/ctx-{{vrf}}",
            "status": "deleted"
        },
        "children":
        []
    }
}

Back to ToC

Create / delete bridge domain

Create bridge domain

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/tn-{{tenant}}/BD-{{bd_name}}.json
  • Body:
{
    "fvBD":
    {
        "attributes":
        {
            "dn": "uni/tn-{{tenant}}/BD-{{bd_name}}",
            "mac": "{{mac_addr}}",
            "arpFlood": "true",
            "name": "{{bd_name}}",
            "descr": "{{descr}}",
            "unkMacUcastAct": "flood",
            "unicastRoute": "false",
            "rn": "BD-{{bd_name}}",
            "status": "created"
        },
        "children":
        [
            {
                "fvRsCtx":
                {
                    "attributes":
                    {
                        "tnFvCtxName": "{{vrf}}",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Delete bridge domain

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/tn-{{tenant}}/BD-{{bd_name}}.json
  • Body:
{
    "fvBD":
    {
        "attributes":
        {
            "dn": "uni/tn-{{tenant}}/BD-{{bd_name}}",
            "status": "deleted"
        },
        "children":
        []
    }
}

Back to ToC

Create / delete leaf interface profile

Create leaf interface profile

One switch

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/accportprof-{{leaf_ifp}}.json
  • Body:
{
    "infraAccPortP":
    {
        "attributes":
        {
            "dn": "uni/infra/accportprof-{{leaf_ifp}}",
            "name": "{{leaf_ifp}}",
            "descr": "{{descr}}",
            "rn": "accportprof-{{leaf_ifp}}",
            "status": "created,modified"
        },
        "children":
        []
    }
}

Two switches

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/accportprof-{{two_leaf_ifp}}.json
  • Body:
{
    "infraAccPortP":
    {
        "attributes":
        {
            "dn": "uni/infra/accportprof-{{two_leaf_ifp}}",
            "name": "{{two_leaf_ifp}}",
            "descr": "interface profile for leaf nodes 101 and 102",
            "rn": "accportprof-{{two_leaf_ifp}}",
            "status": "created,modified"
        },
        "children":
        []
    }
}

Delete leaf interface profile

  • Method: POST
  • URL: TODO
  • Body:
TODO

Back to ToC

Create / delete switch profile and associate it with a leaf profile

Create switch profile

One switch

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/nprof-test_leaf101_swp.json
  • Body:
{
    "infraNodeP":
    {
        "attributes":
        {
            "dn": "uni/infra/nprof-test_leaf101_swp",
            "name": "test_leaf101_swp",
            "rn": "nprof-test_leaf101_swp",
            "status": "created,modified"
        },
        "children":
        [
            {
                "infraLeafS":
                {
                    "attributes":
                    {
                        "dn": "uni/infra/nprof-test_leaf101_swp/leaves-leaf101-typ-range",
                        "type": "range",
                        "name": "leaf101",
                        "rn": "leaves-leaf101-typ-range",
                        "status": "created"
                    },
                    "children":
                    [
                        {
                            "infraNodeBlk":
                            {
                                "attributes":
                                {
                                    "dn": "uni/infra/nprof-test_leaf101_swp/leaves-leaf101-typ-range/nodeblk-d149546e6eb5cdbb",
                                    "from_": "101",
                                    "to_": "101",
                                    "name": "d149546e6eb5cdbb",
                                    "rn": "nodeblk-d149546e6eb5cdbb",
                                    "status": "created"
                                },
                                "children":
                                []
                            }
                        }
                    ]
                }
            },
            {
                "infraRsAccPortP":
                {
                    "attributes":
                    {
                        "tDn": "uni/infra/accportprof-{{leaf_ifp}}",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Two switches

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/nprof-test_leaf101_102_swp.json
  • Body:
{
    "infraNodeP":
    {
        "attributes":
        {
            "dn": "uni/infra/nprof-test_leaf101_102_swp",
            "name": "test_leaf101_102_swp",
            "descr": "swp for leaf 101 and leaf 102",
            "rn": "nprof-test_leaf101_102_swp",
            "status": "created,modified"
        },
        "children":
        [
            {
                "infraLeafS":
                {
                    "attributes":
                    {
                        "dn": "uni/infra/nprof-test_leaf101_102_swp/leaves-leaf101_102-typ-range",
                        "type": "range",
                        "name": "leaf101_102",
                        "rn": "leaves-leaf101_102-typ-range",
                        "status": "created"
                    },
                    "children":
                    [
                        {
                            "infraNodeBlk":
                            {
                                "attributes":
                                {
                                    "dn": "uni/infra/nprof-test_leaf101_102_swp/leaves-leaf101_102-typ-range/nodeblk-496d6206c2b9411d",
                                    "from_": "101",
                                    "to_": "102",
                                    "name": "496d6206c2b9411d",
                                    "rn": "nodeblk-496d6206c2b9411d",
                                    "status": "created"
                                },
                                "children":
                                []
                            }
                        }
                    ]
                }
            },
            {
                "infraRsAccPortP":
                {
                    "attributes":
                    {
                        "tDn": "uni/infra/accportprof-{{two_leaf_ifp}}",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Delete switch profile

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/nprof-test_leaf10_swp.json
  • Body:
{
    "infraNodeP":
    {
        "attributes":
        {
            "dn": "uni/infra/nprof-test_leaf10_swp",
            "status": "deleted"
        },
        "children":
        []
    }
}

Back to ToC

Configure vPC pair

Create vPC explicit protection group

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/fabric/protpol/expgep-{{protection_group}}.json
  • Body:
{
    "fabricExplicitGEp":
    {
        "attributes":
        {
            "dn": "uni/fabric/protpol/expgep-{{protection_group}}",
            "name": "{{protection_group}}",
            "id": "100",
            "rn": "expgep-{{protection_group}}",
            "status": "created"
        },
        "children":
        [
            {
                "fabricNodePEp":
                {
                    "attributes":
                    {
                        "dn": "uni/fabric/protpol/expgep-{{protection_group}}/nodepep-{{node1}}",
                        "id": "{{node1}}",
                        "status": "created",
                        "rn": "nodepep-{{node1}}"
                    },
                    "children":
                    []
                }
            },
            {
                "fabricNodePEp":
                {
                    "attributes":
                    {
                        "dn": "uni/fabric/protpol/expgep-{{protection_group}}/nodepep-{{node2}}",
                        "id": "{{node2}}",
                        "status": "created",
                        "rn": "nodepep-{{node2}}"
                    },
                    "children":
                    []
                }
            },
            {
                "fabricRsVpcInstPol":
                {
                    "attributes":
                    {
                        "tnVpcInstPolName": "default",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Back to ToC

Create / delete interface selector for the interface profiles

Create interface selector

Single switch, access port

  • NOTES:
    • leaf_ifp stands for leaf interface selector profile (Interfaces > Leaf Interfaces > Profiles).
    • For a single port, fromPort and toPort are the same value (Example: 25).
    • Multiple API inspections always yield the same port block block2.
    • To omit the IPG, simply omit this line: "tDn": "uni/infra/funcprof/accportgrp-{{ipg}}",.
  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/accportprof-{{leaf_ifp}}/hports-{{acc_port_sel_name}}-typ-range.json
  • Body:
{
    "infraHPortS":
    {
        "attributes":
        {
            "dn": "uni/infra/accportprof-{{leaf_ifp}}/hports-{{int_selector}}-typ-range",
            "name": "{{int_selector}}",
            "rn": "hports-{{int_selector}}-typ-range",
            "status": "created,modified"
        },
        "children":
        [
            {
                "infraPortBlk":
                {
                    "attributes":
                    {
                        "dn": "uni/infra/accportprof-{{leaf_ifp}}/hports-{{int_selector}}-typ-range/portblk-block2",
                        "fromPort": "{{from_port}}",
                        "toPort": "{{to_port}}",
                        "name": "block2",
                        "rn": "portblk-block2",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            },
            {
                "infraRsAccBaseGrp":
                {
                    "attributes":
                    {
                        "tDn": "uni/infra/funcprof/accportgrp-{{ipg}}",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Two switches, for vPC

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/accportprof-{{two_leaf_ifp}}/hports-{{vpc_int_selector}}-typ-range.json
  • Body:
{
    "infraHPortS":
    {
        "attributes":
        {
            "dn": "uni/infra/accportprof-{{two_leaf_ifp}}/hports-{{vpc_int_selector}}-typ-range",
            "name": "{{vpc_int_selector}}",
            "descr": "{{description}}",
            "rn": "hports-{{vpc_int_selector}}-typ-range",
            "status": "created,modified"
        },
        "children":
        [
            {
                "infraPortBlk":
                {
                    "attributes":
                    {
                        "dn": "uni/infra/accportprof-{{two_leaf_ifp}}/hports-{{vpc_int_selector}}-typ-range/portblk-block2",
                        "fromPort": "{{from_port}}",
                        "toPort": "{{to_port}}",
                        "name": "block2",
                        "rn": "portblk-block2",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            },
            {
                "infraRsAccBaseGrp":
                {
                    "attributes":
                    {
                        "tDn": "uni/infra/funcprof/accbundle-{{ipg}}",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Delete interface selector

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/accportprof-{{acc_port_sel_name}}.json
  • Body:
{
    "infraAccPortP":
    {
        "attributes":
        {
            "dn": "uni/infra/accportprof-acc_port_sel_name",
            "status": "deleted"
        },
        "children":
        []
    }
}

Back to ToC

Create / delete interface policy groups

Create interface policies

LLDP interface policy

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/lldpIfP-{{lldp_int_pol}}.json
  • Body:
{
    "lldpIfPol":
    {
        "attributes":
        {
            "dn": "uni/infra/lldpIfP-{{lldp_int_pol}}",
            "name": "{{lldp_int_pol}}",
            "rn": "lldpIfP-{{lldp_int_pol}}",
            "status": "created"
        },
        "children":
        []
    }
}

CDP interface policy

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/cdpIfP-{{cdp_int_pol}}.json
  • Body:
{
    "cdpIfPol":
    {
        "attributes":
        {
            "dn": "uni/infra/cdpIfP-{{cdp_int_pol}}",
            "name": "{{cdp_int_pol}}",
            "rn": "cdpIfP-{{cdp_int_pol}}",
            "status": "created"
        },
        "children":
        []
    }
}

LACP interface policy

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/lacplagp-{{lacp_int_pol}}.json
  • Body:
{
    "lacpLagPol":
    {
        "attributes":
        {
            "dn": "uni/infra/lacplagp-{{lacp_int_pol}}",
            "name": "{{lacp_int_pol}}",
            "descr": "Meh",
            "mode": "active",
            "rn": "lacplagp-{{lacp_int_pol}}",
            "status": "created"
        },
        "children":
        []
    }
}

Create leaf access port policy group

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/funcprof/accportgrp-{{int_pol_grp}}.json
  • Body:
{
    "infraAccPortGrp":
    {
        "attributes":
        {
            "dn": "uni/infra/funcprof/accportgrp-{{int_pol_grp}}",
            "name": "{{int_pol_grp}}",
            "descr": "meh",
            "rn": "accportgrp-{{int_pol_grp}}",
            "status": "created"
        },
        "children":
        [
            {
                "infraRsLldpIfPol":
                {
                    "attributes":
                    {
                        "tnLldpIfPolName": "test_enable_LLDP",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

create VPC interface policy group

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/funcprof/accbundle-{{vpc_int_pol_grp}}.json
  • Body:
{
    "infraAccBndlGrp":
    {
        "attributes":
        {
            "dn": "uni/infra/funcprof/accbundle-{{vpc_int_pol_grp}}",
            "lagT": "node",
            "name": "{{vpc_int_pol_grp}}",
            "rn": "accbundle-{{vpc_int_pol_grp}}",
            "status": "created"
        },
        "children":
        [
            {
                "infraRsCdpIfPol":
                {
                    "attributes":
                    {
                        "tnCdpIfPolName": "test_enable_CDP",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            },
            {
                "infraRsLldpIfPol":
                {
                    "attributes":
                    {
                        "tnLldpIfPolName": "test_enable_LLDP",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            },
            {
                "infraRsLacpPol":
                {
                    "attributes":
                    {
                        "tnLacpLagPolName": "test_lacp_active",
                        "status": "created,modified"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Apply interface policy groups to port selectors

Leaf access port selector

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/accportprof-{{leaf_ifp}}/hports-catalyst-typ-range/rsaccBaseGrp.json
  • Body:
{
    "infraRsAccBaseGrp":
    {
        "attributes":
        {
            "tDn": "uni/infra/funcprof/accportgrp-{{int_pol_grp}}"
        },
        "children":
        []
    }
}

vPC port selector

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/accportprof-{{two_leaf_ifp}}/hports-test_server_vpc-typ-range/rsaccBaseGrp.json
  • Body:
{
    "infraRsAccBaseGrp":
    {
        "attributes":
        {
            "tDn": "uni/infra/funcprof/accbundle-{{vpc_int_pol_grp}}"
        },
        "children":
        []
    }
}

Back to ToC

Configure VLAN pool, physical domain, and AAEP

Create VLAN pool

Including an encapsulation block

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/vlanns-[test_vlan_pool]-static.json
  • Body:
{
    "fvnsVlanInstP":
    {
        "attributes":
        {
            "dn": "uni/infra/vlanns-[test_vlan_pool]-static",
            "name": "test_vlan_pool",
            "allocMode": "static",
            "rn": "vlanns-[test_vlan_pool]-static",
            "status": "created"
        },
        "children":
        [
            {
                "fvnsEncapBlk":
                {
                    "attributes":
                    {
                        "dn": "uni/infra/vlanns-[test_vlan_pool]-static/from-[vlan-1]-to-[vlan-50]",
                        "from": "vlan-1",
                        "to": "vlan-50",
                        "rn": "from-[vlan-1]-to-[vlan-50]",
                        "status": "created"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Create VLAN encapsulation block

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/vlanns-[test_vlan_pool]-static/from-[vlan-60]-to-[vlan-70].json
  • Body:
{
    "fvnsEncapBlk":
    {
        "attributes":
        {
            "dn": "uni/infra/vlanns-[test_vlan_pool]-static/from-[vlan-60]-to-[vlan-70]",
            "from": "vlan-60",
            "to": "vlan-70",
            "descr": "db",
            "rn": "from-[vlan-60]-to-[vlan-70]",
            "status": "created"
        },
        "children":
        []
    }
}

Delete VLAN encapsulation block

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/vlanns-[jm_vlan_pool]-static/from-[vlan-30]-to-[vlan-40].json
  • Body:
{
    "fvnsEncapBlk":
    {
        "attributes":
        {
            "dn": "uni/infra/vlanns-[jm_vlan_pool]-static/from-[vlan-30]-to-[vlan-40]",
            "status": "deleted"
        },
        "children":
        []
    }
}

Create Physical domain and assign a VLAN pool

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/phys-test_phyDom.json
  • Body:
{
    "physDomP":
    {
        "attributes":
        {
            "dn": "uni/phys-test_phyDom",
            "name": "test_phyDom",
            "rn": "phys-test_phyDom",
            "status": "created"
        },
        "children":
        [
            {
                "infraRsVlanNs":
                {
                    "attributes":
                    {
                        "tDn": "uni/infra/vlanns-[test_vlan_pool]-static",
                        "status": "created"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Change VLAN pool used by a physical domain

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/phys-dom_phy_core/rsvlanNs.json
  • Body:
{
    "infraRsVlanNs":
    {
        "attributes":
        {
            "tDn": "uni/infra/vlanns-[jm_vlan_pool]-static"
        },
        "children":
        []
    }
}

Create an AAEP

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra.json
  • Body:
{
    "infraInfra":
    {
        "attributes":
        {
            "dn": "uni/infra",
            "status": "modified"
        },
        "children":
        [
            {
                "infraAttEntityP":
                {
                    "attributes":
                    {
                        "dn": "uni/infra/attentp-{{aaep}}",
                        "name": "{{aaep}}",
                        "rn": "attentp-{{aaep}}",
                        "status": "created"
                    },
                    "children":
                    [
                        {
                            "infraRsDomP":
                            {
                                "attributes":
                                {
                                    "tDn": "uni/phys-test_phyDom",
                                    "status": "created"
                                },
                                "children":
                                []
                            }
                        }
                    ]
                }
            },
            {
                "infraFuncP":
                {
                    "attributes":
                    {
                        "dn": "uni/infra/funcprof",
                        "status": "modified"
                    },
                    "children":
                    []
                }
            }
        ]
    }
}

Attach AAEP to interface policy groups

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/funcprof/accportgrp-{{int_pol_grp}}/rsattEntP.json
  • Body:
{
    "infraRsAttEntP":
    {
        "attributes":
        {
            "tDn": "uni/infra/attentp-{{aaep}}",
            "status": "created,modified"
        },
        "children":
        []
    }
}
  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/funcprof/accbundle-{{vpc_int_pol_grp}}/rsattEntP.json
  • Body:
{
    "infraRsAttEntP":
    {
        "attributes":
        {
            "tDn": "uni/infra/attentp-{{aaep}}",
            "status": "created,modified"
        },
        "children":
        []
    }
}

Enable / disable physical interface

Enable physical interface

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/fabric/outofsvc.json
  • Body:
{
    "fabricRsOosPath":
    {
        "attributes":
        {
            "dn": "uni/fabric/outofsvc/rsoosPath-[topology/pod-1/paths-{{node}}/pathep-[eth1/4]]",
            "status": "deleted"
        },
        "children":
        []
    }
}

Disable physical interface

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/fabric/outofsvc.json
  • Body:
{
    "fabricRsOosPath":
    {
        "attributes":
        {
            "tDn": "topology/pod-1/paths-{{node}}/pathep-[eth1/4]",
            "lc": "blacklist"
        },
        "children":
        []
    }
}

Back to ToC

Steps to decom interfaces

Steps:

  1. Remove all EPG static path bindings from interfaces
  2. Delete the related policy groups
  3. Delete the interface profile or remove int selector
  4. Shutdown the physical interfaces

Remove all EPG static path bindings from interfaces

Create static path binding

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/tn-{{tenant}}/ap-{{ap_name}}/epg-{{epg_name}}/rspathAtt-[topology/pod-1/{{node}}/pathep-[{{interface}}]].json
  • Body:
{
    "fvRsPathAtt":
    {
        "attributes":
        {
            "dn": "uni/tn-{{tenant}}/ap-{{ap_name}}/epg-{{epg_name}}/rspathAtt-[topology/pod-1/{{node}}/pathep-[{{interface}}]]",
            "encap": "vlan-{{vlan}}",
            "mode": "{{mode}}",
            "tDn": "topology/pod-1/{{node}}/pathep-[{{interface}}]",
            "rn": "rspathAtt-[topology/pod-1/{{node}}/pathep-[{{interface}}]]",
            "status": "created,modified"
        },
        "children":
        []
    }
}

Delete static path binding

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/tn-{{tenant}}/ap-{{ap_name}}/epg-{{epg_name}}/rspathAtt-[topology/pod-1/paths-{{node}}/pathep-[{{interface}}]].json
  • Body:
{
    "fvRsPathAtt":
    {
        "attributes":
        {
            "dn": "uni/tn-{{tenant}}/ap-{{ap_name}}/epg-{{epg_name}}/rspathAtt-[topology/pod-1/paths-{{node}}/pathep-[{{interface}}]]",
            "status": "deleted"
        },
        "children":
        []
    }
}

Delete the interface profile or remove int selector

Delete interface profile

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/accportprof-{{leaf_int_profile}}.json
  • Body:
{
    "infraAccPortP":
    {
        "attributes":
        {
            "dn": "uni/infra/accportprof-{{leaf_int_profile}}",
            "status": "deleted"
        },
        "children":
        []
    }
}

Remove interface selector

In the example below, the interface range could be 1 for a single interface such as hports-ethernet1_1-typ-range or 5-8 for a contiguous range such as ethernet1_5-8-typ-range.

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/accportprof-{{leaf_int_profile}}/hports-ethernet1_{{range}}-typ-range.json
  • Body:
{
    "infraHPortS":
    {
        "attributes":
        {
            "dn": "uni/infra/accportprof-SnV_FI-1A/hports-ethernet1_{{range}}-typ-range",
            "status": "deleted"
        },
        "children":
        []
    }
}

Delete related policy groups

vPC interface

  • Method: POST
  • URL: https://{{apic}}/api/node/mo/uni/infra/funcprof/accbundle-{{vpc_pol_group}}.json
  • Body:
{
    "infraAccBndlGrp":
    {
        "attributes":
        {
            "dn": "uni/infra/funcprof/accbundle-{{vpc_pol_group}}",
            "status": "deleted"
        },
        "children":
        []
    }
}

Shutdown physical interfaces

See Disable physical interface

Back to ToC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment