cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
752
Views
5
Helpful
2
Replies

YANG leafref to another NSO service

douglasfir
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

Nabsch
Spotlight
Spotlight

Hello ,

 

you need to add the instruction import

import my-basic-service {
  prefix my-basic-service;
}

 

View solution in original post

2 Replies 2

Nabsch
Spotlight
Spotlight

Hello ,

 

you need to add the instruction import

import my-basic-service {
  prefix my-basic-service;
}

 

Hi @Nabsch,

 

thanks a lot for the solution and the quick response! All is working now!

 

Regards,

Dragan