Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to fill augmented model parameter using libyang in sysrepo #1

Open
Neeraj0019 opened this issue Dec 10, 2020 · 1 comment
Open

Comments

@Neeraj0019
Copy link

Neeraj0019 commented Dec 10, 2020

Hi,
I have a model which augments ietf-harware model by adding some additional fields to the hardware component.

augment "/hw:hardware/hw:component" {
when "(derived-from-or-self(hw:class, 'o-ran-hw:O-RAN-RADIO')) or
(derived-from-or-self(hw:class, 'o-ran-hw:O-RAN-HW-COMPONENT'))";
description "New O-RAN parameters for o-ran hardware";

leaf product-code {
type string;
config false;
mandatory true;
description
"O-RAN term that is distinct from model-name in ietf-hardware.";
}

Now I want to fill this "product-code" value inside my sysrepo plugin. I tried below 2 ways but its not working. Same way i am able to get the data for ietf-harware specific parameters.

  1. lyd_new_leaf(oruComp,NULL,"product-code xmlns="urn:o-ran:hardware:1.0"",get_product_code());

  2. lyd_new_leaf(oruComp,NULL,"o-ran-hw:product-code",get_product_code());

some other augmented node were added using sysrepocfg edit command and that works(able to get it via netopeer-cli option).

O-RU o-ran-hw:O-RAN-RADIO 0 O-RU
@Neeraj0019
Copy link
Author

Tried with below option... seems to work.
lyd_new_leaf(oruComp,ly_ctx_get_module(sr_get_context(sr_session_get_connection(session)),"o-ran-hardware",NULL,1), "product-code", get_product_code());

But is this the right way to do it for augmented nodes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant