cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

380
Views
0
Helpful
2
Replies
Maurizio Bau
Beginner

More yang in one packages

Hi Guys

 

i've a problem to create one package with more yang in the same service

In detail, i've created two yang, both in src folder

First Yang

module MyMain_Service_Base {
	namespace "http://com/example/MyMain_Service";
	prefix "MyMain_Service";


//==================================
//===  IMPORT 
//==================================
	import ietf-inet-types {
		prefix inet;
		}
	import tailf-common {
		prefix tailf;
		}
	import tailf-ncs {
		prefix ncs;
		}

...<cut>...

//==================================
//===  augment /ncs:services  
//==================================
	augment /ncs:services {
		list Base  {
			tailf:info "Servizio per la creazione di device nella rete RDG";
			uses ncs:service-data;
			ncs:servicepoint "Base";
			key "service_instance";
			
		//==================================

Second Yang

module MyMain_Service_ACL {
	namespace "http://com/example/MyMain_Service";
	prefix "MyMain_Service";
	
//==================================
//===  IMPORT 
//==================================
	import ietf-inet-types {
		prefix inet;
		}
	import tailf-common {
		prefix tailf;
		}
	import tailf-ncs {
		prefix ncs;
		}
	
	
//==================================
//===  augment /ncs:services  
//==================================
	augment /ncs:services {
		list ACL {
			tailf:info "Servizio per la creazione delle ACL nella rete RDG";
			uses ncs:service-data;
			ncs:servicepoint "ACL";
			key "DeviceA_Name DeviceB_Name AclNumber";

After package reload, on services session i found two services named "Base" and "ACL".

If i want to have 1 Macro services, and 2 internal services, what's the yang correct configuration?

For example, if i want to have

MyMainService:ACL

MyMainService:Base

 

Thanks for all support.

Maurizio

2 REPLIES 2
cohult
Cisco Employee

Perhaps something like:

my-main-service.yang

module my-main-service {
prefix my-main-service;
...
container my-main-service {
presence "my-main-service";
uses ncs:service-data;
ncs:servicepoint "my-main-service";
}
}

my-main-service-base.yang

module my-main-service-base {
  ...
import my-main-service { prefix my-main-service; }
... augment /my-main-service:my-main-service { ... } }

my-main-service-acl.yang

module my-main-service-acl {
  ...
import my-main-service { prefix my-main-service; }
... augment /my-main-service:my-main-service { ... } }

 

Hi Cohult

 

yes all right.

thanks

Maurizio