Example #1
0
        public void ReleaseHostsMarshallTest()
        {
            var operation = service_model.FindOperation("ReleaseHosts");

            var request = InstantiateClassGenerator.Execute<ReleaseHostsRequest>();
            var marshaller = new ReleaseHostsRequestMarshaller();
            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 = ReleaseHostsResponseUnmarshaller.Instance.Unmarshall(context)
                as ReleaseHostsResponse;   
            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);       
        }
Example #2
0
        /// <summary>
        /// When you no longer want to use an On-Demand Dedicated Host it can be released. On-Demand
        /// billing is stopped and the host goes into <code>released</code> state. The host ID
        /// of Dedicated Hosts that have been released can no longer be specified in another request,
        /// e.g., ModifyHosts. You must stop or terminate all instances on a host before it can
        /// be released.
        /// 
        ///  
        /// <para>
        /// When Dedicated Hosts are released, it make take some time for them to stop counting
        /// toward your limit and you may receive capacity errors when trying to allocate new
        /// Dedicated hosts. Try waiting a few minutes, and then try again.
        /// </para>
        ///  
        /// <para>
        /// Released hosts will still appear in a <a>DescribeHosts</a> response.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ReleaseHosts service method.</param>
        /// 
        /// <returns>The response from the ReleaseHosts service method, as returned by EC2.</returns>
        public ReleaseHostsResponse ReleaseHosts(ReleaseHostsRequest request)
        {
            var marshaller = new ReleaseHostsRequestMarshaller();
            var unmarshaller = ReleaseHostsResponseUnmarshaller.Instance;

            return Invoke<ReleaseHostsRequest,ReleaseHostsResponse>(request, marshaller, unmarshaller);
        }
Example #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the ReleaseHosts operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ReleaseHosts 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 EndReleaseHosts
        ///         operation.</returns>
        public IAsyncResult BeginReleaseHosts(ReleaseHostsRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new ReleaseHostsRequestMarshaller();
            var unmarshaller = ReleaseHostsResponseUnmarshaller.Instance;

            return BeginInvoke<ReleaseHostsRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
Example #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the ReleaseHosts operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the ReleaseHosts 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<ReleaseHostsResponse> ReleaseHostsAsync(ReleaseHostsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new ReleaseHostsRequestMarshaller();
            var unmarshaller = ReleaseHostsResponseUnmarshaller.Instance;

            return InvokeAsync<ReleaseHostsRequest,ReleaseHostsResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }