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 : IPluginExtends IPlugin
Properties
Section titled “Properties”DefaultSeverity
Section titled “DefaultSeverity”ComplianceSeverity DefaultSeverity { get; }Default implementation
The severity of a new check of this type.
Description
Section titled “Description”string? Description { get; }Default implementation
One short sentence for the type select.
Fields
Section titled “Fields”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
Section titled “SiteSupport”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.
UsesCachedDataOnly
Section titled “UsesCachedDataOnly”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.
Methods
Section titled “Methods”Describe
Section titled “Describe”string Describe(JsonElement settings)Default implementation
One line for the page: “Object Analytics running, at least 1.4”. Default: the display name.
EvaluateAsync
Section titled “EvaluateAsync”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.
ListChoicesAsync
Section titled “ListChoicesAsync”Task<IReadOnlyList<ActionChoice>> ListChoicesAsync(IComplianceQueryContext ctx, string fieldKey, CancellationToken ct)Default implementation
The choices of a ActionFieldType.DynamicChoice field (read only). Default: none.
Validate
Section titled “Validate”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.