Repository navigation
platform sdk actions
Security Center actions instruct an entity to perform an operation, such as triggering an output relay or arming a zone. Applications can receive actions directed at entities they own or control.
For notifications that an operation occurred, see Working with Security Center events. To send actions from your application, use the methods on Engine.ActionManager. To create rules that execute actions when events occur, see Event-to-actions.
The following partial examples assume that engine is a connected Engine field and that the methods belong to the same class. Subscribe to actions using Engine.ActionReceived:
private void Initialize()
{
engine.ActionReceived += OnActionReceived;
}
private void OnActionReceived(object sender, ActionReceivedEventArgs e)
{
Console.WriteLine($"Action received: {e.ActionType} at {e.Timestamp}");
Console.WriteLine($"Recipient: {e.Action.Recipient}");
}ActionReceived reports only actions whose recipient is owned or controlled by your application. It does not report actions for entities managed by another application or role.
To observe activity on entities your application does not control, such as a door being unlocked, subscribe to their events instead. Your application receives an entity's events once it has loaded the entity.
Cast the Action property to specific action classes, which are defined in the Genetec.Sdk.Actions namespace:
private void OnActionReceived(object sender, ActionReceivedEventArgs e)
{
switch (e.ActionType)
{
case ActionType.TriggerOutput:
var triggerAction = e.Action as TriggerOutputAction;
Console.WriteLine($"Output behavior: {triggerAction?.OutputBehavior}");
break;
case ActionType.ArmZone:
var armAction = e.Action as ArmZoneAction;
Console.WriteLine($"Arming zone: {armAction?.Recipient}");
break;
}
}| Property | Type | Description |
|---|---|---|
ActionType |
ActionType |
The type of action received |
Action |
Action |
The action object with details |
Timestamp |
DateTime |
Action timestamp in Coordinated Universal Time (UTC) |
The Action base class provides:
| Property | Type | Description |
|---|---|---|
Type |
ActionType |
The action type |
Recipient |
Guid |
Target entity GUID |
AllRecipients |
IEnumerable<Guid> |
All target entity GUIDs for multi-recipient actions |
Schedule |
Guid |
Associated schedule GUID |
SourceEvent |
Event |
The event that triggered this action, if applicable |
The following action classes represent output, zone, intrusion area, macro, threat level, and input operations:
| Class | Description |
|---|---|
TriggerOutputAction |
Trigger an output relay |
ArmZoneAction |
Arm a zone |
DisarmZoneAction |
Disarm a zone |
ArmIntrusionAreaAction |
Arm an intrusion area |
DisarmIntrusionAreaAction |
Disarm an intrusion area |
ExecuteMacroAction |
Execute a macro |
SetThreatLevelAction |
Set threat level |
BypassInputAction |
Bypass an input |
UnbypassInputAction |
Remove input bypass |
In the class that subscribed to ActionReceived, remove the handler during disposal:
protected override void Dispose(bool disposing)
{
if (disposing)
{
engine.ActionReceived -= OnActionReceived;
}
base.Dispose(disposing);
}-
About the Platform SDK: SDK assemblies and the
Engineclass.
- Overview
- Connecting to Security Center
- SDK certificates
- Referencing SDK assemblies
- ASP.NET hosting
- SDK compatibility
- Migrating to modern .NET
- Entities
- Entity cache
- Entity loading, cache, and query options
- Detecting entity changes
- Entity change event reference
- Transactions
- Security Center events
- Actions
- Security Desk
- Custom events
- Event-to-actions
- Managing macros
- ReportManager
- ReportManager query reference
- Access control raw events
- DownloadAllRelatedData and StrictResults
- Privileges
- Partitions
- Entity write restrictions
- About custom fields
- About video
- About cameras
- Enrolling a video unit
- Ingesting third-party video
- Archiver and auxiliary archiver roles
- Archive transfer
- About access control
- About cardholders and credentials
- About doors, areas, elevators, and access points
- About access rules and schedules
- About access control units and interface modules
- Enrolling an access control unit
- Door templates
- Visitors
- Mobile credentials
- About threat levels
- About alarms
- About incidents
- Maps
- Logging
- Overview
- Localization
- Certificates
- Lifecycle
- Threading
- State management
- Configuration
- Restricted configuration
- Events
- Queries
- Request manager
- Database
- Entity ownership
- Engine extensions
- Entity mappings
- Server management
- Custom privileges
- Custom entity types
- Resolving non-SDK assemblies
- Deploying plugins
- Modern .NET support
- Overview
- Localization
- Certificates
- Creating modules
- Tasks
- Pages
- Components
- Tile extensions
- Services
- Contextual actions
- Custom actions
- Options extensions
- Configuration pages
- Monitors
- Shared components
- Commands
- Extending events
- Map extensions
- Timeline providers
- Image extractors
- Credential encoders
- Credential readers
- Cardholder fields extractors
- Badge printers
- Content builders
- Dashboard widgets
- Incidents
- Logon providers
- Pinnable content builders
- Custom report pages
- Overview
- Getting started
- Media file formats
- MediaPlayer
- VideoSourceFilter
- MediaExporter
- MediaFile
- G64 converters
- FileCryptingManager
- PlaybackSequenceQuerier
- PlaybackStreamReader
- OverlayFactory
- PtzCoordinatesManager
- AudioTransmitter
- AudioRecorder
- AnalogMonitorController
- Camera blocking
- Overview
- Getting started
- Referencing entities
- Entity operations
- About access control in the Web SDK
- About video in the Web SDK
- Users and user groups
- Partitions
- Custom fields
- Custom card formats
- Actions
- Events and alarms
- Incidents
- Reports
- Tasks
- Macros
- Custom entity types
- System endpoints
- Performance guide
- Reference
- Endpoints
- Constants
- Enumerations
- Under the hood
- Troubleshooting