@itentialopensource/adapter-f5_bigiq 0.3.3 → 0.3.4
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/CHANGELOG.md +8 -0
- package/adapter.js +410 -0
- package/entities/DeviceUpgrades/action.json +102 -0
- package/entities/DeviceUpgrades/mockdatafiles/getRemoveDeviceServicesStatusById-default.json +64 -0
- package/entities/DeviceUpgrades/mockdatafiles/getRemoveDeviceTrustStatusById-default.json +25 -0
- package/entities/DeviceUpgrades/mockdatafiles/rebootDevice-default.json +5 -0
- package/entities/DeviceUpgrades/mockdatafiles/removeDeviceTrust-default.json +22 -0
- package/entities/DeviceUpgrades/schema.json +6 -1
- package/package.json +1 -1
- package/pronghorn.json +170 -0
- package/refs?service=git-upload-pack +0 -0
- package/test/integration/adapterTestIntegration.js +217 -0
- package/test/unit/adapterTestUnit.js +145 -0
package/CHANGELOG.md
CHANGED
package/adapter.js
CHANGED
|
@@ -28504,6 +28504,416 @@ class F5BigIQ extends AdapterBaseCl {
|
|
|
28504
28504
|
return callback(null, errorObj);
|
|
28505
28505
|
}
|
|
28506
28506
|
}
|
|
28507
|
+
|
|
28508
|
+
/**
|
|
28509
|
+
* @function rebootDevice
|
|
28510
|
+
* @pronghornType method
|
|
28511
|
+
* @name rebootDevice
|
|
28512
|
+
* @summary Reboot Device
|
|
28513
|
+
*
|
|
28514
|
+
* @param {object} body - body param
|
|
28515
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28516
|
+
* @return {object} results - An object containing the response of the action
|
|
28517
|
+
*
|
|
28518
|
+
* @route {POST} /rebootDevice
|
|
28519
|
+
* @roles admin
|
|
28520
|
+
* @task true
|
|
28521
|
+
*/
|
|
28522
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28523
|
+
rebootDevice(body, callback) {
|
|
28524
|
+
const meth = 'adapter-rebootDevice';
|
|
28525
|
+
const origin = `${this.id}-${meth}`;
|
|
28526
|
+
log.trace(origin);
|
|
28527
|
+
|
|
28528
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28529
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28530
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28531
|
+
return callback(null, errorObj);
|
|
28532
|
+
}
|
|
28533
|
+
|
|
28534
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28535
|
+
if (body === undefined || body === null || body === '') {
|
|
28536
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
28537
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28538
|
+
return callback(null, errorObj);
|
|
28539
|
+
}
|
|
28540
|
+
|
|
28541
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28542
|
+
const queryParamsAvailable = {};
|
|
28543
|
+
const queryParams = {};
|
|
28544
|
+
const pathVars = [];
|
|
28545
|
+
const bodyVars = body;
|
|
28546
|
+
|
|
28547
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28548
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28549
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28550
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28551
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28552
|
+
}
|
|
28553
|
+
});
|
|
28554
|
+
|
|
28555
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28556
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28557
|
+
const reqObj = {
|
|
28558
|
+
payload: bodyVars,
|
|
28559
|
+
uriPathVars: pathVars,
|
|
28560
|
+
uriQuery: queryParams
|
|
28561
|
+
};
|
|
28562
|
+
|
|
28563
|
+
try {
|
|
28564
|
+
// Make the call -
|
|
28565
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28566
|
+
return this.requestHandlerInst.identifyRequest('DeviceUpgrades', 'rebootDevice', reqObj, true, (irReturnData, irReturnError) => {
|
|
28567
|
+
// if we received an error or their is no response on the results
|
|
28568
|
+
// return an error
|
|
28569
|
+
if (irReturnError) {
|
|
28570
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28571
|
+
return callback(null, irReturnError);
|
|
28572
|
+
}
|
|
28573
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28574
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['rebootDevice'], null, null, null);
|
|
28575
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28576
|
+
return callback(null, errorObj);
|
|
28577
|
+
}
|
|
28578
|
+
|
|
28579
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28580
|
+
// return the response
|
|
28581
|
+
return callback(irReturnData, null);
|
|
28582
|
+
});
|
|
28583
|
+
} catch (ex) {
|
|
28584
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28585
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28586
|
+
return callback(null, errorObj);
|
|
28587
|
+
}
|
|
28588
|
+
}
|
|
28589
|
+
|
|
28590
|
+
/**
|
|
28591
|
+
* @function removeDeviceServices
|
|
28592
|
+
* @pronghornType method
|
|
28593
|
+
* @name removeDeviceServices
|
|
28594
|
+
* @summary Remove Device Services
|
|
28595
|
+
*
|
|
28596
|
+
* @param {object} body - body param
|
|
28597
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28598
|
+
* @return {object} results - An object containing the response of the action
|
|
28599
|
+
*
|
|
28600
|
+
* @route {POST} /removeDeviceServices
|
|
28601
|
+
* @roles admin
|
|
28602
|
+
* @task true
|
|
28603
|
+
*/
|
|
28604
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28605
|
+
removeDeviceServices(body, callback) {
|
|
28606
|
+
const meth = 'adapter-removeDeviceServices';
|
|
28607
|
+
const origin = `${this.id}-${meth}`;
|
|
28608
|
+
log.trace(origin);
|
|
28609
|
+
|
|
28610
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28611
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28612
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28613
|
+
return callback(null, errorObj);
|
|
28614
|
+
}
|
|
28615
|
+
|
|
28616
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28617
|
+
if (body === undefined || body === null || body === '') {
|
|
28618
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
28619
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28620
|
+
return callback(null, errorObj);
|
|
28621
|
+
}
|
|
28622
|
+
|
|
28623
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28624
|
+
const queryParamsAvailable = {};
|
|
28625
|
+
const queryParams = {};
|
|
28626
|
+
const pathVars = [];
|
|
28627
|
+
const bodyVars = body;
|
|
28628
|
+
|
|
28629
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28630
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28631
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28632
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28633
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28634
|
+
}
|
|
28635
|
+
});
|
|
28636
|
+
|
|
28637
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28638
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28639
|
+
const reqObj = {
|
|
28640
|
+
payload: bodyVars,
|
|
28641
|
+
uriPathVars: pathVars,
|
|
28642
|
+
uriQuery: queryParams
|
|
28643
|
+
};
|
|
28644
|
+
|
|
28645
|
+
try {
|
|
28646
|
+
// Make the call -
|
|
28647
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28648
|
+
return this.requestHandlerInst.identifyRequest('DeviceUpgrades', 'removeDeviceServices', reqObj, true, (irReturnData, irReturnError) => {
|
|
28649
|
+
// if we received an error or their is no response on the results
|
|
28650
|
+
// return an error
|
|
28651
|
+
if (irReturnError) {
|
|
28652
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28653
|
+
return callback(null, irReturnError);
|
|
28654
|
+
}
|
|
28655
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28656
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['removeDeviceServices'], null, null, null);
|
|
28657
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28658
|
+
return callback(null, errorObj);
|
|
28659
|
+
}
|
|
28660
|
+
|
|
28661
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28662
|
+
// return the response
|
|
28663
|
+
return callback(irReturnData, null);
|
|
28664
|
+
});
|
|
28665
|
+
} catch (ex) {
|
|
28666
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28667
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28668
|
+
return callback(null, errorObj);
|
|
28669
|
+
}
|
|
28670
|
+
}
|
|
28671
|
+
|
|
28672
|
+
/**
|
|
28673
|
+
* @function getRemoveDeviceServicesStatusById
|
|
28674
|
+
* @pronghornType method
|
|
28675
|
+
* @name getRemoveDeviceServicesStatusById
|
|
28676
|
+
* @summary Get Remove Device Services Status by Id
|
|
28677
|
+
*
|
|
28678
|
+
* @param {string} id - id param
|
|
28679
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28680
|
+
* @return {object} results - An object containing the response of the action
|
|
28681
|
+
*
|
|
28682
|
+
* @route {POST} /getRemoveDeviceServicesStatusById
|
|
28683
|
+
* @roles admin
|
|
28684
|
+
* @task true
|
|
28685
|
+
*/
|
|
28686
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28687
|
+
getRemoveDeviceServicesStatusById(id, callback) {
|
|
28688
|
+
const meth = 'adapter-getRemoveDeviceServicesStatusById';
|
|
28689
|
+
const origin = `${this.id}-${meth}`;
|
|
28690
|
+
log.trace(origin);
|
|
28691
|
+
|
|
28692
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28693
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28694
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28695
|
+
return callback(null, errorObj);
|
|
28696
|
+
}
|
|
28697
|
+
|
|
28698
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28699
|
+
if (id === undefined || id === null || id === '') {
|
|
28700
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['id'], null, null, null);
|
|
28701
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28702
|
+
return callback(null, errorObj);
|
|
28703
|
+
}
|
|
28704
|
+
|
|
28705
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28706
|
+
const queryParamsAvailable = {};
|
|
28707
|
+
const queryParams = {};
|
|
28708
|
+
const pathVars = [id];
|
|
28709
|
+
const bodyVars = {};
|
|
28710
|
+
|
|
28711
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28712
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28713
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28714
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28715
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28716
|
+
}
|
|
28717
|
+
});
|
|
28718
|
+
|
|
28719
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28720
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28721
|
+
const reqObj = {
|
|
28722
|
+
payload: bodyVars,
|
|
28723
|
+
uriPathVars: pathVars,
|
|
28724
|
+
uriQuery: queryParams
|
|
28725
|
+
};
|
|
28726
|
+
|
|
28727
|
+
try {
|
|
28728
|
+
// Make the call -
|
|
28729
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28730
|
+
return this.requestHandlerInst.identifyRequest('DeviceUpgrades', 'getRemoveDeviceServicesStatusById', reqObj, true, (irReturnData, irReturnError) => {
|
|
28731
|
+
// if we received an error or their is no response on the results
|
|
28732
|
+
// return an error
|
|
28733
|
+
if (irReturnError) {
|
|
28734
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28735
|
+
return callback(null, irReturnError);
|
|
28736
|
+
}
|
|
28737
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28738
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getRemoveDeviceServicesStatusById'], null, null, null);
|
|
28739
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28740
|
+
return callback(null, errorObj);
|
|
28741
|
+
}
|
|
28742
|
+
|
|
28743
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28744
|
+
// return the response
|
|
28745
|
+
return callback(irReturnData, null);
|
|
28746
|
+
});
|
|
28747
|
+
} catch (ex) {
|
|
28748
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28749
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28750
|
+
return callback(null, errorObj);
|
|
28751
|
+
}
|
|
28752
|
+
}
|
|
28753
|
+
|
|
28754
|
+
/**
|
|
28755
|
+
* @function removeDeviceTrust
|
|
28756
|
+
* @pronghornType method
|
|
28757
|
+
* @name removeDeviceTrust
|
|
28758
|
+
* @summary Remove Device Trust
|
|
28759
|
+
*
|
|
28760
|
+
* @param {object} body - body param
|
|
28761
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28762
|
+
* @return {object} results - An object containing the response of the action
|
|
28763
|
+
*
|
|
28764
|
+
* @route {POST} /removeDeviceTrust
|
|
28765
|
+
* @roles admin
|
|
28766
|
+
* @task true
|
|
28767
|
+
*/
|
|
28768
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28769
|
+
removeDeviceTrust(body, callback) {
|
|
28770
|
+
const meth = 'adapter-removeDeviceTrust';
|
|
28771
|
+
const origin = `${this.id}-${meth}`;
|
|
28772
|
+
log.trace(origin);
|
|
28773
|
+
|
|
28774
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28775
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28776
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28777
|
+
return callback(null, errorObj);
|
|
28778
|
+
}
|
|
28779
|
+
|
|
28780
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28781
|
+
if (body === undefined || body === null || body === '') {
|
|
28782
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
28783
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28784
|
+
return callback(null, errorObj);
|
|
28785
|
+
}
|
|
28786
|
+
|
|
28787
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28788
|
+
const queryParamsAvailable = {};
|
|
28789
|
+
const queryParams = {};
|
|
28790
|
+
const pathVars = [];
|
|
28791
|
+
const bodyVars = body;
|
|
28792
|
+
|
|
28793
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28794
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28795
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28796
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28797
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28798
|
+
}
|
|
28799
|
+
});
|
|
28800
|
+
|
|
28801
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28802
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28803
|
+
const reqObj = {
|
|
28804
|
+
payload: bodyVars,
|
|
28805
|
+
uriPathVars: pathVars,
|
|
28806
|
+
uriQuery: queryParams
|
|
28807
|
+
};
|
|
28808
|
+
|
|
28809
|
+
try {
|
|
28810
|
+
// Make the call -
|
|
28811
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28812
|
+
return this.requestHandlerInst.identifyRequest('DeviceUpgrades', 'removeDeviceTrust', reqObj, true, (irReturnData, irReturnError) => {
|
|
28813
|
+
// if we received an error or their is no response on the results
|
|
28814
|
+
// return an error
|
|
28815
|
+
if (irReturnError) {
|
|
28816
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28817
|
+
return callback(null, irReturnError);
|
|
28818
|
+
}
|
|
28819
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28820
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['removeDeviceTrust'], null, null, null);
|
|
28821
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28822
|
+
return callback(null, errorObj);
|
|
28823
|
+
}
|
|
28824
|
+
|
|
28825
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28826
|
+
// return the response
|
|
28827
|
+
return callback(irReturnData, null);
|
|
28828
|
+
});
|
|
28829
|
+
} catch (ex) {
|
|
28830
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28831
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28832
|
+
return callback(null, errorObj);
|
|
28833
|
+
}
|
|
28834
|
+
}
|
|
28835
|
+
|
|
28836
|
+
/**
|
|
28837
|
+
* @function getRemoveDeviceTrustStatusById
|
|
28838
|
+
* @pronghornType method
|
|
28839
|
+
* @name getRemoveDeviceTrustStatusById
|
|
28840
|
+
* @summary Get Remove Device Trust Status By Id
|
|
28841
|
+
*
|
|
28842
|
+
* @param {string} id - id param
|
|
28843
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28844
|
+
* @return {object} results - An object containing the response of the action
|
|
28845
|
+
*
|
|
28846
|
+
* @route {POST} /getRemoveDeviceTrustStatusById
|
|
28847
|
+
* @roles admin
|
|
28848
|
+
* @task true
|
|
28849
|
+
*/
|
|
28850
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28851
|
+
getRemoveDeviceTrustStatusById(id, callback) {
|
|
28852
|
+
const meth = 'adapter-getRemoveDeviceTrustStatusById';
|
|
28853
|
+
const origin = `${this.id}-${meth}`;
|
|
28854
|
+
log.trace(origin);
|
|
28855
|
+
|
|
28856
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28857
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28858
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28859
|
+
return callback(null, errorObj);
|
|
28860
|
+
}
|
|
28861
|
+
|
|
28862
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28863
|
+
if (id === undefined || id === null || id === '') {
|
|
28864
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['id'], null, null, null);
|
|
28865
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28866
|
+
return callback(null, errorObj);
|
|
28867
|
+
}
|
|
28868
|
+
|
|
28869
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28870
|
+
const queryParamsAvailable = {};
|
|
28871
|
+
const queryParams = {};
|
|
28872
|
+
const pathVars = [id];
|
|
28873
|
+
const bodyVars = {};
|
|
28874
|
+
|
|
28875
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28876
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28877
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28878
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28879
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28880
|
+
}
|
|
28881
|
+
});
|
|
28882
|
+
|
|
28883
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28884
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28885
|
+
const reqObj = {
|
|
28886
|
+
payload: bodyVars,
|
|
28887
|
+
uriPathVars: pathVars,
|
|
28888
|
+
uriQuery: queryParams
|
|
28889
|
+
};
|
|
28890
|
+
|
|
28891
|
+
try {
|
|
28892
|
+
// Make the call -
|
|
28893
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28894
|
+
return this.requestHandlerInst.identifyRequest('DeviceUpgrades', 'getRemoveDeviceTrustStatusById', reqObj, true, (irReturnData, irReturnError) => {
|
|
28895
|
+
// if we received an error or their is no response on the results
|
|
28896
|
+
// return an error
|
|
28897
|
+
if (irReturnError) {
|
|
28898
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28899
|
+
return callback(null, irReturnError);
|
|
28900
|
+
}
|
|
28901
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28902
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getRemoveDeviceTrustStatusById'], null, null, null);
|
|
28903
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28904
|
+
return callback(null, errorObj);
|
|
28905
|
+
}
|
|
28906
|
+
|
|
28907
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28908
|
+
// return the response
|
|
28909
|
+
return callback(irReturnData, null);
|
|
28910
|
+
});
|
|
28911
|
+
} catch (ex) {
|
|
28912
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28913
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28914
|
+
return callback(null, errorObj);
|
|
28915
|
+
}
|
|
28916
|
+
}
|
|
28507
28917
|
}
|
|
28508
28918
|
|
|
28509
28919
|
module.exports = F5BigIQ;
|
|
@@ -40,6 +40,108 @@
|
|
|
40
40
|
"mockFile": ""
|
|
41
41
|
}
|
|
42
42
|
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"name": "rebootDevice",
|
|
46
|
+
"protocol": "REST",
|
|
47
|
+
"method": "POST",
|
|
48
|
+
"entitypath": "{base_path}/{version}/mgmt/cm/device/tasks/device-item-deploy?{query}",
|
|
49
|
+
"requestSchema": "schema.json",
|
|
50
|
+
"responseSchema": "schema.json",
|
|
51
|
+
"timeout": 0,
|
|
52
|
+
"sendEmpty": false,
|
|
53
|
+
"requestDatatype": "JSON",
|
|
54
|
+
"responseDatatype": "JSON",
|
|
55
|
+
"headers": {},
|
|
56
|
+
"responseObjects": [
|
|
57
|
+
{
|
|
58
|
+
"type": "default",
|
|
59
|
+
"key": "",
|
|
60
|
+
"mockFile": "mockdatafiles/rebootDevice-default.json"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "removeDeviceServices",
|
|
66
|
+
"protocol": "REST",
|
|
67
|
+
"method": "POST",
|
|
68
|
+
"entitypath": "{base_path}/{version}/mgmt/cm/global/tasks/device-remove-mgmt-authority?{query}",
|
|
69
|
+
"requestSchema": "schema.json",
|
|
70
|
+
"responseSchema": "schema.json",
|
|
71
|
+
"timeout": 0,
|
|
72
|
+
"sendEmpty": false,
|
|
73
|
+
"requestDatatype": "JSON",
|
|
74
|
+
"responseDatatype": "JSON",
|
|
75
|
+
"headers": {},
|
|
76
|
+
"responseObjects": [
|
|
77
|
+
{
|
|
78
|
+
"type": "default",
|
|
79
|
+
"key": "",
|
|
80
|
+
"mockFile": ""
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"name": "getRemoveDeviceServicesStatusById",
|
|
86
|
+
"protocol": "REST",
|
|
87
|
+
"method": "GET",
|
|
88
|
+
"entitypath": "{base_path}/{version}/mgmt/cm/global/tasks/device-remove-mgmt-authority/{pathv1}?{query}",
|
|
89
|
+
"requestSchema": "schema.json",
|
|
90
|
+
"responseSchema": "schema.json",
|
|
91
|
+
"timeout": 0,
|
|
92
|
+
"sendEmpty": false,
|
|
93
|
+
"sendGetBody": false,
|
|
94
|
+
"requestDatatype": "JSON",
|
|
95
|
+
"responseDatatype": "JSON",
|
|
96
|
+
"headers": {},
|
|
97
|
+
"responseObjects": [
|
|
98
|
+
{
|
|
99
|
+
"type": "default",
|
|
100
|
+
"key": "",
|
|
101
|
+
"mockFile": "mockdatafiles/getRemoveDeviceServicesStatusById-default.json"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"name": "removeDeviceTrust",
|
|
107
|
+
"protocol": "REST",
|
|
108
|
+
"method": "POST",
|
|
109
|
+
"entitypath": "{base_path}/{version}/mgmt/cm/global/tasks/device-remove-trust?{query}",
|
|
110
|
+
"requestSchema": "schema.json",
|
|
111
|
+
"responseSchema": "schema.json",
|
|
112
|
+
"timeout": 0,
|
|
113
|
+
"sendEmpty": false,
|
|
114
|
+
"requestDatatype": "JSON",
|
|
115
|
+
"responseDatatype": "JSON",
|
|
116
|
+
"headers": {},
|
|
117
|
+
"responseObjects": [
|
|
118
|
+
{
|
|
119
|
+
"type": "default",
|
|
120
|
+
"key": "",
|
|
121
|
+
"mockFile": "mockdatafiles/removeDeviceTrust-default.json"
|
|
122
|
+
}
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "getRemoveDeviceTrustStatusById",
|
|
127
|
+
"protocol": "REST",
|
|
128
|
+
"method": "GET",
|
|
129
|
+
"entitypath": "{base_path}/{version}/mgmt/cm/global/tasks/device-remove-trust/{pathv1}?{query}",
|
|
130
|
+
"requestSchema": "schema.json",
|
|
131
|
+
"responseSchema": "schema.json",
|
|
132
|
+
"timeout": 0,
|
|
133
|
+
"sendEmpty": false,
|
|
134
|
+
"sendGetBody": false,
|
|
135
|
+
"requestDatatype": "JSON",
|
|
136
|
+
"responseDatatype": "JSON",
|
|
137
|
+
"headers": {},
|
|
138
|
+
"responseObjects": [
|
|
139
|
+
{
|
|
140
|
+
"type": "default",
|
|
141
|
+
"key": "",
|
|
142
|
+
"mockFile": "mockdatafiles/getRemoveDeviceTrustStatusById-default.json"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
43
145
|
}
|
|
44
146
|
]
|
|
45
147
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "string",
|
|
3
|
+
"kind": "string",
|
|
4
|
+
"name": "string",
|
|
5
|
+
"status": "FINISHED",
|
|
6
|
+
"selfLink": "string",
|
|
7
|
+
"username": "string",
|
|
8
|
+
"generation": 12,
|
|
9
|
+
"moduleList": [
|
|
10
|
+
{
|
|
11
|
+
"module": "string",
|
|
12
|
+
"status": "FINISHED",
|
|
13
|
+
"endTime": "string",
|
|
14
|
+
"startTime": "string",
|
|
15
|
+
"taskReference": {
|
|
16
|
+
"link": "string"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"module": "access",
|
|
21
|
+
"status": "FINISHED"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"module": "asm",
|
|
25
|
+
"status": "FINISHED"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"module": "fps",
|
|
29
|
+
"status": "FINISHED"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"module": "firewall",
|
|
33
|
+
"status": "FINISHED"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"module": "security_shared",
|
|
37
|
+
"status": "FINISHED"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"module": "dns",
|
|
41
|
+
"status": "FINISHED"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"module": "sslo",
|
|
45
|
+
"status": "FINISHED"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"currentStep": "DONE",
|
|
49
|
+
"endDateTime": "string",
|
|
50
|
+
"startDateTime": "string",
|
|
51
|
+
"userReference": {
|
|
52
|
+
"link": "string"
|
|
53
|
+
},
|
|
54
|
+
"ownerMachineId": "string",
|
|
55
|
+
"deviceReference": {
|
|
56
|
+
"link": "string"
|
|
57
|
+
},
|
|
58
|
+
"lastUpdateMicros": 16,
|
|
59
|
+
"identityReferences": [
|
|
60
|
+
{
|
|
61
|
+
"link": "string"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "string",
|
|
3
|
+
"kind": "string",
|
|
4
|
+
"name": "string",
|
|
5
|
+
"status": "FINISHED",
|
|
6
|
+
"selfLink": "string",
|
|
7
|
+
"username": "string",
|
|
8
|
+
"generation": 15,
|
|
9
|
+
"currentStep": "DONE",
|
|
10
|
+
"endDateTime": "string",
|
|
11
|
+
"startDateTime": "string",
|
|
12
|
+
"userReference": {
|
|
13
|
+
"link": "string"
|
|
14
|
+
},
|
|
15
|
+
"ownerMachineId": "string",
|
|
16
|
+
"deviceReference": {
|
|
17
|
+
"link": "string"
|
|
18
|
+
},
|
|
19
|
+
"lastUpdateMicros": 16,
|
|
20
|
+
"identityReferences": [
|
|
21
|
+
{
|
|
22
|
+
"link": "string"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deviceReference": {
|
|
3
|
+
"link": "string"
|
|
4
|
+
},
|
|
5
|
+
"id": "string",
|
|
6
|
+
"status": "STARTED",
|
|
7
|
+
"name": "string",
|
|
8
|
+
"userReference": {
|
|
9
|
+
"link": "string"
|
|
10
|
+
},
|
|
11
|
+
"identityReferences": [
|
|
12
|
+
{
|
|
13
|
+
"link": "string"
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"ownerMachineId": "string",
|
|
17
|
+
"taskWorkerGeneration": 1,
|
|
18
|
+
"generation": 1,
|
|
19
|
+
"lastUpdateMicros": 16,
|
|
20
|
+
"kind": "string",
|
|
21
|
+
"selfLink": "string"
|
|
22
|
+
}
|
|
@@ -11,7 +11,12 @@
|
|
|
11
11
|
"default": "retrievaallUpgradeTasks",
|
|
12
12
|
"enum": [
|
|
13
13
|
"retrievaallUpgradeTasks",
|
|
14
|
-
"performSoftwareUpgrade"
|
|
14
|
+
"performSoftwareUpgrade",
|
|
15
|
+
"rebootDevice",
|
|
16
|
+
"removeDeviceServices",
|
|
17
|
+
"getRemoveDeviceServicesStatusById",
|
|
18
|
+
"removeDeviceTrust",
|
|
19
|
+
"getRemoveDeviceTrustStatusById"
|
|
15
20
|
],
|
|
16
21
|
"external_name": "ph_request_type"
|
|
17
22
|
}
|
package/package.json
CHANGED
package/pronghorn.json
CHANGED
|
@@ -12825,6 +12825,176 @@
|
|
|
12825
12825
|
"path": "/queryDSCGroupByGroupId"
|
|
12826
12826
|
},
|
|
12827
12827
|
"task": true
|
|
12828
|
+
},
|
|
12829
|
+
{
|
|
12830
|
+
"name": "rebootDevice",
|
|
12831
|
+
"summary": "Reboot Device",
|
|
12832
|
+
"description": "Reboot Device",
|
|
12833
|
+
"input": [
|
|
12834
|
+
{
|
|
12835
|
+
"name": "body",
|
|
12836
|
+
"type": "object",
|
|
12837
|
+
"info": ": object",
|
|
12838
|
+
"required": true,
|
|
12839
|
+
"schema": {
|
|
12840
|
+
"title": "body",
|
|
12841
|
+
"type": "object"
|
|
12842
|
+
}
|
|
12843
|
+
}
|
|
12844
|
+
],
|
|
12845
|
+
"output": {
|
|
12846
|
+
"name": "result",
|
|
12847
|
+
"type": "object",
|
|
12848
|
+
"description": "A JSON Object containing status, code and the result",
|
|
12849
|
+
"schema": {
|
|
12850
|
+
"title": "result",
|
|
12851
|
+
"type": "object"
|
|
12852
|
+
}
|
|
12853
|
+
},
|
|
12854
|
+
"roles": [
|
|
12855
|
+
"admin"
|
|
12856
|
+
],
|
|
12857
|
+
"route": {
|
|
12858
|
+
"verb": "POST",
|
|
12859
|
+
"path": "/rebootDevice"
|
|
12860
|
+
},
|
|
12861
|
+
"task": true
|
|
12862
|
+
},
|
|
12863
|
+
{
|
|
12864
|
+
"name": "removeDeviceServices",
|
|
12865
|
+
"summary": "Remove Device Services",
|
|
12866
|
+
"description": "Remove Device Services",
|
|
12867
|
+
"input": [
|
|
12868
|
+
{
|
|
12869
|
+
"name": "body",
|
|
12870
|
+
"type": "object",
|
|
12871
|
+
"info": ": object",
|
|
12872
|
+
"required": true,
|
|
12873
|
+
"schema": {
|
|
12874
|
+
"title": "body",
|
|
12875
|
+
"type": "object"
|
|
12876
|
+
}
|
|
12877
|
+
}
|
|
12878
|
+
],
|
|
12879
|
+
"output": {
|
|
12880
|
+
"name": "result",
|
|
12881
|
+
"type": "object",
|
|
12882
|
+
"description": "A JSON Object containing status, code and the result",
|
|
12883
|
+
"schema": {
|
|
12884
|
+
"title": "result",
|
|
12885
|
+
"type": "object"
|
|
12886
|
+
}
|
|
12887
|
+
},
|
|
12888
|
+
"roles": [
|
|
12889
|
+
"admin"
|
|
12890
|
+
],
|
|
12891
|
+
"route": {
|
|
12892
|
+
"verb": "POST",
|
|
12893
|
+
"path": "/removeDeviceServices"
|
|
12894
|
+
},
|
|
12895
|
+
"task": true
|
|
12896
|
+
},
|
|
12897
|
+
{
|
|
12898
|
+
"name": "getRemoveDeviceServicesStatusById",
|
|
12899
|
+
"summary": "Get Remove Device Services Status by Id",
|
|
12900
|
+
"description": "Get Remove Device Services Status by Id",
|
|
12901
|
+
"input": [
|
|
12902
|
+
{
|
|
12903
|
+
"name": "id",
|
|
12904
|
+
"type": "string",
|
|
12905
|
+
"info": ": string",
|
|
12906
|
+
"required": true,
|
|
12907
|
+
"schema": {
|
|
12908
|
+
"title": "id",
|
|
12909
|
+
"type": "string"
|
|
12910
|
+
}
|
|
12911
|
+
}
|
|
12912
|
+
],
|
|
12913
|
+
"output": {
|
|
12914
|
+
"name": "result",
|
|
12915
|
+
"type": "object",
|
|
12916
|
+
"description": "A JSON Object containing status, code and the result",
|
|
12917
|
+
"schema": {
|
|
12918
|
+
"title": "result",
|
|
12919
|
+
"type": "object"
|
|
12920
|
+
}
|
|
12921
|
+
},
|
|
12922
|
+
"roles": [
|
|
12923
|
+
"admin"
|
|
12924
|
+
],
|
|
12925
|
+
"route": {
|
|
12926
|
+
"verb": "POST",
|
|
12927
|
+
"path": "/getRemoveDeviceServicesStatusById"
|
|
12928
|
+
},
|
|
12929
|
+
"task": true
|
|
12930
|
+
},
|
|
12931
|
+
{
|
|
12932
|
+
"name": "removeDeviceTrust",
|
|
12933
|
+
"summary": "Remove Device Trust",
|
|
12934
|
+
"description": "Remove Device Trust",
|
|
12935
|
+
"input": [
|
|
12936
|
+
{
|
|
12937
|
+
"name": "body",
|
|
12938
|
+
"type": "object",
|
|
12939
|
+
"info": ": object",
|
|
12940
|
+
"required": true,
|
|
12941
|
+
"schema": {
|
|
12942
|
+
"title": "body",
|
|
12943
|
+
"type": "object"
|
|
12944
|
+
}
|
|
12945
|
+
}
|
|
12946
|
+
],
|
|
12947
|
+
"output": {
|
|
12948
|
+
"name": "result",
|
|
12949
|
+
"type": "object",
|
|
12950
|
+
"description": "A JSON Object containing status, code and the result",
|
|
12951
|
+
"schema": {
|
|
12952
|
+
"title": "result",
|
|
12953
|
+
"type": "object"
|
|
12954
|
+
}
|
|
12955
|
+
},
|
|
12956
|
+
"roles": [
|
|
12957
|
+
"admin"
|
|
12958
|
+
],
|
|
12959
|
+
"route": {
|
|
12960
|
+
"verb": "POST",
|
|
12961
|
+
"path": "/removeDeviceTrust"
|
|
12962
|
+
},
|
|
12963
|
+
"task": true
|
|
12964
|
+
},
|
|
12965
|
+
{
|
|
12966
|
+
"name": "getRemoveDeviceTrustStatusById",
|
|
12967
|
+
"summary": "Get Remove Device Trust Status By Id",
|
|
12968
|
+
"description": "Get Remove Device Trust Status By Id",
|
|
12969
|
+
"input": [
|
|
12970
|
+
{
|
|
12971
|
+
"name": "id",
|
|
12972
|
+
"type": "string",
|
|
12973
|
+
"info": ": string",
|
|
12974
|
+
"required": true,
|
|
12975
|
+
"schema": {
|
|
12976
|
+
"title": "id",
|
|
12977
|
+
"type": "string"
|
|
12978
|
+
}
|
|
12979
|
+
}
|
|
12980
|
+
],
|
|
12981
|
+
"output": {
|
|
12982
|
+
"name": "result",
|
|
12983
|
+
"type": "object",
|
|
12984
|
+
"description": "A JSON Object containing status, code and the result",
|
|
12985
|
+
"schema": {
|
|
12986
|
+
"title": "result",
|
|
12987
|
+
"type": "object"
|
|
12988
|
+
}
|
|
12989
|
+
},
|
|
12990
|
+
"roles": [
|
|
12991
|
+
"admin"
|
|
12992
|
+
],
|
|
12993
|
+
"route": {
|
|
12994
|
+
"verb": "POST",
|
|
12995
|
+
"path": "/getRemoveDeviceTrustStatusById"
|
|
12996
|
+
},
|
|
12997
|
+
"task": true
|
|
12828
12998
|
}
|
|
12829
12999
|
],
|
|
12830
13000
|
"views": []
|
|
Binary file
|
|
@@ -8913,5 +8913,222 @@ describe('[integration] F5BigIQ Adapter Test', () => {
|
|
|
8913
8913
|
}
|
|
8914
8914
|
}).timeout(attemptTimeout);
|
|
8915
8915
|
});
|
|
8916
|
+
|
|
8917
|
+
const deviceUpgradesRebootDeviceBodyParam = {
|
|
8918
|
+
passthroughObject: {
|
|
8919
|
+
command: 'reboot',
|
|
8920
|
+
volume: 'HD1.1'
|
|
8921
|
+
},
|
|
8922
|
+
deviceGroupDeviceReference: {
|
|
8923
|
+
link: 'string'
|
|
8924
|
+
},
|
|
8925
|
+
remoteTargetReference: {
|
|
8926
|
+
link: 'string'
|
|
8927
|
+
}
|
|
8928
|
+
};
|
|
8929
|
+
describe('#rebootDevice - errors', () => {
|
|
8930
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
8931
|
+
try {
|
|
8932
|
+
a.rebootDevice(deviceUpgradesRebootDeviceBodyParam, (data, error) => {
|
|
8933
|
+
try {
|
|
8934
|
+
if (stub) {
|
|
8935
|
+
runCommonAsserts(data, error);
|
|
8936
|
+
assert.equal('tm:sys:rebootstate', data.response.kind);
|
|
8937
|
+
assert.equal('reboot', data.response.command);
|
|
8938
|
+
assert.equal('HD1.1', data.response.volume);
|
|
8939
|
+
} else {
|
|
8940
|
+
runCommonAsserts(data, error);
|
|
8941
|
+
}
|
|
8942
|
+
saveMockData('DeviceUpgrades', 'rebootDevice', 'default', data);
|
|
8943
|
+
done();
|
|
8944
|
+
} catch (err) {
|
|
8945
|
+
log.error(`Test Failure: ${err}`);
|
|
8946
|
+
done(err);
|
|
8947
|
+
}
|
|
8948
|
+
});
|
|
8949
|
+
} catch (error) {
|
|
8950
|
+
log.error(`Adapter Exception: ${error}`);
|
|
8951
|
+
done(error);
|
|
8952
|
+
}
|
|
8953
|
+
}).timeout(attemptTimeout);
|
|
8954
|
+
});
|
|
8955
|
+
|
|
8956
|
+
const deviceUpgradesRemoveDeviceServicesBodyParam = {
|
|
8957
|
+
moduleList: [
|
|
8958
|
+
{
|
|
8959
|
+
module: 'adc_core'
|
|
8960
|
+
},
|
|
8961
|
+
{
|
|
8962
|
+
module: 'access'
|
|
8963
|
+
},
|
|
8964
|
+
{
|
|
8965
|
+
module: 'asm'
|
|
8966
|
+
},
|
|
8967
|
+
{
|
|
8968
|
+
module: 'fps'
|
|
8969
|
+
},
|
|
8970
|
+
{
|
|
8971
|
+
module: 'firewall'
|
|
8972
|
+
},
|
|
8973
|
+
{
|
|
8974
|
+
module: 'security_shared'
|
|
8975
|
+
},
|
|
8976
|
+
{
|
|
8977
|
+
module: 'dns'
|
|
8978
|
+
},
|
|
8979
|
+
{
|
|
8980
|
+
module: 'sslo'
|
|
8981
|
+
}
|
|
8982
|
+
],
|
|
8983
|
+
deviceReference: {
|
|
8984
|
+
link: 'string'
|
|
8985
|
+
},
|
|
8986
|
+
name: 'string'
|
|
8987
|
+
};
|
|
8988
|
+
describe('#removeDeviceServices - errors', () => {
|
|
8989
|
+
it('should work if integrated but since no mockdata should error when run standalone', (done) => {
|
|
8990
|
+
try {
|
|
8991
|
+
a.removeDeviceServices(deviceUpgradesRemoveDeviceServicesBodyParam, (data, error) => {
|
|
8992
|
+
try {
|
|
8993
|
+
if (stub) {
|
|
8994
|
+
const displayE = 'Error 400 received on request';
|
|
8995
|
+
runErrorAsserts(data, error, 'AD.500', 'Test-f5_bigiq-connectorRest-handleEndResponse', displayE);
|
|
8996
|
+
} else {
|
|
8997
|
+
runCommonAsserts(data, error);
|
|
8998
|
+
}
|
|
8999
|
+
saveMockData('DeviceUpgrades', 'removeDeviceServices', 'default', data);
|
|
9000
|
+
done();
|
|
9001
|
+
} catch (err) {
|
|
9002
|
+
log.error(`Test Failure: ${err}`);
|
|
9003
|
+
done(err);
|
|
9004
|
+
}
|
|
9005
|
+
});
|
|
9006
|
+
} catch (error) {
|
|
9007
|
+
log.error(`Adapter Exception: ${error}`);
|
|
9008
|
+
done(error);
|
|
9009
|
+
}
|
|
9010
|
+
}).timeout(attemptTimeout);
|
|
9011
|
+
});
|
|
9012
|
+
|
|
9013
|
+
describe('#getRemoveDeviceServicesStatusById - errors', () => {
|
|
9014
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
9015
|
+
try {
|
|
9016
|
+
a.getRemoveDeviceServicesStatusById('fakedata', (data, error) => {
|
|
9017
|
+
try {
|
|
9018
|
+
if (stub) {
|
|
9019
|
+
runCommonAsserts(data, error);
|
|
9020
|
+
assert.equal('string', data.response.id);
|
|
9021
|
+
assert.equal('string', data.response.kind);
|
|
9022
|
+
assert.equal('string', data.response.name);
|
|
9023
|
+
assert.equal('FINISHED', data.response.status);
|
|
9024
|
+
assert.equal('string', data.response.selfLink);
|
|
9025
|
+
assert.equal('string', data.response.username);
|
|
9026
|
+
assert.equal(12, data.response.generation);
|
|
9027
|
+
assert.equal(true, Array.isArray(data.response.moduleList));
|
|
9028
|
+
assert.equal('DONE', data.response.currentStep);
|
|
9029
|
+
assert.equal('string', data.response.endDateTime);
|
|
9030
|
+
assert.equal('string', data.response.startDateTime);
|
|
9031
|
+
assert.equal('object', typeof data.response.userReference);
|
|
9032
|
+
assert.equal('string', data.response.ownerMachineId);
|
|
9033
|
+
assert.equal('object', typeof data.response.deviceReference);
|
|
9034
|
+
assert.equal(16, data.response.lastUpdateMicros);
|
|
9035
|
+
assert.equal(true, Array.isArray(data.response.identityReferences));
|
|
9036
|
+
} else {
|
|
9037
|
+
runCommonAsserts(data, error);
|
|
9038
|
+
}
|
|
9039
|
+
saveMockData('DeviceUpgrades', 'getRemoveDeviceServicesStatusById', 'default', data);
|
|
9040
|
+
done();
|
|
9041
|
+
} catch (err) {
|
|
9042
|
+
log.error(`Test Failure: ${err}`);
|
|
9043
|
+
done(err);
|
|
9044
|
+
}
|
|
9045
|
+
});
|
|
9046
|
+
} catch (error) {
|
|
9047
|
+
log.error(`Adapter Exception: ${error}`);
|
|
9048
|
+
done(error);
|
|
9049
|
+
}
|
|
9050
|
+
}).timeout(attemptTimeout);
|
|
9051
|
+
});
|
|
9052
|
+
|
|
9053
|
+
const deviceUpgradesRemoveDeviceTrustBodyParam = {
|
|
9054
|
+
deviceReference: {
|
|
9055
|
+
link: 'string'
|
|
9056
|
+
},
|
|
9057
|
+
name: 'string'
|
|
9058
|
+
};
|
|
9059
|
+
describe('#removeDeviceTrust - errors', () => {
|
|
9060
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
9061
|
+
try {
|
|
9062
|
+
a.removeDeviceTrust(deviceUpgradesRemoveDeviceTrustBodyParam, (data, error) => {
|
|
9063
|
+
try {
|
|
9064
|
+
if (stub) {
|
|
9065
|
+
runCommonAsserts(data, error);
|
|
9066
|
+
assert.equal('object', typeof data.response.deviceReference);
|
|
9067
|
+
assert.equal('string', data.response.id);
|
|
9068
|
+
assert.equal('STARTED', data.response.status);
|
|
9069
|
+
assert.equal('string', data.response.name);
|
|
9070
|
+
assert.equal('object', typeof data.response.userReference);
|
|
9071
|
+
assert.equal(true, Array.isArray(data.response.identityReferences));
|
|
9072
|
+
assert.equal('string', data.response.ownerMachineId);
|
|
9073
|
+
assert.equal(1, data.response.taskWorkerGeneration);
|
|
9074
|
+
assert.equal(1, data.response.generation);
|
|
9075
|
+
assert.equal(16, data.response.lastUpdateMicros);
|
|
9076
|
+
assert.equal('string', data.response.kind);
|
|
9077
|
+
assert.equal('string', data.response.selfLink);
|
|
9078
|
+
} else {
|
|
9079
|
+
runCommonAsserts(data, error);
|
|
9080
|
+
}
|
|
9081
|
+
saveMockData('DeviceUpgrades', 'removeDeviceTrust', 'default', data);
|
|
9082
|
+
done();
|
|
9083
|
+
} catch (err) {
|
|
9084
|
+
log.error(`Test Failure: ${err}`);
|
|
9085
|
+
done(err);
|
|
9086
|
+
}
|
|
9087
|
+
});
|
|
9088
|
+
} catch (error) {
|
|
9089
|
+
log.error(`Adapter Exception: ${error}`);
|
|
9090
|
+
done(error);
|
|
9091
|
+
}
|
|
9092
|
+
}).timeout(attemptTimeout);
|
|
9093
|
+
});
|
|
9094
|
+
|
|
9095
|
+
describe('#getRemoveDeviceTrustStatusById - errors', () => {
|
|
9096
|
+
it('should work if integrated or standalone with mockdata', (done) => {
|
|
9097
|
+
try {
|
|
9098
|
+
a.getRemoveDeviceTrustStatusById('fakedata', (data, error) => {
|
|
9099
|
+
try {
|
|
9100
|
+
if (stub) {
|
|
9101
|
+
runCommonAsserts(data, error);
|
|
9102
|
+
assert.equal('string', data.response.id);
|
|
9103
|
+
assert.equal('string', data.response.kind);
|
|
9104
|
+
assert.equal('string', data.response.name);
|
|
9105
|
+
assert.equal('FINISHED', data.response.status);
|
|
9106
|
+
assert.equal('string', data.response.selfLink);
|
|
9107
|
+
assert.equal('string', data.response.username);
|
|
9108
|
+
assert.equal(15, data.response.generation);
|
|
9109
|
+
assert.equal('DONE', data.response.currentStep);
|
|
9110
|
+
assert.equal('string', data.response.endDateTime);
|
|
9111
|
+
assert.equal('string', data.response.startDateTime);
|
|
9112
|
+
assert.equal('object', typeof data.response.userReference);
|
|
9113
|
+
assert.equal('string', data.response.ownerMachineId);
|
|
9114
|
+
assert.equal('object', typeof data.response.deviceReference);
|
|
9115
|
+
assert.equal(16, data.response.lastUpdateMicros);
|
|
9116
|
+
assert.equal(true, Array.isArray(data.response.identityReferences));
|
|
9117
|
+
} else {
|
|
9118
|
+
runCommonAsserts(data, error);
|
|
9119
|
+
}
|
|
9120
|
+
saveMockData('DeviceUpgrades', 'getRemoveDeviceTrustStatusById', 'default', data);
|
|
9121
|
+
done();
|
|
9122
|
+
} catch (err) {
|
|
9123
|
+
log.error(`Test Failure: ${err}`);
|
|
9124
|
+
done(err);
|
|
9125
|
+
}
|
|
9126
|
+
});
|
|
9127
|
+
} catch (error) {
|
|
9128
|
+
log.error(`Adapter Exception: ${error}`);
|
|
9129
|
+
done(error);
|
|
9130
|
+
}
|
|
9131
|
+
}).timeout(attemptTimeout);
|
|
9132
|
+
});
|
|
8916
9133
|
});
|
|
8917
9134
|
});
|
|
@@ -12113,5 +12113,150 @@ describe('[unit] F5BigIQ Adapter Test', () => {
|
|
|
12113
12113
|
}
|
|
12114
12114
|
}).timeout(attemptTimeout);
|
|
12115
12115
|
});
|
|
12116
|
+
|
|
12117
|
+
describe('#rebootDevice - errors', () => {
|
|
12118
|
+
it('should have a rebootDevice function', (done) => {
|
|
12119
|
+
try {
|
|
12120
|
+
assert.equal(true, typeof a.rebootDevice === 'function');
|
|
12121
|
+
done();
|
|
12122
|
+
} catch (error) {
|
|
12123
|
+
log.error(`Test Failure: ${error}`);
|
|
12124
|
+
done(error);
|
|
12125
|
+
}
|
|
12126
|
+
}).timeout(attemptTimeout);
|
|
12127
|
+
it('should error if - missing body', (done) => {
|
|
12128
|
+
try {
|
|
12129
|
+
a.rebootDevice(null, (data, error) => {
|
|
12130
|
+
try {
|
|
12131
|
+
const displayE = 'body is required';
|
|
12132
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-f5_bigiq-adapter-rebootDevice', displayE);
|
|
12133
|
+
done();
|
|
12134
|
+
} catch (err) {
|
|
12135
|
+
log.error(`Test Failure: ${err}`);
|
|
12136
|
+
done(err);
|
|
12137
|
+
}
|
|
12138
|
+
});
|
|
12139
|
+
} catch (error) {
|
|
12140
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12141
|
+
done(error);
|
|
12142
|
+
}
|
|
12143
|
+
}).timeout(attemptTimeout);
|
|
12144
|
+
});
|
|
12145
|
+
|
|
12146
|
+
describe('#removeDeviceServices - errors', () => {
|
|
12147
|
+
it('should have a removeDeviceServices function', (done) => {
|
|
12148
|
+
try {
|
|
12149
|
+
assert.equal(true, typeof a.removeDeviceServices === 'function');
|
|
12150
|
+
done();
|
|
12151
|
+
} catch (error) {
|
|
12152
|
+
log.error(`Test Failure: ${error}`);
|
|
12153
|
+
done(error);
|
|
12154
|
+
}
|
|
12155
|
+
}).timeout(attemptTimeout);
|
|
12156
|
+
it('should error if - missing body', (done) => {
|
|
12157
|
+
try {
|
|
12158
|
+
a.removeDeviceServices(null, (data, error) => {
|
|
12159
|
+
try {
|
|
12160
|
+
const displayE = 'body is required';
|
|
12161
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-f5_bigiq-adapter-removeDeviceServices', displayE);
|
|
12162
|
+
done();
|
|
12163
|
+
} catch (err) {
|
|
12164
|
+
log.error(`Test Failure: ${err}`);
|
|
12165
|
+
done(err);
|
|
12166
|
+
}
|
|
12167
|
+
});
|
|
12168
|
+
} catch (error) {
|
|
12169
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12170
|
+
done(error);
|
|
12171
|
+
}
|
|
12172
|
+
}).timeout(attemptTimeout);
|
|
12173
|
+
});
|
|
12174
|
+
|
|
12175
|
+
describe('#getRemoveDeviceServicesStatusById - errors', () => {
|
|
12176
|
+
it('should have a getRemoveDeviceServicesStatusById function', (done) => {
|
|
12177
|
+
try {
|
|
12178
|
+
assert.equal(true, typeof a.getRemoveDeviceServicesStatusById === 'function');
|
|
12179
|
+
done();
|
|
12180
|
+
} catch (error) {
|
|
12181
|
+
log.error(`Test Failure: ${error}`);
|
|
12182
|
+
done(error);
|
|
12183
|
+
}
|
|
12184
|
+
}).timeout(attemptTimeout);
|
|
12185
|
+
it('should error if - missing id', (done) => {
|
|
12186
|
+
try {
|
|
12187
|
+
a.getRemoveDeviceServicesStatusById(null, (data, error) => {
|
|
12188
|
+
try {
|
|
12189
|
+
const displayE = 'id is required';
|
|
12190
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-f5_bigiq-adapter-getRemoveDeviceServicesStatusById', displayE);
|
|
12191
|
+
done();
|
|
12192
|
+
} catch (err) {
|
|
12193
|
+
log.error(`Test Failure: ${err}`);
|
|
12194
|
+
done(err);
|
|
12195
|
+
}
|
|
12196
|
+
});
|
|
12197
|
+
} catch (error) {
|
|
12198
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12199
|
+
done(error);
|
|
12200
|
+
}
|
|
12201
|
+
}).timeout(attemptTimeout);
|
|
12202
|
+
});
|
|
12203
|
+
|
|
12204
|
+
describe('#removeDeviceTrust - errors', () => {
|
|
12205
|
+
it('should have a removeDeviceTrust function', (done) => {
|
|
12206
|
+
try {
|
|
12207
|
+
assert.equal(true, typeof a.removeDeviceTrust === 'function');
|
|
12208
|
+
done();
|
|
12209
|
+
} catch (error) {
|
|
12210
|
+
log.error(`Test Failure: ${error}`);
|
|
12211
|
+
done(error);
|
|
12212
|
+
}
|
|
12213
|
+
}).timeout(attemptTimeout);
|
|
12214
|
+
it('should error if - missing body', (done) => {
|
|
12215
|
+
try {
|
|
12216
|
+
a.removeDeviceTrust(null, (data, error) => {
|
|
12217
|
+
try {
|
|
12218
|
+
const displayE = 'body is required';
|
|
12219
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-f5_bigiq-adapter-removeDeviceTrust', displayE);
|
|
12220
|
+
done();
|
|
12221
|
+
} catch (err) {
|
|
12222
|
+
log.error(`Test Failure: ${err}`);
|
|
12223
|
+
done(err);
|
|
12224
|
+
}
|
|
12225
|
+
});
|
|
12226
|
+
} catch (error) {
|
|
12227
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12228
|
+
done(error);
|
|
12229
|
+
}
|
|
12230
|
+
}).timeout(attemptTimeout);
|
|
12231
|
+
});
|
|
12232
|
+
|
|
12233
|
+
describe('#getRemoveDeviceTrustStatusById - errors', () => {
|
|
12234
|
+
it('should have a getRemoveDeviceTrustStatusById function', (done) => {
|
|
12235
|
+
try {
|
|
12236
|
+
assert.equal(true, typeof a.getRemoveDeviceTrustStatusById === 'function');
|
|
12237
|
+
done();
|
|
12238
|
+
} catch (error) {
|
|
12239
|
+
log.error(`Test Failure: ${error}`);
|
|
12240
|
+
done(error);
|
|
12241
|
+
}
|
|
12242
|
+
}).timeout(attemptTimeout);
|
|
12243
|
+
it('should error if - missing id', (done) => {
|
|
12244
|
+
try {
|
|
12245
|
+
a.getRemoveDeviceTrustStatusById(null, (data, error) => {
|
|
12246
|
+
try {
|
|
12247
|
+
const displayE = 'id is required';
|
|
12248
|
+
runErrorAsserts(data, error, 'AD.300', 'Test-f5_bigiq-adapter-getRemoveDeviceTrustStatusById', displayE);
|
|
12249
|
+
done();
|
|
12250
|
+
} catch (err) {
|
|
12251
|
+
log.error(`Test Failure: ${err}`);
|
|
12252
|
+
done(err);
|
|
12253
|
+
}
|
|
12254
|
+
});
|
|
12255
|
+
} catch (error) {
|
|
12256
|
+
log.error(`Adapter Exception: ${error}`);
|
|
12257
|
+
done(error);
|
|
12258
|
+
}
|
|
12259
|
+
}).timeout(attemptTimeout);
|
|
12260
|
+
});
|
|
12116
12261
|
});
|
|
12117
12262
|
});
|