cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Join Customer Connection to register!
303
Views
0
Helpful
0
Replies
Zeevik
Beginner

Change the Cisco-IO-XE extended access-list using RESTCONF PATCH command

Hi,

I've added the CSR1000v node simulation to CML2-PE and learning the RESTCONF via Python requests package.

The current target is to change one of the configured ACL port action from permit to deny.

The RESTCONF GET

headers = {'Content-Type': 'application/yang-data+json', 'Accept': 'application/yang-data+json'}
auth = requests.auth.HTTPBasicAuth(admin, password)
response = requests.get(https://csrIP:443/restconf/data/Cisco-IO-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:extended=z120",
headers=headers, auth = auth, verify=False

returns:

{'Cisco-IOS-XE-acl:extended': {'name': 'z120', 'access-list-seq-rule': [{'sequence': '40', 'ace-rule': {'action': 'permit', 'protocol': 'tcp', 'any': [None], 'src-eq': 1237, 'dst-any': [None]}}, ...}]}}

I'm trying to change the 'action' from 'permit' to 'deny' of the port ('src-eq': 1237),  using PATCH as follows:

data = "{extended': [{'name': 'z120', 'access-list-seq-rule': [{'sequence': '40', 'ace-rule': {'action': 'deny', 'src-eq': 1237}]}"
response = requests.patch('https://csrIP:443/restconf/data/Cisco-IO-XE-native:native/ip/access-list/Cisco-IOS-XE-acl:extended', data=data, verify=False)

but the error 404 is returned:  {"errors": {"error": [{"error-message": "uri keypath not found", "error-tag": "invalid-value", "error-type": "application"}]

 

What might be the problem?

 

Thanks

 

Zeev

0 REPLIES 0
Content for Community-Ad