Newer
Older
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
package netboxManager
func createDevice() map[string]interface{} {
device := map[string]interface{}{
"name": "Modulares-Gerät",
"device_type": 1,
"role": 1,
"site": 1,
"serial": "SN123456999",
"description": "Kompaktes Beispielgerät",
"status": "active",
}
return device
}
func createDeviceWithParameter(name, deviceTypeID, deviceRoleID, siteID, serial, description, status string) map[string]interface{} {
// /api/dcim/devices/ Gerät
device := map[string]interface{}{
"name": name,
"device_type": deviceTypeID,
"role": deviceRoleID,
"site": siteID,
"serial": serial,
"description": description,
"status": status,
}
return device
}
func createTag() map[string]interface{} {
device := map[string]interface{}{
"name": "Guter Tag aus dem richtigen Programm18",
"slug": "guter-tag18",
"description": "Das ist ein gutes Gerät, aus dem richtigen Programm",
}
return device
}
func createTagWithParameter(name, slug, description string) map[string]interface{} {
device := map[string]interface{}{
"name": name,
"slug": slug,
"description": description,
}
return device
}
func createModultyp(manufacturerID string) map[string]interface{} {
///api/dcim/module-types/ Modultypen
device := map[string]interface{}{
"model": "Großes Model18",
"partNumber": "Ich bin eine Part Number",
//"weight" : "9",
//"weight_unit": "KiloGramm",
"description": "Ich bin eine Beschreibung von einem Großen Model",
"comments": "Und ich bin ein Kommentar",
"manufacturer": manufacturerID,
}
return device
}
func createModultypWithParameter(model, partNumber, description, comments, manufacturerID string) map[string]interface{} {
///api/dcim/module-types/ Modultypen
device := map[string]interface{}{
"model": model,
"partNumber": partNumber,
//"weight" : "9",
//"weight_unit": "KiloGramm",
"description": description,
"comments": comments,
"manufacturer": manufacturerID,
}
return device
}
func createdeviceType(manufacturerID string) map[string]interface{} {
// /dcim/device-types/ Gerätetyp
device := map[string]interface{}{
"manufacturer": manufacturerID,
"model": "Mein-Gerätetyp",
"slug": "mein-geraetetyp",
"u_height": "1",
}
return device
}
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
func createdeviceTypeWithParameter(manufacturerID, model, slug, uHeight string) map[string]interface{} {
// /dcim/device-types/ Gerätetyp
device := map[string]interface{}{
"manufacturer": manufacturerID,
"model": model,
"slug": slug,
"u_height": uHeight,
}
return device
}
func createManufacturer() map[string]interface{} {
// /dcim/manufacturers/ Hersteller
device := map[string]interface{}{
"name": "Großer Hersteller18",
"slug": "grosser-hersteller18",
"description": "Hersteller für große Modelle",
}
return device
}
func createManufacturerWithParameter(name, slug, description string) map[string]interface{} {
// /dcim/manufacturers/ Hersteller
device := map[string]interface{}{
"name": name,
"slug": slug,
"description": description,
}
return device
}
func createDeviceRole() map[string]interface{} {
// /dcim/device-roles/ Geräterolle
device := map[string]interface{}{
"name": "Wichtige Rolle18",
"slug": "wichtige-rolle18",
"description": "Eine wichtige Rolle für Geräte",
"color": "ff0000", // Rote Farbe als Hex-Code
}
return device
}
func createDeviceRoleWithParameter(name, slug, description, color, active string) map[string]interface{} {
// /dcim/device-roles/ Geräterolle
device := map[string]interface{}{
"name": name,
"slug": slug,
"description": description,
"color": color,
"status": active,
}
return device
}
func createSite() map[string]interface{} {
// /dcim/sites/ Standorts
device := map[string]interface{}{
"name": "GoHauptstandort18",
"slug": "Gohauptstandort18",
"description": "Hauptsitz des Unternehmens",
"physicalAddress": "Musterstraße 1, 12345 Musterstadt",
"shippingAddress": "Postfach 1001, 12345 Musterstadt",
"comments": "Dies ist der Hauptstandort.",
"status": "active",
}
return device
}
func createSiteWithParameter(name, slug, description, physicalAddress, shippingAddress, comments, status string) map[string]interface{} {
// /dcim/sites/ Standorts
device := map[string]interface{}{
"name": name,
"slug": slug,
"description": description,
"physicalAddress": physicalAddress,
"shippingAddress": shippingAddress,
"comments": comments,
"status": status,
}
return device
}