Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide option to pass Null as alternate key with pipe #983

Merged
merged 3 commits into from
Jan 10, 2020

Conversation

vnitinv
Copy link
Contributor

@vnitinv vnitinv commented Jan 7, 2020

Need the logical OR support for the key.

UTMStatusTable:
    rpc: show-utmd-status
    item:  //utmd-status
    view: UTMStatusView
    key: re-name | Null

UTMStatusView:
    fields:
        running: { running: flag }

We should be also able to support both item and key as logical OR operator

UTMStatusTable:
    rpc: show-utmd-status
    item: //multi-routing-engine-item/utmd-status | //utmd-status
    view: UTMStatusView
    key: 
      - re-name | Null

UTMStatusView:
    fields:
        running: { running: flag }

Note: When the item is using OR operator, key need to be passed as list (the way code handles it)

Standalone Output:

root@snpsrx4600h> show security utm status | display xml

<rpc-reply xmlns:junos="http://xml.juniper.net/junos/19.2R0/junos">
    <utmd-status xmlns="http://xml.juniper.net/junos/19.2R0/junos-utmd">
        <running/>
    </utmd-status>
    <cli>
        <banner></banner>
    </cli>
</rpc-reply>

In case of standalone, above table should return

{'running': True}

High-Availability Output:

root@riad-srx4200-4> show security utm status | display xml

<rpc-reply xmlns:junos="http://xml.juniper.net/junos/20.1I0/junos">
    <multi-routing-engine-results>
        
        <multi-routing-engine-item>
            
            <re-name>node0</re-name>
            
            <utmd-status xmlns="http://xml.juniper.net/junos/20.1I0/junos-utmd"><running/>
        </utmd-status>
    </multi-routing-engine-item>
    
    <multi-routing-engine-item>
        
        <re-name>node1</re-name>
        
        <utmd-status xmlns="http://xml.juniper.net/junos/20.1I0/junos-utmd"><running/>
    </utmd-status>
</multi-routing-engine-item>

    </multi-routing-engine-results>
    <cli>
<banner>{primary:node0}</banner>
    </cli>
</rpc-reply>

In case of cluster, above table/view should return

{'node0': {'running': True}, 'node1': {'running': True}}

@coveralls
Copy link

coveralls commented Jan 7, 2020

Coverage Status

Coverage increased (+0.02%) to 94.981% when pulling e5a7374 on vnitinv:key-contains-Null into 51ca852 on Juniper:master.

@vnitinv
Copy link
Contributor Author

vnitinv commented Jan 8, 2020

ok to test

@Juniper Juniper deleted a comment from rsmekala Jan 8, 2020
@vnitinv
Copy link
Contributor Author

vnitinv commented Jan 8, 2020

ok to test

@vnitinv
Copy link
Contributor Author

vnitinv commented Jan 8, 2020

retest this please

Copy link
Collaborator

@dineshbaburam91 dineshbaburam91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@vnitinv vnitinv merged commit a2ebb55 into Juniper:master Jan 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants