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

Is rule part of section?


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



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:


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



@Tomer_Sole and @Nicolas_Boisse provided some inspiration within GitHub

Kind regards,
Jozko Mrkvicka
0 Kudos
2 Replies

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

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