protected override void ProcessRecord() { base.ProcessRecord(); GenerateAnalyticsClusterMemoryEstimateRequest request; try { request = new GenerateAnalyticsClusterMemoryEstimateRequest { DbSystemId = DbSystemId, OpcRequestId = OpcRequestId, OpcRetryToken = OpcRetryToken }; response = client.GenerateAnalyticsClusterMemoryEstimate(request).GetAwaiter().GetResult(); WriteOutput(response, response.AnalyticsClusterMemoryEstimate); FinishProcessing(response); } catch (Exception ex) { TerminatingErrorDuringExecution(ex); } }
/// <summary> /// Sends a request to estimate the memory footprints of user tables when loaded to Analytics Cluster memory. /// /// </summary> /// <param name="request">The request object containing the details to send. Required.</param> /// <param name="retryConfiguration">The retry configuration that will be used by to send this request. Optional.</param> /// <param name="cancellationToken">The cancellation token to cancel this operation. Optional.</param> /// <returns>A response object containing details about the completed operation</returns> /// <example>Click <a href="https://docs.cloud.oracle.com/en-us/iaas/tools/dot-net-examples/latest/mysql/GenerateAnalyticsClusterMemoryEstimate.cs.html">here</a> to see an example of how to use GenerateAnalyticsClusterMemoryEstimate API.</example> public async Task <GenerateAnalyticsClusterMemoryEstimateResponse> GenerateAnalyticsClusterMemoryEstimate(GenerateAnalyticsClusterMemoryEstimateRequest request, RetryConfiguration retryConfiguration = null, CancellationToken cancellationToken = default) { logger.Trace("Called generateAnalyticsClusterMemoryEstimate"); Uri uri = new Uri(this.restClient.GetEndpoint(), System.IO.Path.Combine(basePathWithoutHost, "/dbSystems/{dbSystemId}/analyticsClusterMemoryEstimate/actions/generate".Trim('/'))); HttpMethod method = new HttpMethod("POST"); HttpRequestMessage requestMessage = Converter.ToHttpRequestMessage(uri, method, request); requestMessage.Headers.Add("Accept", "application/json"); GenericRetrier retryingClient = Retrier.GetPreferredRetrier(retryConfiguration, this.retryConfiguration); HttpResponseMessage responseMessage; try { if (retryingClient != null) { responseMessage = await retryingClient.MakeRetryingCall(this.restClient.HttpSend, requestMessage, cancellationToken).ConfigureAwait(false); } else { responseMessage = await this.restClient.HttpSend(requestMessage).ConfigureAwait(false); } this.restClient.CheckHttpResponseMessage(requestMessage, responseMessage); return(Converter.FromHttpResponseMessage <GenerateAnalyticsClusterMemoryEstimateResponse>(responseMessage)); } catch (Exception e) { logger.Error($"GenerateAnalyticsClusterMemoryEstimate failed with error: {e.Message}"); throw; } }