/// <summary> /// Gets the actual console history data (not the metadata). See CaptureConsoleHistory for details about using the console history operations. /// </summary> /// <param name="param"></param> /// <returns></returns> public GetConsoleHistoryContentResponse GetConsoleHistoryContent(GetConsoleHistoryContentRequest param) { var uri = new Uri($"{GetEndPoint(CoreServices.InstanceConsoleHistory, this.Region)}/{param.InstanceConsoleHistoryId}/data?{param.GetOptionQuery()}"); var webResponse = this.RestClient.Get(uri); using (var stream = webResponse.GetResponseStream()) using (var reader = new StreamReader(stream)) { var response = reader.ReadToEnd(); return(new GetConsoleHistoryContentResponse() { Contents = response, OpcBytesRemaining = webResponse.Headers.Get("opc-bytes-remaining"), OpcRequestId = webResponse.Headers.Get("opc-request-id") }); } }
protected override void ProcessRecord() { base.ProcessRecord(); GetConsoleHistoryContentRequest request; try { request = new GetConsoleHistoryContentRequest { InstanceConsoleHistoryId = InstanceConsoleHistoryId, Offset = Offset, Length = Length }; response = client.GetConsoleHistoryContent(request).GetAwaiter().GetResult(); WriteOutput(response, response.Value); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }