Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
JozkoMrkvicka
Mentor
Mentor

Is rule part of section?

Hello,

As the Subject says, I would like to check if a specific rule is or is not part of the section.

Example:

image.png

My goal is to check if rule number 3 is part of "access-section" or not.
I can check all sections and check "from" and "to" and compare it with specific rule. But is there any other solution for that ?

The main purpose is that in case there is no rule included in section, I need to run API as follows:

.rulebase[].uid

but in case rule is part of a section, then the API call must be modified as:

.rulebase[].rulebase[].uid

 

@Tomer_Sole and @Nicolas_Boisse provided some inspiration within GitHub

Kind regards,
Jozko Mrkvicka
0 Kudos
2 Replies
PhoneBoy
Admin
Admin

This looks like jq versus just API calls. Which means we probably need to see the full CLI used (mgmt_cli with pipe to jq).

0 Kudos
Tomer_Sole
Mentor
Mentor

Indeed, there is a different handling at the API structure for rules that appear inside a section title, and a different handling for a case where the beginning of the rule set consists of rules with no section title.

But if your purpose is to check whether a rule is a part of a section, you can probably ignore that 2nd case (rules at the beginning of the rule set with no section title). 

I'm not sure if it's relevant but Multi-Domain layers and inline layers also have a bit of a different structure to handle.

@Dima_M @Omer_Kleinstern 

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events