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); }); } }
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); }
public static string SerializeChaosDescription(ChaosDescription description) { return(JsonConvert.SerializeObject( description, chaosDescriptionSerializationSettings)); }