public static ListNodesResponse Unmarshall(UnmarshallerContext context) { ListNodesResponse listNodesResponse = new ListNodesResponse(); listNodesResponse.HttpResponse = context.HttpResponse; listNodesResponse.RequestId = context.StringValue("ListNodes.RequestId"); listNodesResponse.TotalCount = context.IntegerValue("ListNodes.TotalCount"); listNodesResponse.PageNumber = context.IntegerValue("ListNodes.PageNumber"); listNodesResponse.PageSize = context.IntegerValue("ListNodes.PageSize"); List <ListNodesResponse.ListNodes_NodeInfo> listNodesResponse_nodes = new List <ListNodesResponse.ListNodes_NodeInfo>(); for (int i = 0; i < context.Length("ListNodes.Nodes.Length"); i++) { ListNodesResponse.ListNodes_NodeInfo nodeInfo = new ListNodesResponse.ListNodes_NodeInfo(); nodeInfo.Id = context.StringValue("ListNodes.Nodes[" + i + "].Id"); nodeInfo.RegionId = context.StringValue("ListNodes.Nodes[" + i + "].RegionId"); nodeInfo.HostName = context.StringValue("ListNodes.Nodes[" + i + "].HostName"); nodeInfo.IpAddress = context.StringValue("ListNodes.Nodes[" + i + "].IpAddress"); nodeInfo.Status = context.StringValue("ListNodes.Nodes[" + i + "].Status"); nodeInfo.Version = context.StringValue("ListNodes.Nodes[" + i + "].Version"); nodeInfo.CreatedByEhpc = context.BooleanValue("ListNodes.Nodes[" + i + "].CreatedByEhpc"); nodeInfo.AddTime = context.StringValue("ListNodes.Nodes[" + i + "].AddTime"); nodeInfo.Expired = context.BooleanValue("ListNodes.Nodes[" + i + "].Expired"); nodeInfo.ExpiredTime = context.StringValue("ListNodes.Nodes[" + i + "].ExpiredTime"); nodeInfo.SpotStrategy = context.StringValue("ListNodes.Nodes[" + i + "].SpotStrategy"); nodeInfo.LockReason = context.StringValue("ListNodes.Nodes[" + i + "].LockReason"); nodeInfo.ImageOwnerAlias = context.StringValue("ListNodes.Nodes[" + i + "].ImageOwnerAlias"); nodeInfo.ImageId = context.StringValue("ListNodes.Nodes[" + i + "].ImageId"); nodeInfo.Location = context.StringValue("ListNodes.Nodes[" + i + "].Location"); nodeInfo.CreateMode = context.StringValue("ListNodes.Nodes[" + i + "].CreateMode"); nodeInfo.VpcId = context.StringValue("ListNodes.Nodes[" + i + "].VpcId"); nodeInfo.ZoneId = context.StringValue("ListNodes.Nodes[" + i + "].ZoneId"); nodeInfo.VSwitchId = context.StringValue("ListNodes.Nodes[" + i + "].VSwitchId"); List <string> nodeInfo_roles = new List <string>(); for (int j = 0; j < context.Length("ListNodes.Nodes[" + i + "].Roles.Length"); j++) { nodeInfo_roles.Add(context.StringValue("ListNodes.Nodes[" + i + "].Roles[" + j + "]")); } nodeInfo.Roles = nodeInfo_roles; ListNodesResponse.ListNodes_NodeInfo.ListNodes_TotalResources totalResources = new ListNodesResponse.ListNodes_NodeInfo.ListNodes_TotalResources(); totalResources.Cpu = context.IntegerValue("ListNodes.Nodes[" + i + "].TotalResources.Cpu"); totalResources.Memory = context.IntegerValue("ListNodes.Nodes[" + i + "].TotalResources.Memory"); totalResources.Gpu = context.IntegerValue("ListNodes.Nodes[" + i + "].TotalResources.Gpu"); nodeInfo.TotalResources = totalResources; ListNodesResponse.ListNodes_NodeInfo.ListNodes_UsedResources usedResources = new ListNodesResponse.ListNodes_NodeInfo.ListNodes_UsedResources(); usedResources.Cpu = context.IntegerValue("ListNodes.Nodes[" + i + "].UsedResources.Cpu"); usedResources.Memory = context.IntegerValue("ListNodes.Nodes[" + i + "].UsedResources.Memory"); usedResources.Gpu = context.IntegerValue("ListNodes.Nodes[" + i + "].UsedResources.Gpu"); nodeInfo.UsedResources = usedResources; listNodesResponse_nodes.Add(nodeInfo); } listNodesResponse.Nodes = listNodesResponse_nodes; return(listNodesResponse); }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListNodesResponse response = new ListNodesResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Nodes", targetDepth)) { var unmarshaller = new ListUnmarshaller <NodeSummary, NodeSummaryUnmarshaller>(NodeSummaryUnmarshaller.Instance); response.Nodes = unmarshaller.Unmarshall(context); continue; } } return(response); }
public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems) { AmazonManagedBlockchainConfig config = new AmazonManagedBlockchainConfig(); config.RegionEndpoint = region; ConfigureClient(config); AmazonManagedBlockchainClient client = new AmazonManagedBlockchainClient(creds, config); ListNodesResponse resp = new ListNodesResponse(); do { ListNodesRequest req = new ListNodesRequest { NextToken = resp.NextToken , MaxResults = maxItems }; resp = client.ListNodes(req); CheckError(resp.HttpStatusCode, "200"); foreach (var obj in resp.Nodes) { AddObject(obj); } }while (!string.IsNullOrEmpty(resp.NextToken)); }
public static ListNodesResponse Unmarshall(UnmarshallerContext context) { ListNodesResponse listNodesResponse = new ListNodesResponse(); listNodesResponse.HttpResponse = context.HttpResponse; listNodesResponse.RequestId = context.StringValue("ListNodes.RequestId"); ListNodesResponse.ListNodes_Headers headers = new ListNodesResponse.ListNodes_Headers(); headers.XTotalCount = context.IntegerValue("ListNodes.Headers.X-Total-Count"); listNodesResponse.Headers = headers; List <ListNodesResponse.ListNodes_ResultItem> listNodesResponse_result = new List <ListNodesResponse.ListNodes_ResultItem>(); for (int i = 0; i < context.Length("ListNodes.Result.Length"); i++) { ListNodesResponse.ListNodes_ResultItem resultItem = new ListNodesResponse.ListNodes_ResultItem(); resultItem.EcsInstanceId = context.StringValue("ListNodes.Result[" + i + "].ecsInstanceId"); resultItem.EcsInstanceName = context.StringValue("ListNodes.Result[" + i + "].ecsInstanceName"); resultItem.Status = context.StringValue("ListNodes.Result[" + i + "].status"); resultItem.OsType = context.StringValue("ListNodes.Result[" + i + "].osType"); resultItem.CloudAssistantStatus = context.StringValue("ListNodes.Result[" + i + "].cloudAssistantStatus"); resultItem.AgentStatus = context.StringValue("ListNodes.Result[" + i + "].agentStatus"); List <ListNodesResponse.ListNodes_ResultItem.ListNodes_TagsItem> resultItem_tags = new List <ListNodesResponse.ListNodes_ResultItem.ListNodes_TagsItem>(); for (int j = 0; j < context.Length("ListNodes.Result[" + i + "].Tags.Length"); j++) { ListNodesResponse.ListNodes_ResultItem.ListNodes_TagsItem tagsItem = new ListNodesResponse.ListNodes_ResultItem.ListNodes_TagsItem(); tagsItem.TagKey = context.StringValue("ListNodes.Result[" + i + "].Tags[" + j + "].tagKey"); tagsItem.TagValue = context.StringValue("ListNodes.Result[" + i + "].Tags[" + j + "].tagValue"); resultItem_tags.Add(tagsItem); } resultItem.Tags = resultItem_tags; List <ListNodesResponse.ListNodes_ResultItem.ListNodes_IpAddressItem> resultItem_ipAddress = new List <ListNodesResponse.ListNodes_ResultItem.ListNodes_IpAddressItem>(); for (int j = 0; j < context.Length("ListNodes.Result[" + i + "].IpAddress.Length"); j++) { ListNodesResponse.ListNodes_ResultItem.ListNodes_IpAddressItem ipAddressItem = new ListNodesResponse.ListNodes_ResultItem.ListNodes_IpAddressItem(); ipAddressItem.Host = context.StringValue("ListNodes.Result[" + i + "].IpAddress[" + j + "].host"); ipAddressItem.IpType = context.StringValue("ListNodes.Result[" + i + "].IpAddress[" + j + "].ipType"); resultItem_ipAddress.Add(ipAddressItem); } resultItem.IpAddress = resultItem_ipAddress; listNodesResponse_result.Add(resultItem); } listNodesResponse.Result = listNodesResponse_result; return(listNodesResponse); }
public static ListNodesResponse Unmarshall(UnmarshallerContext _ctx) { ListNodesResponse listNodesResponse = new ListNodesResponse(); listNodesResponse.HttpResponse = _ctx.HttpResponse; listNodesResponse.Success = _ctx.BooleanValue("ListNodes.Success"); listNodesResponse.HttpStatusCode = _ctx.IntegerValue("ListNodes.HttpStatusCode"); listNodesResponse.ErrorCode = _ctx.StringValue("ListNodes.ErrorCode"); listNodesResponse.ErrorMessage = _ctx.StringValue("ListNodes.ErrorMessage"); listNodesResponse.RequestId = _ctx.StringValue("ListNodes.RequestId"); ListNodesResponse.ListNodes_Data data = new ListNodesResponse.ListNodes_Data(); data.PageNumber = _ctx.IntegerValue("ListNodes.Data.PageNumber"); data.PageSize = _ctx.IntegerValue("ListNodes.Data.PageSize"); data.TotalCount = _ctx.IntegerValue("ListNodes.Data.TotalCount"); List <ListNodesResponse.ListNodes_Data.ListNodes_NodesItem> data_nodes = new List <ListNodesResponse.ListNodes_Data.ListNodes_NodesItem>(); for (int i = 0; i < _ctx.Length("ListNodes.Data.Nodes.Length"); i++) { ListNodesResponse.ListNodes_Data.ListNodes_NodesItem nodesItem = new ListNodesResponse.ListNodes_Data.ListNodes_NodesItem(); nodesItem.NodeId = _ctx.LongValue("ListNodes.Data.Nodes[" + i + "].NodeId"); nodesItem.NodeName = _ctx.StringValue("ListNodes.Data.Nodes[" + i + "].NodeName"); nodesItem.CronExpress = _ctx.StringValue("ListNodes.Data.Nodes[" + i + "].CronExpress"); nodesItem.SchedulerType = _ctx.StringValue("ListNodes.Data.Nodes[" + i + "].SchedulerType"); nodesItem.ProgramType = _ctx.StringValue("ListNodes.Data.Nodes[" + i + "].ProgramType"); nodesItem.OwnerId = _ctx.StringValue("ListNodes.Data.Nodes[" + i + "].OwnerId"); nodesItem.ProjectId = _ctx.LongValue("ListNodes.Data.Nodes[" + i + "].ProjectId"); nodesItem.Repeatability = _ctx.BooleanValue("ListNodes.Data.Nodes[" + i + "].Repeatability"); nodesItem.ParamValues = _ctx.StringValue("ListNodes.Data.Nodes[" + i + "].ParamValues"); nodesItem.Description = _ctx.StringValue("ListNodes.Data.Nodes[" + i + "].Description"); nodesItem.ResGroupName = _ctx.StringValue("ListNodes.Data.Nodes[" + i + "].ResGroupName"); nodesItem.Priority = _ctx.IntegerValue("ListNodes.Data.Nodes[" + i + "].Priority"); nodesItem.BaselineId = _ctx.LongValue("ListNodes.Data.Nodes[" + i + "].BaselineId"); nodesItem.RepeatInterval = _ctx.LongValue("ListNodes.Data.Nodes[" + i + "].RepeatInterval"); nodesItem.Connection = _ctx.StringValue("ListNodes.Data.Nodes[" + i + "].Connection"); nodesItem.DqcType = _ctx.IntegerValue("ListNodes.Data.Nodes[" + i + "].DqcType"); nodesItem.DqcDescription = _ctx.StringValue("ListNodes.Data.Nodes[" + i + "].DqcDescription"); nodesItem.RelatedFlowId = _ctx.LongValue("ListNodes.Data.Nodes[" + i + "].RelatedFlowId"); data_nodes.Add(nodesItem); } data.Nodes = data_nodes; listNodesResponse.Data = data; return(listNodesResponse); }