コード例 #1
0
        /**
         * Convert CreateAutoScalingGroupRequest to name value pairs
         */
        private static IDictionary <string, string> ConvertCreateAutoScalingGroup(CreateAutoScalingGroupRequest request)
        {
            IDictionary <string, string> parameters = new Dictionary <string, string>();

            parameters["Action"] = "CreateAutoScalingGroup";
            if (request.IsSetAutoScalingGroupName())
            {
                parameters["AutoScalingGroupName"] = request.AutoScalingGroupName;
            }
            if (request.IsSetLaunchConfigurationName())
            {
                parameters["LaunchConfigurationName"] = request.LaunchConfigurationName;
            }
            if (request.IsSetMinSize())
            {
                parameters["MinSize"] = request.MinSize.ToString();
            }
            if (request.IsSetMaxSize())
            {
                parameters["MaxSize"] = request.MaxSize.ToString();
            }
            if (request.IsSetCooldown())
            {
                parameters["Cooldown"] = request.Cooldown.ToString();
            }
            List <string> createAutoScalingGroupRequestAvailabilityZonesList      = request.AvailabilityZones;
            int           createAutoScalingGroupRequestAvailabilityZonesListIndex = 1;

            foreach (string createAutoScalingGroupRequestAvailabilityZones in createAutoScalingGroupRequestAvailabilityZonesList)
            {
                parameters[String.Concat("AvailabilityZones", ".member.", createAutoScalingGroupRequestAvailabilityZonesListIndex)] = createAutoScalingGroupRequestAvailabilityZones;
                createAutoScalingGroupRequestAvailabilityZonesListIndex++;
            }
            List <string> createAutoScalingGroupRequestLoadBalancerNamesList      = request.LoadBalancerNames;
            int           createAutoScalingGroupRequestLoadBalancerNamesListIndex = 1;

            foreach (string createAutoScalingGroupRequestLoadBalancerNames in createAutoScalingGroupRequestLoadBalancerNamesList)
            {
                parameters[String.Concat("LoadBalancerNames", ".member.", createAutoScalingGroupRequestLoadBalancerNamesListIndex)] = createAutoScalingGroupRequestLoadBalancerNames;
                createAutoScalingGroupRequestLoadBalancerNamesListIndex++;
            }

            return(parameters);
        }
コード例 #2
0
        private static IDictionary <string, string> ConvertCreateAutoScalingGroup(CreateAutoScalingGroupRequest request)
        {
            IDictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary["Action"] = "CreateAutoScalingGroup";
            if (request.IsSetAutoScalingGroupName())
            {
                dictionary["AutoScalingGroupName"] = request.AutoScalingGroupName;
            }
            if (request.IsSetLaunchConfigurationName())
            {
                dictionary["LaunchConfigurationName"] = request.LaunchConfigurationName;
            }
            if (request.IsSetMinSize())
            {
                dictionary["MinSize"] = request.MinSize.ToString();
            }
            if (request.IsSetMaxSize())
            {
                dictionary["MaxSize"] = request.MaxSize.ToString();
            }
            if (request.IsSetCooldown())
            {
                dictionary["Cooldown"] = request.Cooldown.ToString();
            }
            List <string> availabilityZones = request.AvailabilityZones;
            int           num = 1;

            foreach (string str in availabilityZones)
            {
                dictionary["AvailabilityZones" + ".member." + num] = str;
                num++;
            }
            List <string> loadBalancerNames = request.LoadBalancerNames;
            int           num2 = 1;

            foreach (string str2 in loadBalancerNames)
            {
                dictionary["LoadBalancerNames" + ".member." + num2] = str2;
                num2++;
            }
            return(dictionary);
        }