Skip to content

IComplianceCheckType

Interface in Oadm.Sdk.Compliance · Oadm.Sdk.dll

A kind of compliance check (“Application running”, “Matches configuration file”). The user adds checks of a type on the Compliance page: the type’s settings, the devices, Problem or Warning, and how often it runs. The host runs it on every chosen device, stores the results, shows them and publishes an event per check for the event rules. Contributed by a core plugin through IComplianceSource; the host’s own types use the same contract. Read only: a check never changes a device.

public interface IComplianceCheckType : IPlugin

Extends IPlugin

ComplianceSeverity DefaultSeverity { get; }

Default implementation

The severity of a new check of this type.

string? Description { get; }

Default implementation

One short sentence for the type select.

IReadOnlyList<ActionField> Fields { get; }

The settings form, drawn by the check dialog and checked on the server.

string Group { get; }

Default implementation

Group of the type select (“Devices”, “Applications”, “Configuration”, “Storage”). Default “General”.

SiteSupport? SiteSupport { get; }

Default implementation

Whether this type checks devices at a site; null (the default) = the package’s siteSupport in plugin.json. A type with SiteSupport.None is Not checked for devices at a site.

bool UsesCachedDataOnly { get; }

Default implementation

True: the type decides from what the server already knows about the device (IComplianceContext.Device) and never contacts it. The host checks it whenever the device changes, without an interval.

string Describe(JsonElement settings)

Default implementation

One line for the page: “Object Analytics running, at least 1.4”. Default: the display name.

Task<ComplianceResult> EvaluateAsync(IComplianceContext ctx, ComplianceInvocation invocation, CancellationToken ct)

Checks one device. Return the result; an exception counts as ComplianceOutcome.CouldNotCheck with its message. The host cancels ct after the device timeout (15 s for all checks of a run) or when the server stops. Devices the server must not contact (status not Ok) never reach a type that reads the device.

Task<IReadOnlyList<ActionChoice>> ListChoicesAsync(IComplianceQueryContext ctx, string fieldKey, CancellationToken ct)

Default implementation

The choices of a ActionFieldType.DynamicChoice field (read only). Default: none.

IReadOnlyDictionary<string, string> Validate(JsonElement settings)

Default implementation

Checks the settings before a check is saved; returns errors per field key (“” for the whole check). Required fields, numbers and choices are already checked. Default: no further errors.