@itentialopensource/adapter-netbox 0.9.0 → 0.11.0
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 +9 -15
- package/CALLS.md +2447 -22
- package/CHANGELOG.md +16 -0
- package/CONTRIBUTING.md +1 -160
- package/ENHANCE.md +2 -2
- package/README.md +32 -23
- package/SYSTEMINFO.md +12 -3
- package/adapter.js +162 -333
- package/adapterBase.js +549 -879
- package/changelogs/changelog.md +181 -0
- package/metadata.json +69 -0
- package/package.json +24 -24
- package/pronghorn.json +470 -138
- package/propertiesSchema.json +422 -31
- package/refs?service=git-upload-pack +0 -0
- package/report/adapter-openapi.json +52536 -0
- package/report/adapter-openapi.yaml +37346 -0
- package/report/adapterInfo.json +8 -8
- package/report/updateReport1691508495299.json +120 -0
- package/report/updateReport1692202980865.json +120 -0
- package/report/updateReport1694466470665.json +120 -0
- package/sampleProperties.json +65 -4
- package/test/integration/adapterTestBasicGet.js +2 -4
- package/test/integration/adapterTestConnectivity.js +91 -42
- package/test/integration/adapterTestIntegration.js +130 -2
- package/test/unit/adapterBaseTestUnit.js +388 -313
- package/test/unit/adapterTestUnit.js +338 -112
- package/utils/adapterInfo.js +1 -1
- package/utils/addAuth.js +1 -1
- package/utils/artifactize.js +1 -1
- package/utils/checkMigrate.js +1 -1
- package/utils/entitiesToDB.js +2 -2
- package/utils/findPath.js +1 -1
- package/utils/methodDocumentor.js +260 -0
- package/utils/modify.js +13 -15
- package/utils/packModificationScript.js +1 -1
- package/utils/pre-commit.sh +2 -0
- package/utils/taskMover.js +309 -0
- package/utils/tbScript.js +89 -34
- package/utils/tbUtils.js +41 -21
- package/utils/testRunner.js +1 -1
- package/utils/troubleshootingAdapter.js +9 -6
- package/workflows/README.md +0 -3
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
|
|
2
|
+
## 0.9.0 [08-05-2022]
|
|
3
|
+
|
|
4
|
+
* Add dcim location calls
|
|
5
|
+
|
|
6
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!16
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 0.8.0 [05-23-2022]
|
|
11
|
+
|
|
12
|
+
* Migration to the latest Adapter Foundation
|
|
13
|
+
|
|
14
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!15
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## 0.7.1 [03-07-2022]
|
|
19
|
+
|
|
20
|
+
- Fix graphql with sendGetBody
|
|
21
|
+
- Migration
|
|
22
|
+
- Add some items to .gitignore (e.g. DS_Store) to keep them out of the repos.
|
|
23
|
+
- Changes to the README (some typo fixes - Add how to extend the adapter). Split the README into various markdown files (AUTH, BROKER, CALLS, ENHANCE, PROPERTIES, SUMMARY, SYSTEMINFO, TROUBLESHOOT)
|
|
24
|
+
- Fix the issues with Confluence in the markdowns (Tables, Lists, Links)
|
|
25
|
+
- Add scripts for easier authentication, removing hooks, etc
|
|
26
|
+
- Script changes (install script as well as database changes in other scripts)
|
|
27
|
+
- Double # of path vars on generic call
|
|
28
|
+
- Update versions of foundation (e.g. adapter-utils)
|
|
29
|
+
- Update npm publish so it supports https
|
|
30
|
+
- Update dependencies
|
|
31
|
+
- Add preinstall for minimist
|
|
32
|
+
- Fix new lint issues that came from eslint dependency change
|
|
33
|
+
- Add more thorough Unit tests for standard files (Package, Pronghorn, Properties (Schema and Sample)
|
|
34
|
+
- Add the adapter type in the package.json
|
|
35
|
+
- Add AdapterInfo.js script
|
|
36
|
+
- Add json-query dependency
|
|
37
|
+
- Add the propertiesDecorators.json for product encryption
|
|
38
|
+
- Change the name of internal IAP/Adapter methods to avoid collisions and make more obvious in Workflow - iapRunAdapterBasicGet, iapRunAdapterConnectivity, iapRunAdapterHealthcheck, iapTroubleshootAdapter, iapGetAdapterQueue, iapUnsuspendAdapter, iapSuspendAdapter, iapFindAdapterPath, iapUpdateAdapterConfiguration, iapGetAdapterWorkflowFunctions
|
|
39
|
+
- Add the adapter config in the database support - iapMoveAdapterEntitiesToDB
|
|
40
|
+
- Add standard broker calls - hasEntities, getDevice, getDevicesFiltered, isAlive, getConfig and iapGetDeviceCount
|
|
41
|
+
- Add genericAdapterRequest that does not use the base_path and version so that the path can be unique - genericAdapterRequestNoBasePath
|
|
42
|
+
- Add AdapterInfo.json
|
|
43
|
+
- Add systemName for documentation
|
|
44
|
+
|
|
45
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!14
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 0.7.0 [02-14-2022]
|
|
50
|
+
|
|
51
|
+
- Migration and added a call for graphql
|
|
52
|
+
|
|
53
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!13
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 0.6.4 [07-13-2021]
|
|
58
|
+
|
|
59
|
+
- The current healthcheck /api/docs/ returns HTML payload that the adapter does not appear able to parse as is. The /api/status returns a minimal JSON response and appears suitable for a healthcheck request to use in the adapter-netbox code.
|
|
60
|
+
|
|
61
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!12
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 0.6.3 [03-17-2021]
|
|
66
|
+
|
|
67
|
+
- Fix descriptions and summaries
|
|
68
|
+
|
|
69
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!11
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 0.6.2 [03-10-2021]
|
|
74
|
+
|
|
75
|
+
- Migration to bring up to the latest foundation
|
|
76
|
+
- Change to .eslintignore (adapter_modification directory)
|
|
77
|
+
- Change to README.md (new properties, new scripts, new processes)
|
|
78
|
+
- Changes to adapterBase.js (new methods)
|
|
79
|
+
- Changes to package.json (new scripts, dependencies)
|
|
80
|
+
- Changes to propertiesSchema.json (new properties and changes to existing)
|
|
81
|
+
- Changes to the Unit test
|
|
82
|
+
- Adding several test files, utils files and .generic entity
|
|
83
|
+
- Fix order of scripts and dependencies in package.json
|
|
84
|
+
- Fix order of properties in propertiesSchema.json
|
|
85
|
+
- Update sampleProperties, unit and integration tests to have all new properties.
|
|
86
|
+
- Add all new calls to adapter.js and pronghorn.json
|
|
87
|
+
- Add suspend piece to older methods
|
|
88
|
+
|
|
89
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!10
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 0.6.1 [01-28-2021]
|
|
94
|
+
|
|
95
|
+
- Changed version of netbox integrating with to 2.8.5 also provide schemas and allow for custom fields in get calls to be available as filters
|
|
96
|
+
|
|
97
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!9
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## 0.6.0 [07-27-2020]
|
|
102
|
+
|
|
103
|
+
- Changed version of netbox integrating with to 2.8.5 also provide schemas and allow for custom fields in get calls to be available as filters
|
|
104
|
+
|
|
105
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!8
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## 0.5.3 [07-08-2020]
|
|
110
|
+
|
|
111
|
+
- Update the adapter to the latest foundation
|
|
112
|
+
|
|
113
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!7
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## 0.5.2 [01-13-2020]
|
|
118
|
+
|
|
119
|
+
- bring up to the latest adapter foundation
|
|
120
|
+
|
|
121
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!6
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 0.5.1 [11-18-2019]
|
|
126
|
+
|
|
127
|
+
- Changes to the healthcheck so it is a tested path
|
|
128
|
+
|
|
129
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!5
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## 0.5.0 [11-08-2019]
|
|
134
|
+
|
|
135
|
+
- Update the adapter to the latest adapter foundation.
|
|
136
|
+
- Updating to adapter-utils 4.24.3 (automatic)
|
|
137
|
+
- Add sample token schemas (manual)
|
|
138
|
+
- Adding placement property to getToken response schema (manual - before encrypt)
|
|
139
|
+
- Adding sso default into action.json for getToken (manual - before response object)
|
|
140
|
+
- Add new adapter properties for metrics & mock (save_metric, mongo and return_raw) (automatic - check place manual before stub)
|
|
141
|
+
- Update sample properties to include new properties (manual)
|
|
142
|
+
- Update integration test for raw mockdata (automatic)
|
|
143
|
+
- Update test properties (manual)
|
|
144
|
+
- Changes to artifactize (automatic)
|
|
145
|
+
- Update type in sampleProperties so it is correct for the adapter (manual)
|
|
146
|
+
- Update the readme (automatic)
|
|
147
|
+
|
|
148
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!4
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## 0.4.0 [09-16-2019]
|
|
153
|
+
|
|
154
|
+
- Update the adapter to the latest adapter foundation
|
|
155
|
+
|
|
156
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!3
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
## 0.3.0 [07-30-2019] & 0.2.0 [07-17-2019]
|
|
160
|
+
|
|
161
|
+
- Migrate to the latest adapter foundation, categorize and prepare for app artifact
|
|
162
|
+
|
|
163
|
+
See merge request itentialopensource/adapters/inventory/adapter-netbox!2
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## 0.1.2 [04-23-2019]
|
|
168
|
+
|
|
169
|
+
- Added keys, update and set versions that this adapter was built with
|
|
170
|
+
|
|
171
|
+
See merge request itentialopensource/adapters/adapter-netbox!1
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## 0.1.1 [04-16-2019]
|
|
176
|
+
|
|
177
|
+
- Initial Commit
|
|
178
|
+
|
|
179
|
+
See commit ca1af4e
|
|
180
|
+
|
|
181
|
+
---
|
package/metadata.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "adapter-netbox",
|
|
3
|
+
"webName": "Adapter for Integration to NetBox",
|
|
4
|
+
"vendor": "NetBox",
|
|
5
|
+
"product": "NetBox",
|
|
6
|
+
"osVersion": [],
|
|
7
|
+
"apiVersions": [
|
|
8
|
+
"2.5",
|
|
9
|
+
"2.8"
|
|
10
|
+
],
|
|
11
|
+
"iapVersions": [
|
|
12
|
+
"2021.1.x",
|
|
13
|
+
"2021.2.x",
|
|
14
|
+
"2022.1.x",
|
|
15
|
+
"2023.1.x"
|
|
16
|
+
],
|
|
17
|
+
"method": "REST",
|
|
18
|
+
"type": "Adapter",
|
|
19
|
+
"domains": [
|
|
20
|
+
"Inventory"
|
|
21
|
+
],
|
|
22
|
+
"tags": [
|
|
23
|
+
"Onboarding",
|
|
24
|
+
"IPAM",
|
|
25
|
+
"CMDB"
|
|
26
|
+
],
|
|
27
|
+
"useCases": [
|
|
28
|
+
"Onboard, update, manage or remove Devices",
|
|
29
|
+
"Reserve, assign, unassign, or release IP Addresses",
|
|
30
|
+
"Reserve, assign, unassign, or release Ports",
|
|
31
|
+
"Create Device Backups/Snapshots for Audit, Compliance, and Rollbacks",
|
|
32
|
+
"Validate Device Configuration before/after Network Changes",
|
|
33
|
+
"Add, update, manage or remove assets to/from CMDB systems"
|
|
34
|
+
],
|
|
35
|
+
"deprecated": {
|
|
36
|
+
"isDeprecated": false
|
|
37
|
+
},
|
|
38
|
+
"brokerSince": "",
|
|
39
|
+
"documentation": {
|
|
40
|
+
"storeLink": "",
|
|
41
|
+
"npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-netbox",
|
|
42
|
+
"repoLink": "https://gitlab.com/itentialopensource/adapters/inventory/adapter-netbox.git",
|
|
43
|
+
"docLink": "https://docs.itential.com/opensource/docs/netbox",
|
|
44
|
+
"demoLinks": [
|
|
45
|
+
"https://www.itential.com/resource/demo/evolving-from-a-source-of-truth-to-automation-orchestration-with-netbox-onug/",
|
|
46
|
+
"https://www.itential.com/resource/demo/integrating-netbox-as-a-source-of-truth-for-network-automation/",
|
|
47
|
+
"https://www.itential.com/solutions/integrations/netbox-network-automation/"
|
|
48
|
+
],
|
|
49
|
+
"faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
|
|
50
|
+
"contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
|
|
51
|
+
"issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
|
|
52
|
+
"webLink": "https://www.itential.com/adapters/netbox/",
|
|
53
|
+
"vendorLink": "https://netbox.dev/",
|
|
54
|
+
"productLink": "https://netbox.dev/",
|
|
55
|
+
"apiLinks": [
|
|
56
|
+
"https://demo.netbox.dev/",
|
|
57
|
+
"https://netbox.grid.uchicago.edu/api/docs/"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"assets": [],
|
|
61
|
+
"relatedItems": {
|
|
62
|
+
"adapters": [],
|
|
63
|
+
"integrations": [],
|
|
64
|
+
"ecosystemApplications": [],
|
|
65
|
+
"workflowProjects": [],
|
|
66
|
+
"transformationProjects": [],
|
|
67
|
+
"exampleProjects": []
|
|
68
|
+
}
|
|
69
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itentialopensource/adapter-netbox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "This adapter integrates with system Netbox",
|
|
5
5
|
"main": "adapter.js",
|
|
6
6
|
"systemName": "NetBox",
|
|
7
7
|
"wizardVersion": "2.44.7",
|
|
8
|
-
"engineVersion": "1.
|
|
8
|
+
"engineVersion": "1.67.8",
|
|
9
9
|
"adapterType": "http",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"artifactize": "npm i && node utils/packModificationScript.js",
|
|
12
|
-
"preinstall": "node utils/setup.js
|
|
12
|
+
"preinstall": "node utils/setup.js",
|
|
13
|
+
"deinstall": "node utils/removeHooks.js",
|
|
13
14
|
"lint": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js",
|
|
14
15
|
"lint:errors": "node --max_old_space_size=4096 ./node_modules/eslint/bin/eslint.js . --ext .json --ext .js --quiet",
|
|
15
16
|
"test:baseunit": "mocha test/unit/adapterBaseTestUnit.js --LOG=error",
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
"adapter:migrate": "node utils/modify.js -m",
|
|
24
25
|
"adapter:update": "node utils/modify.js -u",
|
|
25
26
|
"adapter:revert": "node utils/modify.js -r",
|
|
26
|
-
"troubleshoot": "node utils/tbScript.js",
|
|
27
|
+
"troubleshoot": "node utils/tbScript.js troubleshoot",
|
|
27
28
|
"healthcheck": "node utils/tbScript.js healthcheck",
|
|
28
29
|
"basicget": "node utils/tbScript.js basicget",
|
|
29
30
|
"connectivity": "node utils/tbScript.js connectivity",
|
|
@@ -53,32 +54,31 @@
|
|
|
53
54
|
"author": "Itential",
|
|
54
55
|
"homepage": "https://gitlab.com/itentialopensource/adapters/inventory/adapter-netbox#readme",
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"@itentialopensource/adapter-utils": "^
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
57
|
+
"@itentialopensource/adapter-utils": "^5.1.7",
|
|
58
|
+
"acorn": "^8.10.0",
|
|
59
|
+
"ajv": "^8.12.0",
|
|
60
|
+
"axios": "^1.4.0",
|
|
61
|
+
"commander": "^11.0.0",
|
|
62
|
+
"dns-lookup-promise": "^1.0.4",
|
|
63
|
+
"fs-extra": "^11.1.1",
|
|
61
64
|
"json-query": "^2.2.2",
|
|
62
|
-
"mocha": "^
|
|
65
|
+
"mocha": "^10.2.0",
|
|
63
66
|
"mocha-param": "^2.0.1",
|
|
64
|
-
"mongodb": "^4.
|
|
65
|
-
"network-diagnostics": "^0.5.3",
|
|
67
|
+
"mongodb": "^4.16.0",
|
|
66
68
|
"nyc": "^15.1.0",
|
|
69
|
+
"ping": "^0.4.4",
|
|
70
|
+
"prompts": "^2.4.2",
|
|
67
71
|
"readline-sync": "^1.4.10",
|
|
68
|
-
"semver": "^7.3
|
|
69
|
-
"winston": "^3.
|
|
72
|
+
"semver": "^7.5.3",
|
|
73
|
+
"winston": "^3.9.0"
|
|
70
74
|
},
|
|
71
75
|
"devDependencies": {
|
|
72
|
-
"chai": "^4.3.
|
|
73
|
-
"eslint": "^
|
|
74
|
-
"eslint-config-airbnb-base": "^
|
|
75
|
-
"eslint-plugin-import": "^2.
|
|
76
|
-
"eslint-plugin-json": "^3.
|
|
77
|
-
"
|
|
78
|
-
"testdouble": "^3.16.1"
|
|
79
|
-
},
|
|
80
|
-
"resolutions": {
|
|
81
|
-
"minimist": "^1.2.5"
|
|
76
|
+
"chai": "^4.3.7",
|
|
77
|
+
"eslint": "^8.44.0",
|
|
78
|
+
"eslint-config-airbnb-base": "^15.0.0",
|
|
79
|
+
"eslint-plugin-import": "^2.27.5",
|
|
80
|
+
"eslint-plugin-json": "^3.1.0",
|
|
81
|
+
"testdouble": "^3.18.0"
|
|
82
82
|
},
|
|
83
83
|
"private": false
|
|
84
84
|
}
|