private Amazon.Route53.Model.UpdateHealthCheckResponse CallAWSServiceOperation(IAmazonRoute53 client, Amazon.Route53.Model.UpdateHealthCheckRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Route 53", "UpdateHealthCheck"); try { #if DESKTOP return(client.UpdateHealthCheck(request)); #elif CORECLR return(client.UpdateHealthCheckAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Route53.Model.UpdateHealthCheckRequest(); if (cmdletContext.HealthCheckId != null) { request.HealthCheckId = cmdletContext.HealthCheckId; } if (cmdletContext.HealthCheckVersion != null) { request.HealthCheckVersion = cmdletContext.HealthCheckVersion.Value; } if (cmdletContext.IPAddress != null) { request.IPAddress = cmdletContext.IPAddress; } if (cmdletContext.Port != null) { request.Port = cmdletContext.Port.Value; } if (cmdletContext.ResourcePath != null) { request.ResourcePath = cmdletContext.ResourcePath; } if (cmdletContext.FullyQualifiedDomainName != null) { request.FullyQualifiedDomainName = cmdletContext.FullyQualifiedDomainName; } if (cmdletContext.SearchString != null) { request.SearchString = cmdletContext.SearchString; } if (cmdletContext.FailureThreshold != null) { request.FailureThreshold = cmdletContext.FailureThreshold.Value; } if (cmdletContext.Inverted != null) { request.Inverted = cmdletContext.Inverted.Value; } if (cmdletContext.Disabled != null) { request.Disabled = cmdletContext.Disabled.Value; } if (cmdletContext.HealthThreshold != null) { request.HealthThreshold = cmdletContext.HealthThreshold.Value; } if (cmdletContext.ChildHealthCheck != null) { request.ChildHealthChecks = cmdletContext.ChildHealthCheck; } if (cmdletContext.EnableSNI != null) { request.EnableSNI = cmdletContext.EnableSNI.Value; } if (cmdletContext.HealthCheckRegion != null) { request.Regions = cmdletContext.HealthCheckRegion; } // populate AlarmIdentifier var requestAlarmIdentifierIsNull = true; request.AlarmIdentifier = new Amazon.Route53.Model.AlarmIdentifier(); Amazon.Route53.CloudWatchRegion requestAlarmIdentifier_alarmIdentifier_Region = null; if (cmdletContext.AlarmIdentifier_Region != null) { requestAlarmIdentifier_alarmIdentifier_Region = cmdletContext.AlarmIdentifier_Region; } if (requestAlarmIdentifier_alarmIdentifier_Region != null) { request.AlarmIdentifier.Region = requestAlarmIdentifier_alarmIdentifier_Region; requestAlarmIdentifierIsNull = false; } System.String requestAlarmIdentifier_alarmIdentifier_Name = null; if (cmdletContext.AlarmIdentifier_Name != null) { requestAlarmIdentifier_alarmIdentifier_Name = cmdletContext.AlarmIdentifier_Name; } if (requestAlarmIdentifier_alarmIdentifier_Name != null) { request.AlarmIdentifier.Name = requestAlarmIdentifier_alarmIdentifier_Name; requestAlarmIdentifierIsNull = false; } // determine if request.AlarmIdentifier should be set to null if (requestAlarmIdentifierIsNull) { request.AlarmIdentifier = null; } if (cmdletContext.InsufficientDataHealthStatus != null) { request.InsufficientDataHealthStatus = cmdletContext.InsufficientDataHealthStatus; } if (cmdletContext.ResetElement != null) { request.ResetElements = cmdletContext.ResetElement; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// This action updates an existing health check. /// /// /// <para> /// To update a health check, send a <code>POST</code> request to the <code>2013-04-01/healthcheck/<i>health /// check ID</i></code> resource. The request body must include an XML document with an /// <code>UpdateHealthCheckRequest</code> element. The response returns an <code>UpdateHealthCheckResponse</code> /// element, which contains metadata about the health check. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateHealthCheck service method.</param> /// /// <returns>The response from the UpdateHealthCheck service method, as returned by Route53.</returns> /// <exception cref="Amazon.Route53.Model.HealthCheckVersionMismatchException"> /// /// </exception> /// <exception cref="Amazon.Route53.Model.InvalidInputException"> /// Some value specified in the request is invalid or the XML document is malformed. /// </exception> /// <exception cref="Amazon.Route53.Model.NoSuchHealthCheckException"> /// The health check you are trying to get or delete does not exist. /// </exception> public UpdateHealthCheckResponse UpdateHealthCheck(UpdateHealthCheckRequest request) { var marshaller = new UpdateHealthCheckRequestMarshaller(); var unmarshaller = UpdateHealthCheckResponseUnmarshaller.Instance; return Invoke<UpdateHealthCheckRequest,UpdateHealthCheckResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the UpdateHealthCheck operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateHealthCheck operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<UpdateHealthCheckResponse> UpdateHealthCheckAsync(UpdateHealthCheckRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateHealthCheckRequestMarshaller(); var unmarshaller = UpdateHealthCheckResponseUnmarshaller.Instance; return InvokeAsync<UpdateHealthCheckRequest,UpdateHealthCheckResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the UpdateHealthCheck operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateHealthCheck operation on AmazonRoute53Client.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateHealthCheck /// operation.</returns> public IAsyncResult BeginUpdateHealthCheck(UpdateHealthCheckRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateHealthCheckRequestMarshaller(); var unmarshaller = UpdateHealthCheckResponseUnmarshaller.Instance; return BeginInvoke<UpdateHealthCheckRequest>(request, marshaller, unmarshaller, callback, state); }