cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
426
Views
5
Helpful
3
Replies

I have multiple service package ,how can differentiate package?

himanss4
Cisco Employee
Cisco Employee

I have many service package deploy in NSO. We have many developer creating different package for there working , is there is something like tag we can assign in package-meta-data.xml of service package. Like if A team working on there service package they add A somewhere in service package .

And by RestConf api we can get A specific service package.

 

Is it is possible to tag some service package , so we fetch them only from rest api of NSO?

3 Replies 3

saumya003
Level 1
Level 1

I think, you should keep a baseline of service package and create new package for different developers and manage them with the 'servicepoint' tag within src/yang & template files while creating the package itself.

You will have to change the 'namespace' & 'prefix' tags in /src/yang/{service-package}.yang file as well and try loading them so that they appear as separate packages.

Another way could be create different nso instances for different teams/developers.

May be others can also help, cause I have also faced this problem, but not at a big scale.

snovello
Cisco Employee
Cisco Employee
One thing you might consider is to create 2 containers in the root, similar to the services container, so /a-services and /b-services
Then each service package augments under one or the other root container. You would have an extra package that defines those 2 containers.

I think that approach enables more than for example adopting a naming convention for modules. For example an operator might only be given access to one of the top containers. Naming connventions for modules are the method I have seen commonly to group modules when there are very many. For example in IOS-XR there are modules starting with ietf- *openconfig-* Cisco-IOS-XR-* tailf-*

The one thing in the Yang standard that is built for tagging multiple modules is the namespace, so you could also use namespaces like http://mycompany.com/a/service1 to tag the services. It would help the code developers to immediately see which group developed a module.

I am new to this service package creation thing @snovello . I have this type of yang files in service packages.

 

 
module abc {
  namespace "http://com/example/abc";
  yang-version 1.1;
  
  prefix abc;  

  import ietf-inet-types {
    prefix inet;
  }

  import tailf-ncs {
    prefix ncs;
  }
  
  import tailf-common {
    prefix tailf;
  }

  augment /ncs:services/ {
    list abc {
      key name;

      uses ncs:service-data;
      ncs:servicepoint "abc";

      leaf name {
        type string;
      }

      // list of devices (or device groups) to subscribe to the service
      leaf-list device {
        type leafref {
          path "/ncs:devices/ncs:device/ncs:name";
        }
      }

    }
  }
}
 
 
There will be other package like this abc1, abc2 , abc3. We Have created subscription of those and can fetch from restconf http://server/restconf/data/tailf-ncs:services/ all package.
 
Let say abc1, abc2 create by a team and abc3 by b team . How can i fetch and differentiate them and fetch a service package subscription from rest api? 
 
Do you have any example of above mention answer? 
What you mention above i understand it logically , but how to write container in root for different service , i am layman for that.