protected override void ProcessRecord() { base.ProcessRecord(); if (!ConfirmDelete("OCIComputeConsoleHistory", "Remove")) { return; } DeleteConsoleHistoryRequest request; try { request = new DeleteConsoleHistoryRequest { InstanceConsoleHistoryId = InstanceConsoleHistoryId, IfMatch = IfMatch }; response = client.DeleteConsoleHistory(request).GetAwaiter().GetResult(); WriteOutput(response); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }
/// <summary> /// Deletes the specified console history metadata and the console history data. /// </summary> /// <param name="request"></param> /// <returns></returns> public DeleteConsoleHistoryResponse DeleteConsoleHistory(DeleteConsoleHistoryRequest request) { var uri = new Uri($"{GetEndPoint(CoreServices.InstanceConsoleHistory, this.Region)}/{request.InstanceConsoleHistoryId}"); using (var webResponse = this.RestClient.Delete(uri, new HttpRequestHeaderParam() { IfMatch = request.IfMatch })) using (var stream = webResponse.GetResponseStream()) using (var reader = new StreamReader(stream)) { var response = reader.ReadToEnd(); return(new DeleteConsoleHistoryResponse() { OpcRequestId = webResponse.Headers.Get("opc-request-id") }); } }