06-16-2022 05:40 AM - edited 06-16-2022 06:34 AM
Hi,
how can I reference another service YANG model from the first service YANG?
I tried something like this, but it is giving me "XPath error: Invalid namespace prefix: my-basic-service":
augment /ncs:services { list my-derived-service { key name; leaf name { tailf:info "Unique service id"; tailf:cli-allow-range; type string; } uses ncs:service-data; ncs:servicepoint my-derived-service-servicepoint; leaf basic_parameters { type leafref { path "/ncs:services/my-basic-service:my-basic-service/my-basic-service:name"; } } } }
I have also tried to add the path to the "my-basic-service" using, but the erros stays the same:
YANGPATH += /home/ncs/nso-use-cases/packages/my-basic-service/src/yang
Do you have any idea what might be the issue and if it is even possible to refer to another service YANG? The reason why I am trying all this is because of a service with a huge configuration, which can be dividec however in two parts:
- "lower" part with a lot of common parameters
- "upper" part where these parameters are being used by other service "objects"
If all put together, it takes a lot of time for the slightest service update. If divided into several smaller NSIs, than the "lower" part of configuration has to be copy-pasted in each NSI, as it must always stay consistent.
Thanks in advance!!
Dragan
Solved! Go to Solution.
06-16-2022 11:22 AM - edited 06-16-2022 07:08 PM
Hello ,
you need to add the instruction import
import my-basic-service {
prefix my-basic-service;
}
06-16-2022 11:22 AM - edited 06-16-2022 07:08 PM
Hello ,
you need to add the instruction import
import my-basic-service {
prefix my-basic-service;
}
06-16-2022 01:31 PM
Hi @Nabsch,
thanks a lot for the solution and the quick response! All is working now!
Regards,
Dragan
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide