{
"appList":[
{
"id" : 120,
"name" : "BIGDATA",
"alias" : "大数据",
"appInsList" : [
{
"id" : 590,
"host_name" : "10.131.34.17-uds1",
"alias" : null,
"server_port" : 111111
}, {
"id" : 592,
"host_name" : "10.131.34.17-uds1",
"alias" : null,
"server_port" : 111111
}, {
"id" : 594,
"host_name" : "10.131.34.17-uds1",
"alias" : null,
"server_port" : 111111
}, {
"id" : 610,
"host_name" : "10.131.30.239-sh-dsjfjh-app1",
"alias" : null,
"server_port" : 0
}, {
"id" : 618,
"host_name" : "10.131.30.239-sh-dsjfjh-app1",
"alias" : null,
"server_port" : 111111
}, {
"id" : 620,
"host_name" : "10.131.34.17-uds1",
"alias" : null,
"server_port" : 111111
}, {
"id" : 626,
"host_name" : "10.131.34.17-uds1",
"alias" : null,
"server_port" : 111111
}, {
"id" : 634,
"host_name" : "10.131.34.18-uds2",
"alias" : null,
"server_port" : 111111
}, {
"id" : 636,
"host_name" : "10.131.34.18-uds2",
"alias" : null,
"server_port" : 111111
}, {
"id" : 638,
"host_name" : "10.131.34.18-uds2",
"alias" : null,
"server_port" : 11111
}, {
"id" : 640,
"host_name" : "10.131.34.17-uds1",
"alias" : null,
"server_port" : 11111
}, {
"id" : 726,
"host_name" : "10.131.34.12-bigdata12.bigdata.com",
"alias" : null,
"server_port" : 0
}, {
"id" : 728,
"host_name" : "10.131.34.12-bigdata12.bigdata.com",
"alias" : null,
"server_port" : 11111
}, {
"id" : 730,
"host_name" : "10.131.34.13-bigdata13.bigdata.com",
"alias" : null,
"server_port" : 0
}, {
"id" : 732,
"host_name" : "10.131.34.13-bigdata13.bigdata.com",
"alias" : null,
"server_port" : 111111
}, {
"id" : 734,
"host_name" : "10.131.34.13-bigdata13.bigdata.com",
"alias" : null,
"server_port" : 111111
}, {
"id" : 736,
"host_name" : "10.131.34.12-bigdata12.bigdata.com",
"alias" : null,
"server_port" : 111111
} ]
}, {
"id" : 124,
"name" : "SHUJUFUWU",
"alias" : "数据管理",
"appInsList" : [ {
"id" : 612,
"host_name" : "10.131.25.110-SH-sjgl-app1",
"alias" : null,
"server_port" : 111111
}, {
"id" : 614,
"host_name" : "10.131.25.118-SH-sjgl-app2",
"alias" : null,
"server_port" : 0
}, {
"id" : 616,
"host_name" : "10.131.25.118-SH-sjgl-app2",
"alias" : null,
"server_port" : 11111
} ]
}, {
"id" : 126,
"name" : "YDHL",
"alias" : "移动互联",
"appInsList" : [ {
"id" : 622,
"host_name" : "10.131.30.203-ydhlyy-app03",
"alias" : null,
"server_port" : 111111
}, {
"id" : 628,
"host_name" : "10.131.30.204-ydhlyy-app04",
"alias" : null,
"server_port" : 111111
}, {
"id" : 630,
"host_name" : "10.131.30.202-ydhlyy-app02",
"alias" : null,
"server_port" : 111111
}, {
"id" : 632,
"host_name" : "10.131.30.201-ydhlyy-app01",
"alias" : null,
"server_port" : 111111
}, {
"id" : 716,
"host_name" : "10.131.30.201-ydhlyy-app01",
"alias" : null,
"server_port" : 11111
}, {
"id" : 718,
"host_name" : "10.131.30.201-ydhlyy-app01",
"alias" : null,
"server_port" : 11111
}, {
"id" : 720,
"host_name" : "10.131.30.202-ydhlyy-app02",
"alias" : null,
"server_port" : 11111
}, {
"id" : 722,
"host_name" : "10.131.30.202-ydhlyy-app02",
"alias" : null,
"server_port" : 11111
} ]
}, {
"id" : 128,
"name" : "ythjf2.0",
"alias" : "营销缴费",
"appInsList" : [ {
"id" : 648,
"host_name" : "10.131.38.6-SH-ythjf-app4",
"alias" : null,
"server_port" : 111111
}, {
"id" : 650,
"host_name" : "10.131.38.6-SH-ythjf-app4",
"alias" : null,
"server_port" : 0
}, {
"id" : 652,
"host_name" : "10.131.38.6-SH-ythjf-app4",
"alias" : null,
"server_port" : 111111
}, {
"id" : 654,
"host_name" : "10.131.38.5-SH-ythjf-app3",
"alias" : null,
"server_port" : 11111
}, {
"id" : 656,
"host_name" : "10.131.38.5-SH-ythjf-app3",
"alias" : null,
"server_port" : 0
}, {
"id" : 658,
"host_name" : "10.131.38.6-SH-ythjf-app4",
"alias" : null,
"server_port" : 111111
}, {
"id" : 660,
"host_name" : "10.131.38.5-SH-ythjf-app3",
"alias" : null,
"server_port" : 11111
}, {
"id" : 662,
"host_name" : "10.131.38.5-SH-ythjf-app3",
"alias" : null,
"server_port" : 111111
}, {
"id" : 790,
"host_name" : "10.131.38.6-SH-ythjf-app4",
"alias" : null,
"server_port" : 111111
}, {
"id" : 792,
"host_name" : "10.131.38.5-SH-ythjf-app3",
"alias" : null,
"server_port" : 111111
} ]
}, {
"id" : 130,
"name" : "xmhxt",
"alias" : "新企业门户",
"appInsList" : [ {
"id" : 664,
"host_name" : "10.131.34.187-SH-nwqybgmh-app2",
"alias" : null,
"server_port" : 111111
}, {
"id" : 666,
"host_name" : "10.131.34.187-SH-nwqybgmh-app2",
"alias" : null,
"server_port" : 111111
}, {
"id" : 676,
"host_name" : "10.131.34.189-SH-nwqybgmh-app4",
"alias" : null,
"server_port" : 111111
}, {
"id" : 678,
"host_name" : "10.131.34.189-SH-nwqybgmh-app4",
"alias" : null,
"server_port" : 11111111
}, {
"id" : 680,
"host_name" : "10.131.34.188-SH-nwqybgmh-app3",
"alias" : null,
"server_port" : 11111
}, {
"id" : 682,
"host_name" : "10.131.34.188-SH-nwqybgmh-app3",
"alias" : null,
"server_port" : 11111
}, {
"id" : 788,
"host_name" : "10.131.34.189-SH-nwqybgmh-app4",
"alias" : null,
"server_port" : 0
} ]
}, {
"id" : 136,
"name" : "ZHSJPT",
"alias" : "综合审计",
"appInsList" : [ {
"id" : 738,
"host_name" : "10.131.32.205-vm-zhsj-app2",
"alias" : null,
"server_port" : 11111
}, {
"id" : 740,
"host_name" : "10.131.32.205-vm-zhsj-app2",
"alias" : null,
"server_port" : 777777
}, {
"id" : 742,
"host_name" : "10.131.32.204-vm-zhsj-app1",
"alias" : null,
"server_port" : 6666
}, {
"id" : 744,
"host_name" : "10.131.32.204-vm-zhsj-app1",
"alias" : null,
"server_port" : 22222
}, {
"id" : 912,
"host_name" : "10.131.32.204-vm-zhsj-app1",
"alias" : null,
"server_port" : 0
}, {
"id" : 914,
"host_name" : "10.131.32.205-vm-zhsj-app2",
"alias" : null,
"server_port" : 0
} ]
}, {
"id" : 144,
"name" : "PMS20_NEWTEST",
"alias" : null,
"appInsList" : [ {
"id" : 894,
"host_name" : "10.130.49.44-PMSTESTAPP4",
"alias" : null,
"server_port" : 3333
} ]
}, {
"id" : 146,
"name" : "TY_test_0125_",
"alias" : null,
"appInsList" : [ {
"id" : 896,
"host_name" : "10.131.41.17-localhost",
"alias" : null,
"server_port" : 0
}, {
"id" : 898,
"host_name" : "10.131.41.17-localhost",
"alias" : null,
"server_port" : 3333
} ]
}, {
"id" : 148,
"name" : "PMS20_TEST7003",
"alias" : null,
"appInsList" : [ {
"id" : 900,
"host_name" : "10.130.49.44-PMSTESTAPP4",
"alias" : null,
"server_port" : 0
}, {
"id" : 902,
"host_name" : "10.130.49.44-PMSTESTAPP4",
"alias" : null,
"server_port" : 3333
} ]
}]
}

appdict = {}

for i in ret['appList']:
appinsdict = {}
appdict.update({i.get('id'):i})
for j in i['appInsList']:
appinsdict.update({j.get('id'):j})

appdict.update({i.get('id'):appinsdict})

del ret['appList']
ret.update(appdict)
print(ret)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
需求:不需要列表数据,改造成全是字典格式的,方便日志易解析
思路:定义新字典,更新新字典,新字典的键是id,因为id是唯一的,更新完新字典后删掉部分原数据
---------------------

Python之数据结构改造的更多相关文章

  1. python 与数据结构

    在上面的文章中,我写了python中的一些特性,主要是简单为主,主要是因为一些其他复杂的东西可以通过简单的知识演变而来,比如装饰器还可以带参数,可以使用装饰类,在类中不同的方法中调用,不想写的太复杂, ...

  2. [0x00 用Python讲解数据结构与算法] 概览

    自从工作后就没什么时间更新博客了,最近抽空学了点Python,觉得Python真的是很强大呀.想来在大学中没有学好数据结构和算法,自己的意志力一直不够坚定,这次想好好看一本书,认真把基本的数据结构和算 ...

  3. Python -- 堆数据结构 heapq - I love this game! - 博客频道 - CSDN.NET

    Python -- 堆数据结构 heapq - I love this game! - 博客频道 - CSDN.NET Python -- 堆数据结构 heapq 分类: Python 2012-09 ...

  4. python实现数据结构单链表

    #python实现数据结构单链表 # -*- coding: utf-8 -*- class Node(object): """节点""" ...

  5. 《用Python解决数据结构与算法问题》在线阅读

    源于经典 数据结构作为计算机从业人员的必备基础,Java, c 之类的语言有很多这方面的书籍,Python 相对较少, 其中比较著名的一本 problem-solving-with-algorithm ...

  6. 用Python实现数据结构之二叉搜索树

    二叉搜索树 二叉搜索树是一种特殊的二叉树,它的特点是: 对于任意一个节点p,存储在p的左子树的中的所有节点中的值都小于p中的值 对于任意一个节点p,存储在p的右子树的中的所有节点中的值都大于p中的值 ...

  7. (python数据分析)第03章 Python的数据结构、函数和文件

    本章讨论Python的内置功能,这些功能本书会用到很多.虽然扩展库,比如pandas和Numpy,使处理大数据集很方便,但它们是和Python的内置数据处理工具一同使用的. 我们会从Python最基础 ...

  8. python的数据结构分类,以及数字的处理函数,类型判断

    python的数据结构分类: 数值型 int:python3中都是长整形,没有大小限制,受限内存区域的大小 float:只有双精度型 complex:实数和虚数部分都是浮点型,1+1.2J bool: ...

  9. Python 基本数据结构

    Python基本数据结构 数据结构:通俗点儿说,就是存储数据的容器.这里主要介绍Python的4种基本数据结构:列表.元组.字典.集合: 格式如下: 列表:list = [val1, val2, va ...

随机推荐

  1. 【ACM】 hdu_1090_A+BII_201307261100

    A+B for Input-Output Practice (II)Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/3276 ...

  2. 1414 冰雕 51nod 暴力

    1414 冰雕 题目来源: CodeForces 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题  收藏  关注 白兰大学正在准备庆祝成立256周年.特别任命副校长 ...

  3. [bzoj1131][POI2008]Sta_树形dp

    Sta bzoj-1131 POI-2008 题目大意:给定一棵n个点的树,求一个根,使得深度和最大. 注释:$1\le n \le 10^6$. 想法:扭一扭即可. 扭的时候看看这个点当没当过根. ...

  4. [bzoj4003][JLOI2015]城池攻占_左偏树

    城池攻占 bzoj-4003 JLOI-2015 题目大意:一颗n个节点的有根数,m个有初始战斗力的骑士都站在节点上.每一个节点有一个standard,如果这个骑士的战斗力超过了这个门槛,他就会根据城 ...

  5. Bootstrap:解决Bootstrap下拉框需要双击才能打开的问题

    当使用AngularJS和Bootstrap时,会发生菜单栏navbar控件 需要点击两下才能打开的问题.解决的方法就是在页面加载后,执行如下语句: // 防止下拉菜单需要双击的bug $('.dro ...

  6. 优秀软件project师必备的7大特性

    不是每个程序猿都能成为优秀的软件project师. 在过去的6年时间里,我在Ooyala.Quora和now Quip这3个创业公司面试过许很多多挺有发展潜力的"种子选手".他们都 ...

  7. JDK框架简析--java.lang包中的基础类库、基础数据类型

    题记 JDK.Java Development Kit. 我们必须先认识到,JDK不过,不过一套Java基础类库而已,是Sun公司开发的基础类库,仅此而已,JDK本身和我们自行书写总结的类库,从技术含 ...

  8. Unix网络编程 高级IO套接字设置超时

    我们知道.对于一个套接字的读写(read/write)操作默认是堵塞的.假设当前套接字还不可读/写,那么这个操作会一直堵塞下去,这样对于一个须要高性能的server来说,是不能接受的.所以,我们能够在 ...

  9. linux随便贴贴

    在bin目录下进入mysql: ./mysql -uroot -p123456 update mysql.user set password=password('root') where user=' ...

  10. idea导入ssm项目启动tomcat报错404

    用idea写ssm项目,基于之前一直在用spring boot  对于idea如何运行ssm花费了一番功夫 启动Tom act一直在报404 我搜了网上各种解决办法都不行,花费一天多的时间解决不了 就 ...