Showing results for 
Search instead for 
Did you mean: 

Enabling rules by another rules ?

Occasional Contributor

Enabling rules by another rules ?



Is it possible to enable rules by another script?

In my case, there is these rules to be enabled when the certain rule is enabled (like cascade,   one enlabed, effecting others enabled)



with trafficscript, or external source like vcli, doesn't matter.


any ways?

New Contributor

Re: Enabling rules by another rules ?

I don't think that you can use any built-in functions to do this.


However, it would probably be possible to do a RESTful request to enable/disable rules through the TrafficScipt, ref.:


I'm not so sure if this is a preferred solution in an production environment.


Re: Enabling rules by another rules ?

Indeed that sounds quite tricky. To avoid using a trafficscript rule, I would rather use zcli and VirtualServer.setRules.


If a rule is mandatory but you don't want to do a synchronous call that could block, an option could be to have a rule raise an event, which would trigger an action running an external program doing the REST API call to toggle another rule's attributes.


But we're digging deeper the pit of inelegance here, if you provide more background maybe we could think of a better solution?