@itentialopensource/adapter-viptela 0.12.0 → 0.12.2
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/CALLS.md +193 -144
- package/CHANGELOG.md +16 -0
- package/README.md +10 -6
- package/adapterBase.js +103 -0
- package/metadata.json +18 -7
- package/package.json +4 -4
- package/propertiesSchema.json +64 -0
- package/refs?service=git-upload-pack +0 -0
- package/report/adapterInfo.json +5 -5
- package/report/updateReport1694453336318.json +120 -0
- package/sampleProperties.json +12 -0
- package/test/unit/adapterBaseTestUnit.js +6 -6
- package/test/unit/adapterTestUnit.js +9 -3
- package/utils/methodDocumentor.js +57 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
## 0.12.2 [09-11-2023]
|
|
3
|
+
|
|
4
|
+
* more migration & metadata changes
|
|
5
|
+
|
|
6
|
+
See merge request itentialopensource/adapters/sd-wan/adapter-viptela!33
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 0.12.1 [09-11-2023]
|
|
11
|
+
|
|
12
|
+
* Revert "More migration changes"
|
|
13
|
+
|
|
14
|
+
See merge request itentialopensource/adapters/sd-wan/adapter-viptela!32
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
2
18
|
## 0.12.0 [08-16-2023]
|
|
3
19
|
|
|
4
20
|
* migration changes
|
package/README.md
CHANGED
|
@@ -14,6 +14,7 @@ Some of the page links in this document and links to other GitLab files do not w
|
|
|
14
14
|
- [Testing](#testing)
|
|
15
15
|
- [Configuration](./PROPERTIES.md)
|
|
16
16
|
- [Using this Adapter](./CALLS.md)
|
|
17
|
+
- [Authentication](./AUTH.md)
|
|
17
18
|
- [Additional Information](#additional-information)
|
|
18
19
|
- [Enhancements](./ENHANCE.md)
|
|
19
20
|
- [Contributing](./CONTRIBUTING.md)
|
|
@@ -47,17 +48,20 @@ These instructions will help you get a copy of the project on your local machine
|
|
|
47
48
|
|
|
48
49
|
### Helpful Background Information
|
|
49
50
|
|
|
50
|
-
There is
|
|
51
|
+
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:
|
|
51
52
|
|
|
52
53
|
```text
|
|
53
54
|
Authentication
|
|
54
|
-
|
|
55
|
+
IAP Service Instance Configuration
|
|
55
56
|
Code Files
|
|
56
|
-
Action
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
Endpoint Configuration (Action & Schema)
|
|
58
|
+
Mock Data
|
|
59
|
+
Adapter Generic Methods
|
|
60
|
+
Headers
|
|
61
|
+
Security
|
|
59
62
|
Linting and Testing
|
|
60
|
-
|
|
63
|
+
Build an Adapter
|
|
64
|
+
Troubleshooting an Adapter
|
|
61
65
|
```
|
|
62
66
|
|
|
63
67
|
Others will be added over time.
|
package/adapterBase.js
CHANGED
|
@@ -1027,6 +1027,24 @@ class AdapterBase extends EventEmitterCl {
|
|
|
1027
1027
|
return this.requestHandlerInst.hasEntities(entityType, entityList, callback);
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
|
+
/**
|
|
1031
|
+
* @summary Determines if this adapter supports any in a list of entities
|
|
1032
|
+
*
|
|
1033
|
+
* @function hasEntitiesAuth
|
|
1034
|
+
* @param {String} entityType - the entity type to check for
|
|
1035
|
+
* @param {Array} entityList - the list of entities we are looking for
|
|
1036
|
+
* @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
|
|
1037
|
+
*
|
|
1038
|
+
* @param {Callback} callback - A map where the entity is the key and the
|
|
1039
|
+
* value is true or false
|
|
1040
|
+
*/
|
|
1041
|
+
hasEntitiesAuth(entityType, entityList, callOptions, callback) {
|
|
1042
|
+
const origin = `${this.id}-adapterBase-hasEntitiesAuth`;
|
|
1043
|
+
log.trace(origin);
|
|
1044
|
+
|
|
1045
|
+
return this.requestHandlerInst.hasEntitiesAuth(entityType, entityList, callOptions, callback);
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1030
1048
|
/**
|
|
1031
1049
|
* @summary Get Appliance that match the deviceName
|
|
1032
1050
|
*
|
|
@@ -1043,6 +1061,23 @@ class AdapterBase extends EventEmitterCl {
|
|
|
1043
1061
|
return this.requestHandlerInst.getDevice(deviceName, callback);
|
|
1044
1062
|
}
|
|
1045
1063
|
|
|
1064
|
+
/**
|
|
1065
|
+
* @summary Get Appliance that match the deviceName
|
|
1066
|
+
*
|
|
1067
|
+
* @function getDeviceAuth
|
|
1068
|
+
* @param {String} deviceName - the deviceName to find (required)
|
|
1069
|
+
* @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
|
|
1070
|
+
*
|
|
1071
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
1072
|
+
* (appliance) or the error
|
|
1073
|
+
*/
|
|
1074
|
+
getDeviceAuth(deviceName, callOptions, callback) {
|
|
1075
|
+
const origin = `${this.id}-adapterBase-getDeviceAuth`;
|
|
1076
|
+
log.trace(origin);
|
|
1077
|
+
|
|
1078
|
+
return this.requestHandlerInst.getDeviceAuth(deviceName, callOptions, callback);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1046
1081
|
/**
|
|
1047
1082
|
* @summary Get Appliances that match the filter
|
|
1048
1083
|
*
|
|
@@ -1059,6 +1094,23 @@ class AdapterBase extends EventEmitterCl {
|
|
|
1059
1094
|
return this.requestHandlerInst.getDevicesFiltered(options, callback);
|
|
1060
1095
|
}
|
|
1061
1096
|
|
|
1097
|
+
/**
|
|
1098
|
+
* @summary Get Appliances that match the filter
|
|
1099
|
+
*
|
|
1100
|
+
* @function getDevicesFilteredAuth
|
|
1101
|
+
* @param {Object} options - the data to use to filter the appliances (optional)
|
|
1102
|
+
* @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
|
|
1103
|
+
*
|
|
1104
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
1105
|
+
* (appliances) or the error
|
|
1106
|
+
*/
|
|
1107
|
+
getDevicesFilteredAuth(options, callOptions, callback) {
|
|
1108
|
+
const origin = `${this.id}-adapterBase-getDevicesFilteredAuth`;
|
|
1109
|
+
log.trace(origin);
|
|
1110
|
+
|
|
1111
|
+
return this.requestHandlerInst.getDevicesFilteredAuth(options, callOptions, callback);
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1062
1114
|
/**
|
|
1063
1115
|
* @summary Gets the status for the provided appliance
|
|
1064
1116
|
*
|
|
@@ -1075,6 +1127,23 @@ class AdapterBase extends EventEmitterCl {
|
|
|
1075
1127
|
return this.requestHandlerInst.isAlive(deviceName, callback);
|
|
1076
1128
|
}
|
|
1077
1129
|
|
|
1130
|
+
/**
|
|
1131
|
+
* @summary Gets the status for the provided appliance
|
|
1132
|
+
*
|
|
1133
|
+
* @function isAliveAuth
|
|
1134
|
+
* @param {String} deviceName - the deviceName of the appliance. (required)
|
|
1135
|
+
* @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
|
|
1136
|
+
*
|
|
1137
|
+
* @param {configCallback} callback - callback function to return the result
|
|
1138
|
+
* (appliance isAliveAuth) or the error
|
|
1139
|
+
*/
|
|
1140
|
+
isAliveAuth(deviceName, callOptions, callback) {
|
|
1141
|
+
const origin = `${this.id}-adapterBase-isAliveAuth`;
|
|
1142
|
+
log.trace(origin);
|
|
1143
|
+
|
|
1144
|
+
return this.requestHandlerInst.isAliveAuth(deviceName, callOptions, callback);
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1078
1147
|
/**
|
|
1079
1148
|
* @summary Gets a config for the provided Appliance
|
|
1080
1149
|
*
|
|
@@ -1092,6 +1161,24 @@ class AdapterBase extends EventEmitterCl {
|
|
|
1092
1161
|
return this.requestHandlerInst.getConfig(deviceName, format, callback);
|
|
1093
1162
|
}
|
|
1094
1163
|
|
|
1164
|
+
/**
|
|
1165
|
+
* @summary Gets a config for the provided Appliance
|
|
1166
|
+
*
|
|
1167
|
+
* @function getConfigAuth
|
|
1168
|
+
* @param {String} deviceName - the deviceName of the appliance. (required)
|
|
1169
|
+
* @param {String} format - the desired format of the config. (optional)
|
|
1170
|
+
* @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
|
|
1171
|
+
*
|
|
1172
|
+
* @param {configCallback} callback - callback function to return the result
|
|
1173
|
+
* (appliance config) or the error
|
|
1174
|
+
*/
|
|
1175
|
+
getConfigAuth(deviceName, format, callOptions, callback) {
|
|
1176
|
+
const origin = `${this.id}-adapterBase-getConfigAuth`;
|
|
1177
|
+
log.trace(origin);
|
|
1178
|
+
|
|
1179
|
+
return this.requestHandlerInst.getConfigAuth(deviceName, format, callOptions, callback);
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1095
1182
|
/**
|
|
1096
1183
|
* @summary Gets the device count from the system
|
|
1097
1184
|
*
|
|
@@ -1107,6 +1194,22 @@ class AdapterBase extends EventEmitterCl {
|
|
|
1107
1194
|
return this.requestHandlerInst.iapGetDeviceCount(callback);
|
|
1108
1195
|
}
|
|
1109
1196
|
|
|
1197
|
+
/**
|
|
1198
|
+
* @summary Gets the device count from the system
|
|
1199
|
+
*
|
|
1200
|
+
* @function iapGetDeviceCountAuth
|
|
1201
|
+
* @param {Object} callOptions - Additional options used to make request, including auth headers, AWS service, or datatypes
|
|
1202
|
+
*
|
|
1203
|
+
* @param {getCallback} callback - callback function to return the result
|
|
1204
|
+
* (count) or the error
|
|
1205
|
+
*/
|
|
1206
|
+
iapGetDeviceCountAuth(callOptions, callback) {
|
|
1207
|
+
const origin = `${this.id}-adapterBase-iapGetDeviceCountAuth`;
|
|
1208
|
+
log.trace(origin);
|
|
1209
|
+
|
|
1210
|
+
return this.requestHandlerInst.iapGetDeviceCountAuth(callOptions, callback);
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1110
1213
|
/* ********************************************** */
|
|
1111
1214
|
/* */
|
|
1112
1215
|
/* EXPOSES GENERIC HANDLER */
|
package/metadata.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adapter-viptela",
|
|
3
|
+
"webName": "Adapter for Integration to Cisco Viptela",
|
|
3
4
|
"vendor": "Cisco",
|
|
4
5
|
"product": "Viptela",
|
|
5
6
|
"osVersion": [
|
|
@@ -12,14 +13,19 @@
|
|
|
12
13
|
"2022.1.x",
|
|
13
14
|
"2023.1.x"
|
|
14
15
|
],
|
|
15
|
-
"method": "REST
|
|
16
|
+
"method": "REST",
|
|
16
17
|
"type": "Adapter",
|
|
17
|
-
"example": "",
|
|
18
18
|
"domains": [
|
|
19
19
|
"Inventory",
|
|
20
|
-
"SD-WAN
|
|
20
|
+
"SD-WAN (SASE)"
|
|
21
|
+
],
|
|
22
|
+
"tags": [
|
|
23
|
+
"Configuration Management"
|
|
24
|
+
],
|
|
25
|
+
"useCases": [
|
|
26
|
+
"Device Onboarding",
|
|
27
|
+
"Reboot Device"
|
|
21
28
|
],
|
|
22
|
-
"tags": [],
|
|
23
29
|
"deprecated": {
|
|
24
30
|
"isDeprecated": false
|
|
25
31
|
},
|
|
@@ -29,6 +35,10 @@
|
|
|
29
35
|
"npmLink": "https://www.npmjs.com/package/@itentialopensource/adapter-viptela",
|
|
30
36
|
"repoLink": "https://gitlab.com/itentialopensource/adapters/sd-wan/adapter-viptela",
|
|
31
37
|
"docLink": "https://docs.itential.com/opensource/docs/cisco-viptela",
|
|
38
|
+
"demoLinks": [
|
|
39
|
+
"https://www.itential.com/industries/communications-service-providers/sdwan-network-automation/",
|
|
40
|
+
"https://www.itential.com/solutions/sdwan-automation-orchestration/"
|
|
41
|
+
],
|
|
32
42
|
"faqLink": "https://docs.itential.com/opensource/docs/troubleshooting-an-adapter",
|
|
33
43
|
"contributeLink": "https://gitlab.com/itentialopensource/adapters/contributing-guide",
|
|
34
44
|
"issueLink": "https://itential.atlassian.net/servicedesk/customer/portals",
|
|
@@ -39,12 +49,13 @@
|
|
|
39
49
|
"https://developer.cisco.com/docs/sdwan/#!sd-wan-vmanage-v20-12"
|
|
40
50
|
]
|
|
41
51
|
},
|
|
52
|
+
"assets": [],
|
|
42
53
|
"relatedItems": {
|
|
43
54
|
"adapters": [],
|
|
44
55
|
"integrations": [],
|
|
45
56
|
"ecosystemApplications": [],
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
57
|
+
"workflowProjects": [],
|
|
58
|
+
"transformationProjects": [],
|
|
59
|
+
"exampleProjects": []
|
|
49
60
|
}
|
|
50
61
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itentialopensource/adapter-viptela",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "This adapter integrates with system Viptela",
|
|
5
5
|
"main": "adapter.js",
|
|
6
6
|
"systemName": "Viptela",
|
|
7
7
|
"wizardVersion": "2.44.7",
|
|
8
|
-
"engineVersion": "1.67.
|
|
8
|
+
"engineVersion": "1.67.8",
|
|
9
9
|
"adapterType": "http",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"artifactize": "npm i && node utils/packModificationScript.js",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"author": "Itential",
|
|
55
55
|
"homepage": "https://gitlab.com/itentialopensource/adapters/sd-wan/adapter-viptela#readme",
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@itentialopensource/adapter-utils": "^5.1.
|
|
57
|
+
"@itentialopensource/adapter-utils": "^5.1.7",
|
|
58
|
+
"acorn": "^8.10.0",
|
|
58
59
|
"ajv": "^8.12.0",
|
|
59
60
|
"axios": "^1.4.0",
|
|
60
61
|
"commander": "^11.0.0",
|
|
61
62
|
"dns-lookup-promise": "^1.0.4",
|
|
62
|
-
"esprima": "^4.0.1",
|
|
63
63
|
"fs-extra": "^11.1.1",
|
|
64
64
|
"json-query": "^2.2.2",
|
|
65
65
|
"mocha": "^10.2.0",
|
package/propertiesSchema.json
CHANGED
|
@@ -1063,6 +1063,38 @@
|
|
|
1063
1063
|
"description": "The method of the call to getDevicesFiltered",
|
|
1064
1064
|
"default": "GET"
|
|
1065
1065
|
},
|
|
1066
|
+
"pagination": {
|
|
1067
|
+
"type": "object",
|
|
1068
|
+
"description": "todo",
|
|
1069
|
+
"properties": {
|
|
1070
|
+
"offsetVar": {
|
|
1071
|
+
"type": "string",
|
|
1072
|
+
"description": "Name of variable that defines how to go to next set of results"
|
|
1073
|
+
},
|
|
1074
|
+
"limitVar": {
|
|
1075
|
+
"type": "string",
|
|
1076
|
+
"description": "Name of variable that defines the max results returned in a request"
|
|
1077
|
+
},
|
|
1078
|
+
"incrementBy": {
|
|
1079
|
+
"type": "string",
|
|
1080
|
+
"enum": [
|
|
1081
|
+
"limit",
|
|
1082
|
+
"page"
|
|
1083
|
+
],
|
|
1084
|
+
"description": "How to incremenet offset. Default limit",
|
|
1085
|
+
"default": "limit"
|
|
1086
|
+
},
|
|
1087
|
+
"requestLocation": {
|
|
1088
|
+
"type": "string",
|
|
1089
|
+
"enum": [
|
|
1090
|
+
"query",
|
|
1091
|
+
"body"
|
|
1092
|
+
],
|
|
1093
|
+
"description": "Where in request the pagination data goes",
|
|
1094
|
+
"default": "query"
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
},
|
|
1066
1098
|
"query": {
|
|
1067
1099
|
"type": "object",
|
|
1068
1100
|
"description": "The json object with query parameters of the call to getDevicesFiltered",
|
|
@@ -1487,6 +1519,38 @@
|
|
|
1487
1519
|
"description": "The method of the call to getDevice",
|
|
1488
1520
|
"default": "GET"
|
|
1489
1521
|
},
|
|
1522
|
+
"pagination": {
|
|
1523
|
+
"type": "object",
|
|
1524
|
+
"description": "todo",
|
|
1525
|
+
"properties": {
|
|
1526
|
+
"offsetVar": {
|
|
1527
|
+
"type": "string",
|
|
1528
|
+
"description": "Name of variable that defines how to go to next set of results"
|
|
1529
|
+
},
|
|
1530
|
+
"limitVar": {
|
|
1531
|
+
"type": "string",
|
|
1532
|
+
"description": "Name of variable that defines the max results returned in a request"
|
|
1533
|
+
},
|
|
1534
|
+
"incrementBy": {
|
|
1535
|
+
"type": "string",
|
|
1536
|
+
"enum": [
|
|
1537
|
+
"limit",
|
|
1538
|
+
"page"
|
|
1539
|
+
],
|
|
1540
|
+
"description": "How to incremenet offset. Default limit",
|
|
1541
|
+
"default": "limit"
|
|
1542
|
+
},
|
|
1543
|
+
"requestLocation": {
|
|
1544
|
+
"type": "string",
|
|
1545
|
+
"enum": [
|
|
1546
|
+
"query",
|
|
1547
|
+
"body"
|
|
1548
|
+
],
|
|
1549
|
+
"description": "Where in request the pagination data goes",
|
|
1550
|
+
"default": "query"
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
},
|
|
1490
1554
|
"query": {
|
|
1491
1555
|
"type": "object",
|
|
1492
1556
|
"description": "The json object with query parameters of the call to getDevice",
|
|
Binary file
|
package/report/adapterInfo.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"configLines":
|
|
2
|
+
"version": "0.12.1",
|
|
3
|
+
"configLines": 21544,
|
|
4
4
|
"scriptLines": 1783,
|
|
5
|
-
"codeLines":
|
|
6
|
-
"testLines":
|
|
5
|
+
"codeLines": 45621,
|
|
6
|
+
"testLines": 28255,
|
|
7
7
|
"testCases": 1486,
|
|
8
|
-
"totalCodeLines":
|
|
8
|
+
"totalCodeLines": 75659,
|
|
9
9
|
"wfTasks": 589
|
|
10
10
|
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
{
|
|
2
|
+
"errors": [],
|
|
3
|
+
"statistics": [
|
|
4
|
+
{
|
|
5
|
+
"owner": "errorJson",
|
|
6
|
+
"description": "New adapter errors available for use",
|
|
7
|
+
"value": 0
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"owner": "errorJson",
|
|
11
|
+
"description": "Adapter errors no longer available for use",
|
|
12
|
+
"value": 0
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"owner": "errorJson",
|
|
16
|
+
"description": "Adapter errors that have been updated (e.g. recommendation changes)",
|
|
17
|
+
"value": 31
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"owner": "packageJson",
|
|
21
|
+
"description": "Number of production dependencies",
|
|
22
|
+
"value": 17
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"owner": "packageJson",
|
|
26
|
+
"description": "Number of development dependencies",
|
|
27
|
+
"value": 6
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"owner": "packageJson",
|
|
31
|
+
"description": "Number of npm scripts",
|
|
32
|
+
"value": 22
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"owner": "packageJson",
|
|
36
|
+
"description": "Runtime Library dependency",
|
|
37
|
+
"value": "^5.1.7"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"owner": "propertiesSchemaJson",
|
|
41
|
+
"description": "Adapter properties defined in the propertiesSchema file",
|
|
42
|
+
"value": 76
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"owner": "markdown",
|
|
46
|
+
"description": "Number of lines in the README.md",
|
|
47
|
+
"value": 347
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"owner": "markdown",
|
|
51
|
+
"description": "Number of lines in the SUMMARY.md",
|
|
52
|
+
"value": 9
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"owner": "markdown",
|
|
56
|
+
"description": "Number of lines in the PROPERTIES.md",
|
|
57
|
+
"value": 642
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"owner": "markdown",
|
|
61
|
+
"description": "Number of lines in the TROUBLESHOOT.md",
|
|
62
|
+
"value": 48
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"owner": "markdown",
|
|
66
|
+
"description": "Number of lines in the ENHANCE.md",
|
|
67
|
+
"value": 70
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"owner": "markdown",
|
|
71
|
+
"description": "Number of lines in the BROKER.md",
|
|
72
|
+
"value": 70
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"owner": "unitTestJS",
|
|
76
|
+
"description": "Number of lines of code in unit tests",
|
|
77
|
+
"value": 12106
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"owner": "unitTestJS",
|
|
81
|
+
"description": "Number of unit tests",
|
|
82
|
+
"value": 854
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"owner": "integrationTestJS",
|
|
86
|
+
"description": "Number of lines of code in integration tests",
|
|
87
|
+
"value": 14897
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"owner": "integrationTestJS",
|
|
91
|
+
"description": "Number of integration tests",
|
|
92
|
+
"value": 562
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"owner": "staticFile",
|
|
96
|
+
"description": "Number of lines of code in adapterBase.js",
|
|
97
|
+
"value": 1453
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"owner": "staticFile",
|
|
101
|
+
"description": "Number of static files added",
|
|
102
|
+
"value": 36
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"owner": "Overall",
|
|
106
|
+
"description": "Total lines of Code",
|
|
107
|
+
"value": 28456
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"owner": "Overall",
|
|
111
|
+
"description": "Total Tests",
|
|
112
|
+
"value": 1416
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"owner": "Overall",
|
|
116
|
+
"description": "Total Files",
|
|
117
|
+
"value": 6
|
|
118
|
+
}
|
|
119
|
+
]
|
|
120
|
+
}
|
package/sampleProperties.json
CHANGED
|
@@ -144,6 +144,12 @@
|
|
|
144
144
|
{
|
|
145
145
|
"path": "/device",
|
|
146
146
|
"method": "GET",
|
|
147
|
+
"pagination": {
|
|
148
|
+
"offsetVar": "",
|
|
149
|
+
"limitVar": "",
|
|
150
|
+
"incrementBy": "limit",
|
|
151
|
+
"requestLocation": "query"
|
|
152
|
+
},
|
|
147
153
|
"query": {},
|
|
148
154
|
"body": {},
|
|
149
155
|
"headers": {},
|
|
@@ -221,6 +227,12 @@
|
|
|
221
227
|
{
|
|
222
228
|
"path": "/device",
|
|
223
229
|
"method": "GET",
|
|
230
|
+
"pagination": {
|
|
231
|
+
"offsetVar": "",
|
|
232
|
+
"limitVar": "",
|
|
233
|
+
"incrementBy": "limit",
|
|
234
|
+
"requestLocation": "query"
|
|
235
|
+
},
|
|
224
236
|
"query": {},
|
|
225
237
|
"body": {},
|
|
226
238
|
"headers": {},
|
|
@@ -391,12 +391,12 @@ describe('[unit] Adapter Base Test', () => {
|
|
|
391
391
|
});
|
|
392
392
|
it('should return a list of functions', (done) => {
|
|
393
393
|
const returnedFunctions = ['checkActionFiles', 'checkProperties', 'connect', 'encryptProperty', 'genericAdapterRequest', 'genericAdapterRequestNoBasePath',
|
|
394
|
-
'getAllFunctions', 'getConfig', 'getDevice', '
|
|
395
|
-
'
|
|
396
|
-
'
|
|
397
|
-
'
|
|
398
|
-
'
|
|
399
|
-
'prependListener', 'prependOnceListener', 'rawListeners', 'removeAllListeners', 'removeListener', 'setMaxListeners'];
|
|
394
|
+
'getAllFunctions', 'getConfig', 'getConfigAuth', 'getDevice', 'getDeviceAuth', 'getDevicesFiltered', 'getDevicesFilteredAuth', 'hasEntities', 'hasEntitiesAuth',
|
|
395
|
+
'healthCheck', 'iapActivateTasks', 'iapDeactivateTasks', 'iapExpandedGenericAdapterRequest', 'iapFindAdapterPath', 'iapGetAdapterInventory', 'iapGetAdapterQueue',
|
|
396
|
+
'iapGetAdapterWorkflowFunctions', 'iapGetDeviceCount', 'iapGetDeviceCountAuth', 'iapMoveAdapterEntitiesToDB', 'iapPopulateEntityCache', 'iapRetrieveEntitiesCache',
|
|
397
|
+
'iapRunAdapterBasicGet', 'iapRunAdapterConnectivity', 'iapRunAdapterHealthcheck', 'iapRunAdapterLint', 'iapRunAdapterTests', 'iapSuspendAdapter', 'iapTroubleshootAdapter',
|
|
398
|
+
'iapUnsuspendAdapter', 'iapUpdateAdapterConfiguration', 'isAlive', 'isAliveAuth', 'refreshProperties', 'addListener', 'emit', 'eventNames', 'getMaxListeners',
|
|
399
|
+
'listenerCount', 'listeners', 'off', 'on', 'once', 'prependListener', 'prependOnceListener', 'rawListeners', 'removeAllListeners', 'removeListener', 'setMaxListeners'];
|
|
400
400
|
try {
|
|
401
401
|
const expectedFunctions = a.getAllFunctions();
|
|
402
402
|
try {
|
|
@@ -887,6 +887,8 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
887
887
|
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.isAlive);
|
|
888
888
|
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getConfig);
|
|
889
889
|
assert.notEqual(undefined, sampleDotJson.properties.devicebroker.getCount);
|
|
890
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache);
|
|
891
|
+
assert.notEqual(undefined, sampleDotJson.properties.cache.entities);
|
|
890
892
|
done();
|
|
891
893
|
} catch (error) {
|
|
892
894
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1453,6 +1455,10 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
1453
1455
|
try {
|
|
1454
1456
|
const metadataDotJson = require('../../metadata.json');
|
|
1455
1457
|
assert.equal('adapter-viptela', metadataDotJson.name);
|
|
1458
|
+
assert.notEqual(undefined, metadataDotJson.webName);
|
|
1459
|
+
assert.notEqual(null, metadataDotJson.webName);
|
|
1460
|
+
assert.notEqual('', metadataDotJson.webName);
|
|
1461
|
+
assert.equal('Adapter', metadataDotJson.type);
|
|
1456
1462
|
done();
|
|
1457
1463
|
} catch (error) {
|
|
1458
1464
|
log.error(`Test Failure: ${error}`);
|
|
@@ -1480,9 +1486,9 @@ describe('[unit] Viptela Adapter Test', () => {
|
|
|
1480
1486
|
assert.notEqual(undefined, metadataDotJson.relatedItems.adapters);
|
|
1481
1487
|
assert.notEqual(undefined, metadataDotJson.relatedItems.integrations);
|
|
1482
1488
|
assert.notEqual(undefined, metadataDotJson.relatedItems.ecosystemApplications);
|
|
1483
|
-
assert.notEqual(undefined, metadataDotJson.relatedItems.
|
|
1484
|
-
assert.notEqual(undefined, metadataDotJson.relatedItems.
|
|
1485
|
-
assert.notEqual(undefined, metadataDotJson.relatedItems.
|
|
1489
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.workflowProjects);
|
|
1490
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.transformationProjects);
|
|
1491
|
+
assert.notEqual(undefined, metadataDotJson.relatedItems.exampleProjects);
|
|
1486
1492
|
done();
|
|
1487
1493
|
} catch (error) {
|
|
1488
1494
|
log.error(`Test Failure: ${error}`);
|