@itentialopensource/adapter-f5_bigiq 0.3.2 → 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 +16 -0
- package/adapter.js +410 -0
- package/entities/BIGIPDeviceClustering/schema.json +1 -1
- package/entities/BIGIPDeviceReferenceLookup/schema.json +1 -1
- package/entities/BIGIPIHealth/schema.json +1 -1
- package/entities/BIGIPSoftwareImageManagement/schema.json +1 -1
- package/entities/BIGIPTMSHScripting/schema.json +1 -1
- package/entities/BIGIPUUIDLookup/schema.json +1 -1
- package/entities/BIGIQSystemClusterStatus/schema.json +1 -1
- package/entities/DeviceBackups/schema.json +1 -1
- package/entities/DeviceImport/schema.json +1 -1
- 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 +7 -2
- package/entities/Qkview/schema.json +1 -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
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
|
|
2
|
+
## 0.3.4 [09-26-2023]
|
|
3
|
+
|
|
4
|
+
* Add device upgrade calls
|
|
5
|
+
|
|
6
|
+
See merge request itentialopensource/adapters/controller-orchestrator/adapter-f5_bigiq!7
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 0.3.3 [07-25-2023]
|
|
11
|
+
|
|
12
|
+
* Add default value to schema files
|
|
13
|
+
|
|
14
|
+
See merge request itentialopensource/adapters/controller-orchestrator/adapter-f5_bigiq!5
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
2
18
|
## 0.3.2 [07-20-2023]
|
|
3
19
|
|
|
4
20
|
* Remove additional headers
|
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
|
}
|