Skip to content
Lukas Fey edited this page Dec 11, 2024 · 1 revision

Xyna provides two applications to create netconf/yang messages.

  • YangBase (modules/xfmg/yang) provides basic datatypes to identify datatypes relevant for yang operation
  • YangAppGenerator (modules/xdev/yang) contains a UI to create yang messages

Setup

Install both YangBase and YangAppGenerator. The factorymanager should show a new entry called "Yang (version)" on the left.

Usage

  1. Prerequisites:
  • A zip file containing relevant yang modules
  • A file containing capability information (netconf hello message)
  1. Create an application containing yang module information by clicking "Import Yang module collection" and providing a name and version for the application as well as the fully qualified name (FQN) for the datatype representing the module collection. After clicking the create button, the new application should show up in the Applications-tab.
  2. Create an application containing capability information by clicking "Import Yang device application". Provide application name, version and fully qualified name of the datatype storing capability information. You should see the newly created application in the Applications-tab.
  3. Create a workspace for your Yang messages and add both applications (module collection and device) from the previous steps as dependencies
  4. Create a yang message template by clicking the "Create Usecase" button in the Yang-tab.
  • Usecase Group is the FQN of the service group holding your usecase
  • Usecase Name is the name of the service in the service group
  • Workspace - the workspace you created in the previous step with dependencies to both generated application
  • RPC - name of the RPC this usecase should represent
  • Device Fqn - The FQN you used in step 3
  • (Optional) RPC Namespace - If the RPC name is not unique, provide the namespace of the RPC
  1. You should now see your new Usecase in the main table
  2. Provide input
  • The Usecase service starts with only a message id as input. You can add additional inputs using the upper table in the usecase details.
  • Additional input can be referenced in leafs and list configuration
  • to access a member variable of the input, use "." notation. For example, if you added a variable called id of type base.math.IntegerNumber, you can access the value using id.value
  1. Using the service in a workflow
  • Since the usecase is a regular service, you can add it to workflows and call it from a code snippet
  • Configured inputs become inputs of the service
  1. Mapping values to the yang tree
  • The lower table of the usecase details view shows direct children of the yang rpc root
  • Nodes like leaf or anyXml allow you to set a value
  • Nodes like container or grouping decent the tree

Setting values

There are two ways of providing a value for a leaf. You can either provide a static value by enclosing it in quotation marks (") or you can reference a variable (input or list). If you reference a xmom object, you can use the "." notation to access members.

Configuring lists

Yang nodes of type list or leaf-list have a Configure button above their child node table. There are two possibilities to configure lists. If you provide a static number, the list will have a fixed length. Alternatively, you can provide a variable name followed by ":" and the path to the list to iterate over. For example, if you added an additional input called contact that has a member of type list named phoneNumbers, you can set the list length to phone:contact.phoneNumbers. This will create a dynamic-length list that creates one entry for every value in contact.phoneNumbers. You can use phone as a variable when setting values in the subtree.

Clone this wiki locally