From ba562f20f7d8fbf3fe6c7df7f3c945836bbf1438 Mon Sep 17 00:00:00 2001 From: Buddhika Chathuranga Date: Sat, 22 Aug 2020 16:21:14 +0530 Subject: [PATCH] YAML extension support documentation (#655) * Yaml extension support documentation * Fixed Typos --- doc/extensions/extensions.md | 4 ++-- doc/extensions/runawayProcessKiller.md | 24 +++++++++++++++++++- doc/extensions/sharedDirectoryMapper.md | 29 +++++++++++++++++++++++-- 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/doc/extensions/extensions.md b/doc/extensions/extensions.md index d1ad9f0..81d6c91 100644 --- a/doc/extensions/extensions.md +++ b/doc/extensions/extensions.md @@ -22,10 +22,10 @@ Generic extension creation guideline: * Extension DLL should reference the `WinSWCore` library. * The extension should extend the `AbstractWinSWExtension` class. * The extension then can override event handlers offered by the upper class. -* The extension should implement the configuration parsing from the `XmlNode`. +* The extension should implement the configuration parsing from the `XmlNode` and `YamlExtensionConfiguration`. * The extension should support disabling from the configuration file. -WinSW engine will automatically locate your extension using the class name in the [XML configuration file](../xmlConfigFile.md). +WinSW engine will automatically locate your extension using the class name in the [XML configuration file](../xmlConfigFile.md) or [YAML configuration file](../yamlConfigFile.md). See configuration samples provided for the extensions in the core. For extensions from external DLLs, the `className` field should also specify the assembly name. It can be done via fully qualified class name or just by the `${CLASS_NAME}, ${ASSEMBLY_NAME}` declaration. diff --git a/doc/extensions/runawayProcessKiller.md b/doc/extensions/runawayProcessKiller.md index 374f86b..81439af 100644 --- a/doc/extensions/runawayProcessKiller.md +++ b/doc/extensions/runawayProcessKiller.md @@ -11,7 +11,9 @@ Since: WinSW 2.0. ## Usage -The extension can be configured via the [XML configuration file](../xmlConfigFile.md). Configuration sample: +The extension can be configured via the [XML configuration file](../xmlConfigFile.md) or [YAML configuration file](../yamlConfigFile.md). + +### XML configuration sample ```xml @@ -42,6 +44,26 @@ The extension can be configured via the [XML configuration file](../xmlConfigFil ``` +### YAML configuration sample + +```yaml +id: sampleService +name: Sample Service +description: This is a stub service. +executable: '%BASE%\sleep.bat' +arguments: arg1 arg2 +log: + mode: roll +extensions: + - id: killRunawayProcess + enabled: yes + className: winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension + settings: + pidfile: 'foo/bar/pid.txt' + stopTimeOut: 5000 + StopParentFirst: true +``` + ## Notes * The current implementation of the the extension checks only the root process (started executable) diff --git a/doc/extensions/sharedDirectoryMapper.md b/doc/extensions/sharedDirectoryMapper.md index d91f26b..e973a82 100644 --- a/doc/extensions/sharedDirectoryMapper.md +++ b/doc/extensions/sharedDirectoryMapper.md @@ -9,8 +9,9 @@ Since: WinSW 2.0. ## Usage -The extension can be configured via the [XML configuration file](../xmlConfigFile.md). -Configuration sample: +The extension can be configured via the [XML configuration file](../xmlConfigFile.md) or [YAML configuration file](../yamlConfigFile.md). + +### XML configuration sample ```xml @@ -33,6 +34,30 @@ Configuration sample: ``` +### YAML configuration sample + +```yaml +id: sampleService +name: Sample Service +description: This is a stub service. +executable: '%BASE%\sleep.bat' +arguments: arg1 arg2 +log: + mode: roll +extensions: + - id: mapNetworDirs + className: winsw.Plugins.SharedDirectoryMapper.SharedDirectoryMapper + enabled: true + settings: + mapping: + - enabled: false + label: N + uncpath: \\UNC + - enabled: false + label: M + uncpath: \\UNC2 +``` + ## Notes * If the extension fails to map the drive, the startup fails