@itentialopensource/adapter-vmware_vcenter 0.13.1 → 0.13.3

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 CHANGED
@@ -798,5 +798,17 @@ Specific adapter calls are built based on the API of the VMware vCenter. The Ada
798
798
  <td style="padding:15px">{base_path}/{version}/vcenter/vm-template/library-items/{pathv1}?{query}</td>
799
799
  <td style="padding:15px">Yes</td>
800
800
  </tr>
801
+ <tr>
802
+ <td style="padding:15px">findLibrary(action, body, callback)</td>
803
+ <td style="padding:15px">Find Library</td>
804
+ <td style="padding:15px">{base_path}/{version}/com/vmware/content/library?{query}</td>
805
+ <td style="padding:15px">Yes</td>
806
+ </tr>
807
+ <tr>
808
+ <td style="padding:15px">findLibraryItem(action, body, callback)</td>
809
+ <td style="padding:15px">Find Library Item</td>
810
+ <td style="padding:15px">{base_path}/{version}/com/vmware/content/library/item?{query}</td>
811
+ <td style="padding:15px">Yes</td>
812
+ </tr>
801
813
  </table>
802
814
  <br>
package/CHANGELOG.md CHANGED
@@ -1,4 +1,20 @@
1
1
 
2
+ ## 0.13.3 [08-15-2024]
3
+
4
+ * Changes made at 2024.08.14_19:56PM
5
+
6
+ See merge request itentialopensource/adapters/adapter-vmware_vcenter!28
7
+
8
+ ---
9
+
10
+ ## 0.13.2 [08-14-2024]
11
+
12
+ * Add library calls
13
+
14
+ See merge request itentialopensource/adapters/adapter-vmware_vcenter!27
15
+
16
+ ---
17
+
2
18
  ## 0.13.1 [08-07-2024]
3
19
 
4
20
  * Changes made at 2024.08.06_22:04PM
package/adapter.js CHANGED
@@ -8082,6 +8082,182 @@ class VmwareVCenter extends AdapterBaseCl {
8082
8082
  return callback(null, errorObj);
8083
8083
  }
8084
8084
  }
8085
+
8086
+ /**
8087
+ * @function findLibrary
8088
+ * @pronghornType method
8089
+ * @name findLibrary
8090
+ * @summary Find Library
8091
+ *
8092
+ * @param {string} action - action param
8093
+ * @param {object} body - body param
8094
+ * @param {getCallback} callback - a callback function to return the result
8095
+ * @return {object} results - An object containing the response of the action
8096
+ *
8097
+ * @route {POST} /findLibrary
8098
+ * @roles admin
8099
+ * @task true
8100
+ */
8101
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
8102
+ findLibrary(action, body, callback) {
8103
+ const meth = 'adapter-findLibrary';
8104
+ const origin = `${this.id}-${meth}`;
8105
+ log.trace(origin);
8106
+
8107
+ if (this.suspended && this.suspendMode === 'error') {
8108
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8109
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8110
+ return callback(null, errorObj);
8111
+ }
8112
+
8113
+ /* HERE IS WHERE YOU VALIDATE DATA */
8114
+ if (action === undefined || action === null || action === '') {
8115
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['action'], null, null, null);
8116
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8117
+ return callback(null, errorObj);
8118
+ }
8119
+ if (body === undefined || body === null || body === '') {
8120
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
8121
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8122
+ return callback(null, errorObj);
8123
+ }
8124
+
8125
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
8126
+ const queryParamsAvailable = { action };
8127
+ const queryParams = {};
8128
+ const pathVars = [];
8129
+ const bodyVars = body;
8130
+
8131
+ // loop in template. long callback arg name to avoid identifier conflicts
8132
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
8133
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
8134
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
8135
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
8136
+ }
8137
+ });
8138
+
8139
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8140
+ // see adapter code documentation for more information on the request object's fields
8141
+ const reqObj = {
8142
+ payload: bodyVars,
8143
+ uriPathVars: pathVars,
8144
+ uriQuery: queryParams
8145
+ };
8146
+
8147
+ try {
8148
+ // Make the call -
8149
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8150
+ return this.requestHandlerInst.identifyRequest('Library', 'findLibrary', reqObj, true, (irReturnData, irReturnError) => {
8151
+ // if we received an error or their is no response on the results
8152
+ // return an error
8153
+ if (irReturnError) {
8154
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8155
+ return callback(null, irReturnError);
8156
+ }
8157
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8158
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['findLibrary'], null, null, null);
8159
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8160
+ return callback(null, errorObj);
8161
+ }
8162
+
8163
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8164
+ // return the response
8165
+ return callback(irReturnData, null);
8166
+ });
8167
+ } catch (ex) {
8168
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
8169
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8170
+ return callback(null, errorObj);
8171
+ }
8172
+ }
8173
+
8174
+ /**
8175
+ * @function findLibraryItem
8176
+ * @pronghornType method
8177
+ * @name findLibraryItem
8178
+ * @summary Find Library Item
8179
+ *
8180
+ * @param {string} action - action param
8181
+ * @param {object} body - body param
8182
+ * @param {getCallback} callback - a callback function to return the result
8183
+ * @return {object} results - An object containing the response of the action
8184
+ *
8185
+ * @route {POST} /findLibraryItem
8186
+ * @roles admin
8187
+ * @task true
8188
+ */
8189
+ /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
8190
+ findLibraryItem(action, body, callback) {
8191
+ const meth = 'adapter-findLibraryItem';
8192
+ const origin = `${this.id}-${meth}`;
8193
+ log.trace(origin);
8194
+
8195
+ if (this.suspended && this.suspendMode === 'error') {
8196
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
8197
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8198
+ return callback(null, errorObj);
8199
+ }
8200
+
8201
+ /* HERE IS WHERE YOU VALIDATE DATA */
8202
+ if (action === undefined || action === null || action === '') {
8203
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['action'], null, null, null);
8204
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8205
+ return callback(null, errorObj);
8206
+ }
8207
+ if (body === undefined || body === null || body === '') {
8208
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
8209
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8210
+ return callback(null, errorObj);
8211
+ }
8212
+
8213
+ /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
8214
+ const queryParamsAvailable = { action };
8215
+ const queryParams = {};
8216
+ const pathVars = [];
8217
+ const bodyVars = body;
8218
+
8219
+ // loop in template. long callback arg name to avoid identifier conflicts
8220
+ Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
8221
+ if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
8222
+ && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
8223
+ queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
8224
+ }
8225
+ });
8226
+
8227
+ // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
8228
+ // see adapter code documentation for more information on the request object's fields
8229
+ const reqObj = {
8230
+ payload: bodyVars,
8231
+ uriPathVars: pathVars,
8232
+ uriQuery: queryParams
8233
+ };
8234
+
8235
+ try {
8236
+ // Make the call -
8237
+ // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
8238
+ return this.requestHandlerInst.identifyRequest('Library', 'findLibraryItem', reqObj, true, (irReturnData, irReturnError) => {
8239
+ // if we received an error or their is no response on the results
8240
+ // return an error
8241
+ if (irReturnError) {
8242
+ /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
8243
+ return callback(null, irReturnError);
8244
+ }
8245
+ if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
8246
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['findLibraryItem'], null, null, null);
8247
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8248
+ return callback(null, errorObj);
8249
+ }
8250
+
8251
+ /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
8252
+ // return the response
8253
+ return callback(irReturnData, null);
8254
+ });
8255
+ } catch (ex) {
8256
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
8257
+ log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
8258
+ return callback(null, errorObj);
8259
+ }
8260
+ }
8085
8261
  }
8086
8262
 
8087
8263
  module.exports = VmwareVCenter;
@@ -0,0 +1,44 @@
1
+ {
2
+ "actions": [
3
+ {
4
+ "name": "findLibrary",
5
+ "protocol": "REST",
6
+ "method": "POST",
7
+ "entitypath": "{base_path}/{version}/com/vmware/content/library?{query}",
8
+ "requestSchema": "schema.json",
9
+ "responseSchema": "schema.json",
10
+ "timeout": 0,
11
+ "sendEmpty": false,
12
+ "requestDatatype": "JSON",
13
+ "responseDatatype": "JSON",
14
+ "headers": {},
15
+ "responseObjects": [
16
+ {
17
+ "type": "default",
18
+ "key": "",
19
+ "mockFile": ""
20
+ }
21
+ ]
22
+ },
23
+ {
24
+ "name": "findLibraryItem",
25
+ "protocol": "REST",
26
+ "method": "POST",
27
+ "entitypath": "{base_path}/{version}/com/vmware/content/library/item?{query}",
28
+ "requestSchema": "schema.json",
29
+ "responseSchema": "schema.json",
30
+ "timeout": 0,
31
+ "sendEmpty": false,
32
+ "requestDatatype": "JSON",
33
+ "responseDatatype": "JSON",
34
+ "headers": {},
35
+ "responseObjects": [
36
+ {
37
+ "type": "default",
38
+ "key": "",
39
+ "mockFile": ""
40
+ }
41
+ ]
42
+ }
43
+ ]
44
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "$id": "schema.json",
3
+ "type": "object",
4
+ "schema": "http://json-schema.org/draft-07/schema#",
5
+ "translate": true,
6
+ "dynamicfields": true,
7
+ "properties": {
8
+ "ph_request_type": {
9
+ "type": "string",
10
+ "description": "type of request (internal to adapter)",
11
+ "default": "findLibrary",
12
+ "enum": [
13
+ "findLibrary",
14
+ "findLibraryItem"
15
+ ],
16
+ "external_name": "ph_request_type"
17
+ },
18
+ "action": {
19
+ "type": "string",
20
+ "description": "",
21
+ "parse": false,
22
+ "encode": false,
23
+ "encrypt": {
24
+ "type": "AES",
25
+ "key": ""
26
+ },
27
+ "external_name": "~action"
28
+ }
29
+ },
30
+ "definitions": {}
31
+ }
package/metadata.json CHANGED
@@ -72,7 +72,9 @@
72
72
  "link": "https://developer.vmware.com/apis/vsphere-automation/latest/vcenter/",
73
73
  "public": true
74
74
  }
75
- ]
75
+ ],
76
+ "workshopLinks": [],
77
+ "workshopHomePage": "https://www.itential.com/get-started/"
76
78
  },
77
79
  "assets": [],
78
80
  "relatedItems": {
@@ -83,5 +85,6 @@
83
85
  "transformationProjects": [],
84
86
  "exampleProjects": []
85
87
  },
86
- "supportLevel": "community"
88
+ "supportLevel": "community",
89
+ "techAlliance": false
87
90
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itentialopensource/adapter-vmware_vcenter",
3
- "version": "0.13.1",
3
+ "version": "0.13.3",
4
4
  "description": "This adapter integrates with system Vmware_vCenter",
5
5
  "main": "adapter.js",
6
6
  "systemName": "VMware vCenter",
@@ -57,12 +57,12 @@
57
57
  "@itentialopensource/adapter-utils": "^5.6.0",
58
58
  "acorn": "^8.12.1",
59
59
  "ajv": "^8.17.1",
60
- "axios": "^1.7.2",
60
+ "axios": "^1.7.4",
61
61
  "commander": "^11.0.0",
62
62
  "dns-lookup-promise": "^1.0.4",
63
63
  "fs-extra": "^11.2.0",
64
64
  "json-query": "^2.2.2",
65
- "mocha": "^10.7.0",
65
+ "mocha": "^10.7.3",
66
66
  "mocha-param": "^2.0.1",
67
67
  "mongodb": "^4.16.0",
68
68
  "ping": "^0.4.4",
package/pronghorn.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "admin"
9
9
  ],
10
10
  "methods": [
11
- {
11
+ {
12
12
  "name": "iapUpdateAdapterConfiguration",
13
13
  "summary": "Updates the adapter configuration",
14
14
  "description": "Updates the adapter configuration file with the provided changes",
@@ -177,7 +177,7 @@
177
177
  },
178
178
  "task": true
179
179
  },
180
- {
180
+ {
181
181
  "name": "iapFindAdapterPath",
182
182
  "summary": "Provides the ability to see if a particular API path is supported by the adapter",
183
183
  "description": "Provides the ability to see if a particular API path is supported by the adapter",
@@ -212,7 +212,7 @@
212
212
  },
213
213
  "task": true
214
214
  },
215
- {
215
+ {
216
216
  "name": "iapTroubleshootAdapter",
217
217
  "summary": "Runs troubleshoot script for adapter",
218
218
  "description": "Runs troubleshoot script for adapter",
@@ -256,7 +256,7 @@
256
256
  },
257
257
  "task": true
258
258
  },
259
- {
259
+ {
260
260
  "name": "iapRunAdapterHealthcheck",
261
261
  "summary": "Runs healthcheck script for adapter",
262
262
  "description": "Runs healthcheck script for adapter",
@@ -279,7 +279,7 @@
279
279
  },
280
280
  "task": true
281
281
  },
282
- {
282
+ {
283
283
  "name": "iapRunAdapterConnectivity",
284
284
  "summary": "Runs connectivity check script for adapter",
285
285
  "description": "Runs connectivity check script for adapter",
@@ -302,7 +302,7 @@
302
302
  },
303
303
  "task": true
304
304
  },
305
- {
305
+ {
306
306
  "name": "iapRunAdapterBasicGet",
307
307
  "summary": "Runs basicGet script for adapter",
308
308
  "description": "Runs basicGet script for adapter",
@@ -325,7 +325,7 @@
325
325
  },
326
326
  "task": true
327
327
  },
328
- {
328
+ {
329
329
  "name": "iapMoveAdapterEntitiesToDB",
330
330
  "summary": "Moves entities from an adapter into the IAP database",
331
331
  "description": "Moves entities from an adapter into the IAP database",
@@ -762,7 +762,7 @@
762
762
  },
763
763
  "task": true
764
764
  },
765
- {
765
+ {
766
766
  "name": "genericAdapterRequest",
767
767
  "summary": "Makes the requested generic call",
768
768
  "description": "Makes the requested generic call",
@@ -841,7 +841,7 @@
841
841
  },
842
842
  "task": true
843
843
  },
844
- {
844
+ {
845
845
  "name": "genericAdapterRequestNoBasePath",
846
846
  "summary": "Makes the requested generic call",
847
847
  "description": "Makes the requested generic call",
@@ -5138,6 +5138,94 @@
5138
5138
  "path": "/postVcentervmtemplatedeploy"
5139
5139
  },
5140
5140
  "task": true
5141
+ },
5142
+ {
5143
+ "name": "findLibrary",
5144
+ "summary": "Find Library",
5145
+ "description": "Find Library",
5146
+ "input": [
5147
+ {
5148
+ "name": "action",
5149
+ "type": "string",
5150
+ "info": ": string",
5151
+ "required": true,
5152
+ "schema": {
5153
+ "title": "action",
5154
+ "type": "string"
5155
+ }
5156
+ },
5157
+ {
5158
+ "name": "body",
5159
+ "type": "object",
5160
+ "info": ": object",
5161
+ "required": true,
5162
+ "schema": {
5163
+ "title": "body",
5164
+ "type": "object"
5165
+ }
5166
+ }
5167
+ ],
5168
+ "output": {
5169
+ "name": "result",
5170
+ "type": "object",
5171
+ "description": "A JSON Object containing status, code and the result",
5172
+ "schema": {
5173
+ "title": "result",
5174
+ "type": "object"
5175
+ }
5176
+ },
5177
+ "roles": [
5178
+ "admin"
5179
+ ],
5180
+ "route": {
5181
+ "verb": "POST",
5182
+ "path": "/findLibrary"
5183
+ },
5184
+ "task": true
5185
+ },
5186
+ {
5187
+ "name": "findLibraryItem",
5188
+ "summary": "Find Library Item",
5189
+ "description": "Find Library Item",
5190
+ "input": [
5191
+ {
5192
+ "name": "action",
5193
+ "type": "string",
5194
+ "info": ": string",
5195
+ "required": true,
5196
+ "schema": {
5197
+ "title": "action",
5198
+ "type": "string"
5199
+ }
5200
+ },
5201
+ {
5202
+ "name": "body",
5203
+ "type": "object",
5204
+ "info": ": object",
5205
+ "required": true,
5206
+ "schema": {
5207
+ "title": "body",
5208
+ "type": "object"
5209
+ }
5210
+ }
5211
+ ],
5212
+ "output": {
5213
+ "name": "result",
5214
+ "type": "object",
5215
+ "description": "A JSON Object containing status, code and the result",
5216
+ "schema": {
5217
+ "title": "result",
5218
+ "type": "object"
5219
+ }
5220
+ },
5221
+ "roles": [
5222
+ "admin"
5223
+ ],
5224
+ "route": {
5225
+ "verb": "POST",
5226
+ "path": "/findLibraryItem"
5227
+ },
5228
+ "task": true
5141
5229
  }
5142
5230
  ]
5143
5231
  }
Binary file
@@ -1,10 +1,10 @@
1
1
  {
2
- "version": "0.12.5",
3
- "configLines": 6999,
2
+ "version": "0.13.1",
3
+ "configLines": 7087,
4
4
  "scriptLines": 1783,
5
- "codeLines": 9541,
6
- "testLines": 9903,
7
- "testCases": 479,
8
- "totalCodeLines": 21227,
9
- "wfTasks": 121
5
+ "codeLines": 9717,
6
+ "testLines": 10047,
7
+ "testCases": 487,
8
+ "totalCodeLines": 21547,
9
+ "wfTasks": 123
10
10
  }
@@ -3607,5 +3607,57 @@ describe('[integration] Vmware_vCenter Adapter Test', () => {
3607
3607
  }
3608
3608
  }).timeout(attemptTimeout);
3609
3609
  });
3610
+
3611
+ const libraryFindLibraryBodyParam = {};
3612
+ describe('#findLibrary - errors', () => {
3613
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3614
+ try {
3615
+ a.findLibrary('fakedata', libraryFindLibraryBodyParam, (data, error) => {
3616
+ try {
3617
+ if (stub) {
3618
+ const displayE = 'Error 400 received on request';
3619
+ runErrorAsserts(data, error, 'AD.500', 'Test-vmware_vcenter-connectorRest-handleEndResponse', displayE);
3620
+ } else {
3621
+ runCommonAsserts(data, error);
3622
+ }
3623
+ saveMockData('Library', 'findLibrary', 'default', data);
3624
+ done();
3625
+ } catch (err) {
3626
+ log.error(`Test Failure: ${err}`);
3627
+ done(err);
3628
+ }
3629
+ });
3630
+ } catch (error) {
3631
+ log.error(`Adapter Exception: ${error}`);
3632
+ done(error);
3633
+ }
3634
+ }).timeout(attemptTimeout);
3635
+ });
3636
+
3637
+ const libraryFindLibraryItemBodyParam = {};
3638
+ describe('#findLibraryItem - errors', () => {
3639
+ it('should work if integrated but since no mockdata should error when run standalone', (done) => {
3640
+ try {
3641
+ a.findLibraryItem('fakedata', libraryFindLibraryItemBodyParam, (data, error) => {
3642
+ try {
3643
+ if (stub) {
3644
+ const displayE = 'Error 400 received on request';
3645
+ runErrorAsserts(data, error, 'AD.500', 'Test-vmware_vcenter-connectorRest-handleEndResponse', displayE);
3646
+ } else {
3647
+ runCommonAsserts(data, error);
3648
+ }
3649
+ saveMockData('Library', 'findLibraryItem', 'default', data);
3650
+ done();
3651
+ } catch (err) {
3652
+ log.error(`Test Failure: ${err}`);
3653
+ done(err);
3654
+ }
3655
+ });
3656
+ } catch (error) {
3657
+ log.error(`Adapter Exception: ${error}`);
3658
+ done(error);
3659
+ }
3660
+ }).timeout(attemptTimeout);
3661
+ });
3610
3662
  });
3611
3663
  });
@@ -315,10 +315,10 @@ describe('[unit] Vmware_vCenter Adapter Test', () => {
315
315
  assert.notEqual(null, packageDotJson.dependencies);
316
316
  assert.notEqual('', packageDotJson.dependencies);
317
317
  assert.equal('^8.17.1', packageDotJson.dependencies.ajv);
318
- assert.equal('^1.7.2', packageDotJson.dependencies.axios);
318
+ assert.equal('^1.7.4', packageDotJson.dependencies.axios);
319
319
  assert.equal('^11.0.0', packageDotJson.dependencies.commander);
320
320
  assert.equal('^11.2.0', packageDotJson.dependencies['fs-extra']);
321
- assert.equal('^10.7.0', packageDotJson.dependencies.mocha);
321
+ assert.equal('^10.7.3', packageDotJson.dependencies.mocha);
322
322
  assert.equal('^2.0.1', packageDotJson.dependencies['mocha-param']);
323
323
  assert.equal('^0.4.4', packageDotJson.dependencies.ping);
324
324
  assert.equal('^1.4.10', packageDotJson.dependencies['readline-sync']);
@@ -5034,5 +5034,97 @@ describe('[unit] Vmware_vCenter Adapter Test', () => {
5034
5034
  }
5035
5035
  }).timeout(attemptTimeout);
5036
5036
  });
5037
+
5038
+ describe('#findLibrary - errors', () => {
5039
+ it('should have a findLibrary function', (done) => {
5040
+ try {
5041
+ assert.equal(true, typeof a.findLibrary === 'function');
5042
+ done();
5043
+ } catch (error) {
5044
+ log.error(`Test Failure: ${error}`);
5045
+ done(error);
5046
+ }
5047
+ }).timeout(attemptTimeout);
5048
+ it('should error if - missing action', (done) => {
5049
+ try {
5050
+ a.findLibrary(null, null, (data, error) => {
5051
+ try {
5052
+ const displayE = 'action is required';
5053
+ runErrorAsserts(data, error, 'AD.300', 'Test-vmware_vcenter-adapter-findLibrary', displayE);
5054
+ done();
5055
+ } catch (err) {
5056
+ log.error(`Test Failure: ${err}`);
5057
+ done(err);
5058
+ }
5059
+ });
5060
+ } catch (error) {
5061
+ log.error(`Adapter Exception: ${error}`);
5062
+ done(error);
5063
+ }
5064
+ }).timeout(attemptTimeout);
5065
+ it('should error if - missing body', (done) => {
5066
+ try {
5067
+ a.findLibrary('fakeparam', null, (data, error) => {
5068
+ try {
5069
+ const displayE = 'body is required';
5070
+ runErrorAsserts(data, error, 'AD.300', 'Test-vmware_vcenter-adapter-findLibrary', displayE);
5071
+ done();
5072
+ } catch (err) {
5073
+ log.error(`Test Failure: ${err}`);
5074
+ done(err);
5075
+ }
5076
+ });
5077
+ } catch (error) {
5078
+ log.error(`Adapter Exception: ${error}`);
5079
+ done(error);
5080
+ }
5081
+ }).timeout(attemptTimeout);
5082
+ });
5083
+
5084
+ describe('#findLibraryItem - errors', () => {
5085
+ it('should have a findLibraryItem function', (done) => {
5086
+ try {
5087
+ assert.equal(true, typeof a.findLibraryItem === 'function');
5088
+ done();
5089
+ } catch (error) {
5090
+ log.error(`Test Failure: ${error}`);
5091
+ done(error);
5092
+ }
5093
+ }).timeout(attemptTimeout);
5094
+ it('should error if - missing action', (done) => {
5095
+ try {
5096
+ a.findLibraryItem(null, null, (data, error) => {
5097
+ try {
5098
+ const displayE = 'action is required';
5099
+ runErrorAsserts(data, error, 'AD.300', 'Test-vmware_vcenter-adapter-findLibraryItem', displayE);
5100
+ done();
5101
+ } catch (err) {
5102
+ log.error(`Test Failure: ${err}`);
5103
+ done(err);
5104
+ }
5105
+ });
5106
+ } catch (error) {
5107
+ log.error(`Adapter Exception: ${error}`);
5108
+ done(error);
5109
+ }
5110
+ }).timeout(attemptTimeout);
5111
+ it('should error if - missing body', (done) => {
5112
+ try {
5113
+ a.findLibraryItem('fakeparam', null, (data, error) => {
5114
+ try {
5115
+ const displayE = 'body is required';
5116
+ runErrorAsserts(data, error, 'AD.300', 'Test-vmware_vcenter-adapter-findLibraryItem', displayE);
5117
+ done();
5118
+ } catch (err) {
5119
+ log.error(`Test Failure: ${err}`);
5120
+ done(err);
5121
+ }
5122
+ });
5123
+ } catch (error) {
5124
+ log.error(`Adapter Exception: ${error}`);
5125
+ done(error);
5126
+ }
5127
+ }).timeout(attemptTimeout);
5128
+ });
5037
5129
  });
5038
5130
  });