Policy
This package is used for fetching the policy configurations.
policy.name()
Return the string of the policy name.
policy.http_ports()
Return a lua array with all HTTP ports. Port value is integer.
{ 80, 8080 }
policy.https_ports()
Return a lua array with all HTTPS port. Port value is integer.
{ 443, 8443 }
policy.crs()
Return lua array with all content routing names.
{ “cr1”, “cr2”, “cr3” }
policy.servers() / policy.servers(“cr-name”)
Return lua array with all servers. If the policy has content routing, the caller should pass the “cr-name” argument to fetch the servers of the specific content routing.
{
{ [“type”] = “ip”, [“ip”] = “172.30.154.2”, [“port”] = 80 },
{ [“type”] = “ip”, [“ip”] = “172.30.154.3”, [“port”] = 80 },
...
}