cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1720
Views
0
Helpful
7
Replies

NSO: service not getting list

Geethanjali
Cisco Employee
Cisco Employee

I have created a simple template service (yang and template xml), did a make and reloaded the packages. My package status shows true. But when i run the services command my service is not getting listed. any inputs? This is a basic service, no python/java involved. servicepoints are correctly mapped in the template xml.

 

admin@ncs# packages reload

>>> System upgrade is starting.
>>> Sessions in configure mode must exit to operational mode.
>>> No configuration changes can be performed until upgrade has completed.
>>> System upgrade has completed successfully.
reload-result {
    package IGP
    result true
}
reload-result {
    package IGP-test   << my service package
    result true
}

Not getting listed in when services command invoked

admin@ncs# config
Entering configuration mode terminal
admin@ncs(config)# services
Possible completions:
  check-sync           Check if device configuration is according to the
                       services
  commit-dry-run       DEPRECATED - use commit dry-run instead
  customer-service     Service that can be linked to customer
  global-settings
  logging              Configure service logging
  plan-notifications   Configuration to send plan-state-change notifications
                       for plan state transitions.
  service              List of resource facing services

1 Accepted Solution

Accepted Solutions

Your yang model does not augment services, so you would expect to find IGP-test on the top-level. That is instead of services IGP-test you'd expect just IGP-test. 

 

If the fxs-file was placed in load-dir you should be okay.

View solution in original post

7 Replies 7

vleijon
Cisco Employee
Cisco Employee

Two things:

 

1. What does your YANG model look like? Did you remember to compile it into an fxs file? Are you sure you mounted it under services?

 

2. What do you see if you do show packages package IGP-test?

Viktor,

 

I have deployed my service under the following path.

 

[root@nso packages]# pwd
/root/ncs_run/packages
[root@nso packages]# ls
cisco-ios  cisco-nx  IGP  IGP-test  README.signature  tailf.cer  Test

 

Post creating the service i have run a "make" command which was successful and then ran "package reload" command which list my service with a status true. Below is what i see when i run the command show packages package IGP-test

 

admin@ncs# show packages package IGP-test
packages package IGP-test
 package-version 1.0
 description     "Template-based IGP-test resource facing service"
 ncs-min-version [ 4.7 ]
 directory       ./state/packages-in-use/1/IGP-test
 templates       [ IGP-test-template ]
 oper-status up
admin@ncs#

My Yang content

 

module IGP-test {
  namespace "http://com/example/IGPtest";
  prefix IGP-test;

  import ietf-inet-types {
    prefix inet;
  }


  import tailf-ncs {
    prefix ncs;
  }

  list IGP-test {
    key name;

    uses ncs:service-data;
    ncs:servicepoint "IGP-test";

    leaf name {
      type string;
    }

    // may replace this with other ways of refering to the devices.
    leaf-list device {
      type leafref {
        path "/ncs:devices/ncs:device/ncs:name";
      }
    }

    leaf loopback-interface {
      type uint8 {
        range "0..10";
      }
    }

    leaf ip-address {
       type string {
        pattern
        '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
        +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
        + '/(([0-9])|([1-2][0-9])|(3[0-2]))';
    }

    }

    leaf ip-mask {
      type inet:ipv4-address;
    }
  }
}

 

Template XML file content

 

<config-template xmlns="http://tail-f.com/ns/config/1.0"
                 servicepoint="IGP-test">
  <devices xmlns="http://tail-f.com/ns/ncs">
    <device>
      <!--
          Select the devices from some data structure in the service
          model. In this skeleton the devices are specified in a leaf-list.
          Select all devices in that leaf-list:
      -->
      <name>{/device}</name>
      <config>
        <interface xmlns="urn:ios">
           <Loopback>
              <name>{loopback-interface}</name>
                 <ip>
                    <address>
                        <primary>
                                <address>{ip-address}</address>
                                <mask>{ip-mask}</mask>
                        </primary>
                    </address>
                 </ip>
            </Loopback>
           </interface>
      </config>
    </device>
  </devices>
</config-template>

Your yang model does not augment services, so you would expect to find IGP-test on the top-level. That is instead of services IGP-test you'd expect just IGP-test. 

 

If the fxs-file was placed in load-dir you should be okay.

You are right!

 

I did not augment services.  But i was in the assumption that it gets added in the yang file as a part of the scaffold, i mean when I do the ncs-make-package --service-skeleton template <service_name> command a basic yang file with all default statements is generated. Wondering why augment /ncs:services statement is not auto added as a part of the scaffold.

It used to be, but the majority of people seemed to dislike it so the behaviour was changed.

 

Instead there is now a more generic parameter --augment <path> that you can use to achieve the same effect.

Victor, Thank you for clarifying

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: