Set-ServiceFabricChaosSchedule
Defina o cronograma a ser usado pelo Agendador do Caos.
Sintaxe
Set-ServiceFabricChaosSchedule
-ChaosScheduleDescription <ChaosScheduleDescription>
[-TimeoutSec <Int32>]
[<CommonParameters>]
Description
O cmdlet Set-ServiceFabricChaosSchedule define o agendamento a ser usado pelo Agendador do Caos. O Agendador do Caos começará a executar o Chaos durante com base no cronograma especificado.
Exemplos
Exemplo 1
PS C:\> $JobStartTime = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleTimeUtc (0,0)
PS C:\> $JobEndTime = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleTimeUtc (12,59)
PS C:\> $JobTimeRange = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleTimeRangeUtc ($JobStartTime, $JobEndTime)
PS C:\> $activeDays = New-Object -TypeName System.Collections.Generic.HashSet[DayOfWeek]
PS C:\> $activeDays.Add([System.DayOfWeek]::Monday)
PS C:\> $activeDays.Add([System.DayOfWeek]::Tuesday)
PS C:\> $activeDays.Add([System.DayOfWeek]::Wednesday)
PS C:\> $activeDays.Add([System.DayOfWeek]::Thursday)
PS C:\> $activeDays.Add([System.DayOfWeek]::Friday)
PS C:\> $JobActiveDays = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleJobActiveDays ($activeDays)
PS C:\> $JobActiveTimes = New-Object -TypeName System.Collections.Generic.List[System.Fabric.Chaos.DataStructures.ChaosScheduleTimeRangeUtc]
PS C:\> $JobActiveTimes.Add($JobTimeRange)
PS C:\> $Job = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleJob ("adhoc", $JobActiveDays, $JobActiveTimes)
PS C:\> $Jobs.Add($Job)
PS C:\> $ChaosParameters = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosParameters
PS C:\> $ChaosParametersDictionary = New-Object 'System.Collections.Generic.Dictionary[string,System.Fabric.Chaos.Datastructures.ChaosParameters]'
PS C:\> $ChaosParametersDictionary.Add("adhoc", $ChaosParameters)
PS C:\> $Now = Get-Date
PS C:\> $StartTime = $Now.ToUniversalTime()
PS C:\> $EndTime = $StartTime.AddDays(100)
PS C:\> $ChaosSchedule = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosSchedule ($StartTime, $EndTime, $ChaosParametersDictionary, $Jobs)
PS C:\> $ChaosScheduleDescription = New-Object -TypeName System.Fabric.Chaos.DataStructures.ChaosScheduleDescription (0, $ChaosSchedule)
PS C:\> Set-ServiceFabricChaosSchedule -ChaosSchedule $ChaosScheduleDescription
Defina uma programação que especifique o Caos a ser executado 24 horas por dia, começando na segunda-feira e terminando na sexta-feira (com base no fuso horário UTC). Este cronograma permanecerá ativo por 100 dias, durante os quais, o Chaos Scheduler seguirá este cronograma para executar o Chaos. Para interromper a agendamento, use o cmdlet Stop-ServiceFabricChaos.
Parâmetros
-ChaosScheduleDescription
O cronograma que será definido para o Chaos Scheduler usar.
Tipo: | ChaosScheduleDescription |
Position: | Named |
Default value: | None |
Necessário: | True |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
-TimeoutSec
Especifica o período de tempo limite, em segundos, para a operação.
Tipo: | Int32 |
Position: | Named |
Default value: | None |
Necessário: | False |
Aceitar entrada de pipeline: | False |
Aceitar carateres universais: | False |
Entradas
None
Saídas
System.Object