cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
657
Views
5
Helpful
1
Replies

YANG PUT - Change Key Value

neteng1
Level 1
Level 1

This is related to YANG module Cisco-IOS-XE-wireless-wlan-cfg.

The container I'm working on is below. Is it possible to change the value of "policy-profile-name" after the resource is created? When I attempt to do so, I receive a 'mismatched keypath' error. 

 

container wlan-policies {
      description
        "WLAN policy configuration";
      list wlan-policy {
        key "policy-profile-name";
        description
          "List of WLAN policy configurations";
        uses wireless-wlan-cfg:st-wlan-policies;
      }
    }
{
    "errors": {
        "error": [
            {
                "error-message": "mismatched keypaths: /wireless-wlan-cfg:wlan-cfg-data/wireless-wlan-cfg:wlan-policies/wireless-wlan-cfg:wlan-policy[wireless-wlan-cfg:policy-profile-name='POLICY_PROFILE_1_NEW'] , /wireless-wlan-cfg:wlan-cfg-data/wireless-wlan-cfg:wlan-policies/wireless-wlan-cfg:wlan-policy[wireless-wlan-cfg:policy-profile-name='POLICY_PROFILE_1']",
                "error-path": "/Cisco-IOS-XE-wireless-wlan-cfg:wlan-cfg-data/wlan-policies/wlan-policy=POLICY_PROFILE_1",
                "error-tag": "malformed-message",
                "error-type": "application"
            }
        ]
    }
}

 

1 Accepted Solution

Accepted Solutions

yangorelik
Spotlight
Spotlight

Hello wizi

You cannot change key of the list element. Basically you need delete the existing element and then create element with new key.

Yan Gorelik
YDK Solutions

View solution in original post

1 Reply 1

yangorelik
Spotlight
Spotlight

Hello wizi

You cannot change key of the list element. Basically you need delete the existing element and then create element with new key.

Yan Gorelik
YDK Solutions