示例#1
0
        public static ListInstanceResponse Unmarshall(UnmarshallerContext context)
        {
            ListInstanceResponse listInstanceResponse = new ListInstanceResponse();

            listInstanceResponse.HttpResponse = context.HttpResponse;
            listInstanceResponse.RequestId    = context.StringValue("ListInstance.RequestId");

            ListInstanceResponse.ListInstance_Headers headers = new ListInstanceResponse.ListInstance_Headers();
            headers.XTotalCount          = context.IntegerValue("ListInstance.Headers.XTotalCount");
            listInstanceResponse.Headers = headers;

            List <ListInstanceResponse.ListInstance_Instance> listInstanceResponse_result = new List <ListInstanceResponse.ListInstance_Instance>();

            for (int i = 0; i < context.Length("ListInstance.Result.Length"); i++)
            {
                ListInstanceResponse.ListInstance_Instance instance = new ListInstanceResponse.ListInstance_Instance();
                instance.InstanceId             = context.StringValue("ListInstance.Result[" + i + "].InstanceId");
                instance.Description            = context.StringValue("ListInstance.Result[" + i + "].Description");
                instance.NodeAmount             = context.IntegerValue("ListInstance.Result[" + i + "].NodeAmount");
                instance.PaymentType            = context.StringValue("ListInstance.Result[" + i + "].PaymentType");
                instance.Status                 = context.StringValue("ListInstance.Result[" + i + "].Status");
                instance.EsVersion              = context.StringValue("ListInstance.Result[" + i + "].EsVersion");
                instance.CreatedAt              = context.StringValue("ListInstance.Result[" + i + "].CreatedAt");
                instance.UpdatedAt              = context.StringValue("ListInstance.Result[" + i + "].UpdatedAt");
                instance.AdvancedDedicateMaster = context.BooleanValue("ListInstance.Result[" + i + "].AdvancedDedicateMaster");
                instance.DedicateMaster         = context.BooleanValue("ListInstance.Result[" + i + "].DedicateMaster");

                ListInstanceResponse.ListInstance_Instance.ListInstance_NodeSpec nodeSpec = new ListInstanceResponse.ListInstance_Instance.ListInstance_NodeSpec();
                nodeSpec.Spec     = context.StringValue("ListInstance.Result[" + i + "].NodeSpec.Spec");
                nodeSpec.Disk     = context.IntegerValue("ListInstance.Result[" + i + "].NodeSpec.Disk");
                nodeSpec.DiskType = context.StringValue("ListInstance.Result[" + i + "].NodeSpec.DiskType");
                instance.NodeSpec = nodeSpec;

                ListInstanceResponse.ListInstance_Instance.ListInstance_NetworkConfig networkConfig = new ListInstanceResponse.ListInstance_Instance.ListInstance_NetworkConfig();
                networkConfig.Type      = context.StringValue("ListInstance.Result[" + i + "].NetworkConfig.Type");
                networkConfig.VpcId     = context.StringValue("ListInstance.Result[" + i + "].NetworkConfig.VpcId");
                networkConfig.VswitchId = context.StringValue("ListInstance.Result[" + i + "].NetworkConfig.VswitchId");
                networkConfig.VsArea    = context.StringValue("ListInstance.Result[" + i + "].NetworkConfig.VsArea");
                instance.NetworkConfig  = networkConfig;

                ListInstanceResponse.ListInstance_Instance.ListInstance_MasterConfiguration masterConfiguration = new ListInstanceResponse.ListInstance_Instance.ListInstance_MasterConfiguration();
                masterConfiguration.Spec     = context.StringValue("ListInstance.Result[" + i + "].MasterConfiguration.Spec");
                masterConfiguration.Amount   = context.IntegerValue("ListInstance.Result[" + i + "].MasterConfiguration.Amount");
                masterConfiguration.DiskType = context.StringValue("ListInstance.Result[" + i + "].MasterConfiguration.DiskType");
                masterConfiguration.Disk     = context.IntegerValue("ListInstance.Result[" + i + "].MasterConfiguration.Disk");
                instance.MasterConfiguration = masterConfiguration;

                ListInstanceResponse.ListInstance_Instance.ListInstance_KibanaConfiguration kibanaConfiguration = new ListInstanceResponse.ListInstance_Instance.ListInstance_KibanaConfiguration();
                kibanaConfiguration.Spec     = context.StringValue("ListInstance.Result[" + i + "].KibanaConfiguration.Spec");
                kibanaConfiguration.Disk     = context.IntegerValue("ListInstance.Result[" + i + "].KibanaConfiguration.Disk");
                kibanaConfiguration.Amount   = context.IntegerValue("ListInstance.Result[" + i + "].KibanaConfiguration.Amount");
                kibanaConfiguration.DiskType = context.StringValue("ListInstance.Result[" + i + "].KibanaConfiguration.DiskType");
                instance.KibanaConfiguration = kibanaConfiguration;

                listInstanceResponse_result.Add(instance);
            }
            listInstanceResponse.Result = listInstanceResponse_result;

            return(listInstanceResponse);
        }
示例#2
0
        public static ListInstanceResponse Unmarshall(UnmarshallerContext context)
        {
            ListInstanceResponse listInstanceResponse = new ListInstanceResponse();

            listInstanceResponse.HttpResponse = context.HttpResponse;
            listInstanceResponse.RequestId    = context.StringValue("ListInstance.RequestId");
            listInstanceResponse.PageIndex    = context.IntegerValue("ListInstance.PageIndex");
            listInstanceResponse.PageSize     = context.IntegerValue("ListInstance.PageSize");
            listInstanceResponse.TotalPage    = context.IntegerValue("ListInstance.TotalPage");
            listInstanceResponse.TotalCount   = context.LongValue("ListInstance.TotalCount");

            List <ListInstanceResponse.ListInstance_Instance> listInstanceResponse_instances = new List <ListInstanceResponse.ListInstance_Instance>();

            for (int i = 0; i < context.Length("ListInstance.Instances.Length"); i++)
            {
                ListInstanceResponse.ListInstance_Instance instance = new ListInstanceResponse.ListInstance_Instance();
                instance.Id               = context.LongValue("ListInstance.Instances[" + i + "].Id");
                instance.ProjectName      = context.StringValue("ListInstance.Instances[" + i + "].ProjectName");
                instance.JobName          = context.StringValue("ListInstance.Instances[" + i + "].JobName");
                instance.ActualState      = context.StringValue("ListInstance.Instances[" + i + "].ActualState");
                instance.ExpectState      = context.StringValue("ListInstance.Instances[" + i + "].ExpectState");
                instance.JobType          = context.StringValue("ListInstance.Instances[" + i + "].JobType");
                instance.ApiType          = context.StringValue("ListInstance.Instances[" + i + "].ApiType");
                instance.Code             = context.StringValue("ListInstance.Instances[" + i + "].Code");
                instance.Properties       = context.StringValue("ListInstance.Instances[" + i + "].Properties");
                instance.Packages         = context.StringValue("ListInstance.Instances[" + i + "].Packages");
                instance.Starter          = context.StringValue("ListInstance.Instances[" + i + "].Starter");
                instance.StartTime        = context.LongValue("ListInstance.Instances[" + i + "].StartTime");
                instance.LastErrorTime    = context.LongValue("ListInstance.Instances[" + i + "].LastErrorTime");
                instance.LastErrorMessage = context.StringValue("ListInstance.Instances[" + i + "].LastErrorMessage");
                instance.LastOperator     = context.StringValue("ListInstance.Instances[" + i + "].LastOperator");
                instance.LastOperateTime  = context.LongValue("ListInstance.Instances[" + i + "].LastOperateTime");
                instance.PlanJson         = context.StringValue("ListInstance.Instances[" + i + "].PlanJson");
                instance.EngineVersion    = context.StringValue("ListInstance.Instances[" + i + "].EngineVersion");
                instance.EngineJobHandler = context.StringValue("ListInstance.Instances[" + i + "].EngineJobHandler");
                instance.InputDelay       = context.LongValue("ListInstance.Instances[" + i + "].InputDelay");
                instance.ClusterId        = context.StringValue("ListInstance.Instances[" + i + "].ClusterId");
                instance.QueueName        = context.StringValue("ListInstance.Instances[" + i + "].QueueName");
                instance.EndTime          = context.LongValue("ListInstance.Instances[" + i + "].EndTime");

                listInstanceResponse_instances.Add(instance);
            }
            listInstanceResponse.Instances = listInstanceResponse_instances;

            return(listInstanceResponse);
        }
        public static ListInstanceResponse Unmarshall(UnmarshallerContext _ctx)
        {
            ListInstanceResponse listInstanceResponse = new ListInstanceResponse();

            listInstanceResponse.HttpResponse = _ctx.HttpResponse;
            listInstanceResponse.RequestId    = _ctx.StringValue("ListInstance.RequestId");

            ListInstanceResponse.ListInstance_Headers headers = new ListInstanceResponse.ListInstance_Headers();
            headers.XTotalCount          = _ctx.IntegerValue("ListInstance.Headers.X-Total-Count");
            listInstanceResponse.Headers = headers;

            List <ListInstanceResponse.ListInstance_Instance> listInstanceResponse_result = new List <ListInstanceResponse.ListInstance_Instance>();

            for (int i = 0; i < _ctx.Length("ListInstance.Result.Length"); i++)
            {
                ListInstanceResponse.ListInstance_Instance instance = new ListInstanceResponse.ListInstance_Instance();
                instance.AdvancedDedicateMaster = _ctx.BooleanValue("ListInstance.Result[" + i + "].advancedDedicateMaster");
                instance.CreatedAt       = _ctx.StringValue("ListInstance.Result[" + i + "].createdAt");
                instance.DedicateMaster  = _ctx.BooleanValue("ListInstance.Result[" + i + "].dedicateMaster");
                instance.Description     = _ctx.StringValue("ListInstance.Result[" + i + "].description");
                instance.EsVersion       = _ctx.StringValue("ListInstance.Result[" + i + "].esVersion");
                instance.InstanceId      = _ctx.StringValue("ListInstance.Result[" + i + "].instanceId");
                instance.NodeAmount      = _ctx.IntegerValue("ListInstance.Result[" + i + "].nodeAmount");
                instance.PaymentType     = _ctx.StringValue("ListInstance.Result[" + i + "].paymentType");
                instance.ResourceGroupId = _ctx.StringValue("ListInstance.Result[" + i + "].resourceGroupId");
                instance.Status          = _ctx.StringValue("ListInstance.Result[" + i + "].status");
                instance.UpdatedAt       = _ctx.StringValue("ListInstance.Result[" + i + "].updatedAt");

                List <Dictionary <string, string> > instance_extendConfigs = new List <Dictionary <string, string> >();
                for (int j = 0; j < _ctx.Length("ListInstance.Result[" + i + "].ExtendConfigs.Length"); j++)
                {
                    Dictionary <string, string> tmp = new Dictionary <string, string>()
                    {
                    };
                    foreach (var _item in _ctx.ResponseDictionary)
                    {
                        string prefix = "ListInstance.Result[" + i + "].ExtendConfigs[" + j + "].";
                        if (_item.Key.IndexOf(prefix) == 0)
                        {
                            tmp.Add(_item.Key.Substring(prefix.Length), _item.Value);
                        }
                    }
                    if (tmp.Count > 0)
                    {
                        instance_extendConfigs.Add(tmp);
                    }
                }
                instance.ExtendConfigs = instance_extendConfigs;

                ListInstanceResponse.ListInstance_Instance.ListInstance_ClientNodeConfiguration clientNodeConfiguration = new ListInstanceResponse.ListInstance_Instance.ListInstance_ClientNodeConfiguration();
                clientNodeConfiguration.Amount   = _ctx.IntegerValue("ListInstance.Result[" + i + "].ClientNodeConfiguration.amount");
                clientNodeConfiguration.Disk     = _ctx.IntegerValue("ListInstance.Result[" + i + "].ClientNodeConfiguration.disk");
                clientNodeConfiguration.DiskType = _ctx.StringValue("ListInstance.Result[" + i + "].ClientNodeConfiguration.diskType");
                clientNodeConfiguration.Spec     = _ctx.StringValue("ListInstance.Result[" + i + "].ClientNodeConfiguration.spec");
                instance.ClientNodeConfiguration = clientNodeConfiguration;

                ListInstanceResponse.ListInstance_Instance.ListInstance_ElasticDataNodeConfiguration elasticDataNodeConfiguration = new ListInstanceResponse.ListInstance_Instance.ListInstance_ElasticDataNodeConfiguration();
                elasticDataNodeConfiguration.Amount         = _ctx.IntegerValue("ListInstance.Result[" + i + "].ElasticDataNodeConfiguration.amount");
                elasticDataNodeConfiguration.Disk           = _ctx.IntegerValue("ListInstance.Result[" + i + "].ElasticDataNodeConfiguration.disk");
                elasticDataNodeConfiguration.DiskEncryption = _ctx.BooleanValue("ListInstance.Result[" + i + "].ElasticDataNodeConfiguration.diskEncryption");
                elasticDataNodeConfiguration.DiskType       = _ctx.StringValue("ListInstance.Result[" + i + "].ElasticDataNodeConfiguration.diskType");
                elasticDataNodeConfiguration.Spec           = _ctx.StringValue("ListInstance.Result[" + i + "].ElasticDataNodeConfiguration.spec");
                instance.ElasticDataNodeConfiguration       = elasticDataNodeConfiguration;

                ListInstanceResponse.ListInstance_Instance.ListInstance_KibanaConfiguration kibanaConfiguration = new ListInstanceResponse.ListInstance_Instance.ListInstance_KibanaConfiguration();
                kibanaConfiguration.Amount   = _ctx.IntegerValue("ListInstance.Result[" + i + "].KibanaConfiguration.amount");
                kibanaConfiguration.Disk     = _ctx.IntegerValue("ListInstance.Result[" + i + "].KibanaConfiguration.disk");
                kibanaConfiguration.DiskType = _ctx.StringValue("ListInstance.Result[" + i + "].KibanaConfiguration.diskType");
                kibanaConfiguration.Spec     = _ctx.StringValue("ListInstance.Result[" + i + "].KibanaConfiguration.spec");
                instance.KibanaConfiguration = kibanaConfiguration;

                ListInstanceResponse.ListInstance_Instance.ListInstance_MasterConfiguration masterConfiguration = new ListInstanceResponse.ListInstance_Instance.ListInstance_MasterConfiguration();
                masterConfiguration.Amount   = _ctx.IntegerValue("ListInstance.Result[" + i + "].MasterConfiguration.amount");
                masterConfiguration.Disk     = _ctx.IntegerValue("ListInstance.Result[" + i + "].MasterConfiguration.disk");
                masterConfiguration.DiskType = _ctx.StringValue("ListInstance.Result[" + i + "].MasterConfiguration.diskType");
                masterConfiguration.Spec     = _ctx.StringValue("ListInstance.Result[" + i + "].MasterConfiguration.spec");
                instance.MasterConfiguration = masterConfiguration;

                ListInstanceResponse.ListInstance_Instance.ListInstance_NetworkConfig networkConfig = new ListInstanceResponse.ListInstance_Instance.ListInstance_NetworkConfig();
                networkConfig.Type      = _ctx.StringValue("ListInstance.Result[" + i + "].NetworkConfig.type");
                networkConfig.VpcId     = _ctx.StringValue("ListInstance.Result[" + i + "].NetworkConfig.vpcId");
                networkConfig.VsArea    = _ctx.StringValue("ListInstance.Result[" + i + "].NetworkConfig.vsArea");
                networkConfig.VswitchId = _ctx.StringValue("ListInstance.Result[" + i + "].NetworkConfig.vswitchId");
                instance.NetworkConfig  = networkConfig;

                ListInstanceResponse.ListInstance_Instance.ListInstance_NodeSpec nodeSpec = new ListInstanceResponse.ListInstance_Instance.ListInstance_NodeSpec();
                nodeSpec.Disk           = _ctx.IntegerValue("ListInstance.Result[" + i + "].NodeSpec.disk");
                nodeSpec.DiskEncryption = _ctx.BooleanValue("ListInstance.Result[" + i + "].NodeSpec.diskEncryption");
                nodeSpec.DiskType       = _ctx.StringValue("ListInstance.Result[" + i + "].NodeSpec.diskType");
                nodeSpec.Spec           = _ctx.StringValue("ListInstance.Result[" + i + "].NodeSpec.spec");
                instance.NodeSpec       = nodeSpec;

                List <ListInstanceResponse.ListInstance_Instance.ListInstance_Tag> instance_tags = new List <ListInstanceResponse.ListInstance_Instance.ListInstance_Tag>();
                for (int j = 0; j < _ctx.Length("ListInstance.Result[" + i + "].Tags.Length"); j++)
                {
                    ListInstanceResponse.ListInstance_Instance.ListInstance_Tag tag = new ListInstanceResponse.ListInstance_Instance.ListInstance_Tag();
                    tag.TagKey   = _ctx.StringValue("ListInstance.Result[" + i + "].Tags[" + j + "].tagKey");
                    tag.TagValue = _ctx.StringValue("ListInstance.Result[" + i + "].Tags[" + j + "].tagValue");

                    instance_tags.Add(tag);
                }
                instance.Tags = instance_tags;

                listInstanceResponse_result.Add(instance);
            }
            listInstanceResponse.Result = listInstanceResponse_result;

            return(listInstanceResponse);
        }
        public static ListInstanceResponse Unmarshall(UnmarshallerContext context)
        {
            ListInstanceResponse listInstanceResponse = new ListInstanceResponse();

            listInstanceResponse.HttpResponse = context.HttpResponse;
            listInstanceResponse.RequestId    = context.StringValue("ListInstance.RequestId");

            ListInstanceResponse.ListInstance_Headers headers = new ListInstanceResponse.ListInstance_Headers();
            headers.XTotalCount          = context.IntegerValue("ListInstance.Headers.X-Total-Count");
            listInstanceResponse.Headers = headers;

            List <ListInstanceResponse.ListInstance_Instance> listInstanceResponse_result = new List <ListInstanceResponse.ListInstance_Instance>();

            for (int i = 0; i < context.Length("ListInstance.Result.Length"); i++)
            {
                ListInstanceResponse.ListInstance_Instance instance = new ListInstanceResponse.ListInstance_Instance();
                instance.InstanceId             = context.StringValue("ListInstance.Result[" + i + "].instanceId");
                instance.Description            = context.StringValue("ListInstance.Result[" + i + "].description");
                instance.NodeAmount             = context.IntegerValue("ListInstance.Result[" + i + "].nodeAmount");
                instance.PaymentType            = context.StringValue("ListInstance.Result[" + i + "].paymentType");
                instance.Status                 = context.StringValue("ListInstance.Result[" + i + "].status");
                instance.EsVersion              = context.StringValue("ListInstance.Result[" + i + "].esVersion");
                instance.CreatedAt              = context.StringValue("ListInstance.Result[" + i + "].createdAt");
                instance.UpdatedAt              = context.StringValue("ListInstance.Result[" + i + "].updatedAt");
                instance.AdvancedDedicateMaster = context.BooleanValue("ListInstance.Result[" + i + "].advancedDedicateMaster");
                instance.DedicateMaster         = context.BooleanValue("ListInstance.Result[" + i + "].dedicateMaster");
                instance.ResourceGroupId        = context.StringValue("ListInstance.Result[" + i + "].resourceGroupId");

                ListInstanceResponse.ListInstance_Instance.ListInstance_NodeSpec nodeSpec = new ListInstanceResponse.ListInstance_Instance.ListInstance_NodeSpec();
                nodeSpec.Spec     = context.StringValue("ListInstance.Result[" + i + "].NodeSpec.spec");
                nodeSpec.Disk     = context.IntegerValue("ListInstance.Result[" + i + "].NodeSpec.disk");
                nodeSpec.DiskType = context.StringValue("ListInstance.Result[" + i + "].NodeSpec.diskType");
                instance.NodeSpec = nodeSpec;

                ListInstanceResponse.ListInstance_Instance.ListInstance_NetworkConfig networkConfig = new ListInstanceResponse.ListInstance_Instance.ListInstance_NetworkConfig();
                networkConfig.Type      = context.StringValue("ListInstance.Result[" + i + "].NetworkConfig.type");
                networkConfig.VpcId     = context.StringValue("ListInstance.Result[" + i + "].NetworkConfig.vpcId");
                networkConfig.VswitchId = context.StringValue("ListInstance.Result[" + i + "].NetworkConfig.vswitchId");
                networkConfig.VsArea    = context.StringValue("ListInstance.Result[" + i + "].NetworkConfig.vsArea");
                instance.NetworkConfig  = networkConfig;

                ListInstanceResponse.ListInstance_Instance.ListInstance_MasterConfiguration masterConfiguration = new ListInstanceResponse.ListInstance_Instance.ListInstance_MasterConfiguration();
                masterConfiguration.Spec     = context.StringValue("ListInstance.Result[" + i + "].MasterConfiguration.spec");
                masterConfiguration.Amount   = context.IntegerValue("ListInstance.Result[" + i + "].MasterConfiguration.amount");
                masterConfiguration.DiskType = context.StringValue("ListInstance.Result[" + i + "].MasterConfiguration.diskType");
                masterConfiguration.Disk     = context.IntegerValue("ListInstance.Result[" + i + "].MasterConfiguration.disk");
                instance.MasterConfiguration = masterConfiguration;

                ListInstanceResponse.ListInstance_Instance.ListInstance_KibanaConfiguration kibanaConfiguration = new ListInstanceResponse.ListInstance_Instance.ListInstance_KibanaConfiguration();
                kibanaConfiguration.Spec     = context.StringValue("ListInstance.Result[" + i + "].KibanaConfiguration.spec");
                kibanaConfiguration.Disk     = context.IntegerValue("ListInstance.Result[" + i + "].KibanaConfiguration.disk");
                kibanaConfiguration.Amount   = context.IntegerValue("ListInstance.Result[" + i + "].KibanaConfiguration.amount");
                kibanaConfiguration.DiskType = context.StringValue("ListInstance.Result[" + i + "].KibanaConfiguration.diskType");
                instance.KibanaConfiguration = kibanaConfiguration;

                List <ListInstanceResponse.ListInstance_Instance.ListInstance_Tag> instance_tags = new List <ListInstanceResponse.ListInstance_Instance.ListInstance_Tag>();
                for (int j = 0; j < context.Length("ListInstance.Result[" + i + "].Tags.Length"); j++)
                {
                    ListInstanceResponse.ListInstance_Instance.ListInstance_Tag tag = new ListInstanceResponse.ListInstance_Instance.ListInstance_Tag();
                    tag.TagKey   = context.StringValue("ListInstance.Result[" + i + "].Tags[" + j + "].tagKey");
                    tag.TagValue = context.StringValue("ListInstance.Result[" + i + "].Tags[" + j + "].tagValue");

                    instance_tags.Add(tag);
                }
                instance.Tags = instance_tags;

                listInstanceResponse_result.Add(instance);
            }
            listInstanceResponse.Result = listInstanceResponse_result;

            return(listInstanceResponse);
        }