Skip to main content

1E SDK

Policy.GetRules

Method

GetRules

Module

Policy

Library

Core

Action

Get the list of rules, along with their status, in the current policy.

Parameters

None

Return values

For each rule:

RuleId (integer): The server-defined numeric identifier for the rule.

Name (string): The name of the rule.

Triggers (string): A JSON block containing an array of triggers and their parameters where applicable.

RuleType (string): The type of rule, either 'Check' or 'Fix'.

Status (integer): The numeric representation of the evaluation status (see notes).

StatusText (string): The textual description of the evaluation status (see notes).

Timestamp (string): The date and time corresponding to the rule's current status.

Example

Policy.GetRules();

Platforms

  • Windows

  • Linux

  • MacOS

Notes

The mapping of status codes is as follows:

0: 'Received'

1: 'CheckErrored'

2: 'CheckFailed'

3: 'CheckPassed'

4: 'FixErrored'

5: 'FixPassed'

6: 'FixFailed'

7: 'NotApplied' (the rule has been disabled by the policy manager)

8: 'PreConditionErrored'

9: 'PreConditionPassed'

10: 'PreConditionFailed'

If the policy engine has been disabled through configuration, this method returns no data.

This method will return example data (for testing) in TIMS, because TIMS uses an alternative policy engine