public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            CreateLoadBalancerResponse response = new CreateLoadBalancerResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("CreateLoadBalancerResult", 2))
                    {
                        UnmarshallResult(context, response);
                        continue;
                    }

                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.Instance.Unmarshall(context);
                    }
                }
            }

            return(response);
        }
        private static void UnmarshallResult(XmlUnmarshallerContext context, CreateLoadBalancerResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            if (context.IsStartOfDocument)
            {
                targetDepth += 2;
            }

            while (context.ReadAtDepth(originalDepth))
            {
                if (context.IsStartElement || context.IsAttribute)
                {
                    if (context.TestExpression("DNSName", targetDepth))
                    {
                        var unmarshaller = StringUnmarshaller.Instance;
                        response.DNSName = unmarshaller.Unmarshall(context);
                        continue;
                    }
                }
            }

            return;
        }
Пример #3
0
        /// <summary>
        /// <para> Creates a new LoadBalancer. </para> <para> Once the call has completed successfully, a new LoadBalancer is created; however, it will
        /// not be usable until at least one instance has been registered. When the LoadBalancer creation is completed, the client can check whether or
        /// not it is usable by using the DescribeInstanceHealth API. The LoadBalancer is usable as soon as any registered instance is <i>InService</i>
        /// .
        /// </para> <para><b>NOTE:</b> Currently, the client's quota of LoadBalancers is limited to five per Region. </para> <para><b>NOTE:</b>
        /// Load balancer DNS names vary depending on the Region they're created in. For load balancers created in the United States, the DNS name ends
        /// with: us-east-1.elb.amazonaws.com (for the US Standard Region) us-west-1.elb.amazonaws.com (for the Northern California Region) For load
        /// balancers created in the EU (Ireland) Region, the DNS name ends with: eu-west-1.elb.amazonaws.com </para>
        /// </summary>
        ///
        /// <param name="createLoadBalancerRequest">Container for the necessary parameters to execute the CreateLoadBalancer service method on
        ///           AmazonElasticLoadBalancing.</param>
        ///
        /// <returns>The response from the CreateLoadBalancer service method, as returned by AmazonElasticLoadBalancing.</returns>
        ///
        /// <exception cref="TooManyLoadBalancersException"/>
        /// <exception cref="InvalidConfigurationRequestException"/>
        /// <exception cref="CertificateNotFoundException"/>
        /// <exception cref="DuplicateLoadBalancerNameException"/>
        public CreateLoadBalancerResponse CreateLoadBalancer(CreateLoadBalancerRequest createLoadBalancerRequest)
        {
            IRequest <CreateLoadBalancerRequest> request  = new CreateLoadBalancerRequestMarshaller().Marshall(createLoadBalancerRequest);
            CreateLoadBalancerResponse           response = Invoke <CreateLoadBalancerRequest, CreateLoadBalancerResponse> (request, this.signer, CreateLoadBalancerResponseUnmarshaller.GetInstance());

            return(response);
        }
        public static CreateLoadBalancerResponse Unmarshall(UnmarshallerContext context)
        {
            CreateLoadBalancerResponse createLoadBalancerResponse = new CreateLoadBalancerResponse();

            createLoadBalancerResponse.HttpResponse     = context.HttpResponse;
            createLoadBalancerResponse.RequestId        = context.StringValue("CreateLoadBalancer.RequestId");
            createLoadBalancerResponse.LoadBalancerId   = context.StringValue("CreateLoadBalancer.LoadBalancerId");
            createLoadBalancerResponse.Address          = context.StringValue("CreateLoadBalancer.Address");
            createLoadBalancerResponse.LoadBalancerName = context.StringValue("CreateLoadBalancer.LoadBalancerName");
            createLoadBalancerResponse.VpcId            = context.StringValue("CreateLoadBalancer.VpcId");
            createLoadBalancerResponse.VSwitchId        = context.StringValue("CreateLoadBalancer.VSwitchId");
            createLoadBalancerResponse.NetworkType      = context.StringValue("CreateLoadBalancer.NetworkType");

            return(createLoadBalancerResponse);
        }
        public static CreateLoadBalancerResponse Unmarshall(UnmarshallerContext _ctx)
        {
            CreateLoadBalancerResponse createLoadBalancerResponse = new CreateLoadBalancerResponse();

            createLoadBalancerResponse.HttpResponse     = _ctx.HttpResponse;
            createLoadBalancerResponse.RequestId        = _ctx.StringValue("CreateLoadBalancer.RequestId");
            createLoadBalancerResponse.LoadBalancerId   = _ctx.StringValue("CreateLoadBalancer.LoadBalancerId");
            createLoadBalancerResponse.ResourceGroupId  = _ctx.StringValue("CreateLoadBalancer.ResourceGroupId");
            createLoadBalancerResponse.Address          = _ctx.StringValue("CreateLoadBalancer.Address");
            createLoadBalancerResponse.LoadBalancerName = _ctx.StringValue("CreateLoadBalancer.LoadBalancerName");
            createLoadBalancerResponse.VpcId            = _ctx.StringValue("CreateLoadBalancer.VpcId");
            createLoadBalancerResponse.VSwitchId        = _ctx.StringValue("CreateLoadBalancer.VSwitchId");
            createLoadBalancerResponse.NetworkType      = _ctx.StringValue("CreateLoadBalancer.NetworkType");
            createLoadBalancerResponse.OrderId          = _ctx.LongValue("CreateLoadBalancer.OrderId");
            createLoadBalancerResponse.AddressIPVersion = _ctx.StringValue("CreateLoadBalancer.AddressIPVersion");

            return(createLoadBalancerResponse);
        }
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            CreateLoadBalancerResponse response = new CreateLoadBalancerResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("operations", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller <Operation, OperationUnmarshaller>(OperationUnmarshaller.Instance);
                    response.Operations = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Пример #7
0
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            CreateLoadBalancerResponse response = new CreateLoadBalancerResponse();

            while (context.Read())
            {
                if (context.IsStartElement)
                {
                    if (context.TestExpression("CreateLoadBalancerResult", 2))
                    {
                        response.CreateLoadBalancerResult = CreateLoadBalancerResultUnmarshaller.GetInstance().Unmarshall(context);
                        continue;
                    }
                    if (context.TestExpression("ResponseMetadata", 2))
                    {
                        response.ResponseMetadata = ResponseMetadataUnmarshaller.GetInstance().Unmarshall(context);
                    }
                }
            }


            return(response);
        }