forked from device42/servicenow_device42_mapping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mapping.xml.sample
79 lines (71 loc) · 4.15 KB
/
mapping.xml.sample
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
<meta>
<settings>
<servicenow
url=""
user=""
password=""/>
<device42
url=""
user=""
password=""/>
</settings>
<tasks>
<task enable="true" description="Copy from Servicenow to Device42">
<api>
<resource target="serviceNow" method="GET" path="/api/now/table/cmdb_ci_aix_server"/>
<target model="device" target="device42" method="POST" update_method="PUT" path="/api/1.0/device/"/>
</api>
<mapping callback="to_d42" key="device_id">
<field resource="name" type="string" target="name"/>
<field resource="serial_number" type="string" target="serial_no"/>
<field resource="classification" type="string" target="service_level"/>
<field resource="asset_tag" type="string" target="tags"/>
<field resource="mac_address" type="string" target="macaddress"/>
<field resource="cpu_count" type="integer" target="cpucount"/>
<field resource="cpu_core_count" type="integer" target="cpucore"/>
<field resource="cpu_speed" type="integer" target="cpupower"/>
<field resource="ram" type="float" target="memory"/>
<field resource="disk_space" type="float" target="hddsize"/>
<field resource="os" type="string" target="os"/>
<field resource="os_version" type="string" target="osver"/>
<field resource="short_description" type="string" target="notes"/>
<field resource="model_id" sub_field="manufacturer" sub_field2="name" type="string" target="manufacturer"/>
<field resource="model_id" sub_field="name" type="string" target="hardware"/>
</mapping>
</task>
<task enable="false" description="Copy from Device42 to Servicenow">
<api>
<target target="serviceNow" method="POST" update_method="PATCH" path="/api/now/table/cmdb_ci_aix_server"/>
<resource model="device" target="device42" method="GET" path="/api/1.0/devices/all"/>
</api>
<mapping callback="from_d42" key="device_id" source="Devices">
<field resource="name" type="string" target="name"/>
<field resource="serial_no" type="string" target="serial_number"/>
<field resource="service_level" type="string" target="classification"/>
<field resource="tags" type="string" target="asset_tag"/>
<field resource="custom_fields" type="string" target="u_custom_field_name" key="test2"/>
<field resource="mac_addresses" type="string" target="mac_address" element="0"/>
<field resource="cpucount" type="integer" target="cpu_count"/>
<field resource="cpucore" type="interger" target="cpu_core_count"/>
<field resource="cpuspeed" type="integer" target="cpu_speed"/>
<field resource="ram" type="float" target="ram"/>
<field resource="hddsize" type="float" target="disk_space"/>
<field resource="os" type="string" target="os"/>
<field resource="osver" type="string" target="os_version"/>
<field resource="notes" type="string" target="short_description"/>
<field resource="manufacturer" checker="/api/now/table/core_company"
resource2="hw_model" checker2="/api/now/table/cmdb_model" target="model_id"/>
</mapping>
</task>
<task enable="false" description="Copy from Servicenow to Device42">
<api>
<resource target="serviceNow" method="GET" path="/api/now/table/core_company"/>
<target model="company" target="device42" method="POST" update_method="PUT" path="/api/1.0/vendors/"/>
</api>
<mapping callback="to_d42" key="name">
<field resource="name" type="string" target="name"/>
<field resource="website" type="string" target="homepage"/>
</mapping>
</task>
</tasks>
</meta>