SelectPolicyForDevices

Syntax

sub SelectPolicyForDevices

Description

This function is called automatically only when FireFlow is configured to work with this hook.

This hook is only applicable to Panorama devices and is an alternative to manually resetting the selected device group

when the default lowest device group is not the required target.

Configuration

By default, this hook is not called.

Two FireFlow configuration parameters are required in order for this hook function to be performed:

  • HooksFileNames - Enter the name of the file which includes the SelectPolicyForDevices function

  • PolicyBasedRequestForPanorama - The current value should be "DeviceGroup"

Note: After setting these parameters, you must restart FireFlow for the change to take affect. See Restarting FireFlow (see Restart FireFlow).

Input Parameters

$ticket

May have two values depending on "flatTicket" configuration. It can be a ticket hash or full array of the raw ticket's data, for example id, Requestor name, etc. A Perl hash reference containing a single key called Ticket, which points to the ticket representation of the change request.

For details, see Flat Ticket Examples.

$defaultPolicy

The name of the lowest Device Group (the Device Group level selected by default) that the device belongs to.

$deviceNames

An array of device names that are related to the default policy.

$policyHierarchy

An array of names of device groups that the device belongs to. The first element is the highest device group.

Return Values

Name of policy to select.