Beispiel #1
0
        protected override void ProcessRecord()
        {
            var clusterConnection = this.GetClusterConnection();

            try
            {
                ChaosDescription description = null;

                description = clusterConnection.GetChaosAsync(
                    this.GetTimeout(),
                    this.GetCancellationToken()).Result;

                this.WriteObject(this.FormatOutput(description));
            }
            catch (AggregateException aggregateException)
            {
                aggregateException.Handle((ae) =>
                {
                    this.ThrowTerminatingError(
                        ae,
                        Constants.GetChaosCommandErrorId,
                        clusterConnection);
                    return(true);
                });
            }
        }
Beispiel #2
0
            internal static unsafe ChaosDescription CreateFromNative(NativeClient.IFabricChaosDescriptionResult nativeResult)
            {
                if (nativeResult == null)
                {
                    return(null);
                }

                var chaosDescription = ChaosDescription.FromNative(nativeResult.get_ChaosDescriptionResult());

                GC.KeepAlive(nativeResult);
                return(chaosDescription);
            }
Beispiel #3
0
 public static string SerializeChaosDescription(ChaosDescription description)
 {
     return(JsonConvert.SerializeObject(
                description,
                chaosDescriptionSerializationSettings));
 }