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

Move regexregex to params for consistency #38

Closed
lvrfrc87 opened this issue Feb 21, 2022 · 4 comments
Closed

Move regexregex to params for consistency #38

lvrfrc87 opened this issue Feb 21, 2022 · 4 comments

Comments

@lvrfrc87
Copy link
Collaborator

Environment

  • netcompare version:

Proposed Functionality

Use Case

@lvrfrc87 lvrfrc87 changed the title Moverregexregex to params for consistency Move regexregex to params for consistency Feb 21, 2022
@lvrfrc87 lvrfrc87 self-assigned this Feb 21, 2022
@chadell
Copy link
Collaborator

chadell commented Feb 21, 2022

I don't understand this issue 😓

@lvrfrc87
Copy link
Collaborator Author

lvrfrc87 commented Mar 7, 2022

Let me get my head around it and might try to remember what i meant. Next time would be good to add some context :D

@lvrfrc87
Copy link
Collaborator Author

@chadell

As it stands now, regex check type is define as per example below

    "regex",
    {"regex": ".*UNDERLAY.*", "mode": "match"},
    "result[0].vrfs.default.peerList[*].[$peerAddress$,peerGroup]",

if you look at parameter_match check type, we define as below

    "parameter_match",
    {"mode": "no-match", "params": {"localAsn": "65130.1100", "linkType": "external"}},
    "result[0].vrfs.default.peerList[*].[$peerAddress$,localAsn,linkType]",

To keep the structure more consistent, the ideal would be to have regex define as per below:

    "regex",
    {"mode": "match", "params": {"regex": "*UNDERLAY.*"},
    "result[0].vrfs.default.peerList[*].[$peerAddress$,peerGroup]",

Would that make sense?

@pszulczewski your opinion is much appreciated

@pszulczewski
Copy link
Collaborator

In parameter check having params is justified as you may have different number of k:v pairs and you don't know key names.
In regex you have only one k:v pair, and the key is always regex, you don't really need params.

For me it's good as it is in regex.

In operator check, we have double nested params which I am not sure if inecessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants