show route-map

show route-map

import json

"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'

myheaders={'content-type':'application/json'}
payload={
  "ins_api":{
  "version": "1.0",
  "type": "cli_show",
  "chunk": "0",
  "sid": "1",
  "input": "show route-map",
  "output_format": "json"
}

response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)


{

    "ins_api": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE_rmap": {
                        "ROW_rmap": [
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "US", 
                                        "match_type": "as-path (as-path filter)"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "160", 
                                        "set_type": "local-preference"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "LPREF_lhc", 
                                "seq": "10"
                            }, 
                            {
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "110", 
                                        "set_type": "local-preference"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "LPREF_lhc", 
                                "seq": "20"
                            }, 
                            {
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": [
                                        {
                                            "set_stmt": "8", 
                                            "set_type": "metric"
                                        }, 
                                        {
                                            "set_stmt": "type-2", 
                                            "set_type": "metric-type"
                                        }
                                    ]
                                }, 
                                "action": "permit", 
                                "name": "OSPF-DEF-ROUTE", 
                                "seq": "10"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "PL-MDR-10", 
                                        "match_type": "ip address prefix-lists"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "65057:10", 
                                        "set_type": "community"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-FRK-OUT", 
                                "seq": "10"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "256", 
                                        "match_type": "as-path (as-path filter)"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "65057:7", 
                                        "set_type": "community"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-FRK-OUT", 
                                "seq": "20"
                            }, 
                            {
                                "action": "permit", 
                                "name": "RM-FRK-OUT", 
                                "seq": "100"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "PL-MDR-10", 
                                        "match_type": "ip address prefix-lists"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "65057:10", 
                                        "set_type": "community"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-LHC-OUT", 
                                "seq": "10"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "256", 
                                        "match_type": "as-path (as-path filter)"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "65057:7", 
                                        "set_type": "community"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-LHC-OUT", 
                                "seq": "20"
                            }, 
                            {
                                "action": "permit", 
                                "name": "RM-LHC-OUT", 
                                "seq": "100"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "US", 
                                        "match_type": "as-path (as-path filter)"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "160", 
                                        "set_type": "local-preference"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-LSL-IN", 
                                "seq": "10"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "APAC", 
                                        "match_type": "as-path (as-path filter)"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "130", 
                                        "set_type": "local-preference"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-LSL-IN", 
                                "seq": "15"
                            }, 
                            {
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "110", 
                                        "set_type": "local-preference"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-LSL-IN", 
                                "seq": "20"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "PL-MDR-10", 
                                        "match_type": "ip address prefix-lists"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "65057:10", 
                                        "set_type": "community"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-LSL-OUT", 
                                "seq": "10"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "256", 
                                        "match_type": "as-path (as-path filter)"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "65057:7", 
                                        "set_type": "community"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-LSL-OUT", 
                                "seq": "20"
                            }, 
                            {
                                "action": "permit", 
                                "name": "RM-LSL-OUT", 
                                "seq": "100"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "ANYCAST", 
                                        "match_type": "ip address prefix-lists"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "500", 
                                        "set_type": "local-preference"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-MIL-IN", 
                                "seq": "1"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "CL-BO", 
                                        "match_type": "community  (community-list filter)"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "140", 
                                        "set_type": "local-preference"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-MIL-IN", 
                                "seq": "10"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "67", 
                                        "match_type": "as-path (as-path filter)"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "120", 
                                        "set_type": "local-preference"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-MIL-IN", 
                                "seq": "20"
                            }, 
                            {
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "90", 
                                        "set_type": "local-preference"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-MIL-IN", 
                                "seq": "30"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "PL-MDR-10", 
                                        "match_type": "ip address prefix-lists"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "65057:10", 
                                        "set_type": "community"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-MIL-OUT", 
                                "seq": "10"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "256", 
                                        "match_type": "as-path (as-path filter)"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "65057:7", 
                                        "set_type": "community"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-MIL-OUT", 
                                "seq": "20"
                            }, 
                            {
                                "action": "permit", 
                                "name": "RM-MIL-OUT", 
                                "seq": "100"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "group 239.128.0.0/16", 
                                        "match_type": "ip multicast"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-SPT-INFINITY", 
                                "seq": "200"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "PL_STATIC-TO-OSPF", 
                                        "match_type": "ip address prefix-lists"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "type-1", 
                                        "set_type": "metric-type"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM_STATIC-TO-OSPF", 
                                "seq": "10"
                            }, 
                            {
                                "action": "deny", 
                                "name": "RM_STATIC-TO-OSPF", 
                                "seq": "100"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "group 239.128.0.0/16", 
                                        "match_type": "ip multicast"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RP_Tree", 
                                "seq": "45"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show route-map", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show route-map command, see the CLI command reference:

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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show route-map
route-map LPREF_lhc, permit, sequence 10 
  Match clauses:
    as-path (as-path filter): US 
  Set clauses:
    local-preference 160
route-map LPREF_lhc, permit, sequence 20 
  Match clauses:
  Set clauses:
    local-preference 110
route-map OSPF-DEF-ROUTE, permit, sequence 10 
  Match clauses:
  Set clauses:
    metric 8 
    metric-type type-2 
route-map RM-FRK-OUT, permit, sequence 10 
  Match clauses:
    ip address prefix-lists: PL-MDR-10 
  Set clauses:
    community 65057:10 
route-map RM-FRK-OUT, permit, sequence 20 
  Match clauses:
    as-path (as-path filter): 256 
  Set clauses:
    community 65057:7 
route-map RM-FRK-OUT, permit, sequence 100 
  Match clauses:
  Set clauses:
route-map RM-LHC-OUT, permit, sequence 10 
  Match clauses:
    ip address prefix-lists: PL-MDR-10 
  Set clauses:
    community 65057:10 
route-map RM-LHC-OUT, permit, sequence 20 
  Match clauses:
    as-path (as-path filter): 256 
  Set clauses:
    community 65057:7 
route-map RM-LHC-OUT, permit, sequence 100 
  Match clauses:
  Set clauses:
route-map RM-LSL-IN, permit, sequence 10 
  Match clauses:
    as-path (as-path filter): US 
  Set clauses:
    local-preference 160
route-map RM-LSL-IN, permit, sequence 15 
  Match clauses:
    as-path (as-path filter): APAC 
  Set clauses:
    local-preference 130
route-map RM-LSL-IN, permit, sequence 20 
  Match clauses:
  Set clauses:
    local-preference 110
route-map RM-LSL-OUT, permit, sequence 10 
  Match clauses:
    ip address prefix-lists: PL-MDR-10 
  Set clauses:
    community 65057:10 
route-map RM-LSL-OUT, permit, sequence 20 
  Match clauses:
    as-path (as-path filter): 256 
  Set clauses:
    community 65057:7 
route-map RM-LSL-OUT, permit, sequence 100 
  Match clauses:
  Set clauses:
route-map RM-MIL-IN, permit, sequence 1 
  Match clauses:
    ip address prefix-lists: ANYCAST 
  Set clauses:
    local-preference 500
route-map RM-MIL-IN, permit, sequence 10 
  Match clauses:
    community  (community-list filter): CL-BO 
  Set clauses:
    local-preference 140
route-map RM-MIL-IN, permit, sequence 20 
  Match clauses:
    as-path (as-path filter): 67 
  Set clauses:
    local-preference 120
route-map RM-MIL-IN, permit, sequence 30 
  Match clauses:
  Set clauses:
    local-preference 90
route-map RM-MIL-OUT, permit, sequence 10 
  Match clauses:
    ip address prefix-lists: PL-MDR-10 
  Set clauses:
    community 65057:10 
route-map RM-MIL-OUT, permit, sequence 20 
  Match clauses:
    as-path (as-path filter): 256 
  Set clauses:
    community 65057:7 
route-map RM-MIL-OUT, permit, sequence 100 
  Match clauses:
  Set clauses:
route-map RM-SPT-INFINITY, permit, sequence 200 
  Match clauses:
    ip multicast: group 239.128.0.0/16 
  Set clauses:
route-map RM_STATIC-TO-OSPF, permit, sequence 10 
  Match clauses:
    ip address prefix-lists: PL_STATIC-TO-OSPF 
  Set clauses:
    metric-type type-1 
route-map RM_STATIC-TO-OSPF, deny, sequence 100 
  Match clauses:
  Set clauses:
route-map RP_Tree, permit, sequence 45 
  Match clauses:
    ip multicast: group 239.128.0.0/16 
  Set clauses:

show route-map RM-MIL-OUT

show route-map  RM-MIL-OUT

import json

"""
Modify these please
"""
url='http://<IP_Address>/ins'
switchuser='<User_ID>'
switchpassword='<Password>'

myheaders={'content-type':'application/json'}
payload={
  "ins_api":{
  "version": "1.0",
  "type": "cli_show",
  "chunk": "0",
  "sid": "1",
  "input": "show route-map  RM-MIL-OUT",
  "output_format": "json"
}

response = requests.post(url,data=json.dumps(payload), headers=myheaders,auth=(switchuser,switchpassword)).json()
output = json.dumps(response, indent=4, sort_keys=True)


{

    "ins_api": {
        "outputs": {
            "output": {
                "body": {
                    "TABLE_rmap": {
                        "ROW_rmap": [
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "PL-MDR-10", 
                                        "match_type": "ip address prefix-lists"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "65057:10", 
                                        "set_type": "community"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-MIL-OUT", 
                                "seq": "10"
                            }, 
                            {
                                "TABLE_rmap_match": {
                                    "ROW_rmap_match": {
                                        "match_stmt": "256", 
                                        "match_type": "as-path (as-path filter)"
                                    }
                                }, 
                                "TABLE_rmap_set": {
                                    "ROW_rmap_set": {
                                        "set_stmt": "65057:7", 
                                        "set_type": "community"
                                    }
                                }, 
                                "action": "permit", 
                                "name": "RM-MIL-OUT", 
                                "seq": "20"
                            }, 
                            {
                                "action": "permit", 
                                "name": "RM-MIL-OUT", 
                                "seq": "100"
                            }
                        ]
                    }
                }, 
                "code": "200", 
                "input": "show route-map  RM-MIL-OUT", 
                "msg": "Success"
            }
        }, 
        "sid": "eoc", 
        "type": "cli_show", 
        "version": "1.0"
    }
}

The CLI output example below corresponds to the payload example in the code pane on the right. For more information about the show route-map RM-MIL-OUT command, see the CLI command reference:

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

Note: This example was added in Cisco NX-OS Release 6.0(2)A8(8).

CLI Output
Switch# show route-map  RM-MIL-OUT
route-map RM-MIL-OUT, permit, sequence 10 
  Match clauses:
    ip address prefix-lists: PL-MDR-10 
  Set clauses:
    community 65057:10 
route-map RM-MIL-OUT, permit, sequence 20 
  Match clauses:
    as-path (as-path filter): 256 
  Set clauses:
    community 65057:7 
route-map RM-MIL-OUT, permit, sequence 100 
  Match clauses:
  Set clauses: