@itentialopensource/adapter-netbox_v33 2.1.7 → 2.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AUTH.md +14 -18
- package/BROKER.md +31 -19
- package/CALLS.md +59 -23
- package/CHANGELOG.md +16 -0
- package/PROPERTIES.md +5 -0
- package/README.md +60 -63
- package/SYSTEMINFO.md +21 -6
- package/TAB1.md +11 -0
- package/TAB2.md +55 -47
- package/compliance-report.json +9 -0
- package/compliance-report.txt +5 -0
- package/metadata.json +57 -8
- package/package.json +13 -15
- package/propertiesSchema.json +5 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +4 -4
- package/report/updateReport1715186697583.json +120 -0
- package/sampleProperties.json +39 -27
- package/test/integration/adapterTestIntegration.js +1 -0
- package/test/unit/adapterTestUnit.js +6 -8
package/AUTH.md
CHANGED
|
@@ -1,39 +1,35 @@
|
|
|
1
|
-
## Authenticating
|
|
1
|
+
## Authenticating NetBox Adapter
|
|
2
2
|
|
|
3
|
-
This document will go through the steps for authenticating the
|
|
3
|
+
This document will go through the steps for authenticating the NetBox adapter with authentication methods we have worked with in the past. Properly configuring the properties for an adapter in IAP is critical for getting the adapter online. You can read more about adapter authentication <a href="https://docs.itential.com/opensource/docs/authentication" target="_blank">HERE</a>.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Companies periodically change authentication methods to provide better security. As this happens this section should be updated and contributed/merge back into the adapter repository.
|
|
6
|
+
|
|
7
|
+
### Static Token (APIKEY) Authentication
|
|
8
|
+
The NetBox adapter requires Static Token (APIKEY) Authentication. If you change authentication methods, you should change this section accordingly and merge it back into the adapter repository.
|
|
7
9
|
|
|
8
10
|
STEPS
|
|
9
|
-
1. Ensure you have access to a
|
|
11
|
+
1. Ensure you have access to a NetBox server and that it is running
|
|
10
12
|
2. Follow the steps in the README.md to import the adapter into IAP if you have not already done so
|
|
11
13
|
3. Use the properties below for the ```properties.authentication``` field
|
|
12
14
|
```json
|
|
13
15
|
"authentication": {
|
|
14
|
-
"auth_method": "
|
|
15
|
-
"
|
|
16
|
-
"password": "<password>",
|
|
17
|
-
"token": "",
|
|
18
|
-
"token_timeout": 1800000,
|
|
19
|
-
"token_cache": "local",
|
|
20
|
-
"invalid_token_error": 401,
|
|
16
|
+
"auth_method": "static_token",
|
|
17
|
+
"token": "<token>",
|
|
21
18
|
"auth_field": "header.headers.Authorization",
|
|
22
|
-
"auth_field_format": "
|
|
23
|
-
"auth_logging": false
|
|
24
|
-
"client_id": "",
|
|
25
|
-
"client_secret": "",
|
|
26
|
-
"grant_type": ""
|
|
19
|
+
"auth_field_format": "Token {token}",
|
|
20
|
+
"auth_logging": false
|
|
27
21
|
}
|
|
28
22
|
```
|
|
23
|
+
you can leave all of the other properties in the authentication section, they will not be used when the auth_method is static_token.<br>
|
|
29
24
|
4. Restart the adapter. If your properties were set correctly, the adapter should go online.
|
|
30
25
|
|
|
31
26
|
### Troubleshooting
|
|
32
|
-
- Make sure you copied over the correct
|
|
27
|
+
- Make sure you copied over the correct token.
|
|
33
28
|
- Turn on debug level logs for the adapter in IAP Admin Essentials.
|
|
34
29
|
- Turn on auth_logging for the adapter in IAP Admin Essentials (adapter properties).
|
|
35
30
|
- Investigate the logs - in particular:
|
|
36
31
|
- The FULL REQUEST log to make sure the proper headers are being sent with the request.
|
|
37
32
|
- The FULL BODY log to make sure the payload is accurate.
|
|
38
33
|
- The CALL RETURN log to see what the other system is telling us.
|
|
34
|
+
- Credentials should be ** masked ** by the adapter so make sure you verify the username and password - including that there are erroneous spaces at the front or end.
|
|
39
35
|
- Remember when you are done to turn auth_logging off as you do not want to log credentials.
|
package/BROKER.md
CHANGED
|
@@ -22,18 +22,25 @@ Below is an example of how you may set up the properties for this call.
|
|
|
22
22
|
{
|
|
23
23
|
"path": "/{org}/get/devices",
|
|
24
24
|
"method": "GET",
|
|
25
|
+
"pagination": {
|
|
26
|
+
"offsetVar": "",
|
|
27
|
+
"limitVar": "",
|
|
28
|
+
"incrementBy": "limit",
|
|
29
|
+
"requestLocation": "query"
|
|
30
|
+
},
|
|
25
31
|
"query": {},
|
|
26
32
|
"body": {},
|
|
27
33
|
"headers": {},
|
|
28
34
|
"handleFailure": "ignore",
|
|
35
|
+
"responseDataKey": "",
|
|
29
36
|
"requestFields": {
|
|
30
37
|
"org": "555"
|
|
31
38
|
},
|
|
32
39
|
"responseFields": {
|
|
33
|
-
"name": "
|
|
34
|
-
"ostype": "
|
|
40
|
+
"name": "{hostField}",
|
|
41
|
+
"ostype": "{osField}",
|
|
35
42
|
"ostypePrefix": "system-",
|
|
36
|
-
"ipaddress": "attributes.ipaddr",
|
|
43
|
+
"ipaddress": "{attributes.ipaddr}",
|
|
37
44
|
"port": "443"
|
|
38
45
|
}
|
|
39
46
|
},
|
|
@@ -44,16 +51,17 @@ Below is an example of how you may set up the properties for this call.
|
|
|
44
51
|
"body": {},
|
|
45
52
|
"headers": {},
|
|
46
53
|
"handleFailure": "ignore",
|
|
54
|
+
"responseDataKey": "",
|
|
47
55
|
"requestFields": {
|
|
48
56
|
"org": "777"
|
|
49
57
|
},
|
|
50
58
|
"responseFields": {
|
|
51
|
-
"name": "
|
|
52
|
-
"ostype": "
|
|
59
|
+
"name": "{hostField}",
|
|
60
|
+
"ostype": "{osField}",
|
|
53
61
|
"ostypePrefix": "system-",
|
|
54
|
-
"ipaddress": "attributes.ipaddr",
|
|
62
|
+
"ipaddress": "{attributes.ipaddr}",
|
|
55
63
|
"port": "443",
|
|
56
|
-
"myorg": "
|
|
64
|
+
"myorg": "{orgField}"
|
|
57
65
|
}
|
|
58
66
|
}
|
|
59
67
|
]
|
|
@@ -88,12 +96,13 @@ Below is an example of how you may set up the properties for this call.
|
|
|
88
96
|
"headers": {},
|
|
89
97
|
"handleFailure": "ignore",
|
|
90
98
|
"statusValue": "online",
|
|
99
|
+
"responseDataKey": "",
|
|
91
100
|
"requestFields": {
|
|
92
|
-
"org": "myorg",
|
|
93
|
-
"id": "name"
|
|
101
|
+
"org": "{myorg}",
|
|
102
|
+
"id": "{name}"
|
|
94
103
|
},
|
|
95
104
|
"responseFields": {
|
|
96
|
-
"status": "status"
|
|
105
|
+
"status": "{status}"
|
|
97
106
|
}
|
|
98
107
|
}
|
|
99
108
|
]
|
|
@@ -129,9 +138,10 @@ Below is an example of how you may set up the properties for this call.
|
|
|
129
138
|
"body": {},
|
|
130
139
|
"headers": {},
|
|
131
140
|
"handleFailure": "ignore",
|
|
141
|
+
"responseDataKey": "",
|
|
132
142
|
"requestFields": {
|
|
133
|
-
"org": "myorg",
|
|
134
|
-
"id": "name"
|
|
143
|
+
"org": "{myorg}",
|
|
144
|
+
"id": "{name}"
|
|
135
145
|
}
|
|
136
146
|
"responseFields": {}
|
|
137
147
|
},
|
|
@@ -142,8 +152,9 @@ Below is an example of how you may set up the properties for this call.
|
|
|
142
152
|
"body": {},
|
|
143
153
|
"headers": {},
|
|
144
154
|
"handleFailure": "ignore",
|
|
155
|
+
"responseDataKey": "",
|
|
145
156
|
"requestFields": {
|
|
146
|
-
"org": "myorg"
|
|
157
|
+
"org": "{myorg}"
|
|
147
158
|
}
|
|
148
159
|
"responseFields": {}
|
|
149
160
|
}
|
|
@@ -178,17 +189,18 @@ Below is an example of how you may set up the properties for this call.
|
|
|
178
189
|
"body": {},
|
|
179
190
|
"headers": {},
|
|
180
191
|
"handleFailure": "ignore",
|
|
192
|
+
"responseDataKey": "",
|
|
181
193
|
"requestFields": {
|
|
182
|
-
"org": "myorg",
|
|
183
|
-
"id": "name"
|
|
194
|
+
"org": "{myorg}",
|
|
195
|
+
"id": "{name}"
|
|
184
196
|
},
|
|
185
197
|
"responseFields": {
|
|
186
|
-
"name": "
|
|
187
|
-
"ostype": "
|
|
198
|
+
"name": "{hostField}",
|
|
199
|
+
"ostype": "{osField}",
|
|
188
200
|
"ostypePrefix": "system-",
|
|
189
|
-
"ipaddress": "attributes.ipaddr",
|
|
201
|
+
"ipaddress": "{attributes.ipaddr}",
|
|
190
202
|
"port": "443",
|
|
191
|
-
"myorg": "
|
|
203
|
+
"myorg": "{orgField}"
|
|
192
204
|
}
|
|
193
205
|
}
|
|
194
206
|
]
|
package/CALLS.md
CHANGED
|
@@ -19,7 +19,7 @@ These are adapter methods that IAP or you might use. There are some other method
|
|
|
19
19
|
</tr>
|
|
20
20
|
<tr>
|
|
21
21
|
<td style="padding:15px">healthCheck(callback)</td>
|
|
22
|
-
<td style="padding:15px">This call ensures that the adapter can communicate with
|
|
22
|
+
<td style="padding:15px">This call ensures that the adapter can communicate with Adapter for NetBox. The actual call that is used is defined in the adapter properties and .system entities action.json file.</td>
|
|
23
23
|
<td style="padding:15px">No</td>
|
|
24
24
|
</tr>
|
|
25
25
|
<tr>
|
|
@@ -29,7 +29,7 @@ These are adapter methods that IAP or you might use. There are some other method
|
|
|
29
29
|
</tr>
|
|
30
30
|
<tr>
|
|
31
31
|
<td style="padding:15px">encryptProperty(property, technique, callback)</td>
|
|
32
|
-
<td style="padding:15px">This call will take the provided property and technique, and return the property encrypted with the technique. This allows the property to be used in the adapterProps section for the credential password so that the password does not have to be in clear text. The adapter will decrypt the property as needed for communications with
|
|
32
|
+
<td style="padding:15px">This call will take the provided property and technique, and return the property encrypted with the technique. This allows the property to be used in the adapterProps section for the credential password so that the password does not have to be in clear text. The adapter will decrypt the property as needed for communications with Adapter for NetBox.</td>
|
|
33
33
|
<td style="padding:15px">No</td>
|
|
34
34
|
</tr>
|
|
35
35
|
<tr>
|
|
@@ -37,11 +37,6 @@ These are adapter methods that IAP or you might use. There are some other method
|
|
|
37
37
|
<td style="padding:15px">This call provides the ability to update the adapter configuration from IAP - includes actions, schema, mockdata and other configurations.</td>
|
|
38
38
|
<td style="padding:15px">Yes</td>
|
|
39
39
|
</tr>
|
|
40
|
-
<tr>
|
|
41
|
-
<td style="padding:15px">iapFindAdapterPath(apiPath, callback)</td>
|
|
42
|
-
<td style="padding:15px">This call provides the ability to see if a particular API path is supported by the adapter.</td>
|
|
43
|
-
<td style="padding:15px">Yes</td>
|
|
44
|
-
</tr>
|
|
45
40
|
<tr>
|
|
46
41
|
<td style="padding:15px">iapSuspendAdapter(mode, callback)</td>
|
|
47
42
|
<td style="padding:15px">This call provides the ability to suspend the adapter and either have requests rejected or put into a queue to be processed after the adapter is resumed.</td>
|
|
@@ -57,12 +52,16 @@ These are adapter methods that IAP or you might use. There are some other method
|
|
|
57
52
|
<td style="padding:15px">This call will return the requests that are waiting in the queue if throttling is enabled.</td>
|
|
58
53
|
<td style="padding:15px">Yes</td>
|
|
59
54
|
</tr>
|
|
55
|
+
<tr>
|
|
56
|
+
<td style="padding:15px">iapFindAdapterPath(apiPath, callback)</td>
|
|
57
|
+
<td style="padding:15px">This call provides the ability to see if a particular API path is supported by the adapter.</td>
|
|
58
|
+
<td style="padding:15px">Yes</td>
|
|
59
|
+
</tr>
|
|
60
60
|
<tr>
|
|
61
61
|
<td style="padding:15px">iapTroubleshootAdapter(props, persistFlag, adapter, callback)</td>
|
|
62
62
|
<td style="padding:15px">This call can be used to check on the performance of the adapter - it checks connectivity, healthcheck and basic get calls.</td>
|
|
63
63
|
<td style="padding:15px">Yes</td>
|
|
64
64
|
</tr>
|
|
65
|
-
|
|
66
65
|
<tr>
|
|
67
66
|
<td style="padding:15px">iapRunAdapterHealthcheck(adapter, callback)</td>
|
|
68
67
|
<td style="padding:15px">This call will return the results of a healthcheck.</td>
|
|
@@ -83,6 +82,21 @@ These are adapter methods that IAP or you might use. There are some other method
|
|
|
83
82
|
<td style="padding:15px">This call will push the adapter configuration from the entities directory into the Adapter or IAP Database.</td>
|
|
84
83
|
<td style="padding:15px">Yes</td>
|
|
85
84
|
</tr>
|
|
85
|
+
<tr>
|
|
86
|
+
<td style="padding:15px">iapDeactivateTasks(tasks, callback)</td>
|
|
87
|
+
<td style="padding:15px">This call provides the ability to remove tasks from the adapter.</td>
|
|
88
|
+
<td style="padding:15px">Yes</td>
|
|
89
|
+
</tr>
|
|
90
|
+
<tr>
|
|
91
|
+
<td style="padding:15px">iapActivateTasks(tasks, callback)</td>
|
|
92
|
+
<td style="padding:15px">This call provides the ability to add deactivated tasks back into the adapter.</td>
|
|
93
|
+
<td style="padding:15px">Yes</td>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr>
|
|
96
|
+
<td style="padding:15px">iapExpandedGenericAdapterRequest(metadata, uriPath, restMethod, pathVars, queryData, requestBody, addlHeaders, callback)</td>
|
|
97
|
+
<td style="padding:15px">This is an expanded Generic Call. The metadata object allows us to provide many new capabilities within the generic request.</td>
|
|
98
|
+
<td style="padding:15px">Yes</td>
|
|
99
|
+
</tr>
|
|
86
100
|
<tr>
|
|
87
101
|
<td style="padding:15px">genericAdapterRequest(uriPath, restMethod, queryData, requestBody, addlHeaders, callback)</td>
|
|
88
102
|
<td style="padding:15px">This call allows you to provide the path to have the adapter call. It is an easy way to incorporate paths that have not been built into the adapter yet.</td>
|
|
@@ -94,23 +108,46 @@ These are adapter methods that IAP or you might use. There are some other method
|
|
|
94
108
|
<td style="padding:15px">Yes</td>
|
|
95
109
|
</tr>
|
|
96
110
|
<tr>
|
|
97
|
-
<td style="padding:15px">
|
|
98
|
-
<td style="padding:15px">
|
|
99
|
-
<td style="padding:15px">
|
|
111
|
+
<td style="padding:15px">iapRunAdapterLint(callback)</td>
|
|
112
|
+
<td style="padding:15px">Runs lint on the addapter and provides the information back.</td>
|
|
113
|
+
<td style="padding:15px">Yes</td>
|
|
100
114
|
</tr>
|
|
101
115
|
<tr>
|
|
102
|
-
<td style="padding:15px">
|
|
103
|
-
<td style="padding:15px">
|
|
104
|
-
<td style="padding:15px">
|
|
116
|
+
<td style="padding:15px">iapRunAdapterTests(callback)</td>
|
|
117
|
+
<td style="padding:15px">Runs baseunit and unit tests on the adapter and provides the information back.</td>
|
|
118
|
+
<td style="padding:15px">Yes</td>
|
|
105
119
|
</tr>
|
|
106
120
|
<tr>
|
|
107
|
-
<td style="padding:15px">
|
|
108
|
-
<td style="padding:15px">This call
|
|
109
|
-
<td style="padding:15px">
|
|
121
|
+
<td style="padding:15px">iapGetAdapterInventory(callback)</td>
|
|
122
|
+
<td style="padding:15px">This call provides some inventory related information about the adapter.</td>
|
|
123
|
+
<td style="padding:15px">Yes</td>
|
|
110
124
|
</tr>
|
|
111
125
|
</table>
|
|
112
126
|
<br>
|
|
127
|
+
|
|
128
|
+
### Adapter Cache Calls
|
|
113
129
|
|
|
130
|
+
These are adapter methods that are used for adapter caching. If configured, the adapter will cache based on the interval provided. However, you can force a population of the cache manually as well.
|
|
131
|
+
|
|
132
|
+
<table border="1" class="bordered-table">
|
|
133
|
+
<tr>
|
|
134
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Method Signature</span></th>
|
|
135
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
136
|
+
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Workflow?</span></th>
|
|
137
|
+
</tr>
|
|
138
|
+
<tr>
|
|
139
|
+
<td style="padding:15px">iapPopulateEntityCache(entityTypes, callback)</td>
|
|
140
|
+
<td style="padding:15px">This call populates the adapter cache.</td>
|
|
141
|
+
<td style="padding:15px">Yes</td>
|
|
142
|
+
</tr>
|
|
143
|
+
<tr>
|
|
144
|
+
<td style="padding:15px">iapRetrieveEntitiesCache(entityType, options, callback)</td>
|
|
145
|
+
<td style="padding:15px">This call retrieves the specific items from the adapter cache.</td>
|
|
146
|
+
<td style="padding:15px">Yes</td>
|
|
147
|
+
</tr>
|
|
148
|
+
</table>
|
|
149
|
+
<br>
|
|
150
|
+
|
|
114
151
|
### Adapter Broker Calls
|
|
115
152
|
|
|
116
153
|
These are adapter methods that are used to integrate to IAP Brokers. This adapter currently supports the following broker calls.
|
|
@@ -129,32 +166,31 @@ These are adapter methods that are used to integrate to IAP Brokers. This adapte
|
|
|
129
166
|
<tr>
|
|
130
167
|
<td style="padding:15px">getDevice(deviceName, callback)</td>
|
|
131
168
|
<td style="padding:15px">This call returns the details of the requested device.</td>
|
|
132
|
-
<td style="padding:15px">
|
|
169
|
+
<td style="padding:15px">No</td>
|
|
133
170
|
</tr>
|
|
134
171
|
<tr>
|
|
135
172
|
<td style="padding:15px">getDevicesFiltered(options, callback)</td>
|
|
136
173
|
<td style="padding:15px">This call returns the list of devices that match the criteria provided in the options filter.</td>
|
|
137
|
-
<td style="padding:15px">
|
|
174
|
+
<td style="padding:15px">No</td>
|
|
138
175
|
</tr>
|
|
139
176
|
<tr>
|
|
140
177
|
<td style="padding:15px">isAlive(deviceName, callback)</td>
|
|
141
178
|
<td style="padding:15px">This call returns whether the device status is active</td>
|
|
142
|
-
<td style="padding:15px">
|
|
179
|
+
<td style="padding:15px">No</td>
|
|
143
180
|
</tr>
|
|
144
181
|
<tr>
|
|
145
182
|
<td style="padding:15px">getConfig(deviceName, format, callback)</td>
|
|
146
183
|
<td style="padding:15px">This call returns the configuration for the selected device.</td>
|
|
147
|
-
<td style="padding:15px">
|
|
184
|
+
<td style="padding:15px">No</td>
|
|
148
185
|
</tr>
|
|
149
186
|
<tr>
|
|
150
187
|
<td style="padding:15px">iapGetDeviceCount(callback)</td>
|
|
151
188
|
<td style="padding:15px">This call returns the count of devices.</td>
|
|
152
|
-
<td style="padding:15px">
|
|
189
|
+
<td style="padding:15px">No</td>
|
|
153
190
|
</tr>
|
|
154
191
|
</table>
|
|
155
192
|
<br>
|
|
156
193
|
|
|
157
|
-
|
|
158
194
|
### Specific Adapter Calls
|
|
159
195
|
|
|
160
196
|
Specific adapter calls are built based on the API of the Netbox_v33. The Adapter Builder creates the proper method comments for generating JS-DOC for the adapter. This is the best way to get information on the calls.
|
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
## 2.1.9 [08-07-2024]
|
|
3
|
+
|
|
4
|
+
* Changes made at 2024.08.06_19:11PM
|
|
5
|
+
|
|
6
|
+
See merge request itentialopensource/adapters/adapter-netbox_v33!14
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 2.1.8 [07-23-2024]
|
|
11
|
+
|
|
12
|
+
* add timeout to fix unit
|
|
13
|
+
|
|
14
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox_v33!13
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
2
18
|
## 2.1.7 [05-01-2024]
|
|
3
19
|
|
|
4
20
|
* Patch/adapt 3335
|
package/PROPERTIES.md
CHANGED
|
@@ -97,6 +97,7 @@ This section defines **all** the properties that are available for the adapter,
|
|
|
97
97
|
}
|
|
98
98
|
},
|
|
99
99
|
"devicebroker": {
|
|
100
|
+
"enabled": false,
|
|
100
101
|
"getDevice": [
|
|
101
102
|
{
|
|
102
103
|
"path": "/call/to/get/device/details",
|
|
@@ -580,6 +581,10 @@ The device broker section defines the properties used integrate Netbox_v33 to th
|
|
|
580
581
|
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Property</span></th>
|
|
581
582
|
<th bgcolor="lightgrey" style="padding:15px"><span style="font-size:12.0pt">Description</span></th>
|
|
582
583
|
</tr>
|
|
584
|
+
<tr>
|
|
585
|
+
<td style="padding:15px">enabled</td>
|
|
586
|
+
<td style="padding:15px">Whether or not the device broker calls have been mapped.</td>
|
|
587
|
+
</tr>
|
|
583
588
|
<tr>
|
|
584
589
|
<td style="padding:15px">getDevice</td>
|
|
585
590
|
<td style="padding:15px">The array of calls used to get device details for the broker</td>
|
package/README.md
CHANGED
|
@@ -4,29 +4,49 @@
|
|
|
4
4
|
|
|
5
5
|
Some of the page links in this document and links to other GitLab files do not work in Confluence however, the information is available in other sections of the Confluence material.
|
|
6
6
|
|
|
7
|
-
- [
|
|
8
|
-
- [Versioning](#versioning)
|
|
9
|
-
- [Supported IAP Versions](#supported-iap-versions)
|
|
10
|
-
- [Getting Started](#getting-started)
|
|
11
|
-
- [Helpful Background Information](#helpful-background-information)
|
|
12
|
-
- [Prerequisites](#prerequisites)
|
|
13
|
-
- [How to Install](#how-to-install)
|
|
14
|
-
- [Testing](#testing)
|
|
15
|
-
- [Configuration](./PROPERTIES.md)
|
|
16
|
-
- [Using this Adapter](./CALLS.md)
|
|
7
|
+
- [Specific to this Adapter](#specific-to-this-adapter)
|
|
17
8
|
- [Authentication](./AUTH.md)
|
|
18
|
-
- [
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
21
|
-
|
|
22
|
-
- [
|
|
23
|
-
- [
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
9
|
+
- [Sample Properties](./sampleProperties.json)
|
|
10
|
+
- [Available Calls](./CALLS.md)
|
|
11
|
+
- [Swagger](./report/adapter-openapi.json)
|
|
12
|
+
- [Generic Adapter Information](#generic-adapter-information)
|
|
13
|
+
- [Overview](./SUMMARY.md)
|
|
14
|
+
- [Versioning](#versioning)
|
|
15
|
+
- [Supported IAP Versions](#supported-iap-versions)
|
|
16
|
+
- [Getting Started](#getting-started)
|
|
17
|
+
- [Helpful Background Information](#helpful-background-information)
|
|
18
|
+
- [Prerequisites](#prerequisites)
|
|
19
|
+
- [How to Install](#how-to-install)
|
|
20
|
+
- [Testing](#testing)
|
|
21
|
+
- [Configuration](./PROPERTIES.md)
|
|
22
|
+
- [Additional Information](#additional-information)
|
|
23
|
+
- [Enhancements](./ENHANCE.md)
|
|
24
|
+
- [Contributing](./CONTRIBUTING.md)
|
|
25
|
+
- [Helpful Links](#helpful-links)
|
|
26
|
+
- [Node Scripts](#node-scripts)
|
|
27
|
+
- [Troubleshoot](./TROUBLESHOOT.md)
|
|
28
|
+
- [License and Maintainers](#license-and-maintainers)
|
|
29
|
+
- [Product License](#product-license)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Specific to this Adapter
|
|
26
33
|
|
|
27
|
-
|
|
34
|
+
### [Authentication](./AUTH.md)
|
|
35
|
+
|
|
36
|
+
### [Sample Properties](./sampleProperties.json)
|
|
37
|
+
|
|
38
|
+
<a href="./sampleProperties.json" target="_blank">Sample Properties</a> can be used to help you configure the adapter in the Itential Automation Platform. You will need to update connectivity information such as the host, port, protocol and credentials.
|
|
39
|
+
|
|
40
|
+
### [Available Calls](./CALLS.md)
|
|
41
|
+
|
|
42
|
+
### [Swagger](./report/adapter-openapi.json)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Generic Adapter Information
|
|
28
46
|
|
|
29
|
-
|
|
47
|
+
### [Overview](./SUMMARY.md)
|
|
48
|
+
|
|
49
|
+
### Versioning
|
|
30
50
|
|
|
31
51
|
Itential Product and opensource adapters utilize SemVer for versioning. The current version of the adapter can be found in the `package.json` file or viewed in the IAP GUI on the System page. All Itential opensource adapters can be found in the <a href="https://gitlab.com/itentialopensource/adapters" target="_blank">Itential OpenSource Repository</a>.
|
|
32
52
|
|
|
@@ -34,7 +54,7 @@ Any release prior to 1.0.0 is a pre-release. Initial builds of adapters are gene
|
|
|
34
54
|
|
|
35
55
|
Release notes can be viewed in CHANGELOG.md.
|
|
36
56
|
|
|
37
|
-
|
|
57
|
+
### Supported IAP Versions
|
|
38
58
|
|
|
39
59
|
Itential Product adapters are built for particular versions of IAP and packaged with the versions they work with.
|
|
40
60
|
|
|
@@ -42,11 +62,11 @@ Itential opensource adapter as well as custom adapters built with the Itential A
|
|
|
42
62
|
|
|
43
63
|
Many of the scripts that come with all adapters built using the Itential Adapter Builder do have some dependencies on IAP or the IAP database schema and so it is possible these scripts could stop working in different versions of IAP. If you notify Itential of any issues, the Adapter Team will attempt to fix the scripts for newer releases of IAP.
|
|
44
64
|
|
|
45
|
-
|
|
65
|
+
### Getting Started
|
|
46
66
|
|
|
47
67
|
These instructions will help you get a copy of the project on your local machine for development and testing. Reading this section is also helpful for deployments as it provides you with pertinent information on prerequisites and properties.
|
|
48
68
|
|
|
49
|
-
|
|
69
|
+
#### Helpful Background Information
|
|
50
70
|
|
|
51
71
|
There is <a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter documentation available on the Itential Documentation Site</a>. This documentation includes information and examples that are helpful for:
|
|
52
72
|
|
|
@@ -67,7 +87,7 @@ Troubleshooting an Adapter
|
|
|
67
87
|
Others will be added over time.
|
|
68
88
|
Want to build a new adapter? Use the <a href="https://adapters.itential.io" target="_blank">Itential Adapter Builder</a>
|
|
69
89
|
|
|
70
|
-
|
|
90
|
+
#### Prerequisites
|
|
71
91
|
|
|
72
92
|
The following is a list of required packages for installation on the system the adapter will run on:
|
|
73
93
|
|
|
@@ -154,7 +174,7 @@ eslint-plugin-json
|
|
|
154
174
|
testdouble
|
|
155
175
|
```
|
|
156
176
|
|
|
157
|
-
|
|
177
|
+
#### How to Install
|
|
158
178
|
|
|
159
179
|
1. Set up the name space location in your IAP node_modules.
|
|
160
180
|
|
|
@@ -167,8 +187,8 @@ if the @itentialopensource directory does not exist, create it:
|
|
|
167
187
|
2. Clone/unzip/tar the adapter into your IAP environment.
|
|
168
188
|
|
|
169
189
|
```bash
|
|
170
|
-
cd
|
|
171
|
-
git clone git@gitlab.com
|
|
190
|
+
cd @itentialopensource
|
|
191
|
+
git clone git@gitlab.com:@itentialopensource/adapters/adapter-netbox_v33
|
|
172
192
|
or
|
|
173
193
|
unzip adapter-netbox_v33.zip
|
|
174
194
|
or
|
|
@@ -196,30 +216,11 @@ systemctl restart pronghorn
|
|
|
196
216
|
|
|
197
217
|
7. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
|
|
198
218
|
|
|
199
|
-
|
|
200
|
-
For an easier install of the adapter use npm run adapter:install, it will install the adapter in IAP. Please note that it can be dependent on where the adapter is installed and on the version of IAP so it is subject to fail. If using this, you can replace step 3-5 above with these:
|
|
201
|
-
|
|
202
|
-
3. Install adapter dependencies and check the adapter.
|
|
203
|
-
|
|
204
|
-
```bash
|
|
205
|
-
cd adapter-netbox_v33
|
|
206
|
-
npm run adapter:install
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
4. Restart IAP
|
|
210
|
-
|
|
211
|
-
```bash
|
|
212
|
-
systemctl restart pronghorn
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
5. Change the adapter service instance configuration (host, port, credentials, etc) in IAP Admin Essentials GUI
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
### Testing
|
|
219
|
+
#### Testing
|
|
219
220
|
|
|
220
221
|
Mocha is generally used to test all Itential Opensource Adapters. There are unit tests as well as integration tests performed. Integration tests can generally be run as standalone using mock data and running the adapter in stub mode, or as integrated. When running integrated, every effort is made to prevent environmental failures, however there is still a possibility.
|
|
221
222
|
|
|
222
|
-
|
|
223
|
+
##### Unit Testing
|
|
223
224
|
|
|
224
225
|
Unit Testing includes testing basic adapter functionality as well as error conditions that are triggered in the adapter prior to any integration. There are two ways to run unit tests. The prefered method is to use the testRunner script; however, both methods are provided here.
|
|
225
226
|
|
|
@@ -232,7 +233,7 @@ npm run test:baseunit
|
|
|
232
233
|
|
|
233
234
|
To add new unit tests, edit the `test/unit/adapterTestUnit.js` file. The tests that are already in this file should provide guidance for adding additional tests.
|
|
234
235
|
|
|
235
|
-
|
|
236
|
+
##### Integration Testing - Standalone
|
|
236
237
|
|
|
237
238
|
Standalone Integration Testing requires mock data to be provided with the entities. If this data is not provided, standalone integration testing will fail. When the adapter is set to run in stub mode (setting the stub property to true), the adapter will run through its code up to the point of making the request. It will then retrieve the mock data and return that as if it had received that data as the response from Netbox_v33. It will then translate the data so that the adapter can return the expected response to the rest of the Itential software. Standalone is the default integration test.
|
|
238
239
|
|
|
@@ -247,7 +248,7 @@ npm run test:integration
|
|
|
247
248
|
|
|
248
249
|
To add new integration tests, edit the `test/integration/adapterTestIntegration.js` file. The tests that are already in this file should provide guidance for adding additional tests.
|
|
249
250
|
|
|
250
|
-
|
|
251
|
+
##### Integration Testing
|
|
251
252
|
|
|
252
253
|
Integration Testing requires connectivity to Netbox_v33. By using the testRunner script it prevents you from having to edit the integration test. It also resets the integration test after the test is complete so that credentials are not saved in the file.
|
|
253
254
|
|
|
@@ -263,23 +264,19 @@ Test should also be written to clean up after themselves. However, it is importa
|
|
|
263
264
|
|
|
264
265
|
> **Reminder**: Do not check in code with actual credentials to systems.
|
|
265
266
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
## [Using this Adapter](./CALLS.md)
|
|
269
|
-
|
|
270
|
-
### [Authentication](./AUTH.md)
|
|
267
|
+
### [Configuration](./PROPERTIES.md)
|
|
271
268
|
|
|
272
|
-
|
|
269
|
+
### Additional Information
|
|
273
270
|
|
|
274
|
-
|
|
271
|
+
#### [Enhancements](./ENHANCE.md)
|
|
275
272
|
|
|
276
|
-
|
|
273
|
+
#### [Contributing](./CONTRIBUTING.md)
|
|
277
274
|
|
|
278
|
-
|
|
275
|
+
#### Helpful Links
|
|
279
276
|
|
|
280
277
|
<a href="https://docs.itential.com/opensource/docs/adapters" target="_blank">Adapter Technical Resources</a>
|
|
281
278
|
|
|
282
|
-
|
|
279
|
+
#### Node Scripts
|
|
283
280
|
|
|
284
281
|
There are several node scripts that now accompany the adapter. These scripts are provided to make several activities easier. Many of these scripts can have issues with different versions of IAP as they have dependencies on IAP and Mongo. If you have issues with the scripts please report them to the Itential Adapter Team. Each of these scripts are described below.
|
|
285
282
|
|
|
@@ -331,9 +328,9 @@ There are several node scripts that now accompany the adapter. These scripts are
|
|
|
331
328
|
</table>
|
|
332
329
|
<br>
|
|
333
330
|
|
|
334
|
-
|
|
331
|
+
### [Troubleshoot](./TROUBLESHOOT.md)
|
|
335
332
|
|
|
336
|
-
|
|
333
|
+
### License and Maintainers
|
|
337
334
|
|
|
338
335
|
```text
|
|
339
336
|
Itential Product Adapters are maintained by the Itential Product Team.
|
|
@@ -341,6 +338,6 @@ Itential OpenSource Adapters are maintained by the Itential Adapter Team and the
|
|
|
341
338
|
Custom Adapters are maintained by other sources.
|
|
342
339
|
```
|
|
343
340
|
|
|
344
|
-
|
|
341
|
+
### Product License
|
|
345
342
|
|
|
346
343
|
[Apache 2.0](./LICENSE)
|
package/SYSTEMINFO.md
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# NetBox
|
|
2
2
|
|
|
3
|
-
Vendor:
|
|
4
|
-
Homepage: https://
|
|
3
|
+
Vendor: NetBox
|
|
4
|
+
Homepage: https://netbox.dev/
|
|
5
5
|
|
|
6
|
-
Product:
|
|
7
|
-
Product Page: https://
|
|
6
|
+
Product: NetBox
|
|
7
|
+
Product Page: https://netbox.dev/
|
|
8
8
|
|
|
9
9
|
## Introduction
|
|
10
|
+
We classify NetBox into the Inventory domain because it contains an inventory of devices, assets, network discovery and topology information.
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
"NetBox provides the ideal "source of truth" to power network automation."
|
|
13
|
+
|
|
14
|
+
## Why Integrate
|
|
15
|
+
The NetBox adapter from Itential is used to integrate the Itential Automation Platform (IAP) with NetBox. With this adapter you have the ability to perform operations such as:
|
|
16
|
+
|
|
17
|
+
- Add and Remove Inventory Items.
|
|
18
|
+
- Create Subnet
|
|
19
|
+
- Create IP Record
|
|
20
|
+
- Get Next Available IP
|
|
21
|
+
- Get Circuit
|
|
22
|
+
- Get L2VPN
|
|
23
|
+
- Get Device
|
|
24
|
+
|
|
25
|
+
## Additional Product Documentation
|
|
26
|
+
The [API documents for Netbox](https://demo.netbox.dev/)
|
package/TAB1.md
CHANGED
|
@@ -2,4 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
This adapter is used to integrate the Itential Automation Platform (IAP) with the Netbox_v33 System. The API that was used to build the adapter for Netbox_v33 is usually available in the report directory of this adapter. The adapter utilizes the Netbox_v33 API to provide the integrations that are deemed pertinent to IAP. The ReadMe file is intended to provide information on this adapter it is generated from various other Markdown files.
|
|
4
4
|
|
|
5
|
+
## Details
|
|
6
|
+
The NetBox adapter from Itential is used to integrate the Itential Automation Platform (IAP) with NetBox. With this adapter you have the ability to perform operations such as:
|
|
7
|
+
|
|
8
|
+
- Add and Remove Inventory Items.
|
|
9
|
+
- Create Subnet
|
|
10
|
+
- Create IP Record
|
|
11
|
+
- Get Next Available IP
|
|
12
|
+
- Get Circuit
|
|
13
|
+
- Get L2VPN
|
|
14
|
+
- Get Device
|
|
15
|
+
|
|
5
16
|
For further technical details on how to install and use this adapter, please click the Technical Documentation tab.
|