Configuring Policy Maps
This section contains payload examples and CLIs to demonstrate many of the QoS policy map configuration options and to show how the REST APIs correspond to the CLI commands.
Defining a Policy Map
Defining a Policy Map
POST http://<mgmt0_IP>/api/mo/sys/ipqos/queuing/p.json
{
"ipqosPMapEntity": {
"children": [
{
"ipqosPMapInst": {
"attributes": {
"matchType": "match-all",
"name": "foo"
}}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<queuing-items>
<p-items>
<name-items>
<PMapInst-list>
<name>foo</name>
<matchType>match-all</matchType>
</PMapInst-list>
</name-items>
</p-items>
</queuing-items>
</ipqos-items>
</System>
This example creates a named object that represents a set of policies that are to be applied to a set of traffic classes.
CLI Command
The CLI command below is the equivalent to the payload example 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 or the YANG tab to view the XML payload.
policy-map type queuing foo
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 CoS Marking
Configuring CoS Marking
POST http://<mgmt0_IP>/api/mo/sys/ipqos/dflt/p/name-map1.json
{
"ipqosPMapInst": {
"attributes": {
"matchType": "match-all",
"name": "map1"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "class1",
"userSetBit": "1"
},
"children": [
{
"ipqosSetCos": {
"attributes": {
"val": "1"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<dflt-items>
<p-items>
<name-items>
<PMapInst-list>
<name>map1</name>
<matchType>match-all</matchType>
<cmap-items>
<MatchCMap-list>
<name>class1</name>
<userSetBit>1</userSetBit>
<setCos-items>
<val>1</val>
</setCos-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</dflt-items>
</ipqos-items>
</System>
This example sets the CoS value to cos-value. The value can range from 0 to 7.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map map1
class class1
set cos 1
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 QoS Group
Setting the QoS Group
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/p/name-p1.json
{
"ipqosPMapInst": {
"attributes": {
"matchType": "match-all",
"name": "p1"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "class-default",
"userSetBit": "1"
},
"children": [
{
"ipqosSetQoSGrp": {
"attributes": {
"id": "3"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<dflt-items>
<p-items>
<name-items>
<PMapInst-list>
<name>p1</name>
<matchType>match-all</matchType>
<cmap-items>
<MatchCMap-list>
<name>class-default</name>
<userSetBit>1</userSetBit>
<setGrp-items>
<id>3</id>
</setGrp-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</dflt-items>
</ipqos-items>
</System>
This example configures one or more qos-group values to match on for classification
of traffic into this class map.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map type qos p1
class class-default
set qos-group 3
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
Disabling Dynamic Load Balancing
Disabling Dynamic Load Balancing
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/p/name-p1.json
{
"ipqosPMapInst": {
"attributes": {
"matchType": "match-all",
"name": "p1"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "class1",
"userSetBit": "1"
},
"children": [
{
"ipqosSetDlbDisable": {
"attributes": {
"uid": "0"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<dflt-items>
<p-items>
<name-items>
<PMapInst-list>
<name>p1</name>
<matchType>match-all</matchType>
<cmap-items>
<MatchCMap-list>
<name>class1</name>
<userSetBit>1</userSetBit>
<setDlbDisable-items>
<uid>0</uid>
</setDlbDisable-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</dflt-items>
</ipqos-items>
</System>
This example disables DLB.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map p1
class class1
set dlb-disable
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 DSCP Marking
Configuring DSCP Marking
POST http://<IP_Address>/api/mo/sys/ipqos/dflt/p/name-p1.json
{
"ipqosPMapInst": {
"attributes": {
"matchType": "match-all",
"name": "p1"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "class1",
"userSetBit": "1"
},
"children": [
{
"ipqosSetDscp": {
"attributes": {
"tunnel": "no",
"val": "cs6"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<dflt-items>
<p-items>
<name-items>
<PMapInst-list>
<name>p1</name>
<matchType>match-all</matchType>
<cmap-items>
<MatchCMap-list>
<name>class1</name>
<userSetBit>1</userSetBit>
<setDscp-items>
<tunnel>false</tunnel>
<val>cs6</val>
</setDscp-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</dflt-items>
</ipqos-items>
</System>
This example sets the DSCP value.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map p1
class class1
set dscp cs6
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 Bandwidth
Configuring Bandwidth
POST http://<mgmt0_IP>/api/mo/sys/ipqos/queuing/p/name-p1.json
{
"ipqosPMapInst": {
"attributes": {
"matchType": "match-all",
"name": "p1"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "c-in-q1",
"userSetBit": "1"
},
"children": [
{
"ipqosSetBW": {
"attributes": {
"val": "40"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<queuing-items>
<p-items>
<name-items>
<PMapInst-list>
<name>p1</name>
<matchType>match-all</matchType>
<cmap-items>
<MatchCMap-list>
<name>c-in-q1</name>
<userSetBit>1</userSetBit>
<setBW-items>
<val>40</val>
</setBW-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</queuing-items>
</ipqos-items>
</System>
This example assigns a minimum rate of the interface bandwidth to an output queue as the percentage of the underlying interface link rate. The range is from 0 to 100.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map type queuing p1
class type queuing c-in-q1
bandwidth percent 40
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 MTU
Setting the MTU
POST http://<mgmt0_IP>/api/mo/sys/ipqos/nw/p/name-p1.json
{
"ipqosPMapInst": {
"attributes": {
"name": "p1"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "c-nq1",
"userSetBit": "1"
},
"children": [
{
"ipqosSetMTU": {
"attributes": {
"value": "2000"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<nw-items>
<p-items>
<name-items>
<PMapInst-list>
<name>p1</name>
<cmap-items>
<MatchCMap-list>
<name>c-nq1</name>
<userSetBit>1</userSetBit>
<mtu-items>
<value>2000</value>
</mtu-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</nw-items>
</ipqos-items>
</System>
The example sets the MTU size.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map type network-qos p1
class type network-qos c-nq1
mtu 2000
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 Pause to Network QoS Policy Class
Configuring Pause to Network QoS Policy Class
POST http://<IP_Address>/api/mo/sys/ipqos/nw/p/name-p2.json
{
"ipqosPMapInst": {
"attributes": {
"name": "p2"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "class3",
"userSetBit": "1"
},
"children": [
{
"ipqosPause": {
"attributes": {
"bufferSize": "50000",
"pauseThreshold": "40000",
"pfcCos0": "no",
"pfcCos1": "no",
"pfcCos2": "yes",
"pfcCos3": "no",
"pfcCos4": "no",
"pfcCos5": "no",
"pfcCos6": "no",
"pfcCos7": "no",
"resumeThreshold": "25000"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<nw-items>
<p-items>
<name-items>
<PMapInst-list>
<name>p2</name>
<cmap-items>
<MatchCMap-list>
<name>class3</name>
<userSetBit>1</userSetBit>
<pause-items>
<bufferSize>50000</bufferSize>
<pauseThreshold>40000</pauseThreshold>
<pfcCos0>false</pfcCos0>
<pfcCos1>false</pfcCos1>
<pfcCos2>true</pfcCos2>
<pfcCos3>false</pfcCos3>
<pfcCos4>false</pfcCos4>
<pfcCos5>false</pfcCos5>
<pfcCos6>false</pfcCos6>
<pfcCos7>false</pfcCos7>
<resumeThreshold>25000</resumeThreshold>
</pause-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</nw-items>
</ipqos-items>
</System>
This example specifies the buffer threshold settings for pause and resume.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map type network-qos p2
class type network-qos class3
pause buffer-size 50000 pause-threshold 40000 resume-threshold 25000 pfc-cos 2
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 Police to a Policy Class
Configuring Police to a Policy Class
POST http://<IP-Address>/api/mo/sys/ipqos/dflt/p/name-p1.json
{
"ipqosPMapInst": {
"attributes": {
"matchType": "match-all",
"name": "p1"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "class2",
"userSetBit": "1"
},
"children": [
{
"ipqosPolice": {
"attributes": {
"bcRate": "200",
"bcUnit": "ms",
"beRate": "unspecified",
"beUnit": "unspecified",
"cirRate": "8000",
"cirUnit": "bps",
"conformAction": "unspecified",
"conformSetCosTransmit": "0",
"conformSetDscpTransmit": "default",
"conformSetPrecTransmit": "routine",
"conformSetQosGrpTransmit": "0",
"exceedAction": "unspecified",
"exceedSetCosTransmit": "0",
"exceedSetDscpTransmit": "default",
"exceedSetPrecTransmit": "routine",
"exceedSetQosGrpTransmit": "0",
"pirRate": "unspecified",
"pirUnit": "unspecified",
"violateAction": "unspecified",
"violateSetCosTransmit": "0",
"violateSetDscpTransmit": "default",
"violateSetPrecTransmit": "routine",
"violateSetQosGrpTransmit": "0"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<dflt-items>
<p-items>
<name-items>
<PMapInst-list>
<name>p1</name>
<matchType>match-all</matchType>
<cmap-items>
<MatchCMap-list>
<name>class2</name>
<userSetBit>1</userSetBit>
<police-items>
<bcRate>200</bcRate>
<bcUnit>ms</bcUnit>
<beRate>unspecified</beRate>
<beUnit>unspecified</beUnit>
<cirRate>8000</cirRate>
<cirUnit>bps</cirUnit>
<conformAction>unspecified</conformAction>
<conformSetCosTransmit>0</conformSetCosTransmit>
<conformSetDscpTransmit>default</conformSetDscpTransmit>
<conformSetPrecTransmit>routine</conformSetPrecTransmit>
<conformSetQosGrpTransmit>0</conformSetQosGrpTransmit>
<exceedAction>unspecified</exceedAction>
<exceedSetCosTransmit>0</exceedSetCosTransmit>
<exceedSetDscpTransmit>default</exceedSetDscpTransmit>
<exceedSetPrecTransmit>routine</exceedSetPrecTransmit>
<exceedSetQosGrpTransmit>0</exceedSetQosGrpTransmit>
<pirRate>unspecified</pirRate>
<pirUnit>unspecified</pirUnit>
<violateAction>unspecified</violateAction>
<violateSetCosTransmit>0</violateSetCosTransmit>
<violateSetDscpTransmit>default</violateSetDscpTransmit>
<violateSetPrecTransmit>routine</violateSetPrecTransmit>
<violateSetQosGrpTransmit>0</violateSetQosGrpTransmit>
</police-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</dflt-items>
</ipqos-items>
</System>
This example shows how to configure policing.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map type qos match-first p1
class type qos class2
police cir 8000 bc 200 ms
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 a Priority Level to a Queuing Policy Class
Setting a Priority Level to a Queuing Policy Class
POST http://<IP_Address>/api/mo/sys/ipqos/queuing/p/name-p1.json
{
"ipqosPMapInst": {
"attributes": {
"matchType": "match-all",
"name": "p1"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "c-in-q1",
"userSetBit": "1"
},
"children": [
{
"ipqosQueueLimit": {
"attributes": {
"QueueLimitUnit": "none",
"QueueLimitVal": "2000",
"dynamic": "0"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<queuing-items>
<p-items>
<name-items>
<PMapInst-list>
<name>p1</name>
<matchType>match-all</matchType>
<cmap-items>
<MatchCMap-list>
<name>c-in-q1</name>
<userSetBit>1</userSetBit>
<QueueLimit-items>
<QueueLimitUnit>none</QueueLimitUnit>
<QueueLimitVal>2000</QueueLimitVal>
<dynamic>0</dynamic>
</QueueLimit-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</queuing-items>
</ipqos-items>
</System>
This example assigns a tail drop threshold based on the queue size in bytes, kilobytes,
or megabytes or allows the queue’s threshold size to be determined dynamically depending on the number of free cells available. The device drops packets that exceed the specified threshold.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map type queuing p1
class type queuing c-in-q1
queue-limit 2000
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 WRED on Egress Queues
Configuring WRED on Egress Queues
POST http://<IP_Address>/api/mo/sys/ipqos/queuing/p/name-p1.json
{
"ipqosPMapInst": {
"attributes": {
"matchType": "match-all",
"name": "p1"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "c-out-q1",
"userSetBit": "1"
},
"children": [
{
"ipqosRandomDetect": {
"attributes": {
"capAverage": "no",
"dropAvail": "0",
"ecn": "no",
"maxThreshold": "0",
"maxThresholdUnit": "none",
"minThreshold": "0",
"minThresholdUnit": "none",
"weight": "0"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<queuing-items>
<p-items>
<name-items>
<PMapInst-list>
<name>p1</name>
<matchType>match-all</matchType>
<cmap-items>
<MatchCMap-list>
<name>c-in-q1</name>
<userSetBit>1</userSetBit>
<RandDet-items>
<capAverage>false</capAverage>
<dropAvail>0</dropAvail>
<ecn>false</ecn>
<maxThreshold>0</maxThreshold>
<maxThresholdUnit>none</maxThresholdUnit>
<minThreshold>0</minThreshold>
<minThresholdUnit>none</minThresholdUnit>
<weight>0</weight>
</RandDet-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</queuing-items>
</ipqos-items>
</System>
This example configures WRED on the specified queuing class.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map type queuing p1
class type queuing c-in-q1
random-detect
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 Traffic Shaping
Configuring Traffic Shaping
POST http://<IP_Address>/api/mo/sys/ipqos/queuing/p/name-p1.json
{
"ipqosPMapInst": {
"attributes": {
"matchType": "match-all",
"name": "p1"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "c-in-q2",
"userSetBit": "1"
},
"children": [
{
"ipqosShape": {
"attributes": {
"max": "40000",
"maxRateUnit": "bps",
"min": "8000",
"minRateUnit": "bps"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<queuing-items>
<p-items>
<name-items>
<PMapInst-list>
<name>p1</name>
<matchType>match-all</matchType>
<cmap-items>
<MatchCMap-list>
<name>c-in-q2</name>
<userSetBit>1</userSetBit>
<shape-items>
<max>40000</max>
<maxRateUnit>bps</maxRateUnit>
<min>8000</min>
<minRateUnit>bps</minRateUnit>
</shape-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</queuing-items>
</ipqos-items>
</System>
This example assigns a minimum and maximum bit rate on an output queue.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map type queuing p1
class type queuing c-in-q2
shape min 8000 bps max 40000
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 the Bandwidth Limit
Removing the Bandwidth Limit
POST http://<IP_Address>/api/mo/sys/ipqos/queuing/p/name-p1.json
{
"ipqosPMapInst": {
"attributes": {
"matchType": "match-all",
"name": "p1"
},
"children": [
{
"ipqosMatchCMap": {
"attributes": {
"name": "c-in-q2",
"userSetBit": "1"
},
"children": [
{
"ipqosSetBW": {
"attributes": {
"status": "deleted"
}}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<queuing-items>
<p-items>
<name-items>
<PMapInst-list>
<name>p1</name>
<matchType>match-all</matchType>
<cmap-items>
<MatchCMap-list>
<name>c-in-q2</name>
<userSetBit>1</userSetBit>
<setBW-items xc:operation="delete">
</setBW-items>
</MatchCMap-list>
</cmap-items>
</PMapInst-list>
</name-items>
</p-items>
</queuing-items>
</ipqos-items>
</System>
This example removes the bandwidth specification from this class.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
policy-map type queuing p1
class type queuing c-in-q2
no bandwidth percent 30
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
QoS on an Interface (input)
QoS on an Interface (input)
POST http://<mgmt0_IP>/api/mo/sys/ipqos/dflt/policy/in/intf-[eth1/4].json
{
"ipqosIf": {
"attributes": {
"name": "eth1/4"
},
"children": [
{
"ipqosInst": {
"attributes": {
"name": "foo",
"stats": "yes"
}}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<dflt-items>
<policy-items>
<in-items>
<intf-items>
<If-list>
<name>eth1/4</name>
<pmap-items>
<name>foo</name>
<stats>true</stats>
</pmap-items>
</If-list>
</intf-items>
</in-items>
</policy-items>
</dflt-items>
</ipqos-items>
</System>
This example adds the policy map to the input packets of an interface.
An instance of the interface for QoS must be initialized before configuring QoS. The interface can be any of the following types:
- ethernet - Ethernet IEEE 802.3z
- loopback - Loopback interface
- mgmt - Management interface
- port-channel - Port Channel interface
Note: Sub-interfaces and breakout ports for the above are also supported.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
interface eth1/4
service-policy type qos input foo
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
QoS on an Interface (output)
QoS on an interface (output)
POST http://<mgmt0_IP>/api/mo/sys/ipqos/dflt/policy/out/intf-[eth1/4].json
{
"ipqosIf": {
"attributes": {
"name": "eth1/4"
},
"children": [
{
"ipqosInst": {
"attributes": {
"name": "foo",
"stats": "yes"
}}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<dflt-items>
<policy-items>
<out-items>
<intf-items>
<If-list>
<name>eth1/4</name>
<pmap-items>
<name>foo</name>
<stats>true</stats>
</pmap-items>
</If-list>
</intf-items>
</out-items>
</policy-items>
</dflt-items>
</ipqos-items>
</System>
This example adds the policy map to the output packets of an interface.
An instance of the interface for QoS must be initialized before configuring QoS. The interface can be any of the following types:
- ethernet - Ethernet IEEE 802.3z
- loopback - Loopback interface
- mgmt - Management interface
- port-channel - Port Channel interface
Note: Sub-interfaces and breakout ports for the above are also supported.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
interface eth 1/4
service-policy type qos output foo
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
QoS on the System
QoS on the system (input)
POST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"ipqosEntity": {
"children": [
{
"ipqosQueuing": {
"children": [
{
"ipqosServPol": {
"children": [
{
"ipqosIngress": {
"children": [
{
"ipqosSystem": {
"attributes": {
"userSetBit": "0"
}}}]}},
{
"ipqosEgress": {
"children": [
{
"ipqosSystem": {
"attributes": {
"userSetBit": "0"
}}}]}}]}}]}},
{
"ipqosNwQoS": {
"children": [
{
"ipqosServPol": {
"children": [
{
"ipqosIngress": {
"children": [
{
"ipqosSystem": {
"attributes": {
"userSetBit": "0"
}}}]}},
{
"ipqosEgress": {
"children": [
{
"ipqosSystem": {
"attributes": {
"userSetBit": "0"
}}}]}}]}}]}},
{
"ipqosDefaultQoS": {
"children": [
{
"ipqosServPol": {
"children": [
{
"ipqosIngress": {
"children": [
{
"ipqosSystem": {
"children": [
{
"ipqosInst": {
"attributes": {
"name": "foo",
"stats": "yes"
}}}]}}]}}]}}]}}]}}]}}
{
imdata:[]
}
<System>
<ipqos-items>
<queuing-items>
<policy-items>
<in-items>
<sys-items>
<userSetBit>0</userSetBit>
</sys-items>
</in-items>
<out-items>
<sys-items>
<userSetBit>0</userSetBit>
</sys-items>
</out-items>
</policy-items>
</queuing-items>
<nw-items>
<policy-items>
<in-items>
<sys-items>
<userSetBit>0</userSetBit>
</sys-items>
</in-items>
<out-items>
<sys-items>
<userSetBit>0</userSetBit>
</sys-items>
</out-items>
</policy-items>
</nw-items>
<dflt-items>
<policy-items>
<in-items>
<sys-items>
<pmap-items>
<name>foo</name>
<stats>true</stats>
</pmap-items>
</sys-items>
</in-items>
</policy-items>
</dflt-items>
</ipqos-items>
</System>
This example has all nw, queuing and dos policies being applied at the system level.
CLI Commands
The CLI commands and options 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 or the YANG tab to view the XML payload.
system qos
service-policy type qos input foo
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