Trying to update the source match address in a class-map and YDK returned an error:
YPYServiceProviderError: Server reported an error while committing change.
error-type: application
error-tag: operation-failed
error-severity: error
error-path: ns1:policy-manager/ns1:class-maps/ns1:class-map[type = 'traffic' and name = 'flow1_cm']/ns1:name
error-message: Operation not supported (FS MGR): InPlace Modify Error:
error-type: application
error-tag: backend-status-summary
error-severity: warning
error-message: QT/SysDB backend failed, non-QT backend passed [read rest of response for details]
The original XML config is:
<class-maps>
<class-map>
<type>traffic</type>
<name>flow1_cm</name>
<class-map-mode-match-all/>
<match>
<source-address-ipv4>
<address>192.168.1.0</address>
<netmask>255.255.255.0</netmask>
</source-address-ipv4>
<destination-address-ipv4>
<address>192.168.100.0</address>
<netmask>255.255.255.0</netmask>
</destination-address-ipv4>
</match>
</class-map>
changed the 192.168.1.0 to 192.168.2.0 and the error occured.
That error is not locally generated by YDK. It comes from the router. Please share your YDK code snippet, will try to reproduce and follow up on the what is causing the router to reject the config.
code related is below:
def update_flow():
policy_manager = PolicyManager()
class_maps = policy_manager.class_maps
cm = class_maps.ClassMap()
cm.name = 'flow1_cm'
cm.type = ClassMapTypeEnum.traffic
cm.class_map_mode_match_all = Empty()
source = cm.match.SourceAddressIpv4()
source.address = '192.168.2.0'
source.netmask = '255.255.255.0'
cm.match.source_address_ipv4.append(source)
dest = cm.match.DestinationAddressIpv4()
dest.address = '192.168.100.0'
dest.netmask = '255.255.255.0'
cm.match.destination_address_ipv4.append(dest)
class_maps.class_map.append(cm)
provider = get_connection()
update(provider, policy_manager)
release_connection(provider)
Also tried to delete the PolicyManager.ClassMaps.ClassMap.Match.
SourceAddressIpv4 object first and then add a new source address. The delete operation didn't raise an error but the source address is still in the config.
The code is:
def delete_test():
provider = get_connection()
p_object = PolicyManager()
p_result = read(provider, p_object)
for j in p_result.class_maps.class_map:
for k in j.match.source_address_ipv4:
print k.address
delete(provider, k)
release_connection(provider)
Try deleting the entire match and then adding the new match with the updated src-address.
The problem you may be hitting is that the source address isn't independently updatable.
Tried to delete the match object and a new error is raised.
YPYServiceProviderError: Server reported an error while committing change.
error-type: application
error-tag: operation-failed
error-severity: error
error-path: ns1:policy-manager/ns1:class-maps/ns1:class-map[type = 'traffic' and name = 'flow1_cm']/ns1:name
error-message: Policy manager does not support this feature: Classmap is empty,if class map no more required please delete class map 'flow1_cm'
error-type: application
error-tag: backend-status-summary
error-severity: warning
error-message: QT/SysDB backend failed, non-QT backend passed [read rest of response for details]
Looks like cannot delete the match object
Tried to do same for my XR boxes and seems it works for me. Try to copy paste the code (in attachment) if it runs also for you.
- The prints just iterate through the class map and print its name, type and source/dest ip addresses/masks
- The edit_class_map function do the trick with addying IPs to class_map
EDIT: running YDK 0.5.3 and the version of my XR is 6.1.2
Since you cannot specify match-any for match-source address or destination address. Error message from ASR if you want to configure it like that:
!!% Policy manager does not support this feature: Match all is the only mode supported for match type "source-address-ipv4" in class-map type "traffic"
end
Class map test_CM is my class map I am editing. So use your name in that code. Hopefully it will work. Here is mine config from XR:
RP/0/0/CPU0:TFI-LAB-XRv6.1.2-01#show run class-map
Tue Feb 28 14:18:42.900 UTC
class-map type traffic match-all test_CM
description This is my description
match source-address ipv4 10.0.0.0 255.255.255.0
match source-address ipv4 50.0.0.1 255.255.255.0
match destination-address ipv4 100.0.0.1 255.255.255.0
match destination-address ipv4 20.0.0.0 255.255.255.0
end-class-map
!
Comments
0 comments
Please sign in to leave a comment.