-1

I have one yang model, which is use to change run time parameter of my application.how i can make some parameter read only because some parameter when get change it impact on my code.I want user cannot change that parameter on run time.

    notification bind-lne-name-failed {
    description
      "Indicates an error in the association of an interface to an
       LNE. Only generated after success is initially returned when
       bind-lne-name is set.";
    leaf name {
      type leafref {
        path "/if:interfaces/if:interface/if:name";
      }
      mandatory true;
      description
        "Contains the interface name associated with the
         failure.";
    }
    leaf bind-lne-name {
      type leafref {
        path "/if:interfaces/if:interface/lne:bind-lne-name";
      }
      mandatory true;
      description
        "Contains the bind-lne-name associated with the
         failure.";
    }
    leaf error-info {
      type string;
      description
        "Optionally, indicates the source of the assignment
         failure.";
    }
  }

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216

1 Answers1

0

You've provided a YANG notification, which defines the structure of messages being sent from a YANG-capable server (for example, a NETCONF server) to a YANG-capable client (a NETCONF client) that has subscribed to it. So notifications doesn't describe configuration data, but something the server sends to the client on its own.

I assume you have another yang model that does contain the data you want, which might overlap with the notification data.

Generically, you make leafs non-configurable by using the config keyword, which can have true or false values. Here's an example on how that would look like in the error-info leaf:

    leaf error-info {
      type string;
      config false;
      description
        "Optionally, indicates the source of the assignment
         failure.";
    }

By default, every data nodes are config true, meaning that they are writable, so that can be ommitted. For defining read-only data, you use config false.

You can find documentation on this keyword on the YANG RFC at https://www.rfc-editor.org/rfc/rfc6020#section-7.19.1

Community
  • 1
  • 1
Paulo Gomes
  • 156
  • 3