@itentialopensource/adapter-vmware_vcenter 0.5.3 → 0.7.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/.eslintignore +1 -0
- package/.eslintrc.js +12 -12
- package/CHANGELOG.md +32 -0
- package/README.md +209 -29
- package/adapter.js +1476 -34
- package/adapterBase.js +289 -11
- package/entities/.generic/action.json +109 -0
- package/entities/.generic/schema.json +23 -0
- package/entities/.system/action.json +3 -3
- package/entities/.system/schemaTokenReq.json +2 -2
- package/entities/Vmtemplatelibraryitems/action.json +25 -0
- package/entities/Vmtemplatelibraryitems/schema.json +19 -0
- package/error.json +6 -0
- package/package.json +42 -21
- package/pronghorn.json +614 -0
- package/propertiesSchema.json +56 -9
- package/refs?service=git-upload-pack +0 -0
- package/report/updateReport1594310791028.json +95 -0
- package/report/updateReport1615860501665.json +95 -0
- package/report/updateReport1643047821981.json +95 -0
- package/sampleProperties.json +20 -5
- package/test/integration/adapterTestBasicGet.js +85 -0
- package/test/integration/adapterTestConnectivity.js +93 -0
- package/test/integration/adapterTestIntegration.js +59 -6
- package/test/unit/adapterBaseTestUnit.js +944 -0
- package/test/unit/adapterTestUnit.js +683 -10
- package/utils/addAuth.js +94 -0
- package/utils/basicGet.js +50 -0
- package/utils/checkMigrate.js +63 -0
- package/utils/entitiesToDB.js +224 -0
- package/utils/findPath.js +74 -0
- package/utils/modify.js +154 -0
- package/utils/packModificationScript.js +1 -1
- package/utils/patches2bundledDeps.js +90 -0
- package/utils/removeHooks.js +20 -0
- package/utils/tbScript.js +169 -0
- package/utils/tbUtils.js +451 -0
- package/utils/troubleshootingAdapter.js +190 -0
package/adapterBase.js
CHANGED
|
@@ -22,6 +22,10 @@ const AjvCl = require('ajv');
|
|
|
22
22
|
const PropUtilCl = require('@itentialopensource/adapter-utils').PropertyUtility;
|
|
23
23
|
const RequestHandlerCl = require('@itentialopensource/adapter-utils').RequestHandler;
|
|
24
24
|
|
|
25
|
+
const entitiesToDB = require(path.join(__dirname, 'utils/entitiesToDB'));
|
|
26
|
+
const troubleshootingAdapter = require(path.join(__dirname, 'utils/troubleshootingAdapter'));
|
|
27
|
+
const tbUtils = require(path.join(__dirname, 'utils/tbUtils'));
|
|
28
|
+
|
|
25
29
|
let propUtil = null;
|
|
26
30
|
|
|
27
31
|
/*
|
|
@@ -155,9 +159,11 @@ class AdapterBase extends EventEmitterCl {
|
|
|
155
159
|
this.id = prongid;
|
|
156
160
|
this.propUtilInst = new PropUtilCl(prongid, __dirname);
|
|
157
161
|
propUtil = this.propUtilInst;
|
|
158
|
-
|
|
162
|
+
this.initProps = properties;
|
|
159
163
|
this.alive = false;
|
|
160
164
|
this.healthy = false;
|
|
165
|
+
this.suspended = false;
|
|
166
|
+
this.suspendMode = 'pause';
|
|
161
167
|
this.caching = false;
|
|
162
168
|
this.repeatCacheCount = 0;
|
|
163
169
|
this.allowFailover = 'AD.300';
|
|
@@ -242,6 +248,7 @@ class AdapterBase extends EventEmitterCl {
|
|
|
242
248
|
// properties that this code cares about
|
|
243
249
|
this.healthcheckType = this.allProps.healthcheck.type;
|
|
244
250
|
this.healthcheckInterval = this.allProps.healthcheck.frequency;
|
|
251
|
+
this.healthcheckQuery = this.allProps.healthcheck.query_object;
|
|
245
252
|
|
|
246
253
|
// set the failover codes from properties
|
|
247
254
|
if (this.allProps.request.failover_codes) {
|
|
@@ -271,11 +278,11 @@ class AdapterBase extends EventEmitterCl {
|
|
|
271
278
|
}
|
|
272
279
|
|
|
273
280
|
/**
|
|
274
|
-
*
|
|
281
|
+
* updateAdapterConfiguration is used to update any of the adapter configuration files. This
|
|
275
282
|
* allows customers to make changes to adapter configuration without having to be on the
|
|
276
283
|
* file system.
|
|
277
284
|
*
|
|
278
|
-
* @function
|
|
285
|
+
* @function updateAdapterConfiguration
|
|
279
286
|
* @param {string} configFile - the name of the file being updated (required)
|
|
280
287
|
* @param {Object} changes - an object containing all of the changes = formatted like the configuration file (required)
|
|
281
288
|
* @param {string} entity - the entity to be changed, if an action, schema or mock data file (optional)
|
|
@@ -283,8 +290,8 @@ class AdapterBase extends EventEmitterCl {
|
|
|
283
290
|
* @param {string} action - the action to be changed, if an action, schema or mock data file (optional)
|
|
284
291
|
* @param {Callback} callback - The results of the call
|
|
285
292
|
*/
|
|
286
|
-
|
|
287
|
-
const meth = 'adapterBase-
|
|
293
|
+
updateAdapterConfiguration(configFile, changes, entity, type, action, callback) {
|
|
294
|
+
const meth = 'adapterBase-updateAdapterConfiguration';
|
|
288
295
|
const origin = `${this.id}-${meth}`;
|
|
289
296
|
log.trace(origin);
|
|
290
297
|
|
|
@@ -446,6 +453,20 @@ class AdapterBase extends EventEmitterCl {
|
|
|
446
453
|
const origin = `${this.id}-adapterBase-healthCheck`;
|
|
447
454
|
log.trace(origin);
|
|
448
455
|
|
|
456
|
+
// if there is healthcheck query_object property, it needs to be added to the adapter
|
|
457
|
+
let myRequest = reqObj;
|
|
458
|
+
if (this.healthcheckQuery && Object.keys(this.healthcheckQuery).length > 0) {
|
|
459
|
+
if (myRequest && myRequest.uriQuery) {
|
|
460
|
+
myRequest.uriQuery = { ...myRequest.uriQuery, ...this.healthcheckQuery };
|
|
461
|
+
} else if (myRequest) {
|
|
462
|
+
myRequest.uriQuery = this.healthcheckQuery;
|
|
463
|
+
} else {
|
|
464
|
+
myRequest = {
|
|
465
|
+
uriQuery: this.healthcheckQuery
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
449
470
|
// call to the healthcheck in connector
|
|
450
471
|
return this.requestHandlerInst.identifyHealthcheck(reqObj, (res, error) => {
|
|
451
472
|
// unhealthy
|
|
@@ -479,6 +500,68 @@ class AdapterBase extends EventEmitterCl {
|
|
|
479
500
|
});
|
|
480
501
|
}
|
|
481
502
|
|
|
503
|
+
/**
|
|
504
|
+
* @summary Suspends the adapter
|
|
505
|
+
* @param {Callback} callback - The adapater suspension status
|
|
506
|
+
* @function suspend
|
|
507
|
+
*/
|
|
508
|
+
suspend(mode, callback) {
|
|
509
|
+
const origin = `${this.id}-adapterBase-suspend`;
|
|
510
|
+
if (this.suspended) {
|
|
511
|
+
throw new Error(`${origin}: Adapter is already suspended`);
|
|
512
|
+
}
|
|
513
|
+
try {
|
|
514
|
+
this.suspended = true;
|
|
515
|
+
this.suspendMode = mode;
|
|
516
|
+
if (this.suspendMode === 'pause') {
|
|
517
|
+
const props = JSON.parse(JSON.stringify(this.initProps));
|
|
518
|
+
// To suspend adapter, enable throttling and set concurrent max to 0
|
|
519
|
+
props.throttle.throttle_enabled = true;
|
|
520
|
+
props.throttle.concurrent_max = 0;
|
|
521
|
+
this.refreshProperties(props);
|
|
522
|
+
}
|
|
523
|
+
return callback({ suspended: true });
|
|
524
|
+
} catch (error) {
|
|
525
|
+
return callback(null, error);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* @summary Unsuspends the adapter
|
|
531
|
+
* @param {Callback} callback - The adapater suspension status
|
|
532
|
+
*
|
|
533
|
+
* @function unsuspend
|
|
534
|
+
*/
|
|
535
|
+
unsuspend(callback) {
|
|
536
|
+
const origin = `${this.id}-adapterBase-unsuspend`;
|
|
537
|
+
if (!this.suspended) {
|
|
538
|
+
throw new Error(`${origin}: Adapter is not suspended`);
|
|
539
|
+
}
|
|
540
|
+
if (this.suspendMode === 'pause') {
|
|
541
|
+
const props = JSON.parse(JSON.stringify(this.initProps));
|
|
542
|
+
// To unsuspend adapter, keep throttling enabled and begin processing queued requests in order
|
|
543
|
+
props.throttle.throttle_enabled = true;
|
|
544
|
+
props.throttle.concurrent_max = 1;
|
|
545
|
+
this.refreshProperties(props);
|
|
546
|
+
setTimeout(() => {
|
|
547
|
+
this.getQueue((q, error) => {
|
|
548
|
+
// console.log("Items in queue: " + String(q.length))
|
|
549
|
+
if (q.length === 0) {
|
|
550
|
+
// if queue is empty, return to initial properties state
|
|
551
|
+
this.refreshProperties(this.initProps);
|
|
552
|
+
this.suspended = false;
|
|
553
|
+
return callback({ suspended: false });
|
|
554
|
+
}
|
|
555
|
+
// recursive call to check queue again every second
|
|
556
|
+
return this.unsuspend(callback);
|
|
557
|
+
});
|
|
558
|
+
}, 1000);
|
|
559
|
+
} else {
|
|
560
|
+
this.suspended = false;
|
|
561
|
+
callback({ suspend: false });
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
482
565
|
/**
|
|
483
566
|
* getAllFunctions is used to get all of the exposed function in the adapter
|
|
484
567
|
*
|
|
@@ -505,10 +588,11 @@ class AdapterBase extends EventEmitterCl {
|
|
|
505
588
|
|
|
506
589
|
/**
|
|
507
590
|
* getWorkflowFunctions is used to get all of the workflow function in the adapter
|
|
591
|
+
* @param {array} ignoreThese - additional methods to ignore (optional)
|
|
508
592
|
*
|
|
509
|
-
* @function
|
|
593
|
+
* @function getWorkflowFunctions
|
|
510
594
|
*/
|
|
511
|
-
getWorkflowFunctions() {
|
|
595
|
+
getWorkflowFunctions(ignoreThese) {
|
|
512
596
|
const myfunctions = this.getAllFunctions();
|
|
513
597
|
const wffunctions = [];
|
|
514
598
|
|
|
@@ -519,8 +603,19 @@ class AdapterBase extends EventEmitterCl {
|
|
|
519
603
|
break;
|
|
520
604
|
}
|
|
521
605
|
if (myfunctions[m] !== 'hasEntity' && myfunctions[m] !== 'verifyCapability' && myfunctions[m] !== 'updateEntityCache'
|
|
522
|
-
&& myfunctions[m] !== 'healthCheck' &&
|
|
523
|
-
|
|
606
|
+
&& myfunctions[m] !== 'healthCheck' && myfunctions[m] !== 'getWorkflowFunctions'
|
|
607
|
+
&& !(myfunctions[m].endsWith('Emit') || myfunctions[m].match(/Emit__v[0-9]+/))) {
|
|
608
|
+
let found = false;
|
|
609
|
+
if (ignoreThese && Array.isArray(ignoreThese)) {
|
|
610
|
+
for (let i = 0; i < ignoreThese.length; i += 1) {
|
|
611
|
+
if (myfunctions[m].toUpperCase() === ignoreThese[i].toUpperCase()) {
|
|
612
|
+
found = true;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
if (!found) {
|
|
617
|
+
wffunctions.push(myfunctions[m]);
|
|
618
|
+
}
|
|
524
619
|
}
|
|
525
620
|
}
|
|
526
621
|
|
|
@@ -544,6 +639,89 @@ class AdapterBase extends EventEmitterCl {
|
|
|
544
639
|
}
|
|
545
640
|
}
|
|
546
641
|
|
|
642
|
+
/**
|
|
643
|
+
* See if the API path provided is found in this adapter
|
|
644
|
+
*
|
|
645
|
+
* @function findPath
|
|
646
|
+
* @param {string} apiPath - the api path to check on
|
|
647
|
+
* @param {Callback} callback - The results of the call
|
|
648
|
+
*/
|
|
649
|
+
findPath(apiPath, callback) {
|
|
650
|
+
const result = {
|
|
651
|
+
apiPath
|
|
652
|
+
};
|
|
653
|
+
|
|
654
|
+
// verify the path was provided
|
|
655
|
+
if (!apiPath) {
|
|
656
|
+
log.error('NO API PATH PROVIDED!');
|
|
657
|
+
result.found = false;
|
|
658
|
+
result.message = 'NO PATH PROVIDED!';
|
|
659
|
+
return callback(null, result);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// make sure the entities directory exists
|
|
663
|
+
const entitydir = path.join(__dirname, 'entities');
|
|
664
|
+
if (!fs.statSync(entitydir).isDirectory()) {
|
|
665
|
+
log.error('Could not find the entities directory');
|
|
666
|
+
result.found = false;
|
|
667
|
+
result.message = 'Could not find the entities directory';
|
|
668
|
+
return callback(null, result);
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
const entities = fs.readdirSync(entitydir);
|
|
672
|
+
const fitems = [];
|
|
673
|
+
|
|
674
|
+
// need to go through each entity in the entities directory
|
|
675
|
+
for (let e = 0; e < entities.length; e += 1) {
|
|
676
|
+
// make sure the entity is a directory - do not care about extra files
|
|
677
|
+
// only entities (dir)
|
|
678
|
+
if (fs.statSync(`${entitydir}/${entities[e]}`).isDirectory()) {
|
|
679
|
+
// see if the action file exists in the entity
|
|
680
|
+
if (fs.existsSync(`${entitydir}/${entities[e]}/action.json`)) {
|
|
681
|
+
// Read the entity actions from the file system
|
|
682
|
+
const actions = require(`${entitydir}/${entities[e]}/action.json`);
|
|
683
|
+
|
|
684
|
+
// go through all of the actions set the appropriate info in the newActions
|
|
685
|
+
for (let a = 0; a < actions.actions.length; a += 1) {
|
|
686
|
+
if (actions.actions[a].entitypath.indexOf(apiPath) >= 0) {
|
|
687
|
+
log.info(` Found - entity: ${entities[e]} action: ${actions.actions[a].name}`);
|
|
688
|
+
log.info(` method: ${actions.actions[a].method} path: ${actions.actions[a].entitypath}`);
|
|
689
|
+
const fitem = {
|
|
690
|
+
entity: entities[e],
|
|
691
|
+
action: actions.actions[a].name,
|
|
692
|
+
method: actions.actions[a].method,
|
|
693
|
+
path: actions.actions[a].entitypath
|
|
694
|
+
};
|
|
695
|
+
fitems.push(fitem);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
} else {
|
|
699
|
+
log.error(`Could not find entities ${entities[e]} action.json file`);
|
|
700
|
+
result.found = false;
|
|
701
|
+
result.message = `Could not find entities ${entities[e]} action.json file`;
|
|
702
|
+
return callback(null, result);
|
|
703
|
+
}
|
|
704
|
+
} else {
|
|
705
|
+
log.error(`Could not find entities ${entities[e]} directory`);
|
|
706
|
+
result.found = false;
|
|
707
|
+
result.message = `Could not find entities ${entities[e]} directory`;
|
|
708
|
+
return callback(null, result);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
if (fitems.length === 0) {
|
|
713
|
+
log.info('PATH NOT FOUND!');
|
|
714
|
+
result.found = false;
|
|
715
|
+
result.message = 'API PATH NOT FOUND!';
|
|
716
|
+
return callback(null, result);
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
result.foundIn = fitems;
|
|
720
|
+
result.found = true;
|
|
721
|
+
result.message = 'API PATH FOUND!';
|
|
722
|
+
return callback(result, null);
|
|
723
|
+
}
|
|
724
|
+
|
|
547
725
|
/**
|
|
548
726
|
* checkProperties is used to validate the adapter properties.
|
|
549
727
|
*
|
|
@@ -595,6 +773,85 @@ class AdapterBase extends EventEmitterCl {
|
|
|
595
773
|
return this.requestHandlerInst.encryptProperty(property, technique, callback);
|
|
596
774
|
}
|
|
597
775
|
|
|
776
|
+
/**
|
|
777
|
+
* @summary runs troubleshoot scripts for adapter
|
|
778
|
+
*
|
|
779
|
+
* @function troubleshoot
|
|
780
|
+
* @param {Object} props - the connection, healthcheck and authentication properties
|
|
781
|
+
* @param {boolean} persistFlag - whether the adapter properties should be updated
|
|
782
|
+
* @param {Adapter} adapter - adapter instance to troubleshoot
|
|
783
|
+
* @param {Callback} callback - callback function to return troubleshoot results
|
|
784
|
+
*/
|
|
785
|
+
async troubleshoot(props, persistFlag, adapter, callback) {
|
|
786
|
+
try {
|
|
787
|
+
const result = await troubleshootingAdapter.troubleshoot(props, false, persistFlag, adapter);
|
|
788
|
+
if (result.healthCheck && result.connectivity.failCount === 0 && result.basicGet.failCount === 0) {
|
|
789
|
+
return callback(result);
|
|
790
|
+
}
|
|
791
|
+
return callback(null, result);
|
|
792
|
+
} catch (error) {
|
|
793
|
+
return callback(null, error);
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* @summary runs healthcheck script for adapter
|
|
799
|
+
*
|
|
800
|
+
* @function runHealthcheck
|
|
801
|
+
* @param {Adapter} adapter - adapter instance to troubleshoot
|
|
802
|
+
* @param {Callback} callback - callback function to return healthcheck status
|
|
803
|
+
*/
|
|
804
|
+
async runHealthcheck(adapter, callback) {
|
|
805
|
+
try {
|
|
806
|
+
const result = await tbUtils.healthCheck(adapter);
|
|
807
|
+
if (result) {
|
|
808
|
+
return callback(result);
|
|
809
|
+
}
|
|
810
|
+
return callback(null, result);
|
|
811
|
+
} catch (error) {
|
|
812
|
+
return callback(null, error);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/**
|
|
817
|
+
* @summary runs connectivity check script for adapter
|
|
818
|
+
*
|
|
819
|
+
* @function runConnectivity
|
|
820
|
+
* @param {Adapter} adapter - adapter instance to troubleshoot
|
|
821
|
+
* @param {Callback} callback - callback function to return connectivity status
|
|
822
|
+
*/
|
|
823
|
+
async runConnectivity(callback) {
|
|
824
|
+
try {
|
|
825
|
+
const { serviceItem } = await tbUtils.getAdapterConfig();
|
|
826
|
+
const { host } = serviceItem.properties.properties;
|
|
827
|
+
const result = tbUtils.runConnectivity(host, false);
|
|
828
|
+
if (result.failCount > 0) {
|
|
829
|
+
return callback(null, result);
|
|
830
|
+
}
|
|
831
|
+
return callback(result);
|
|
832
|
+
} catch (error) {
|
|
833
|
+
return callback(null, error);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* @summary runs basicGet script for adapter
|
|
839
|
+
*
|
|
840
|
+
* @function runBasicGet
|
|
841
|
+
* @param {Callback} callback - callback function to return basicGet result
|
|
842
|
+
*/
|
|
843
|
+
runBasicGet(callback) {
|
|
844
|
+
try {
|
|
845
|
+
const result = tbUtils.runBasicGet(false);
|
|
846
|
+
if (result.failCount > 0) {
|
|
847
|
+
return callback(null, result);
|
|
848
|
+
}
|
|
849
|
+
return callback(result);
|
|
850
|
+
} catch (error) {
|
|
851
|
+
return callback(null, error);
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
|
|
598
855
|
/**
|
|
599
856
|
* @summary take the entities and add them to the cache
|
|
600
857
|
*
|
|
@@ -655,7 +912,7 @@ class AdapterBase extends EventEmitterCl {
|
|
|
655
912
|
const resEntity = [];
|
|
656
913
|
|
|
657
914
|
for (let e = 0; e < entityId.length; e += 1) {
|
|
658
|
-
if (data.includes(entityId)) {
|
|
915
|
+
if (data.includes(entityId[e])) {
|
|
659
916
|
resEntity.push(true);
|
|
660
917
|
} else {
|
|
661
918
|
resEntity.push(false);
|
|
@@ -679,7 +936,7 @@ class AdapterBase extends EventEmitterCl {
|
|
|
679
936
|
* desired capability or an error
|
|
680
937
|
*/
|
|
681
938
|
capabilityResults(results, callback) {
|
|
682
|
-
const meth = 'adapterBase-
|
|
939
|
+
const meth = 'adapterBase-capabilityResults';
|
|
683
940
|
const origin = `${this.id}-${meth}`;
|
|
684
941
|
log.trace(origin);
|
|
685
942
|
let locResults = results;
|
|
@@ -745,6 +1002,27 @@ class AdapterBase extends EventEmitterCl {
|
|
|
745
1002
|
return [];
|
|
746
1003
|
}
|
|
747
1004
|
}
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* @summary moves entities to mongo database
|
|
1008
|
+
*
|
|
1009
|
+
* @function moveEntitiesToDB
|
|
1010
|
+
*
|
|
1011
|
+
* @return {Callback} - containing the response from the mongo transaction
|
|
1012
|
+
*/
|
|
1013
|
+
moveEntitiesToDB(callback) {
|
|
1014
|
+
const meth = 'adapterBase-moveEntitiesToDB';
|
|
1015
|
+
const origin = `${this.id}-${meth}`;
|
|
1016
|
+
log.trace(origin);
|
|
1017
|
+
|
|
1018
|
+
try {
|
|
1019
|
+
return callback(entitiesToDB.moveEntitiesToDB(__dirname, { pronghornProps: this.allProps, id: this.id }), null);
|
|
1020
|
+
} catch (err) {
|
|
1021
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, err);
|
|
1022
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
1023
|
+
return callback(null, errorObj);
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
748
1026
|
}
|
|
749
1027
|
|
|
750
1028
|
module.exports = AdapterBase;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
{
|
|
2
|
+
"actions": [
|
|
3
|
+
{
|
|
4
|
+
"name": "getGenerics",
|
|
5
|
+
"protocol": "REST",
|
|
6
|
+
"method": "GET",
|
|
7
|
+
"entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
|
|
8
|
+
"requestSchema": "schema.json",
|
|
9
|
+
"responseSchema": "schema.json",
|
|
10
|
+
"timeout": 0,
|
|
11
|
+
"sendEmpty": false,
|
|
12
|
+
"sendGetBody": false,
|
|
13
|
+
"requestDatatype": "JSON",
|
|
14
|
+
"responseDatatype": "JSON",
|
|
15
|
+
"headers": {},
|
|
16
|
+
"responseObjects": [
|
|
17
|
+
{
|
|
18
|
+
"type": "default",
|
|
19
|
+
"key": "",
|
|
20
|
+
"mockFile": ""
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "createGeneric",
|
|
26
|
+
"protocol": "REST",
|
|
27
|
+
"method": "POST",
|
|
28
|
+
"entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
|
|
29
|
+
"requestSchema": "schema.json",
|
|
30
|
+
"responseSchema": "schema.json",
|
|
31
|
+
"timeout": 0,
|
|
32
|
+
"sendEmpty": false,
|
|
33
|
+
"sendGetBody": false,
|
|
34
|
+
"requestDatatype": "JSON",
|
|
35
|
+
"responseDatatype": "JSON",
|
|
36
|
+
"headers": {},
|
|
37
|
+
"responseObjects": [
|
|
38
|
+
{
|
|
39
|
+
"type": "default",
|
|
40
|
+
"key": "",
|
|
41
|
+
"mockFile": ""
|
|
42
|
+
}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "updateGeneric",
|
|
47
|
+
"protocol": "REST",
|
|
48
|
+
"method": "PUT",
|
|
49
|
+
"entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
|
|
50
|
+
"requestSchema": "schema.json",
|
|
51
|
+
"responseSchema": "schema.json",
|
|
52
|
+
"timeout": 0,
|
|
53
|
+
"sendEmpty": false,
|
|
54
|
+
"sendGetBody": false,
|
|
55
|
+
"requestDatatype": "JSON",
|
|
56
|
+
"responseDatatype": "JSON",
|
|
57
|
+
"headers": {},
|
|
58
|
+
"responseObjects": [
|
|
59
|
+
{
|
|
60
|
+
"type": "default",
|
|
61
|
+
"key": "",
|
|
62
|
+
"mockFile": ""
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"name": "patchGeneric",
|
|
68
|
+
"protocol": "REST",
|
|
69
|
+
"method": "PATCH",
|
|
70
|
+
"entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
|
|
71
|
+
"requestSchema": "schema.json",
|
|
72
|
+
"responseSchema": "schema.json",
|
|
73
|
+
"timeout": 0,
|
|
74
|
+
"sendEmpty": false,
|
|
75
|
+
"sendGetBody": false,
|
|
76
|
+
"requestDatatype": "JSON",
|
|
77
|
+
"responseDatatype": "JSON",
|
|
78
|
+
"headers": {},
|
|
79
|
+
"responseObjects": [
|
|
80
|
+
{
|
|
81
|
+
"type": "default",
|
|
82
|
+
"key": "",
|
|
83
|
+
"mockFile": ""
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"name": "deleteGeneric",
|
|
89
|
+
"protocol": "REST",
|
|
90
|
+
"method": "DELETE",
|
|
91
|
+
"entitypath": "{base_path}/{version}/{pathv1}/{pathv2}/{pathv3}/{pathv4}/{pathv5}/{pathv6}/{pathv7}/{pathv8}/{pathv9}/{pathv10}/{pathv11}/{pathv12}/{pathv13}/{pathv14}/{pathv15}/{pathv16}/{pathv17}/{pathv18}/{pathv19}/{pathv20}?{query}",
|
|
92
|
+
"requestSchema": "schema.json",
|
|
93
|
+
"responseSchema": "schema.json",
|
|
94
|
+
"timeout": 0,
|
|
95
|
+
"sendEmpty": false,
|
|
96
|
+
"sendGetBody": false,
|
|
97
|
+
"requestDatatype": "JSON",
|
|
98
|
+
"responseDatatype": "JSON",
|
|
99
|
+
"headers": {},
|
|
100
|
+
"responseObjects": [
|
|
101
|
+
{
|
|
102
|
+
"type": "default",
|
|
103
|
+
"key": "",
|
|
104
|
+
"mockFile": ""
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "generic_schema.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
+
"translate": false,
|
|
6
|
+
"dynamicfields": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"ph_request_type": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "type of request (internal to adapter)",
|
|
11
|
+
"default": "getGeneric",
|
|
12
|
+
"enum": [
|
|
13
|
+
"getGenerics",
|
|
14
|
+
"createGeneric",
|
|
15
|
+
"updateGeneric",
|
|
16
|
+
"patchGeneric",
|
|
17
|
+
"deleteGeneric"
|
|
18
|
+
],
|
|
19
|
+
"external_name": "ph_request_type"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"definitions": {}
|
|
23
|
+
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "getToken",
|
|
5
5
|
"protocol": "REST",
|
|
6
6
|
"method": "POST",
|
|
7
|
-
"entitypath": "/
|
|
7
|
+
"entitypath": "{base_path}/{version}/com/vmware/cis/session",
|
|
8
8
|
"requestSchema": "schemaTokenReq.json",
|
|
9
9
|
"responseSchema": "schemaTokenResp.json",
|
|
10
10
|
"timeout": 0,
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"requestDatatype": "JSON",
|
|
14
14
|
"responseDatatype": "JSON",
|
|
15
15
|
"headers": {
|
|
16
|
-
"Authorization": "{b64}{username}:{password}{/b64}"
|
|
16
|
+
"Authorization": "Basic {b64}{username}:{password}{/b64}"
|
|
17
17
|
},
|
|
18
18
|
"sso": {
|
|
19
19
|
"protocol": "",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"name": "healthcheck",
|
|
33
33
|
"protocol": "REST",
|
|
34
34
|
"method": "GET",
|
|
35
|
-
"entitypath": "{base_path}/{version}/
|
|
35
|
+
"entitypath": "{base_path}/{version}/com/vmware/content/local-library?{query}",
|
|
36
36
|
"requestSchema": "schema.json",
|
|
37
37
|
"responseSchema": "schema.json",
|
|
38
38
|
"timeout": 0,
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"type": "AES",
|
|
24
24
|
"key": ""
|
|
25
25
|
},
|
|
26
|
-
"external_name": "
|
|
26
|
+
"external_name": "username"
|
|
27
27
|
},
|
|
28
28
|
"password": {
|
|
29
29
|
"type": "string",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"type": "AES",
|
|
35
35
|
"key": ""
|
|
36
36
|
},
|
|
37
|
-
"external_name": "
|
|
37
|
+
"external_name": "password"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"required": ["username","password"],
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"actions": [
|
|
3
|
+
{
|
|
4
|
+
"name": "postVcentervmtemplatedeploy",
|
|
5
|
+
"protocol": "REST",
|
|
6
|
+
"method": "POST",
|
|
7
|
+
"entitypath": "{base_path}/{version}/vcenter/vm-template/library-items/{pathv1}?{query}",
|
|
8
|
+
"requestSchema": "schema.json",
|
|
9
|
+
"responseSchema": "schema.json",
|
|
10
|
+
"timeout": 0,
|
|
11
|
+
"sendEmpty": false,
|
|
12
|
+
"sendGetBody": false,
|
|
13
|
+
"requestDatatype": "JSON",
|
|
14
|
+
"responseDatatype": "JSON",
|
|
15
|
+
"headers": {},
|
|
16
|
+
"responseObjects": [
|
|
17
|
+
{
|
|
18
|
+
"type": "default",
|
|
19
|
+
"key": "",
|
|
20
|
+
"mockFile": ""
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$id": "schema.json",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"schema": "http://json-schema.org/draft-07/schema#",
|
|
5
|
+
"translate": false,
|
|
6
|
+
"dynamicfields": true,
|
|
7
|
+
"properties": {
|
|
8
|
+
"ph_request_type": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "type of request (internal to adapter)",
|
|
11
|
+
"default": "postVcentervmtemplatedeploy",
|
|
12
|
+
"enum": [
|
|
13
|
+
"postVcentervmtemplatedeploy"
|
|
14
|
+
],
|
|
15
|
+
"external_name": "ph_request_type"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"definitions": {}
|
|
19
|
+
}
|
package/error.json
CHANGED
|
@@ -168,6 +168,12 @@
|
|
|
168
168
|
"displayString": "Failure response received for $VARIABLE$",
|
|
169
169
|
"recommendation": "Check the reason for failure in the stack trace"
|
|
170
170
|
},
|
|
171
|
+
{
|
|
172
|
+
"key": "Suspended Adapter",
|
|
173
|
+
"icode": "AD.600",
|
|
174
|
+
"displayString": "Adapter is suspended",
|
|
175
|
+
"recommendation": "Check if external system is functional and unsuspend if appropriate"
|
|
176
|
+
},
|
|
171
177
|
{
|
|
172
178
|
"key": "Caught Exception",
|
|
173
179
|
"icode": "AD.900",
|