cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
113
Views
0
Helpful
4
Replies
Highlighted
Cisco Employee

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

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
Cisco Employee

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

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

4 REPLIES 4
Cisco Employee

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

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

Cisco Employee

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

Thanks!
Cisco Employee

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

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

Cisco Employee

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

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