cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2009
Views
0
Helpful
4
Replies

NSO Junos NED request-shell-execute

denoia
Level 1
Level 1

Hi,

we are trying to use Rpc  request-shell-execute in ned juniper-junos 4.2.1.

This Rpc emulates the execution of a cli command in juniper shell.

For example

cli show configuration vlans VLAN-755

returns

description PROVA_INTERNAL;
vlan-id 755;

My question is about concatenation of commands through "|"

for example

cli show configuration | display set |match VLAN-755

returns

display: Command not found.
match: Command not found.
cli: remote side unexpectedly closed connection

Is there a way to fire concatenated commands though this RPC?

Thanks in advance,

Giuseppe

 

1 Accepted Solution

Accepted Solutions

Please issue a TAC ticket and the NED developer will add the missing commands. This is typical work on NEDs. In particular, remember that Juniper original API was based on NETCONF but not YANG. So, we need to semi-automatically translate from the Juniper proprietary XSD to YANG and that is done by the NED team.

View solution in original post

4 Replies 4

reparab
Cisco Employee
Cisco Employee

Escape character '\' needs to be added to any special character in the command like below:

cli show configuration \| display set \|match VLAN-755

rogaglia
Cisco Employee
Cisco Employee

There is an example in the NED README file:

admin@ncs# devices device mx960-1 rpc rpc-request-shell-execute request-shell-execute command "cli request unified-edge sgw call-trace show brief \| display json"

 

In your case, that woudl translate to:

admin@ncs# devices device mx960-1 rpc rpc-request-shell-execute request-shell-execute command "cli show configuration \| display set \| match VLAN-755"

Hi Roque

 

I'm read your post and i've similar question

I want configure this command on Junos Device

set interface xe-5/0/1 unit 4017 family pppoe dynamic-profile FTTH-profile

At this time, my NED version not supported this command; as you can see, after family section there isn't a pppoe section

 

nso@ncs(config)# devices device OPM-RGJIT001 config junos:configuration interfaces interface xe-1/2/0 unit 4017 family ?
Possible completions:
  any                   Parameters for 'any' family
  apply-groups          
  apply-groups-except   
  apply-macro           
  bridge                Layer-2 bridging parameters
  ccc                   Circuit cross-connect parameters
  ethernet-switching    Ethernet switching parameters
  fibre-channel         Fibre channel switching parameters
  inet                  IPv4 parameters
  inet6                 IPv6 protocol parameters
  iso                   OSI ISO protocol parameters
  mlfr-end-to-end       Multilink Frame Relay end-to-end protocol parameters
  mlfr-uni-nni          Multilink Frame Relay UNI NNI protocol parameters
  mlppp                 Multilink PPP protocol parameters
  mpls                  MPLS protocol parameters
  tcc                   Translational cross-connect parameters
  vpls                  Virtual private LAN service parameters

So, I try to use rpc request-shell command

 

 

 

devices device OPM-RGJIT001 rpc rpc-request-shell-execute request-shell-execute command "cli edit private\nset interfaces xe-1/2/0 unit 4017 family pppoe dynamic-profile FTTH-profile \ncommit and-quit"

nso@ncs# devices device OPM-RGJIT001 rpc rpc-request-shell-execute request-shell-execute command "cli edit private\nset interfaces xe-1/2/0 unit 4018 family pppoe dynamic-profile RESIDENTIAL-NGN2-FTTH\n commit and-quit"
output Entering configuration mode
set: Variable name must contain alphanumeric characters.
commit: Command not found.

I try to use "\" first minus simbol or number without success.

Do you have any idea to solve this issue?

thanks for you support

Bye

Maurizio

 

Please issue a TAC ticket and the NED developer will add the missing commands. This is typical work on NEDs. In particular, remember that Juniper original API was based on NETCONF but not YANG. So, we need to semi-automatically translate from the Juniper proprietary XSD to YANG and that is done by the NED team.

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: