public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Route53.Model.UpdateTrafficPolicyInstanceRequest(); if (cmdletContext.Id != null) { request.Id = cmdletContext.Id; } if (cmdletContext.TTL != null) { request.TTL = cmdletContext.TTL.Value; } if (cmdletContext.TrafficPolicyId != null) { request.TrafficPolicyId = cmdletContext.TrafficPolicyId; } if (cmdletContext.TrafficPolicyVersion != null) { request.TrafficPolicyVersion = cmdletContext.TrafficPolicyVersion.Value; } 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> /// Initiates the asynchronous execution of the UpdateTrafficPolicyInstance operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateTrafficPolicyInstance 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 EndUpdateTrafficPolicyInstance /// operation.</returns> public IAsyncResult BeginUpdateTrafficPolicyInstance(UpdateTrafficPolicyInstanceRequest request, AsyncCallback callback, object state) { var marshaller = new UpdateTrafficPolicyInstanceRequestMarshaller(); var unmarshaller = UpdateTrafficPolicyInstanceResponseUnmarshaller.Instance; return BeginInvoke<UpdateTrafficPolicyInstanceRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Updates the resource record sets in a specified hosted zone that were created based /// on the settings in a specified traffic policy version. /// /// /// <para> /// Send a <code>POST</code> request to the <code>/2013-04-01/trafficpolicyinstance/<i>traffic /// policy ID</i> </code> resource. The request body must include a document with an <code>UpdateTrafficPolicyInstanceRequest</code> /// element. /// </para> /// /// <para> /// When you update a traffic policy instance, Amazon Route 53 continues to respond to /// DNS queries for the root resource record set name (such as example.com) while it replaces /// one group of resource record sets with another. Amazon Route 53 performs the following /// operations: /// </para> /// <ol> <li> /// <para> /// Amazon Route 53 creates a new group of resource record sets based on the specified /// traffic policy. This is true regardless of how substantial the differences are between /// the existing resource record sets and the new resource record sets. /// </para> /// </li> <li> /// <para> /// When all of the new resource record sets have been created, Amazon Route 53 starts /// to respond to DNS queries for the root resource record set name (such as example.com) /// by using the new resource record sets. /// </para> /// </li> <li> /// <para> /// Amazon Route 53 deletes the old group of resource record sets that are associated /// with the root resource record set name. /// </para> /// </li> </ol> /// </summary> /// <param name="request">Container for the necessary parameters to execute the UpdateTrafficPolicyInstance service method.</param> /// /// <returns>The response from the UpdateTrafficPolicyInstance service method, as returned by Route53.</returns> /// <exception cref="Amazon.Route53.Model.ConflictingTypesException"> /// You tried to update a traffic policy instance by using a traffic policy version that /// has a different DNS type than the current type for the instance. You specified the /// type in the JSON document in the <code>CreateTrafficPolicy</code> or <code>CreateTrafficPolicyVersion</code>request. /// </exception> /// <exception cref="Amazon.Route53.Model.InvalidInputException"> /// The input is not valid. /// </exception> /// <exception cref="Amazon.Route53.Model.NoSuchTrafficPolicyException"> /// No traffic policy exists with the specified ID. /// </exception> /// <exception cref="Amazon.Route53.Model.NoSuchTrafficPolicyInstanceException"> /// No traffic policy instance exists with the specified ID. /// </exception> /// <exception cref="Amazon.Route53.Model.PriorRequestNotCompleteException"> /// If Amazon Route 53 can't process a request before the next request arrives, it will /// reject subsequent requests for the same hosted zone and return an <code>HTTP 400 error</code> /// (<code>Bad request</code>). If Amazon Route 53 returns this error repeatedly for the /// same request, we recommend that you wait, in intervals of increasing duration, before /// you try the request again. /// </exception> public UpdateTrafficPolicyInstanceResponse UpdateTrafficPolicyInstance(UpdateTrafficPolicyInstanceRequest request) { var marshaller = new UpdateTrafficPolicyInstanceRequestMarshaller(); var unmarshaller = UpdateTrafficPolicyInstanceResponseUnmarshaller.Instance; return Invoke<UpdateTrafficPolicyInstanceRequest,UpdateTrafficPolicyInstanceResponse>(request, marshaller, unmarshaller); }
private Amazon.Route53.Model.UpdateTrafficPolicyInstanceResponse CallAWSServiceOperation(IAmazonRoute53 client, Amazon.Route53.Model.UpdateTrafficPolicyInstanceRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Route 53", "UpdateTrafficPolicyInstance"); try { #if DESKTOP return(client.UpdateTrafficPolicyInstance(request)); #elif CORECLR return(client.UpdateTrafficPolicyInstanceAsync(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; } }
/// <summary> /// Initiates the asynchronous execution of the UpdateTrafficPolicyInstance operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the UpdateTrafficPolicyInstance 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<UpdateTrafficPolicyInstanceResponse> UpdateTrafficPolicyInstanceAsync(UpdateTrafficPolicyInstanceRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new UpdateTrafficPolicyInstanceRequestMarshaller(); var unmarshaller = UpdateTrafficPolicyInstanceResponseUnmarshaller.Instance; return InvokeAsync<UpdateTrafficPolicyInstanceRequest,UpdateTrafficPolicyInstanceResponse>(request, marshaller, unmarshaller, cancellationToken); }