diff --git a/source/DSCResources/DSC_xServiceResource/DSC_xServiceResource.psm1 b/source/DSCResources/DSC_xServiceResource/DSC_xServiceResource.psm1 index 7650039c5..8dc157ca7 100644 --- a/source/DSCResources/DSC_xServiceResource/DSC_xServiceResource.psm1 +++ b/source/DSCResources/DSC_xServiceResource/DSC_xServiceResource.psm1 @@ -315,7 +315,7 @@ function Set-TargetResource $FailureCommand, [Parameter()] - [System.Object[]] + [Microsoft.Management.Infrastructure.CimInstance[]] $FailureActionsCollection, [Parameter()] @@ -600,7 +600,7 @@ function Test-TargetResource $FailureCommand, [Parameter()] - [System.Object[]] + [Microsoft.Management.Infrastructure.CimInstance[]] $FailureActionsCollection, [Parameter()] @@ -1835,7 +1835,7 @@ function Set-ServiceProperty $FailureCommand, [Parameter()] - [System.Object[]] + [Microsoft.Management.Infrastructure.CimInstance[]] $FailureActionsCollection, [Parameter()] @@ -2349,7 +2349,7 @@ function Set-ServiceFailureActionProperty { $FailureCommand, [Parameter()] - [System.Object[]] + [Microsoft.Management.Infrastructure.CimInstance[]] $FailureActionsCollection, [Parameter()] diff --git a/source/DSCResources/DSC_xServiceResource/DSC_xServiceResource.schema.mof b/source/DSCResources/DSC_xServiceResource/DSC_xServiceResource.schema.mof index 2876dbea2..d409201f2 100644 --- a/source/DSCResources/DSC_xServiceResource/DSC_xServiceResource.schema.mof +++ b/source/DSCResources/DSC_xServiceResource/DSC_xServiceResource.schema.mof @@ -16,4 +16,15 @@ class DSC_xServiceResource : OMI_BaseResource [Write,Description("An array of strings indicating the names of the dependencies of the service.")] String Dependencies[]; [Write,Description("The time to wait for the service to start in milliseconds. Defaults to 30000.")] uint32 StartupTimeout; [Write,Description("The time to wait for the service to stop in milliseconds. Defaults to 30000.")] uint32 TerminateTimeout; + [Write,Description("The time to wait for the Failure count to reset in seconds.")] UInt32 ResetPeriodSeconds; + [Write,Description("The command line to run if a service fails.")] String FailureCommand; + [Write,EmbeddedInstance("DSC_xFailureAction"),Description("The actions to take when a service fails.")] String FailureActionsCollection[]; + [Write,Description("A flag indicating whether failure actions should be invoked on non-crash failures.")] Boolean FailureActionsOnNonCrashFailures; +}; + +[ClassVersion("1.0.0")] +class DSC_xFailureAction +{ + [Write, Description("The action to take on failure"), ValueMap{"NONE", "RESTART", "REBOOT", "RUN_COMMAND"}, Values{"NONE", "RESTART", "REBOOT", "RUN_COMMAND"}] String Type; + [Write, Description("Delay in seconds to wait before taking the specified action")] UInt32 DelaySeconds; };