Configuring NetFlow

NetFlow identifies packet flows for ingress IP packets and provides statistics based on these packet flows. NetFlow does not require any change to either the packets themselves or to any networking device. NetFlow uses flows to provide statistics for accounting, network monitoring, and network planning. A flow is a unidirectional stream of packets that arrives on a source interface (or VLAN) and has the same values for the keys. A key is an identified value for a field within the packet. You create a flow using a flow record to define the unique keys for your flow.

Cisco NX-OS supports the flexible NetFlow feature that enables enhanced network anomalies and security detection. Flexible NetFlow allows you to define an optimal flow record for a particular application by selecting the keys from a large collection of predefined fields.

All key values must match for the packet to count in a given flow. A flow might gather other fields of interest, depending on the export record version that you configure. Flows are stored in the NetFlow cache. You can export the data that NetFlow gathers for your flow by using a flow exporter and export this data to a remote NetFlow Collector, such as Cisco Stealthwatch. Cisco NX-OS exports a flow as part of a NetFlow export User Datagram Protocol (UDP) datagram under the following circumstances:

  • Flows are exported periodically as per the flow timeout value, which defaults to 10 seconds if not configured.
  • You have forced the flow to export.

The flow record determines the size of the data to be collected for a flow. The flow monitor combines the flow record and flow exporter with the NetFlow cache information. Cisco NX-OS can gather NetFlow statistics and analyze all packets on the interface or subinterface.

This section contains payload examples and CLIs to demonstrate how to use the NX-API REST API to configure NetFlow on Cisco Nexus 3000 and 9000 Series switches and to show how the REST APIs correspond to the CLI commands.

For more information, see the Cisco Nexus 9000 Series NX-OS System Management Configuration Guide, Release 7.x.

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

Enabling NetFlow

Enabling NetFlow
POST http://<mgmt0_IP>/api/mo/sys/fm.json
{
   "fmEntity": {
    "children": [
   {
     "fmNetflow": {
      "attributes": {
       "adminSt": "enabled"
}}}]}}
{
    "imdata": []
}
<System">
  <fm-items>
    <netflow-items>
     <adminSt>enabled</adminSt>
    </netflow-items>
  </fm-items>
</System>

Note: This example was added in Release 7.0(3)I7(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.

feature netflow

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/media/dme/index.html

Disabling NetFlow

Enabling NetFlow
POST http://<mgmt0_IP>/api/mo/sys/fm.json
{
   "fmEntity": {
    "children": [
   {
     "fmNetflow": {
      "attributes": {
       "adminSt": "disabled"
}}}]}}
{
    "imdata": []
}
<System>
  <fm-items>
    <netflow-items>disabled</netflow-items>
  </fm-items>
</System>

Note: This example was added in Release 7.0(3)I7(2).


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 feature netflow

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/media/dme/index.html

Configuring Flow System

Configuring an Exporter Id

Configuring an Exporter Id
POST http://<mgmt0_IP>/api/mo/sys.json
{
  "topSystem": {
    "children": [
      {
        "analyticsEntity": {
          "children": [
            {
              "analyticsInst": {
                "attributes": {
                  "mode": "analytics"
                },
                "children": [
                  {
                    "analyticsFwdInstTarget": {
                      "attributes": {
                        "collectorId": "5633",
                        "id": "65794"
                      }
                    }
                  },
                  {
                    "analyticsFwdInstTarget": {
                      "attributes": {
                        "collectorId": "5377",
                        "id": "65793"
                      }
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}
{
    imdata:[]
}
<System>
  <analytics-items>
    <inst-items>
      <Inst-list>
        <mode>analytics</mode>
        <fwdinst-items>
          <FwdInstTarget-list>
            <id>65794</id>
            <collectorId>5633</collectorId>
          </FwdInstTarget-list>
          <FwdInstTarget-list>
            <id>65793</id>
            <collectorId>5377</collectorId>
          </FwdInstTarget-list>
        </fwdinst-items>
      </Inst-list>
    </inst-items>
  </analytics-items>
</System>

Note: This example was added in Release 7.0(3)I7(7).


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.

flow system config
  exporter-id 1


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
analyticsEntity sys/analytics
analyticsInst sys/analytics/inst-analytics
analyticsFwdInstTarget sys/analytics/inst-analytics/fwdinst-65794
analyticsFwdInstTarget sys/analytics/inst-analytics/fwdinst-65793


analyticsInst Properties

The following table contains information about the analyticsInst 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
modeanalytics:ModeT
(scalar:Enum8)
Mode Select to represent the featureSELECTION:
0 - analytics
1 - netflow
DEFAULT: netflow


analyticsFwdInstTarget Properties

The following table contains information about the analyticsFwdInstTarget 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
collectorIdanalytics:CollectorId
(scalar:Uint32)
Analytics exporter Id to identify the exporting hardware instance.
RANGE: [0 , 65535]
idanalytics:FwdInstTargetId
(scalar:Uint32)
Analytics Target identifier
RANGE: [0 , 16777215]


analyticsFwdInstTarget Properties

The following table contains information about the analyticsFwdInstTarget 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
collectorIdanalytics:CollectorId
(scalar:Uint32)
Analytics exporter Id to identify the exporting hardware instance.
RANGE: [0 , 65535]
idanalytics:FwdInstTargetId
(scalar:Uint32)
Analytics Target identifier
RANGE: [0 , 16777215]


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 an Exporter Id

Deleting an Exporter Id
POST http://<mgmt0_IP>/api/mo/sys.json
{
  "topSystem": {
    "children": [
      {
        "analyticsEntity": {
          "children": [
            {
              "analyticsInst": {
                "attributes": {
                  "mode": "analytics"
                },
                "children": [
                  {
                    "analyticsFwdInstTarget": {
                      "attributes": {
                        "id": "65794",
                        "status": "deleted"
                      }
                    }
                  },
                  {
                    "analyticsFwdInstTarget": {
                      "attributes": {
                        "id": "65793",
                        "status": "deleted"
                      }
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    ]
  }
}
{
    imdata:[]
}
<System>
  <analytics-items>
    <inst-items>
      <Inst-list>
        <mode>analytics</mode>
        <fwdinst-items>
          <FwdInstTarget-list nc:operation="delete">
            <id>65794</id>
          </FwdInstTarget-list>
          <FwdInstTarget-list nc:operation="delete">
            <id>65793</id>
          </FwdInstTarget-list>
        </fwdinst-items>
      </Inst-list>
    </inst-items>
  </analytics-items>
</System>

Note: This example was added in Release 7.0(3)I7(7).


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.

flow system config
  no exporter-id 1


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
analyticsEntity sys/analytics
analyticsInst sys/analytics/inst-analytics
analyticsFwdInstTarget sys/analytics/inst-analytics/fwdinst-65794
analyticsFwdInstTarget sys/analytics/inst-analytics/fwdinst-65793


analyticsInst Properties

The following table contains information about the analyticsInst 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
modeanalytics:ModeT
(scalar:Enum8)
Mode Select to represent the featureSELECTION:
0 - analytics
1 - netflow
DEFAULT: netflow


analyticsFwdInstTarget Properties

The following table contains information about the analyticsFwdInstTarget 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
idanalytics:FwdInstTargetId
(scalar:Uint32)
Analytics Target identifier
RANGE: [0 , 16777215]
statusmo:ModificationStatus
(scalar:Bitmask32)
Modification statusSELECTION:
2 - created
4 - modified
8 - deleted
16 - replaced


analyticsFwdInstTarget Properties

The following table contains information about the analyticsFwdInstTarget 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
idanalytics:FwdInstTargetId
(scalar:Uint32)
Analytics Target identifier
RANGE: [0 , 16777215]
statusmo:ModificationStatus
(scalar:Bitmask32)
Modification statusSELECTION:
2 - created
4 - modified
8 - deleted
16 - replaced


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 Flow Filter

Configuring an IPv4 ACL

Configuring an IPv4 ACL
POST http://<mgmt0_IP>/api/mo/sys/analytics.json
{
  "analyticsEntity": {
    "children": [
      {
        "analyticsInst": {
          "attributes": {
            "mode": "analytics"
          },
          "children": [
            {
              "analyticsPolicy": {
                "attributes": {
                  "name": "Filt_1"
                },
                "children": [
                  {
                    "analyticsMatchAcl": {
                      "attributes": {
                        "fltType": "ipv4",
                        "name": "acl_name"
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <analytics-items>
    <inst-items>
      <Inst-list>
        <mode>analytics</mode>
        <policy-items>
          <Policy-list>
            <name>Filt_1</name>
            <acl-items>
              <MatchAcl-list>
                <name>acl_name</name>
                <fltType>ipv4</fltType>
              </MatchAcl-list>
            </acl-items>
          </Policy-list>
        </policy-items>
      </Inst-list>
    </inst-items>
  </analytics-items>
</System>

Note: This example was added in Release 7.0(3)I7(7).


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.

flow filter Filt_1
  ipv4 acl_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
analyticsEntity sys/analytics
analyticsInst sys/analytics/inst-analytics
analyticsPolicy sys/analytics/inst-analytics/policy-[Filt_1]
analyticsMatchAcl sys/analytics/inst-analytics/policy-[Filt_1]/acl-[acl_name]


analyticsInst Properties

The following table contains information about the analyticsInst 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
modeanalytics:ModeT
(scalar:Enum8)
Mode Select to represent the featureSELECTION:
0 - analytics
1 - netflow
DEFAULT: netflow


analyticsPolicy Properties

The following table contains information about the analyticsPolicy 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
namepol:ObjName
(naming:Name256)
Name
RANGE: [1 , 32]
DEFAULT: test


analyticsMatchAcl Properties

The following table contains information about the analyticsMatchAcl 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
fltTypeanalytics:FltType
(scalar:Enum8)
ACL Filter TypeSELECTION:
1 - ipv4
2 - ipv6
3 - ce
DEFAULT: ipv4
namepol:ObjName
(naming:Name256)
Name
RANGE: [1 , 32]
DEFAULT: test


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 an IPv4 ACL

Deleting an IPv4 ACL
POST http://<mgmt0_IP>/api/mo/sys/analytics.json
{
  "analyticsEntity": {
    "children": [
      {
        "analyticsInst": {
          "attributes": {
            "mode": "analytics"
          },
          "children": [
            {
              "analyticsPolicy": {
                "attributes": {
                  "name": "Filt_1"
                },
                "children": [
                  {
                    "analyticsMatchAcl": {
                      "attributes": {
                        "name": "acl_name",
                        "status": "deleted"
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <analytics-items>
    <inst-items>
      <Inst-list>
        <mode>analytics</mode>
        <policy-items>
          <Policy-list>
            <name>Filt_1</name>
            <acl-items>
              <MatchAcl-list nc:operation="delete">
                <name>acl_name</name>
              </MatchAcl-list>
            </acl-items>
          </Policy-list>
        </policy-items>
      </Inst-list>
    </inst-items>
  </analytics-items>
</System>

Note: This example was added in Release 7.0(3)I7(7).


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.

flow filter Filt_1
  no ipv4 acl_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
analyticsEntity sys/analytics
analyticsInst sys/analytics/inst-analytics
analyticsPolicy sys/analytics/inst-analytics/policy-[Filt_1]
analyticsMatchAcl sys/analytics/inst-analytics/policy-[Filt_1]/acl-[acl_name]


analyticsInst Properties

The following table contains information about the analyticsInst 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
modeanalytics:ModeT
(scalar:Enum8)
Mode Select to represent the featureSELECTION:
0 - analytics
1 - netflow
DEFAULT: netflow


analyticsPolicy Properties

The following table contains information about the analyticsPolicy 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
namepol:ObjName
(naming:Name256)
Name
RANGE: [1 , 32]
DEFAULT: test


analyticsMatchAcl Properties

The following table contains information about the analyticsMatchAcl 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
namepol:ObjName
(naming:Name256)
Name
RANGE: [1 , 32]
DEFAULT: test
statusmo:ModificationStatus
(scalar:Bitmask32)
Modification statusSELECTION:
2 - created
4 - modified
8 - deleted
16 - replaced


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 an IPv6 ACL

Configuring an IPv6 ACL
POST http://<mgmt0_IP>/api/mo/sys/analytics.json
{
  "analyticsEntity": {
    "children": [
      {
        "analyticsInst": {
          "attributes": {
            "mode": "analytics"
          },
          "children": [
            {
              "analyticsPolicy": {
                "attributes": {
                  "name": "Filt_1"
                },
                "children": [
                  {
                    "analyticsMatchAcl": {
                      "attributes": {
                        "fltType": "ipv6",
                        "name": "acl_name"
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <analytics-items>
    <inst-items>
      <Inst-list>
        <mode>analytics</mode>
        <policy-items>
          <Policy-list>
            <name>Filt_1</name>
            <acl-items>
              <MatchAcl-list>
                <name>acl_name</name>
                <fltType>ipv6</fltType>
              </MatchAcl-list>
            </acl-items>
          </Policy-list>
        </policy-items>
      </Inst-list>
    </inst-items>
  </analytics-items>
</System>

Note: This example was added in Release 7.0(3)I7(7).


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.

flow filter Filt_1
  ipv6 acl_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
analyticsEntity sys/analytics
analyticsInst sys/analytics/inst-analytics
analyticsPolicy sys/analytics/inst-analytics/policy-[Filt_1]
analyticsMatchAcl sys/analytics/inst-analytics/policy-[Filt_1]/acl-[acl_name]


analyticsInst Properties

The following table contains information about the analyticsInst 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
modeanalytics:ModeT
(scalar:Enum8)
Mode Select to represent the featureSELECTION:
0 - analytics
1 - netflow
DEFAULT: netflow


analyticsPolicy Properties

The following table contains information about the analyticsPolicy 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
namepol:ObjName
(naming:Name256)
Name
RANGE: [1 , 32]
DEFAULT: test


analyticsMatchAcl Properties

The following table contains information about the analyticsMatchAcl 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
fltTypeanalytics:FltType
(scalar:Enum8)
ACL Filter TypeSELECTION:
1 - ipv4
2 - ipv6
3 - ce
DEFAULT: ipv4
namepol:ObjName
(naming:Name256)
Name
RANGE: [1 , 32]
DEFAULT: test


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 an IPv6 ACL

Deleting an IPv6 ACL
POST http://<mgmt0_IP>/api/mo/sys/analytics.json
{
  "analyticsEntity": {
    "children": [
      {
        "analyticsInst": {
          "attributes": {
            "mode": "analytics"
          },
          "children": [
            {
              "analyticsPolicy": {
                "attributes": {
                  "name": "Filt_1"
                },
                "children": [
                  {
                    "analyticsMatchAcl": {
                      "attributes": {
                        "name": "acl_name",
                        "status": "deleted"
}}}]}}]}}]}}
{
    imdata:[]
}
<System>
  <analytics-items>
    <inst-items>
      <Inst-list>
        <mode>analytics</mode>
        <policy-items>
          <Policy-list>
            <name>Filt_1</name>
            <acl-items>
              <MatchAcl-list nc:operation="delete">
                <name>acl_name</name>
              </MatchAcl-list>
            </acl-items>
          </Policy-list>
        </policy-items>
      </Inst-list>
    </inst-items>
  </analytics-items>
</System>

Note: This example was added in Release 7.0(3)I7(7).


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.

flow filter Filt_1
  no ipv6 acl_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
analyticsEntity sys/analytics
analyticsInst sys/analytics/inst-analytics
analyticsPolicy sys/analytics/inst-analytics/policy-[Filt_1]
analyticsMatchAcl sys/analytics/inst-analytics/policy-[Filt_1]/acl-[acl_name]


analyticsInst Properties

The following table contains information about the analyticsInst 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
modeanalytics:ModeT
(scalar:Enum8)
Mode Select to represent the featureSELECTION:
0 - analytics
1 - netflow
DEFAULT: netflow


analyticsPolicy Properties

The following table contains information about the analyticsPolicy 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
namepol:ObjName
(naming:Name256)
Name
RANGE: [1 , 32]
DEFAULT: test


analyticsMatchAcl Properties

The following table contains information about the analyticsMatchAcl 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
namepol:ObjName
(naming:Name256)
Name
RANGE: [1 , 32]
DEFAULT: test
statusmo:ModificationStatus
(scalar:Bitmask32)
Modification statusSELECTION:
2 - created
4 - modified
8 - deleted
16 - replaced


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 Flow Record

Configuring a Counter for Byte Packets

Configuring a Counter for Byte Packets
POST http://<mgmt0_IP>/api/mo/sys/analytics.json
{
  "analyticsEntity": {
    "children": [
      {
        "analyticsInst": {
          "attributes": {
            "mode": "analytics"
          },
          "children": [
            {
              "analyticsRecordP": {
                "attributes": {
                  "collect": "count-bytes,src-intf",
                  "name": "Flow_Rec_1"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <analytics-items>
    <inst-items>
      <Inst-list>
        <mode>analytics</mode>
        <recordp-items>
          <RecordP-list>
            <name>Flow_Rec_1</name>
            <collect>count-bytes,src-intf</collect>
          </RecordP-list>
        </recordp-items>
      </Inst-list>
    </inst-items>
  </analytics-items>
</System>

Note: This example was added in Release 7.0(3)I7(7).


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.

flow record Flow_Rec_1
  collect counter bytes


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
analyticsEntity sys/analytics
analyticsInst sys/analytics/inst-analytics
analyticsRecordP sys/analytics/inst-analytics/recordp-[Flow_Rec_1]


analyticsInst Properties

The following table contains information about the analyticsInst 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
modeanalytics:ModeT
(scalar:Enum8)
Mode Select to represent the featureSELECTION:
0 - analytics
1 - netflow
DEFAULT: netflow


analyticsRecordP Properties

The following table contains information about the analyticsRecordP 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
collectanalytics:CollectParams
(scalar:Bitmask64)
Analytics Record parameters to collect in the flows.SELECTION:
1 - count-bytes
2 - count-pkts
4 - sampler-id
8 - pkt-disp
16 - ts-first
32 - ts-recent
64 - tcp-flags
128 - src-intf
DEFAULT: src-intf
namepol:ObjName
(naming:Name256)
Name
RANGE: [1 , 32]
DEFAULT: test


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 a Counter for Byte Packets

Deleting a Counter for Byte Packets
POST http://<mgmt0_IP>/api/mo/sys/analytics.json
{
  "analyticsEntity": {
    "children": [
      {
        "analyticsInst": {
          "attributes": {
            "mode": "analytics"
          },
          "children": [
            {
              "analyticsRecordP": {
                "attributes": {
                  "collect": "src-intf",
                  "name": "Flow_Rec_1"
}}}]}}]}}
{
    imdata:[]
}
<System>
  <analytics-items>
    <inst-items>
      <Inst-list>
        <mode>analytics</mode>
        <recordp-items>
          <RecordP-list>
            <name>Flow_Rec_1</name>
            <collect>src-intf</collect>
          </RecordP-list>
        </recordp-items>
      </Inst-list>
    </inst-items>
  </analytics-items>
</System>

Note: This example was added in Release 7.0(3)I7(7).


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.

flow record Flow_Rec_1
  no collect counter bytes


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
analyticsEntity sys/analytics
analyticsInst sys/analytics/inst-analytics
analyticsRecordP sys/analytics/inst-analytics/recordp-[Flow_Rec_1]


analyticsInst Properties

The following table contains information about the analyticsInst 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
modeanalytics:ModeT
(scalar:Enum8)
Mode Select to represent the featureSELECTION:
0 - analytics
1 - netflow
DEFAULT: netflow


analyticsRecordP Properties

The following table contains information about the analyticsRecordP 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
collectanalytics:CollectParams
(scalar:Bitmask64)
Analytics Record parameters to collect in the flows.SELECTION:
1 - count-bytes
2 - count-pkts
4 - sampler-id
8 - pkt-disp
16 - ts-first
32 - ts-recent
64 - tcp-flags
128 - src-intf
DEFAULT: src-intf
namepol:ObjName
(naming:Name256)
Name
RANGE: [1 , 32]
DEFAULT: test


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