public void ModifyInstancePlacementMarshallTest() { var operation = service_model.FindOperation("ModifyInstancePlacement"); var request = InstantiateClassGenerator.Execute<ModifyInstancePlacementRequest>(); var marshaller = new ModifyInstancePlacementRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var validator = new AWSQueryValidator(internalRequest.Parameters, request, service_model, operation); validator.Validate(); var payloadResponse = new XmlSampleGenerator(service_model, operation).Execute(); UnmarshallerContext context = new EC2UnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, new WebResponseData()); var response = ModifyInstancePlacementResponseUnmarshaller.Instance.Unmarshall(context) as ModifyInstancePlacementResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Set the instance affinity value for a specific stopped instance and modify the instance /// tenancy setting. /// /// /// <para> /// Instance affinity is disabled by default. When instance affinity is <code>host</code> /// and it is not associated with a specific Dedicated Host, the next time it is launched /// it will automatically be associated with the host it lands on. This relationship will /// persist if the instance is stopped/started, or rebooted. /// </para> /// /// <para> /// You can modify the host ID associated with a stopped instance. If a stopped instance /// has a new host ID association, the instance will target that host when restarted. /// </para> /// /// <para> /// You can modify the tenancy of a stopped instance with a tenancy of <code>host</code> /// or <code>dedicated</code>. /// </para> /// /// <para> /// Affinity, hostID, and tenancy are not required parameters, but at least one of them /// must be specified in the request. Affinity and tenancy can be modified in the same /// request, but tenancy can only be modified on instances that are stopped. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the ModifyInstancePlacement service method.</param> /// /// <returns>The response from the ModifyInstancePlacement service method, as returned by EC2.</returns> public ModifyInstancePlacementResponse ModifyInstancePlacement(ModifyInstancePlacementRequest request) { var marshaller = new ModifyInstancePlacementRequestMarshaller(); var unmarshaller = ModifyInstancePlacementResponseUnmarshaller.Instance; return Invoke<ModifyInstancePlacementRequest,ModifyInstancePlacementResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the ModifyInstancePlacement operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyInstancePlacement operation on AmazonEC2Client.</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 EndModifyInstancePlacement /// operation.</returns> public IAsyncResult BeginModifyInstancePlacement(ModifyInstancePlacementRequest request, AsyncCallback callback, object state) { var marshaller = new ModifyInstancePlacementRequestMarshaller(); var unmarshaller = ModifyInstancePlacementResponseUnmarshaller.Instance; return BeginInvoke<ModifyInstancePlacementRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the ModifyInstancePlacement operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the ModifyInstancePlacement 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<ModifyInstancePlacementResponse> ModifyInstancePlacementAsync(ModifyInstancePlacementRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new ModifyInstancePlacementRequestMarshaller(); var unmarshaller = ModifyInstancePlacementResponseUnmarshaller.Instance; return InvokeAsync<ModifyInstancePlacementRequest,ModifyInstancePlacementResponse>(request, marshaller, unmarshaller, cancellationToken); }