Exemplo n.º 1
0
        public static DescribeClusterResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeClusterResponse describeClusterResponse = new DescribeClusterResponse();

            describeClusterResponse.HttpResponse = context.HttpResponse;
            describeClusterResponse.RequestId    = context.StringValue("DescribeCluster.RequestId");

            DescribeClusterResponse.DescribeCluster_Cluster cluster = new DescribeClusterResponse.DescribeCluster_Cluster();
            cluster.ClusterId               = context.StringValue("DescribeCluster.Cluster.ClusterId");
            cluster.ClusterName             = context.StringValue("DescribeCluster.Cluster.ClusterName");
            cluster.Status                  = context.StringValue("DescribeCluster.Cluster.Status");
            cluster.PayType                 = context.StringValue("DescribeCluster.Cluster.PayType");
            cluster.CreatedTime             = context.StringValue("DescribeCluster.Cluster.CreatedTime");
            cluster.ExpireTime              = context.StringValue("DescribeCluster.Cluster.ExpireTime");
            cluster.MajorVersion            = context.StringValue("DescribeCluster.Cluster.MajorVersion");
            cluster.MinorVersion            = context.StringValue("DescribeCluster.Cluster.MinorVersion");
            cluster.DataCenterCount         = context.IntegerValue("DescribeCluster.Cluster.DataCenterCount");
            cluster.IsLatestVersion         = context.BooleanValue("DescribeCluster.Cluster.IsLatestVersion");
            cluster.MaintainStartTime       = context.StringValue("DescribeCluster.Cluster.MaintainStartTime");
            cluster.MaintainEndTime         = context.StringValue("DescribeCluster.Cluster.MaintainEndTime");
            cluster.LockMode                = context.StringValue("DescribeCluster.Cluster.LockMode");
            describeClusterResponse.Cluster = cluster;

            return(describeClusterResponse);
        }
Exemplo n.º 2
0
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeClusterResponse response = new DescribeClusterResponse();

            context.Read();

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

            context.Read();
            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("clusterInfo", targetDepth))
                {
                    var unmarshaller = ClusterInfoUnmarshaller.Instance;
                    response.ClusterInfo = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return response;
        }
Exemplo n.º 4
0
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            DescribeClusterResponse response = new DescribeClusterResponse();

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

            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Cluster", targetDepth))
                {
                    response.Cluster = ClusterUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }
            }

            return(response);
        }
Exemplo n.º 5
0
        public static DescribeClusterResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeClusterResponse describeClusterResponse = new DescribeClusterResponse();

            describeClusterResponse.HttpResponse = context.HttpResponse;
            describeClusterResponse.RequestId    = context.StringValue("DescribeCluster.RequestId");

            DescribeClusterResponse.DescribeCluster_Cluster cluster = new DescribeClusterResponse.DescribeCluster_Cluster();
            cluster.ClusterId         = context.StringValue("DescribeCluster.Cluster.ClusterId");
            cluster.ClusterName       = context.StringValue("DescribeCluster.Cluster.ClusterName");
            cluster.Status            = context.StringValue("DescribeCluster.Cluster.Status");
            cluster.PayType           = context.StringValue("DescribeCluster.Cluster.PayType");
            cluster.CreatedTime       = context.StringValue("DescribeCluster.Cluster.CreatedTime");
            cluster.ExpireTime        = context.StringValue("DescribeCluster.Cluster.ExpireTime");
            cluster.MajorVersion      = context.StringValue("DescribeCluster.Cluster.MajorVersion");
            cluster.MinorVersion      = context.StringValue("DescribeCluster.Cluster.MinorVersion");
            cluster.DataCenterCount   = context.IntegerValue("DescribeCluster.Cluster.DataCenterCount");
            cluster.IsLatestVersion   = context.BooleanValue("DescribeCluster.Cluster.IsLatestVersion");
            cluster.MaintainStartTime = context.StringValue("DescribeCluster.Cluster.MaintainStartTime");
            cluster.MaintainEndTime   = context.StringValue("DescribeCluster.Cluster.MaintainEndTime");
            cluster.LockMode          = context.StringValue("DescribeCluster.Cluster.LockMode");
            cluster.AutoRenewal       = context.BooleanValue("DescribeCluster.Cluster.AutoRenewal");
            cluster.AutoRenewPeriod   = context.IntegerValue("DescribeCluster.Cluster.AutoRenewPeriod");

            List <DescribeClusterResponse.DescribeCluster_Cluster.DescribeCluster_Tag> cluster_tags = new List <DescribeClusterResponse.DescribeCluster_Cluster.DescribeCluster_Tag>();

            for (int i = 0; i < context.Length("DescribeCluster.Cluster.Tags.Length"); i++)
            {
                DescribeClusterResponse.DescribeCluster_Cluster.DescribeCluster_Tag tag = new DescribeClusterResponse.DescribeCluster_Cluster.DescribeCluster_Tag();
                tag.Key    = context.StringValue("DescribeCluster.Cluster.Tags[" + i + "].Key");
                tag._Value = context.StringValue("DescribeCluster.Cluster.Tags[" + i + "].Value");

                cluster_tags.Add(tag);
            }
            cluster.Tags = cluster_tags;
            describeClusterResponse.Cluster = cluster;

            return(describeClusterResponse);
        }
Exemplo n.º 6
0
        private static void UnmarshallResult(JsonUnmarshallerContext context, DescribeClusterResponse response)
        {
            int originalDepth = context.CurrentDepth;
            int targetDepth   = originalDepth + 1;

            while (context.Read())
            {
                if (context.TestExpression("Cluster", targetDepth))
                {
                    context.Read();
                    response.Cluster = ClusterUnmarshaller.GetInstance().Unmarshall(context);
                    continue;
                }

                if (context.CurrentDepth <= originalDepth)
                {
                    return;
                }
            }

            return;
        }
        public static DescribeClusterResponse Unmarshall(UnmarshallerContext context)
        {
            DescribeClusterResponse describeClusterResponse = new DescribeClusterResponse();

            describeClusterResponse.HttpResponse = context.HttpResponse;
            describeClusterResponse.RequestId    = context.StringValue("DescribeCluster.RequestId");

            DescribeClusterResponse.DescribeCluster_ClusterInfo clusterInfo = new DescribeClusterResponse.DescribeCluster_ClusterInfo();
            clusterInfo.Id               = context.StringValue("DescribeCluster.ClusterInfo.Id");
            clusterInfo.RegionId         = context.StringValue("DescribeCluster.ClusterInfo.RegionId");
            clusterInfo.Name             = context.StringValue("DescribeCluster.ClusterInfo.Name");
            clusterInfo.Description      = context.StringValue("DescribeCluster.ClusterInfo.Description");
            clusterInfo.Status           = context.StringValue("DescribeCluster.ClusterInfo.Status");
            clusterInfo.OsTag            = context.StringValue("DescribeCluster.ClusterInfo.OsTag");
            clusterInfo.AccountType      = context.StringValue("DescribeCluster.ClusterInfo.AccountType");
            clusterInfo.SchedulerType    = context.StringValue("DescribeCluster.ClusterInfo.SchedulerType");
            clusterInfo.CreateTime       = context.StringValue("DescribeCluster.ClusterInfo.CreateTime");
            clusterInfo.SecurityGroupId  = context.StringValue("DescribeCluster.ClusterInfo.SecurityGroupId");
            clusterInfo.VpcId            = context.StringValue("DescribeCluster.ClusterInfo.VpcId");
            clusterInfo.VSwitchId        = context.StringValue("DescribeCluster.ClusterInfo.VSwitchId");
            clusterInfo.VolumeType       = context.StringValue("DescribeCluster.ClusterInfo.VolumeType");
            clusterInfo.VolumeId         = context.StringValue("DescribeCluster.ClusterInfo.VolumeId");
            clusterInfo.VolumeProtocol   = context.StringValue("DescribeCluster.ClusterInfo.VolumeProtocol");
            clusterInfo.VolumeMountpoint = context.StringValue("DescribeCluster.ClusterInfo.VolumeMountpoint");
            clusterInfo.RemoteDirectory  = context.StringValue("DescribeCluster.ClusterInfo.RemoteDirectory");
            clusterInfo.DeployMode       = context.StringValue("DescribeCluster.ClusterInfo.DeployMode");
            clusterInfo.HaEnable         = context.BooleanValue("DescribeCluster.ClusterInfo.HaEnable");
            clusterInfo.EcsChargeType    = context.StringValue("DescribeCluster.ClusterInfo.EcsChargeType");
            clusterInfo.KeyPairName      = context.StringValue("DescribeCluster.ClusterInfo.KeyPairName");
            clusterInfo.SccClusterId     = context.StringValue("DescribeCluster.ClusterInfo.SccClusterId");
            clusterInfo.ClientVersion    = context.StringValue("DescribeCluster.ClusterInfo.ClientVersion");
            clusterInfo.ImageOwnerAlias  = context.StringValue("DescribeCluster.ClusterInfo.ImageOwnerAlias");
            clusterInfo.ImageId          = context.StringValue("DescribeCluster.ClusterInfo.ImageId");
            clusterInfo.Location         = context.StringValue("DescribeCluster.ClusterInfo.Location");

            DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_EcsInfo ecsInfo = new DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_EcsInfo();

            DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_EcsInfo.DescribeCluster_Manager manager = new DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_EcsInfo.DescribeCluster_Manager();
            manager.Count        = context.IntegerValue("DescribeCluster.ClusterInfo.EcsInfo.Manager.Count");
            manager.InstanceType = context.StringValue("DescribeCluster.ClusterInfo.EcsInfo.Manager.InstanceType");
            ecsInfo.Manager      = manager;

            DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_EcsInfo.DescribeCluster_Compute compute = new DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_EcsInfo.DescribeCluster_Compute();
            compute.Count        = context.IntegerValue("DescribeCluster.ClusterInfo.EcsInfo.Compute.Count");
            compute.InstanceType = context.StringValue("DescribeCluster.ClusterInfo.EcsInfo.Compute.InstanceType");
            ecsInfo.Compute      = compute;

            DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_EcsInfo.DescribeCluster_Login login = new DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_EcsInfo.DescribeCluster_Login();
            login.Count         = context.IntegerValue("DescribeCluster.ClusterInfo.EcsInfo.Login.Count");
            login.InstanceType  = context.StringValue("DescribeCluster.ClusterInfo.EcsInfo.Login.InstanceType");
            ecsInfo.Login       = login;
            clusterInfo.EcsInfo = ecsInfo;

            List <DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_ApplicationInfo> clusterInfo_applications = new List <DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_ApplicationInfo>();

            for (int i = 0; i < context.Length("DescribeCluster.ClusterInfo.Applications.Length"); i++)
            {
                DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_ApplicationInfo applicationInfo = new DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_ApplicationInfo();
                applicationInfo.Tag     = context.StringValue("DescribeCluster.ClusterInfo.Applications[" + i + "].Tag");
                applicationInfo.Name    = context.StringValue("DescribeCluster.ClusterInfo.Applications[" + i + "].Name");
                applicationInfo.Version = context.StringValue("DescribeCluster.ClusterInfo.Applications[" + i + "].Version");

                clusterInfo_applications.Add(applicationInfo);
            }
            clusterInfo.Applications = clusterInfo_applications;

            List <DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_PostInstallScriptInfo> clusterInfo_postInstallScripts = new List <DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_PostInstallScriptInfo>();

            for (int i = 0; i < context.Length("DescribeCluster.ClusterInfo.PostInstallScripts.Length"); i++)
            {
                DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_PostInstallScriptInfo postInstallScriptInfo = new DescribeClusterResponse.DescribeCluster_ClusterInfo.DescribeCluster_PostInstallScriptInfo();
                postInstallScriptInfo.Url  = context.StringValue("DescribeCluster.ClusterInfo.PostInstallScripts[" + i + "].Url");
                postInstallScriptInfo.Args = context.StringValue("DescribeCluster.ClusterInfo.PostInstallScripts[" + i + "].Args");

                clusterInfo_postInstallScripts.Add(postInstallScriptInfo);
            }
            clusterInfo.PostInstallScripts      = clusterInfo_postInstallScripts;
            describeClusterResponse.ClusterInfo = clusterInfo;

            return(describeClusterResponse);
        }