cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

1601
Views
5
Helpful
1
Replies

IOS-XE RESTCONF delete elemet of the config

Hello,

 

I'm wondering how to remove elements of the config of a switch through RESTCONF.

 

For example, I can add a class-map with RESTCONF by sending a PATCH, PUT or POST to this URL "data/Cisco-IOS-XE-native:native/policy", with this data:

{
	'Cisco-IOS-XE-native:policy': {
		'Cisco-IOS-XE-policy:class-map': [{
				'description': 'Test class-map',
				'name': 'test-cmap',
				'match': {
					'vlan': {
						'value': ['123']
					}
				},
				'prematch': 'match-any'
			}
		],
    }        
}

But how to deleted it ?

If I send the same command with the method DELETE, I get an error 404 "Operation not allowed."

I was unable to find any example of DELETE command with RESTCONF on internet, I have the same problem with policy-map or VLAN.

 

Thank in advance for the help,

Olivier

1 ACCEPTED SOLUTION

Accepted Solutions

Finally I found myself.

 

For information:

  • To delete a policy-map: data/Cisco-IOS-XE-native:native/policy/policy-map=policy-map_name
  • To delete a policy-map: data/Cisco-IOS-XE-native:native/policy/class-map=class-map_name
  • To delete a VLAN: data/Cisco-IOS-XE-native:native/vlan/vlan-list=VLAN-ID

Like on CLI, take care of the order when deleting commands (first policy-map, after class-map) !

If the name of policy-map or class-map contains a '/', it has to replaced by '%2F'.

View solution in original post

1 REPLY 1

Finally I found myself.

 

For information:

  • To delete a policy-map: data/Cisco-IOS-XE-native:native/policy/policy-map=policy-map_name
  • To delete a policy-map: data/Cisco-IOS-XE-native:native/policy/class-map=class-map_name
  • To delete a VLAN: data/Cisco-IOS-XE-native:native/vlan/vlan-list=VLAN-ID

Like on CLI, take care of the order when deleting commands (first policy-map, after class-map) !

If the name of policy-map or class-map contains a '/', it has to replaced by '%2F'.

Create
Recognize Your Peers
Content for Community-Ad