Cisco Nexus 3000 and 9000 Series NX-API REST SDK and API, Release 7.x
NX-OS 7(x)
- Cisco Nexus 3000 and 9000 Series NX-API REST Documentation
- Cisco Nexus 3000 and 9000 Series NX-API REST SDK User Guide and API Reference, Release 7.x
- Getting Started with the Cisco Nexus 3000 and 9000 Series NX-API REST SDK
- New and Changed
- Manageability
- Configuring System Management
- Configuring VXLAN BGP EVPN
- Configuring Fundamentals
- Configuring Power Modes
- Configuring Interfaces
- Configuring Static MPLS and Segment Routing
- Configuring Netstack
- Configuring Layer 2 Switching
- Configuring Multicast
- Configuring QoS
- Configuring TCAM
- Configuring Security
- Configuring Unicast Routing
- Configuring ARP
- Configuring DNS
- Configuring OSPFv2
- Configuring BGP
- Configuring a BGP Router
- Configuring an IPv4 Labeled Unicast Address Family
- Configuring an IPv4 Multicast Address Family
- Configuring an IPv4 MVPN Address Family
- Configuring an IPv4 Unicast Address Family
- Configuring an IPv6 Labeled Unicast Address Family
- Configuring an IPv6 Multicast Address Family
- Configuring an IPv6 MVPN Address Family
- Configuring an IPv6 Unicast Address Family
- Configuring an L2VPN EVPN Address Family
- Configuring a Link-State Address Family
- Configuring a VPNv4 Unicast Address Family
- Configuring a VPNv6 Unicast Address Family
- Configuring a Peer Template
- Configuring a BGP Neighbor
- Configuring a BMP Server
- Configuring EVPN
- Querying Ephemeral Data
- Configuring VRF
- First-Hop Redundancy Protocols
- Configuring Static Routes
- Configuring Route Policy Manager
- Configuring Telemetry
- Querying Analytic Information
- Querying Configurations (Show Commands)
- Querying Interface and VLAN Counters and Statistics
- Using the Managed Object Browser
- Monitoring the Environment
Creating User Roles and Rules
DME
YANG
CopyPOST http://<mgmt0_IP>/api/mo/sys.json
{
"topSystem": {
"children": [
{
"aaaUserEp": {
"children": [
{
"aaaRole": {
"attributes": {
"descr": "This role does not allow users to use clear commands",
"name": "UserA"
},
"children": [
{
"aaaRoleRule": {
"attributes": {
"permission": "deny",
"ruleAccess": "read-write",
"ruleNumber": "2"
}}},{
"aaaRoleRule": {
"attributes": {
"cmdStr": "clear users",
"permission": "deny",
"ruleAccess": "command",
"ruleNumber": "1"
}}},{
"aaaRoleRule": {
"attributes": {
"permission": "deny",
"ruleAccess": "read-write",
"ruleNumber": "4",
"ruleScope": "feature-group",
"scopeEntity": "L3"
}}},{
"aaaRoleRule": {
"attributes": {
"permission": "deny",
"ruleAccess": "read-write",
"ruleNumber": "5",
"ruleScope": "oid",
"scopeEntity": "1.3.6.1.2.1.1.9"
}}},{
"aaaRoleRule": {
"attributes": {
"permission": "permit",
"ruleAccess": "read",
"ruleNumber": "3",
"ruleScope": "feature",
"scopeEntity": "router-bgp"
}}}]}}]}}]}}
Response
{
imdata:[]
}
Copy<System>
<userext-items>
<role-items>
<Role-list>
<name>UserA</name>
<descr>This role does not allow users to use clear commands</descr>
<rule-items>
<RoleRule-list>
<ruleNumber>2</ruleNumber>
<permission>deny</permission>
<ruleAccess>read-write</ruleAccess>
</RoleRule-list>
<RoleRule-list>
<ruleNumber>1</ruleNumber>
<cmdStr>clear users</cmdStr>
<permission>deny</permission>
<ruleAccess>command</ruleAccess>
</RoleRule-list>
<RoleRule-list>
<ruleNumber>4</ruleNumber>
<permission>deny</permission>
<ruleAccess>read-write</ruleAccess>
<ruleScope>feature-group</ruleScope>
<scopeEntity>L3</scopeEntity>
</RoleRule-list>
<RoleRule-list>
<ruleNumber>5</ruleNumber>
<permission>deny</permission>
<ruleAccess>read-write</ruleAccess>
<ruleScope>oid</ruleScope>
<scopeEntity>1.3.6.1.2.1.1.9</scopeEntity>
</RoleRule-list>
<RoleRule-list>
<ruleNumber>3</ruleNumber>
<permission>permit</permission>
<ruleAccess>read</ruleAccess>
<ruleScope>feature</ruleScope>
<scopeEntity>router-bgp</scopeEntity>
</RoleRule-list>
</rule-items>
</Role-list>
</role-items>
</userext-items>
</System>