Configuring VLANs

The NX-API REST API supports VLAN configuration that is enabled by the following CLI commands:

[no] vlan {vlan-id-create-delete}
switchport access vlan <vlan-id-access> | no switchport access vlan
switchport trunk allowed vlan{ <allow-vlans | add <add-vlans | except <except-vlans> | remove <remove-vlans> | all | none | no switchport trunk allowed vlan

Configuring the Native VLAN ID for a Virtual Ethernet Interface

Configuring the Native VLAN ID for a Virtual Ethernet Interface
POST http://<IP_Address>/api/mo/sys/intf.json
{
"interfaceEntity": {
  "children": [
    {
      "l1PhysIf": {
        "attributes": {
          "id": "eth1/1",
          "nativeVlan": "vlan-60"
}}}]}}     
{
    imdata": []
}
<System>
  <intf-items>
    <phys-items>
      <PhysIf-list>
        <id>eth1/1</id>
        <nativeVlan>vlan-60</nativeVlan>
      </PhysIf-list>
    </phys-items>
  </intf-items>
</System>

Configures the native VLAN ID for the virtual Ethernet interface.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right.

interface ethernet 1/1
 switchport trunk native vlan 60

Note: The property information for this example was added in Release 9.3(3).


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
interfaceEntity sys/intf
l1PhysIf sys/intf/phys-{[id]}


l1PhysIf Properties

The following table contains information about the l1PhysIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
idnw:IfId
(base:IfIndex)
An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100
nativeVlanl1:l1IfNativeVlan
(base:Encap)
Configured Native VlanSELECTION: unknown, vlan-%d or vxlan-%d
DEFAULT: vlan-1


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Enabling Interface VLAN

Enabling Interface VLAN
POST http://<IP_Address>/api/mo/sys/fm.json
{
"fmEntity": {
  "children": [
    {
      "fmInterfaceVlan": {
        "attributes": {
          "adminSt": "enabled"
}}}]}}    
{
    imdata": []
}
<System>
  <fm-items>
    <ifvlan-items>
      <adminSt>enabled</adminSt>
    </ifvlan-items>
  </fm-items>
</System>

This is required before configuring a VLAN interface.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right.

feature interface-vlan

Note: The property information for this example was added in Release 9.3(3).


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
fmEntity sys/fm
fmInterfaceVlan sys/fm/ifvlan


fmInterfaceVlan Properties

The following table contains information about the fmInterfaceVlan properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
adminStfm:AdminState
(scalar:Enum8)
Admin statusSELECTION:
1 - enabled
2 - disabled
DEFAULT: disabled


Related Documentation

For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

Creating a VLAN

Creating a VLAN 
POST http://<IP_Address>/api/mo/sys/bd.json
{
"bdEntity": {
  "children": [
    {
      "l2BD": {
        "attributes": {
          "fabEncap": "vlan-50",
          "pcTag": "1"
}}}]}}   
{
    imdata": []
}
<System>
  <bd-items>
    <bd-items>
      <BD-list>
        <fabEncap>vlan-50</fabEncap>
        <pcTag>1</pcTag>
      </BD-list>
    </bd-items>
  </bd-items>
</System>

Creates a VLAN.


CLI Command

The CLI command below is the equivalent to the payload example displayed in the pane on the right.

vlan 50

Note: The property information for this example was added in Release 9.3(3).


Verifying a DME Configuration
The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

MODN
bdEntity sys/bd
l2BD sys/bd/bd-{[fabEncap]}


l2BD Properties

The following table contains information about the l2BD properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

Property NameData TypeDescriptionValues
fabEncapbase:Encap
The Layer 2 bridge-domain Fabric encapsulation (VNID).SELECTION: unknown, vlan-%d or vxlan-%d
pcTag
actrl:PcTag
scalar:Uint32
The default classId for the unknown Unicast traffic terminating on the L2 bridge-domain.SELECTION:
  • 0u - any
  • DEFAULT: 0

  • Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Configuring a VLAN Interface

    Configuring a VLAN Interface
    
    POST http://<IP_Address>/api/mo/sys.json
    
    
    {
      "topSystem": {
        "children": [
          {
            "interfaceEntity": {
              "children": [
                {
                  "sviIf": {
                    "attributes": {
                      "id": "vlan50"
    }}}]}}]}} 
    
    {
        imdata": []
    }
    
    <System>
      <intf-items>
        <svi-items>
          <If-list>
            <id>vlan50</id>
          </If-list>
        </svi-items>
      </intf-items>
    </System>
    

    Configures a VLAN interface.


    CLI Command

    The CLI command below is the equivalent to the payload example displayed in the pane on the right.

    interface vlan 50

    Note: The property information for this example was added in Release 9.3(3).


    Verifying a DME Configuration
    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    topSystem sys
    interfaceEntity sys/intf
    sviIf sys/intf/svi-{[id]}


    sviIf Properties

    The following table contains information about the sviIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    idnw:IfId
    (base:IfIndex)
    An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Configuring Switchport Parameters

    Configuring Switchport Parameters
    
    POST http://<IP_Address>/api/mo/sys.json
    
    
    {
      "topSystem": {
        "children": [
          {
            "interfaceEntity": {
              "children": [
                {
                  "l1PhysIf": {
                    "attributes": {
                      "id": "eth1/2",
                      "layer": "Layer2",
                      "userCfgdFlags": "admin_layer"
    
    }}}]}}]}}
    
    {
        imdata": []
    }
    
    <System>
      <intf-items>
        <phys-items>
          <PhysIf-list>
            <id>eth1/2</id>
            <layer>Layer2</layer>
            <userCfgdFlags>admin_layer</userCfgdFlags>
          </PhysIf-list>
        </phys-items>
      </intf-items>
    </System>
    

    Configures switchport parameters.


    CLI Command

    The CLI command below is the equivalent to the payload example displayed in the pane on the right.

    interface ethernet 1/2
     switchport

    Note: The property information for this example was added in Release 9.3(3).


    Verifying a DME Configuration
    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    topSystem sys
    interfaceEntity sys/intf
    l1PhysIf sys/intf/phys-{[id]}


    l1PhysIf Properties

    The following table contains information about the l1PhysIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    idnw:IfId
    (base:IfIndex)
    An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100
    layerl1:Layer
    (scalar:Enum8)
    Administrative port layerSELECTION:
    1 - Layer2
    2 - Layer3
    DEFAULT: Layer2
    userCfgdFlagsl1:userCfgdFlags
    (scalar:Bitmask8)
    Port User Config FlagsSELECTION:
    0 - none
    1 - admin_state
    2 - admin_layer
    4 - admin_router_mac
    8 - admin_dce_mode
    16 - admin_mtu
    DEFAULT: none


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Setting the Access Mode of an Interface to a VLAN

    Setting the Access Mode of an Interface to a VLAN
    
    POST http://<IP_Address>/api/mo/sys.json
    
    {
      "topSystem": {
        "children": [
          {
            "interfaceEntity": {
              "children": [
                {
                  "l1PhysIf": {
                    "attributes": {
                      "accessVlan": "vlan-50",
                      "id": "eth1/2"
    
    }}}]}}]}}
    
    {
        imdata": []
    }
    
    <System>
      <intf-items>
        <phys-items>
          <PhysIf-list>
            <id>eth1/2</id>
            <accessVlan>vlan-50</accessVlan>
          </PhysIf-list>
        </phys-items>
      </intf-items>
    </System>
    

    Sets the access mode of the interface to the specified VLAN.


    CLI Command

    The CLI commands below are the equivalent to the payload example displayed in the pane on the right.

    interface ethernet 1/2
     switchport access vlan 50

    Note: The property information for this example was added in Release 9.3(3).


    Verifying a DME Configuration
    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    topSystem sys
    interfaceEntity sys/intf
    l1PhysIf sys/intf/phys-{[id]}


    l1PhysIf Properties

    The following table contains information about the l1PhysIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    accessVlanl1:l1IfAccessVlan
    (base:Encap)
    Configured Access VlanSELECTION: unknown, vlan-%d or vxlan-%d
    DEFAULT: vlan-1
    idnw:IfId
    (base:IfIndex)
    An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Configuring VLANs for a Virtual Ethernet Interface

    Configuring VLANs for a Virtual Ethernet Interface
    
    POST http://<IP_Address>/api/mo/sys/intf.json
    
    {
    "interfaceEntity": {
      "children": [
        {
          "l1PhysIf": {
            "attributes": {
              "id": "eth1/2",
              "trunkVlans": "70"
    }}}]}}
    
    {
        imdata:[]
    }
    
    <System>
      <intf-items>
        <phys-items>
          <PhysIf-list>
            <id>eth1/2</id>
            <trunkVlans>70</trunkVlans>
          </PhysIf-list>
        </phys-items>
      </intf-items>
    </System>
    


    CLI Command

    The CLI command below is the equivalent to the payload example displayed in the pane on the right.

    interface ethernet 1/2
     switchport trunk allowed vlan 70

    Note: The property information for this example was added in Release 9.3(3).


    Verifying a DME Configuration
    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    interfaceEntity sys/intf
    l1PhysIf sys/intf/phys-{[id]}


    l1PhysIf Properties

    The following table contains information about the l1PhysIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    idnw:IfId
    (base:IfIndex)
    An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100
    trunkVlansl1:l1IfTrunkVlans
    (l2:VlanBitmap)
    Configed Trunk Vlans
    DEFAULT: 1-4094


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Adding VLANs to an Interface

    Adding VLANs to an Interface
    
    POST http://<IP_Address>/api/mo/sys.json
    
    {
    "topSystem": {
        "children": [
            {
                "l1PhysIf": {
                    "attributes": {
                        "rn": "phys-[eth1/2]",
                        "id": "eth3/21",
                        "descr": "MDT test: trunk port",
                        "layer": "Layer2",
                        "mode": "trunk",
                        "mtu": "9216",
                        "adminSt": "up",
                        "trunkLog": "enable",
                        "trunkVlans": "+2",
                        "snmpTrapSt": "disable"
    }}}}}
    
    {
        imdata:[]
    }
    

    This example demonstrates how to add VLANs to an interface. In the payload, the rn and trunkVlans properties are required. For the rn property, enter the interface as shown. For the trunkVlans property, enter plus (+) followed by the number of VLANs you want to add. For example: +2.


    CLI Command

    The CLI command below is the equivalent to the payload example displayed in the pane on the right.

    interface ethernet 1/2
     switchport trunk allowed vlan add 2

    Note: The property information for this example was added in Release 9.3(3).


    Verifying a DME Configuration
    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    topSystem sys
    l1PhysIf sys/intf/phys-{[id]}


    l1PhysIf Properties

    The following table contains information about the l1PhysIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    rn
    reference:BinRN
    Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.
    idnw:IfId
    (base:IfIndex)
    An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100
    descrnaming:Descr1024
    (string:Basic)
    descr
    MAX SIZE: 254
    layerl1:Layer
    (scalar:Enum8)
    Administrative port layerSELECTION:
    1 - Layer2
    2 - Layer3
    DEFAULT: Layer2
    model1:Mode
    (scalar:Enum8)
    Administrative port modeSELECTION:
    1 - access
    2 - trunk
    3 - fex-fabric
    4 - dot1q-tunnel
    5 - promiscuous
    6 - host
    7 - trunk_secondary
    8 - trunk_promiscuous
    9 - vntag
    DEFAULT: access
    mtul1:Mtu
    (scalar:Uint32)
    Administrative port mtu
    RANGE: [576 , 9216]
    DEFAULT: 1500
    adminStl1:AdminSt
    (scalar:Enum8)
    Administrative port stateSELECTION:
    1 - down
    2 - up
    DEFAULT: up
    trunkLogl1:TrunkLog
    (scalar:Enum8)
    Administrative trunk logging enableSELECTION:
    1 - default
    2 - enable
    3 - disable
    DEFAULT: default
    trunkVlansl1:l1IfTrunkVlans
    (l2:VlanBitmap)
    Configed Trunk Vlans
    DEFAULT: 1-4094
    snmpTrapStl1:SnmpTrapSt
    (scalar:Enum8)
    Administrative port snmp trap stateSELECTION:
    1 - enable
    2 - disable
    DEFAULT: enable


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Removing VLANs from an Interface

    Removing VLANs from an Interface
    
    POST http://<IP_Address>/api/mo/sys.json
    
    {
    "topSystem": {
        "children": [
            {
                "l1PhysIf": {
                    "attributes": {
                        "rn": "phys-[eth1/2]",
                        "id": "eth3/21",
                        "descr": "MDT test: trunk port",
                        "layer": "Layer2",
                        "mode": "trunk",
                        "mtu": "9216",
                        "adminSt": "up",
                        "trunkLog": "enable",
                        "trunkVlans": "-2",
                        "snmpTrapSt": "disable"
    }}}}}
    
    {
        imdata:[]
    }
    

    This example demonstrates how to remove VLANs from an interface. The rn and trunkVlans properties are required. For the rn property, enter the interface as shown. For the trunkVlans property, enter a minus (-) followed by the number of VLANs you want to remove. For example: -2.


    CLI Command

    The CLI command below is the equivalent to the payload example displayed in the pane on the right.

    interface ethernet 1/2
     switchport trunk allowed vlan remove 2

    Note: The property information for this example was added in Release 9.3(3).


    Verifying a DME Configuration
    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    topSystem sys
    l1PhysIf sys/intf/phys-{[id]}


    l1PhysIf Properties

    The following table contains information about the l1PhysIf properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    rn
    reference:BinRN
    Identifies an object from its siblings within the context of its parent object. The distinguished name contains a sequence of relative names.
    idnw:IfId
    (base:IfIndex)
    An identifier .Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100
    descrnaming:Descr1024
    (string:Basic)
    descr
    MAX SIZE: 254
    layerl1:Layer
    (scalar:Enum8)
    Administrative port layerSELECTION:
    1 - Layer2
    2 - Layer3
    DEFAULT: Layer2
    model1:Mode
    (scalar:Enum8)
    Administrative port modeSELECTION:
    1 - access
    2 - trunk
    3 - fex-fabric
    4 - dot1q-tunnel
    5 - promiscuous
    6 - host
    7 - trunk_secondary
    8 - trunk_promiscuous
    9 - vntag
    DEFAULT: access
    mtul1:Mtu
    (scalar:Uint32)
    Administrative port mtu
    RANGE: [576 , 9216]
    DEFAULT: 1500
    adminStl1:AdminSt
    (scalar:Enum8)
    Administrative port stateSELECTION:
    1 - down
    2 - up
    DEFAULT: up
    trunkLogl1:TrunkLog
    (scalar:Enum8)
    Administrative trunk logging enableSELECTION:
    1 - default
    2 - enable
    3 - disable
    DEFAULT: default
    trunkVlansl1:l1IfTrunkVlans
    (l2:VlanBitmap)
    Configed Trunk Vlans
    DEFAULT: 1-4094
    snmpTrapStl1:SnmpTrapSt
    (scalar:Enum8)
    Administrative port snmp trap stateSELECTION:
    1 - enable
    2 - disable
    DEFAULT: enable


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Specifying VLANs to Exclude from a List

    Specifying VLANs to Exclude from a List
    
    POST http://<IP_Address>/api/mo/sys.json
    
    {
      "topSystem": {
        "children": [
          {
            "interfaceEntity": {
              "children": [
                {
                  "l1PhysIf": {
                    "attributes": {
                      "id": "eth1/2",
                      "trunkVlans": "1-69,71-4094"
    }}}]}}]}}
    
    {
        imdata": []
    }
    
    <System>
      <intf-items>
        <phys-items>
          <PhysIf-list>
            <id>eth1/2</id>
            <trunkVlans>1-69,71-4094</trunkVlans>
          </PhysIf-list>
        </phys-items>
      </intf-items>
    </System>
    ``` 	
    Specifies all VLANs to be added to the current list, except the specified VLANs.
    
    <br><font color="00ace6"><b>CLI Command</b></font>
       
    The CLI command below is the equivalent to the payload example displayed in the pane on the right.
     
    `interface ethernet 1/2`   
    &nbsp;`switchport trunk allowed vlan except 70`
    
    
    
    
    **Note:** The property information for this example was added in Release 9.3(3).
    
    
    <br><font color="00ace6"><b>Verifying a DME Configuration</b></font></br><br>The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.
    
    
    <table><tr><th>MO</th><th>DN</th></tr>
    <tr>
    <td>topSystem</td>
    <td>sys</td>
    </tr>
    <tr>
    <td>interfaceEntity</td>
    <td>sys/intf</td>
    </tr>
    <tr>
    <td>l1PhysIf</td>
    <td>sys/intf/phys-{[id]}</td>
    </tr>
    </table>
    
    <br><font color=00ace6><b>l1PhysIf Properties</b></font>
    
    The following table contains information about the l1PhysIf properties in the DME payload. For more information about the properties and MOs, see the *NX-API DME Model Reference* linked in the *Related Documentation* section below.
    
     <table><tr><th>Property Name</th><th>Data Type</th><th>Description</th><th>Values</th></tr>
    <tr><td>id</td><td>nw:IfId<br>(base:IfIndex)</td><td>An identifier .</td><td>Must match first field in the output of `show intf brief`. Example: Eth1/1 or Vlan100</td></tr>
    <tr><td>trunkVlans</td><td>l1:l1IfTrunkVlans<br>(l2:VlanBitmap)</td><td>Configed Trunk Vlans</td><td><div>DEFAULT: 1-4094</div></td></tr>
    </table>
    
    <br><font color="00ace6"><b>Related Documentation</b></font></br>
    
    
    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference: 
    
    [http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html](http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html)
    
    
    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:
    
    [https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/](https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/)
    
    
    For information about using the payloads, see the *Cisco Nexus 9000 Series NX-OS Programmability Guide*: 
    
    [https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html](https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html)
    
    
    ## Disabling MAC Learning on all VLANs on an Interface
    
    
    ```title
    Disabling MAC Learning on all VLANs on an Interface
    
    POST http://<mgmt0_IP>/api/mo/sys.json
    
    {
      "topSystem": {
        "children": [
          {
            "l2fmEntity": {
              "attributes": {
                "macLearn": "disable"
    }}}]}}
    
    {
        "imdata": []
    }
    
    <System  xmlns="http://cisco.com/ns/yang/cisco-nx-os-device">
      <l2fm-items>
        <macLearn>disable</macLearn>
      </l2fm-items>
    </System>
    
    `  
    

    This example is only supported on the following platforms:

    Line cards:

    • N9K-9408PC-CFP2
    • N9K-X9564PX
    • N9K-C9272Q
    • N9K-X9464TX
    • N9K-X9464TX2
    • N9K-X9564TX
    • N9K-X9464PX
    • N9K-X9536PQ
    • N9K-X9636PQ
    • N9K-X9432PQ

    Switches:

    • N3K-C31108TC-V
    • N9K-C9332PQ
    • N9K-C92160YC-X
    • N3K-C3132Q-40GX
    • N3K-C3132Q-V
    • N9K-C9372PX
    • N9K-C9372PX-E
    • N3K-C31108PC-V
    • N3K-C3172PQ
    • N3K-C3172TQ
    • N3K-C3164Q
    • N9K-C9372TX
    • N9K-C9372TX-E
    • N9K-C93120TX
    • N3K-C31128PQ-10GE


    CLI Commands

    The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

    mac-learn disable

    Note: The property information for this example was added in Release 9.3(3).


    Verifying a DME Configuration
    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    topSystem sys
    l2fmEntity sys/l2fm


    l2fmEntity Properties

    The following table contains information about the l2fmEntity properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    macLearnl2fm:Learning
    (scalar:Enum8)
    mac-learn Enable DisableSELECTION:
    0 - disable
    1 - enable
    DEFAULT: enable


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Enabling MAC Learning on all VLANs on an Interface

     Enabling MAC Learning on all VLANs on an Interface
    
    POST http://<mgmt0_IP>/api/mo/sys.json
    
    {
      "topSystem": {
        "children": [
          {
            "l2fmEntity": {
              "attributes": {
                "macLearn": "enable"
    }}}]}}
    
    {
        "imdata": []
    }
    
    <System  xmlns="http://cisco.com/ns/yang/cisco-nx-os-device">
      <l2fm-items>
        <macLearn>enable</macLearn>
      </l2fm-items>
    </System>
    

    This example is only supported on the following platforms:

    Line cards:

    • N9K-9408PC-CFP2
    • N9K-X9564PX
    • N9K-C9272Q
    • N9K-X9464TX
    • N9K-X9464TX2
    • N9K-X9564TX
    • N9K-X9464PX
    • N9K-X9536PQ
    • N9K-X9636PQ
    • N9K-X9432PQ

    Switches:

    • N3K-C31108TC-V
    • N9K-C9332PQ
    • N9K-C92160YC-X
    • N3K-C3132Q-40GX
    • N3K-C3132Q-V
    • N9K-C9372PX
    • N9K-C9372PX-E
    • N3K-C31108PC-V
    • N3K-C3172PQ
    • N3K-C3172TQ
    • N3K-C3164Q
    • N9K-C9372TX
    • N9K-C9372TX-E
    • N9K-C93120TX
    • N3K-C31128PQ-10GE


    CLI Commands

    The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

    no mac-learn disable

    Note: The property information for this example was added in Release 9.3(3).


    Verifying a DME Configuration
    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    topSystem sys
    l2fmEntity sys/l2fm


    l2fmEntity Properties

    The following table contains information about the l2fmEntity properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    macLearnl2fm:Learning
    (scalar:Enum8)
    mac-learn Enable DisableSELECTION:
    0 - disable
    1 - enable
    DEFAULT: enable


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Configuring 128 Character VLAN Names

    Configuring 128 Character VLAN Names
    
    POST http://<mgmt0_IP>/api/mo/sys/vlanmgr.json
    
    {
      "vlanmgrEntity": {
        "children": [
          {
            "vlanmgrInst": {
              "attributes": {
                "longName": "yes"
    }}}]}}
    
    {
        imdata:[]
    }
    
    <System>
      <vlanmgr-items>
        <inst-items>
          <longName>true</longName>
        </inst-items>
      </vlanmgr-items>
    </System>
    

    Note: This example was added in Release 9.3(3).


    CLI Commands

    The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

    system vlan long-name


    Verifying a DME Configuration

    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    vlanmgrEntity sys/vlanmgr
    vlanmgrInst sys/vlanmgr/inst


    vlanmgrInst Properties

    The following table contains information about the vlanmgrInst properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    longNamescalar:Bool
    Enable or Disable long name of 128 characters for VLANSELECTION: true or false
    DEFAULT: false


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html

    Deleting 128 Character VLAN Names

    Deleting 128 Character VLAN Names
    
    POST http://<mgmt0_IP>/api/mo/sys/vlanmgr.json
    
    {
      "vlanmgrEntity": {
        "children": [
          {
            "vlanmgrInst": {
              "attributes": {
                "longName": "no"
    }}}]}}
    
    {
        imdata:[]
    }
    
    <System>
      <vlanmgr-items>
        <inst-items>
          <longName>false</longName>
        </inst-items>
      </vlanmgr-items>
    </System>
    

    Note: This example was added in Release 9.3(3).


    CLI Commands

    The CLI commands are equivalent to the payload examples displayed in the pane on the right. Click the DME tab in the top-left corner of the right pane to view the JSON payload. Click the YANG tab to view the XML payload.

    no system vlan long-name


    Verifying a DME Configuration

    The following table contains the distinguished name (DN) for each managed object (MO) in the DME payload. Issue a GET request using the DN to verify the configuration was posted or to get information about the configured properties of a particular object.

    MODN
    vlanmgrEntity sys/vlanmgr
    vlanmgrInst sys/vlanmgr/inst


    vlanmgrInst Properties

    The following table contains information about the vlanmgrInst properties in the DME payload. For more information about the properties and MOs, see the NX-API DME Model Reference linked in the Related Documentation section below.

    Property NameData TypeDescriptionValues
    longNamescalar:Bool
    Enable or Disable long name of 128 characters for VLANSELECTION: true or false
    DEFAULT: false


    Related Documentation

    For other CLI options, see the Cisco Nexus 9000 Series NX-OS Command Reference:

    http://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-command-reference-list.html

    See the NX-API DME Model Reference for detailed information about classes and attributes described in the payload:

    https://developer.cisco.com/site/nx-os/docs/nexus-model-reference/

    For information about using the payloads, see the Cisco Nexus 9000 Series NX-OS Programmability Guide:

    https://www.cisco.com/c/en/us/support/switches/nexus-9000-series-switches/products-programming-reference-guides-list.html