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

Boolean operation for if-ned-id xpath function in templates

rogaglia
Cisco Employee
Cisco Employee

Hi,

I want to apply a boolean operation in the if-ned-id function, in particular an OR for two types of NEDs.

 

Is this supported?

 

Tried without success:

<?if-ned-id zte-nc-1-nc-1.0:zte-nc-1-nc-1.0 or if-ned-id hw-nc-1.0:hw-nc-1.0?>

<?(if-ned-id zte-nc-1-nc-1.0:zte-nc-1-nc-1.0) or (if-ned-id hw-nc-1.0:hw-nc-1.0)?>

 

Roque

1 Accepted Solution

Accepted Solutions

ramkraja
Cisco Employee
Cisco Employee

Tried without success:

<?if-ned-id zte-nc-1-nc-1.0:zte-nc-1-nc-1.0 or if-ned-id hw-nc-1.0:hw-nc-1.0?>

<?(if-ned-id zte-nc-1-nc-1.0:zte-nc-1-nc-1.0) or (if-ned-id hw-nc-1.0:hw-nc-1.0)?>


You just have to separate the ned-id's with a space or a newline. Don't use "if-ned-id" twice in the instruction. So:

 

<?if-ned-id zte-nc-1-nc-1.0:zte-nc-1-nc-1.0 hw-nc-1.0:hw-nc-1.0?>

No other 'boolean operation' makes sense here. (you can even have more than two ned-id's, and it will pass if any one of them is loaded).

 

/Ram

View solution in original post

4 Replies 4

ramkraja
Cisco Employee
Cisco Employee

Tried without success:

<?if-ned-id zte-nc-1-nc-1.0:zte-nc-1-nc-1.0 or if-ned-id hw-nc-1.0:hw-nc-1.0?>

<?(if-ned-id zte-nc-1-nc-1.0:zte-nc-1-nc-1.0) or (if-ned-id hw-nc-1.0:hw-nc-1.0)?>


You just have to separate the ned-id's with a space or a newline. Don't use "if-ned-id" twice in the instruction. So:

 

<?if-ned-id zte-nc-1-nc-1.0:zte-nc-1-nc-1.0 hw-nc-1.0:hw-nc-1.0?>

No other 'boolean operation' makes sense here. (you can even have more than two ned-id's, and it will pass if any one of them is loaded).

 

/Ram

Thanks!

Hi Ram,

 

Maybe an additional question, do you know if I can run XPATH string functions in "if-ned-id" call? The user story would be "every cisco-ios-* NED or every huawei-vrp* NED".

 

Thanks!

Roque

Maybe an additional question, do you know if I can run XPATH string functions in "if-ned-id" call? The user story would be "every cisco-ios-* NED or every huawei-vrp* NED".


No. Currently, the implementation only splits the contents based on whitespace or newlines, and checks if any of the ned-id's are loaded. There is no support for wildcards or xpath string functions as of now.

/Ram