Questions tagged [yang]

YANG (Yet Another Next Generation) is a modular data modelling language for data used by network management protocols. It is defined in [RFC 7950](https://tools.ietf.org/html/rfc7950).

YANG is a data modeling language used to model configuration data, state data, Remote Procedure Calls, and notifications for network management protocols.

YANG was originally designed to model data for the NETCONF protocol. A YANG module defines hierarchies of data that can be used for NETCONF-based operations, including configuration, state data, RPCs, and notifications. This allows a complete description of all data sent between a NETCONF client and server. YANG may also be used with protocols other than NETCONF.

To the extent possible, YANG maintains compatibility with the Simple Network Management Protocol's (SNMP's) SMIv2. SMIv2-based MIB modules can be automatically translated into YANG modules for read-only access.

Further reading:

55 questions
0
votes
1 answer

CLI to YANG XML from local input

I have a huge cli conf file that I'd like to convert to YANG xml .... system host-name hostname.com system-ip 8.8.8.8 site-id 1 organization-name "Organization name" sp-organization-name "Organization name" vbond vbond.net .... ! There are…
0
votes
0 answers

can we use brackets in when statement in yang model. And how to use "and" and "or" operators in it

This leaf should be available only if we disable l3 access and the traffic type or types should be single vlan. leaf VLAN-normalization { type enumeration { enum "Normalize to Dot1q tag"; enum "Normalize to QinQ tags"; …
0
votes
1 answer

How to convert Yang to XPath?

I need to know if there are any tools that can take .yang file as an input and return all the XPaths that will be present. (I tried pyang, but I couldn't find any option to convert to XPath) For example: if .yang file is…
0
votes
1 answer

AttributeError: 'RPCReply' object has no attribute 'data_ele'

I'm getting this error**" AttributeError: 'RPCReply' object has no attribute 'data_ele'"** when I try to run the below python script Please help me to solve this problem import lxml.etree as et from argparse import ArgumentParser from ncclient…
kovalo
  • 1
0
votes
1 answer

How to deviate a leaf to container in Yang?

Vice versa would work as well. I looked in RFC#6020 but cannot think of how to do this. The container contains 4 leaves. I was planning to do a deviate replace, but am unable to figure out how the container could be added.
avm598
  • 1
0
votes
1 answer

unique constraints for Yang leaf-list across all nodes in a list

I have below yang models container PORT { description "PORT part of config_db.json"; list PORT_LIST { key "name"; leaf name { type string { length 1..128; } } …
0
votes
0 answers

YANG to Java for subsequent XML serialization/deserialization?

So I have YANG model files. I want to generate corresponding Java classes and be able to convert them to XML. For now, I try the following approach: YANG -> Relax NG -> XSD -> Java with JAXB Annotations YANG -> Relax NG can be performed by pyang…
Siarhei Vouchak
  • 125
  • 1
  • 10
0
votes
1 answer

Is it possible to use two When statements in a Yang model

Trying to use one Yang leaf with two different if-types depending on the value given. Currently have: leaf interface_number { when "boolean(string(/payload/interface_type) != 'ae')"; type isyt:interface_number_value; when…
0
votes
1 answer

Yang pattern not accepting regex containing ^ and $

Yang pattern does not accept valid Regex when it contains caret ^ or dollar $. The bellow pattern is valid on Regex validators, but when run inside a Yang pattern template in an is-types.yang file my application errors. However when i take off the ^…
0
votes
1 answer

How can I use YANG Compiler to convert Yang to Java?

I am trying to generate Java code from Yang using the ONOS YANG Compiler. I'm following the instructions on the Wiki to compile, but I'm getting compile errors and cannot generate Java code from Yang. YANG Compiler The following is the error…
0
votes
0 answers

bad arg and connection errors using Netconf-Yang on IOS-XE

I'm working Netconf-Yang for the first time on an IOS-XE device (Cat 9k, 16.8.1r) and I'm sending the following XML block to change an interface description. I'm using ansible netconf_config with these parameters: - name: netconf playbook hosts:…
MrPoulet
  • 91
  • 1
  • 1
  • 6
0
votes
1 answer

Default string values for union types in Yang Schema

Why can't the leaf wibble be assigned a default value "-"in the following schema (comments not in schema, added to post for clarity) module type { namespace "example.com"; prefix "foo"; typedef optional-value { type union…
Olumide
  • 5,397
  • 10
  • 55
  • 104
0
votes
2 answers

Why netconf is not using XML as data modeling language?

We know Netconf uses yang as data modeling language. Also it comprises of XML. Why XML itself is not used as modeling language?. What stops XML as a data modeling language?.
JavaUser
  • 25,542
  • 46
  • 113
  • 139
0
votes
1 answer

alternative way to use boolean container

container first{ container second{ type boolean; } } how can i do something like this.(My error:i can't boolean a container/error: unexpected keyword "type") I don't want to use leaf. Is there an alternative ?
0
votes
1 answer

How to add restriction to a integer leaf with set of values in yang

I want to set restriction to my yang leaf I tried something like this leaf remind-me-before { tailf:info "Remind me before value"; type uint16 { range "30, 25, 10, 5, 7"; } } } but it throws an error…
Lohit raj
  • 23
  • 5