IActionContext
Interface in Oadm.Sdk.Actions · Oadm.Sdk.dll
Server services for one action run.
public interface IActionContextGuide: Event rules
Properties
Section titled “Properties”Logger
Section titled “Logger”ILogger Logger { get; }The server log. For the event log, use IActionContext.Log.
ICorePlugin? Owner { get; }The core plugin that contributed the action (VAPIX Commander for “Run VAPIX command”), else null.
Settings
Section titled “Settings”IPluginSettings Settings { get; }The settings of the plugin package (e.g. an SMTP server), namespaced like a core plugin’s.
IVapixClient? Vapix { get; }Pre-authenticated for ActionInvocation.Device with the stored credentials; null without a device.
Methods
Section titled “Methods”void Log(string message)Extra line for the event log entry of this run. Never log secrets.
string Text(string? text)Fills the placeholders of ActionPlaceholders.Fixed ({rule}, {event}, {state}, {time}, {device}, {serial}, {mac}, …) in a text of the settings, then every value of the event by its name ({port}, {total}; ActionTrigger.Data). The fixed names win over event values of the same name; unknown names stay. Device values come from the action’s device, else from the device of the event.
string Text(string? text, PlaceholderEscape escape)Default implementation
IActionContext.Text for a text with a format: each value is escaped (PlaceholderEscape), so “objectId”: “{objectId}” stays valid JSON whatever the value holds. The text around the placeholders is unchanged.