cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
45
Views
1
Helpful
8
Replies
Cisco Employee

About how to add CLI

 

Hi,

 

As you know,  show running-config devices device node-0 config cisco-ios-xr: that can display all device configuration. But that is so large. And show full-configuration services servicename can not display every device configuration that has configed by NSO service.

 

Could I add an show command only show device configuration that configed by service model? For example show each device’s configuration  that configuration by service model. If can, could you tell me how can I do ?

 

 

 

---------

 

Thanks

 

Hao Fan   

 

Everyone's tags (4)
8 REPLIES 8
Highlighted
Cisco Employee

Re: About how to add CLI

 

Hi Hao,

 

 

Not sure if this meets your request, but you can use “show services <service name> <instance> device-modifications” command.

 

Following is example.

 

 

admin@ncs# show services AddVlanJava test device-modifications

 

device-modifications  devices {

 

                          device R1 {

 

                              config {

 

                                  ios:interface {

 

                     +                Ethernet 0/1.101 {

 

                     +                    description "this interface is for 101";

 

                     +                    encapsulation {

 

                     +                        dot1Q {

 

                     +                            vlan-id 101;

 

                     +                        }

 

                     +                    }

 

                     +                    ip {

 

                     +                        address {

 

                     +                            primary {

 

                     +                                address 10.12.101.1;

 

                     +                                mask 255.255.255.0;

 

                     +                            }

 

                     +                        }

 

                     +                        ospf {

 

                     +                            network point-to-point;

 

                     +                        }

 

                     +                    }

 

 

 

Best regards,

 

Hiro

 

Highlighted
Cisco Employee

Re: About how to add CLI

 

Hi Hirotsugu,

 

Thanks for your replying me. It it helpful for me. But this way only can display the modifications part currently and can not display old configuration by NSO.

 

So I mean that how can I display show each device’s configuration  that configuration by service model ? Could I write a cli show  command ?

 

 

Thanks

 

Hao Fan

 

Highlighted
Cisco Employee

Re: About how to add CLI

 

Hi Hao,

 

 

I am not sure if I captured your request, but would you like to display all configuration changes made by a service model, instead of single service instance?

 

 

I think you can still use the same command, such as “show services <service model name> * device-modifications”.

 

You will get all modifications made by all instances of a service model.

 

 

I am not sure how much this helps.

 

Please let me know your thoughts.

 

 

Best regards,

 

Hiro

 

Highlighted
Cisco Employee

Re: About how to add CLI

 

Hi Hiro,

 

Thanks for your kindly replying email. I mean that could NSO display show each device’s configuration , such as “show services <service model name> * device-modifications device node-1”.

 

node-1 is my device name. If NSO can not do, could I write a cli show  command ? how can I do?

 

Thanks

 

Hao Fan

 

Highlighted
Cisco Employee

Re: About how to add CLI

 

Don’t think the CLI does that right now. Would something like this be acceptable:

 

show services service-name device-modification | begin “device node-1”

 

 

Or perhaps write an action and supply the device-name as an input.

 

 

Thanks,

Bilal.

 

Highlighted
Cisco Employee

Re: About how to add CLI

 

Hi Hao,

 

 

You can easily add a new CLI command with your service package to provide the output you desire. I’ve done similar things using the Python API. Should be pretty straight forward.

 

 

-Dan

 

Highlighted
Cisco Employee

Re: About how to add CLI

 

Hi Dan

 

I know that how to write service package, but do not know how to add a new CLI command ? Could you give me some instructions ?

 

 

---------

 

Thanks

 

Hao Fan   

 

Highlighted
Cisco Employee

Re: About how to add CLI

 

Have a look at examples.ncs/getting-started/developing-with-ncs/11-scripting