Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
phlrnnr
Advisor
Jump to solution

show-access-rulebase and large rulesets

I am using the REST API to create access-rules.  As part of the process, I'd like to validate that the rule name that the customer is submitting doesn't already exist in the rulebase/layer.  I was thinking I'd use 'show-access-rulebase' to export all the rules in the layer and then look for rule name matches. 

The code I have to do this works.  However, my question is, if the rulebase were to grow over 500 rules, 'show-access-rulebase' has a limit of 500 results.  What is the recommended way to do this on rulebases with large numbers of rules?

Is there a better way to do what I want to do?  If not, how can I process all the possible rules if > 500?

thanks!

1 Solution

Accepted Solutions
Robert_Decker
Advisor

Phillip,

Along with the rules data, this command also returns rulebase portion information - from, to, total.

Now, when querying the rulebase, you can pass parameters like offset and limit. As you said, you use limit 500.

So, offset along with from, to and total values can assist in looping over and querying the data, until total is reached. (advance the offset by limit per loop).

Robert.

View solution in original post

0 Kudos
7 Replies
Robert_Decker
Advisor

Phillip,

Along with the rules data, this command also returns rulebase portion information - from, to, total.

Now, when querying the rulebase, you can pass parameters like offset and limit. As you said, you use limit 500.

So, offset along with from, to and total values can assist in looping over and querying the data, until total is reached. (advance the offset by limit per loop).

Robert.

0 Kudos
Vincent_Bacher
Advisor
Advisor

Robert Decker schrieb:

As you said, you use limit 500

He  did not say he uses a limit of 500, he asks if there is a limit of 500  

And yes, the default limit is 500 afaik. 

So he may set the limit value higher or loop as recommended by you.

show access-rulebase offset 0 limit 2000 name "Network" details-level..... 
and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite
0 Kudos
(1)
Robert_Decker
Advisor

the default limit is 50. the maximum is 500. over 500 he must loop.

robert.

0 Kudos
Vincent_Bacher
Advisor
Advisor

Oh you're right, I think I misunderstood a bit 

and now to something completely different - CCVS, CCAS, CCTE, CCCS, CCSM elite
0 Kudos
Tomer_Sole
Mentor
Mentor

generally though it's a best practice not to loop on page size of 500, since the response packet can be relatively big and also the Management server processing of each chunk might take more time than looping on the default page size of 50. The reason why we capped it with max size of 500, is because beyond that the server might create a response too big to send.

0 Kudos
Huseyin_Rencber
Collaborator

If the rulebase grow over 500 rules, you must loop. 

John_Doe
Contributor

In my environment, I set a big limit value (10000).

My biggest rulebase has almost 4000 rules so it's ok.

What I don't understand is that documentation says maximum is 500. Why ?

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events