-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathQueryMap.json
199 lines (199 loc) · 7.8 KB
/
QueryMap.json
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
{
"reQueryLookupDict":{
"tenants/":"name",
"sites/":"name",
"rack-groups/":"name",
"manufacturers/":"name",
"device-roles/":"name",
"racks/":"name",
"device-types/":"model",
"devices/":"name",
"child-devices/":"name",
"device-bays/":"name"
},
"results": [
{
"querySubObjectID":"Tenants",
"sType":"tenancy/",
"sSubType":"tenants/",
"queryString":"SELECT dt.Name FROM fac_Department dt",
"outputMapping":{
"name":0
},
"slugEnable":true
},
{
"querySubObjectID":"Sites",
"sType":"dcim/",
"sSubType":"sites/",
"queryString":"SELECT dc.Name, dc.DeliveryAddress FROM fac_DataCenter dc",
"outputMapping":{
"name":0,
"physical_address":1
},
"slugEnable":true
},
{
"querySubObjectID":"Rack Groups",
"sType":"dcim/",
"sSubType":"rack-groups/",
"queryString":"SELECT cr.Name, dc.Name FROM fac_CabRow cr, fac_DataCenter dc WHERE cr.DataCenterID=dc.DataCenterID",
"outputMapping":{
"name":0,
"site":{
"sSubType":"sites/",
"reQueryIndexHeader":1
}
},
"slugEnable":true
},
{
"querySubObjectID":"Racks",
"sType":"dcim/",
"sSubType":"racks/",
"queryString":"SELECT cb.Location, dc.Name, cr.Name, cb.CabinetHeight FROM fac_Cabinet cb, fac_CabRow cr, fac_DataCenter dc WHERE cb.DataCenterID=dc.DataCenterID AND cb.CabRowID=cr.CabRowID",
"outputMapping":{
"name":0,
"site":{
"sSubType":"sites/",
"reQueryIndexHeader":1
},
"group":{
"sSubType":"rack-groups/",
"reQueryIndexHeader":2
},
"u_height":3
},
"slugEnable":true
},
{
"querySubObjectID":"Manufacturers",
"sType":"dcim/",
"sSubType":"manufacturers/",
"queryString":"SELECT mf.Name FROM fac_Manufacturer mf",
"outputMapping":{
"name":0
},
"slugEnable":true
},
{
"querySubObjectID":"Device Roles",
"sType":"dcim/",
"sSubType":"device-roles/",
"queryString":"SELECT DISTINCT dt.DeviceType, ca.DefaultValue FROM fac_DeviceTemplate dt, fac_DeviceCustomAttribute ca WHERE ca.Label='migrate_color'",
"outputMapping":{
"name":0,
"color":1
},
"slugEnable":true
},
{
"querySubObjectID":"Device Types",
"sType":"dcim/",
"sSubType":"device-types/",
"queryString":"SELECT dt.Model, mf.Name, dt.Height, CASE WHEN dt.DeviceType='Chassis' THEN true WHEN dt.Model LIKE '%SLED%' OR '%BLADE%' THEN false ELSE 'None' END AS ParentStatus FROM fac_DeviceTemplate dt, fac_Manufacturer mf WHERE dt.ManufacturerID=mf.ManufacturerID",
"outputMapping":{
"model":0,
"manufacturer":{
"sSubType":"manufacturers/",
"reQueryIndexHeader":1
},
"u_height":2,
"subdevice_role":3
},
"slugEnable":true
},
{
"querySubObjectID":"Devices",
"sType":"dcim/",
"sSubType":"devices/",
"queryString":"SELECT dv.Label, dt.DeviceType, dt.Model, mf.Name, dv.SerialNo, dv.AssetTag, dc.Name, cb.Location, ca.DefaultValue, dv.Position, dp.Name, CONCAT('Install Date: ', dv.InstallDate, '\n Warranty Expiration: ', dv.WarrantyExpire, '\n Notes: ', dv.Notes) Comment FROM fac_Device dv, fac_DeviceTemplate dt, fac_Manufacturer mf, fac_DataCenter dc, fac_Cabinet cb, fac_DeviceCustomAttribute ca, fac_Department dp WHERE dv.TemplateID=dt.TemplateID AND dt.ManufacturerID=mf.ManufacturerID AND cb.DataCenterID=dc.DataCenterID AND cb.CabinetID=dv.Cabinet AND ca.Label='default_face' AND dv.Owner=dp.DeptID AND dv.ParentDevice=0",
"outputMapping":{
"name":0,
"device_role":{
"sSubType":"device-roles/",
"reQueryIndexHeader":1
},
"manufacturer":{
"sSubType":"manufacturers/",
"reQueryIndexHeader":3
},
"device_type":{
"sSubType":"device-types/",
"reQueryIndexHeader":2
},
"serial":4,
"asset_tag":5,
"site":{
"sSubType":"sites/",
"reQueryIndexHeader":6
},
"rack":{
"sSubType":"racks/",
"reQueryIndexHeader":7
},
"face":8,
"position":9,
"tenant":{
"sSubType":"tenants/",
"reQueryIndexHeader":10
},
"comments":11
},
"slugEnable":false
},
{
"querySubObjectID":"Child Devices",
"sType":"dcim/",
"sSubType":"devices/",
"queryString":"SELECT dv.Label, dt.DeviceType, dt.Model, mf.Name, dc.Name, cb.Location, ca.DefaultValue, dp.Name FROM fac_Device dv, fac_DeviceTemplate dt, fac_Manufacturer mf, fac_DataCenter dc, fac_Cabinet cb, fac_DeviceCustomAttribute ca, fac_Department dp WHERE dv.TemplateID=dt.TemplateID AND dt.ManufacturerID=mf.ManufacturerID AND cb.DataCenterID=dc.DataCenterID AND cb.CabinetID=dv.Cabinet AND ca.Label='default_face' AND dv.Owner=dp.DeptID AND NOT dv.ParentDevice=0",
"outputMapping":{
"name":0,
"device_role":{
"sSubType":"device-roles/",
"reQueryIndexHeader":1
},
"device_type":{
"sSubType":"device-types/",
"reQueryIndexHeader":2
},
"manufacturer":{
"sSubType":"manufacturers/",
"reQueryIndexHeader":3
},
"site":{
"sSubType":"sites/",
"reQueryIndexHeader":4
},
"rack":{
"sSubType":"racks/",
"reQueryIndexHeader":5
},
"face":6,
"tenant":{
"sSubType":"tenants/",
"reQueryIndexHeader":7
}
},
"slugEnable":true
},
{
"querySubObjectID":"Device Bays",
"sType":"dcim/",
"sSubType":"device-bays/",
"queryString":"SELECT ParentDevices.Label, ChildDevices.CL, ChildDevices.Position FROM (SELECT dv.Label As CL, dv.ParentDevice AS Pid, dv.Position FROM fac_Device dv WHERE NOT dv.ParentDevice=0) AS ChildDevices, (SELECT dv.Label As Label, dv.DeviceID AS Pid FROM fac_Device dv WHERE DeviceType='Chassis') AS ParentDevices WHERE ChildDevices.Pid=ParentDevices.Pid",
"outputMapping":{
"device":{
"sSubType":"devices/",
"reQueryIndexHeader":0
},
"installed_device":{
"sSubType":"devices/",
"reQueryIndexHeader":1
},
"name":2
},
"slugEnable":true
}
]
}