@itentialopensource/adapter-f5_bigiq 0.2.0 → 0.3.1
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 +4221 -2
- package/entities/BIGIPDeviceClustering/action.json +46 -0
- package/entities/BIGIPDeviceClustering/schema.json +20 -0
- package/entities/BIGIPDeviceReferenceLookup/action.json +25 -0
- package/entities/BIGIPDeviceReferenceLookup/schema.json +19 -0
- package/entities/BIGIPIHealth/action.json +313 -0
- package/entities/BIGIPIHealth/schema.json +33 -0
- package/entities/BIGIPSoftwareImageManagement/action.json +46 -0
- package/entities/BIGIPSoftwareImageManagement/schema.json +20 -0
- package/entities/BIGIPTMSHScripting/action.json +107 -0
- package/entities/BIGIPTMSHScripting/schema.json +23 -0
- package/entities/BIGIPUUIDLookup/action.json +25 -0
- package/entities/BIGIPUUIDLookup/schema.json +19 -0
- package/entities/BIGIQSystemClusterStatus/action.json +46 -0
- package/entities/BIGIQSystemClusterStatus/schema.json +20 -0
- package/entities/Device/action.json +84 -0
- package/entities/Device/schema.json +5 -1
- package/entities/DeviceBackups/action.json +148 -0
- package/entities/DeviceBackups/schema.json +25 -0
- package/entities/DeviceImport/action.json +86 -0
- package/entities/DeviceImport/schema.json +22 -0
- package/entities/DeviceUpgrades/action.json +45 -0
- package/entities/DeviceUpgrades/schema.json +20 -0
- package/entities/Qkview/action.json +148 -0
- package/entities/Qkview/schema.json +25 -0
- package/package.json +1 -1
- package/pronghorn.json +5173 -3300
- package/refs?service=git-upload-pack +0 -0
- package/report/AdditionalF5.OpenApi3Json.json +3886 -0
- package/test/integration/adapterTestIntegration.js +1427 -0
- package/test/unit/adapterTestUnit.js +1151 -0
package/adapter.js
CHANGED
|
@@ -930,7 +930,7 @@ class F5BigIQ extends AdapterBaseCl {
|
|
|
930
930
|
* @name patchAlertRule
|
|
931
931
|
* @summary Patch Alert Rule
|
|
932
932
|
*
|
|
933
|
-
* @param {} name - A unique ID for this alert rule.
|
|
933
|
+
* @param {string} name - A unique ID for this alert rule.
|
|
934
934
|
* @param {object} body - body
|
|
935
935
|
* @param {getCallback} callback - a callback function to return the result
|
|
936
936
|
* @return {object} results - An object containing the response of the action
|
|
@@ -3748,7 +3748,7 @@ class F5BigIQ extends AdapterBaseCl {
|
|
|
3748
3748
|
* @name patchActiveDirectoryServer
|
|
3749
3749
|
* @summary Patch Active Directory Server
|
|
3750
3750
|
*
|
|
3751
|
-
* @param {} id - id
|
|
3751
|
+
* @param {string} id - id
|
|
3752
3752
|
* @param {object} body - body
|
|
3753
3753
|
* @param {getCallback} callback - a callback function to return the result
|
|
3754
3754
|
* @return {object} results - An object containing the response of the action
|
|
@@ -14026,6 +14026,95 @@ class F5BigIQ extends AdapterBaseCl {
|
|
|
14026
14026
|
}
|
|
14027
14027
|
}
|
|
14028
14028
|
|
|
14029
|
+
/**
|
|
14030
|
+
* @function performDeviceDiscoveryTask
|
|
14031
|
+
* @pronghornType method
|
|
14032
|
+
* @name performDeviceDiscoveryTask
|
|
14033
|
+
* @summary Perform Device Discovery Task
|
|
14034
|
+
*
|
|
14035
|
+
* @param {string} objectId - Unique id assigned to device discovery task. required
|
|
14036
|
+
* @param {object} body - Body
|
|
14037
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
14038
|
+
* @return {object} results - An object containing the response of the action
|
|
14039
|
+
*
|
|
14040
|
+
* @route {POST} /performDeviceDiscoveryTask
|
|
14041
|
+
* @roles admin
|
|
14042
|
+
* @task true
|
|
14043
|
+
*/
|
|
14044
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
14045
|
+
performDeviceDiscoveryTask(objectId, body, callback) {
|
|
14046
|
+
const meth = 'adapter-performDeviceDiscoveryTask';
|
|
14047
|
+
const origin = `${this.id}-${meth}`;
|
|
14048
|
+
log.trace(origin);
|
|
14049
|
+
|
|
14050
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
14051
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
14052
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
14053
|
+
return callback(null, errorObj);
|
|
14054
|
+
}
|
|
14055
|
+
|
|
14056
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
14057
|
+
if (objectId === undefined || objectId === null || objectId === '') {
|
|
14058
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['objectId'], null, null, null);
|
|
14059
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
14060
|
+
return callback(null, errorObj);
|
|
14061
|
+
}
|
|
14062
|
+
|
|
14063
|
+
if (body === undefined || body === null || body === '') {
|
|
14064
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
14065
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
14066
|
+
return callback(null, errorObj);
|
|
14067
|
+
}
|
|
14068
|
+
|
|
14069
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
14070
|
+
const queryParamsAvailable = {};
|
|
14071
|
+
const queryParams = {};
|
|
14072
|
+
const pathVars = [objectId];
|
|
14073
|
+
const bodyVars = body;
|
|
14074
|
+
|
|
14075
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
14076
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
14077
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
14078
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
14079
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
14080
|
+
}
|
|
14081
|
+
});
|
|
14082
|
+
|
|
14083
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
14084
|
+
// see adapter code documentation for more information on the request object's fields
|
|
14085
|
+
const reqObj = {
|
|
14086
|
+
payload: bodyVars,
|
|
14087
|
+
uriPathVars: pathVars,
|
|
14088
|
+
uriQuery: queryParams
|
|
14089
|
+
};
|
|
14090
|
+
|
|
14091
|
+
try {
|
|
14092
|
+
// Make the call -
|
|
14093
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
14094
|
+
return this.requestHandlerInst.identifyRequest('Device', 'performDeviceDiscoveryTask', reqObj, true, (irReturnData, irReturnError) => {
|
|
14095
|
+
// if we received an error or their is no response on the results
|
|
14096
|
+
// return an error
|
|
14097
|
+
if (irReturnError) {
|
|
14098
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
14099
|
+
return callback(null, irReturnError);
|
|
14100
|
+
}
|
|
14101
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
14102
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['performDeviceDiscoveryTask'], null, null, null);
|
|
14103
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
14104
|
+
return callback(null, errorObj);
|
|
14105
|
+
}
|
|
14106
|
+
|
|
14107
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
14108
|
+
// return the response
|
|
14109
|
+
return callback(irReturnData, null);
|
|
14110
|
+
});
|
|
14111
|
+
} catch (ex) {
|
|
14112
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
14113
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
14114
|
+
return callback(null, errorObj);
|
|
14115
|
+
}
|
|
14116
|
+
}
|
|
14117
|
+
|
|
14029
14118
|
/**
|
|
14030
14119
|
* @function postDeviceTrustTask
|
|
14031
14120
|
* @pronghornType method
|
|
@@ -24353,6 +24442,4136 @@ class F5BigIQ extends AdapterBaseCl {
|
|
|
24353
24442
|
return callback(null, errorObj);
|
|
24354
24443
|
}
|
|
24355
24444
|
}
|
|
24445
|
+
|
|
24446
|
+
/**
|
|
24447
|
+
* @function getResolveMachineId
|
|
24448
|
+
* @pronghornType method
|
|
24449
|
+
* @name getResolveMachineId
|
|
24450
|
+
* @summary Resolve machineId
|
|
24451
|
+
*
|
|
24452
|
+
* @param {string} [filter] - filter param
|
|
24453
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
24454
|
+
* @return {object} results - An object containing the response of the action
|
|
24455
|
+
*
|
|
24456
|
+
* @route {POST} /getResolveMachineId
|
|
24457
|
+
* @roles admin
|
|
24458
|
+
* @task true
|
|
24459
|
+
*/
|
|
24460
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
24461
|
+
getResolveMachineId(filter, callback) {
|
|
24462
|
+
const meth = 'adapter-getResolveMachineId';
|
|
24463
|
+
const origin = `${this.id}-${meth}`;
|
|
24464
|
+
log.trace(origin);
|
|
24465
|
+
|
|
24466
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
24467
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
24468
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24469
|
+
return callback(null, errorObj);
|
|
24470
|
+
}
|
|
24471
|
+
|
|
24472
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
24473
|
+
|
|
24474
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
24475
|
+
const queryParamsAvailable = { $filter: filter };
|
|
24476
|
+
const queryParams = {};
|
|
24477
|
+
const pathVars = [];
|
|
24478
|
+
const bodyVars = {};
|
|
24479
|
+
|
|
24480
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
24481
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
24482
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
24483
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
24484
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
24485
|
+
}
|
|
24486
|
+
});
|
|
24487
|
+
|
|
24488
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
24489
|
+
// see adapter code documentation for more information on the request object's fields
|
|
24490
|
+
const reqObj = {
|
|
24491
|
+
payload: bodyVars,
|
|
24492
|
+
uriPathVars: pathVars,
|
|
24493
|
+
uriQuery: queryParams
|
|
24494
|
+
};
|
|
24495
|
+
|
|
24496
|
+
try {
|
|
24497
|
+
// Make the call -
|
|
24498
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
24499
|
+
return this.requestHandlerInst.identifyRequest('BIGIPUUIDLookup', 'getResolveMachineId', reqObj, true, (irReturnData, irReturnError) => {
|
|
24500
|
+
// if we received an error or their is no response on the results
|
|
24501
|
+
// return an error
|
|
24502
|
+
if (irReturnError) {
|
|
24503
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
24504
|
+
return callback(null, irReturnError);
|
|
24505
|
+
}
|
|
24506
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
24507
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getResolveMachineId'], null, null, null);
|
|
24508
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24509
|
+
return callback(null, errorObj);
|
|
24510
|
+
}
|
|
24511
|
+
|
|
24512
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
24513
|
+
// return the response
|
|
24514
|
+
return callback(irReturnData, null);
|
|
24515
|
+
});
|
|
24516
|
+
} catch (ex) {
|
|
24517
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
24518
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24519
|
+
return callback(null, errorObj);
|
|
24520
|
+
}
|
|
24521
|
+
}
|
|
24522
|
+
|
|
24523
|
+
/**
|
|
24524
|
+
* @function getExampleQkview
|
|
24525
|
+
* @pronghornType method
|
|
24526
|
+
* @name getExampleQkview
|
|
24527
|
+
* @summary EXAMPLE - Qkview
|
|
24528
|
+
*
|
|
24529
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
24530
|
+
* @return {object} results - An object containing the response of the action
|
|
24531
|
+
*
|
|
24532
|
+
* @route {GET} /getExampleQkview
|
|
24533
|
+
* @roles admin
|
|
24534
|
+
* @task true
|
|
24535
|
+
*/
|
|
24536
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
24537
|
+
getExampleQkview(callback) {
|
|
24538
|
+
const meth = 'adapter-getExampleQkview';
|
|
24539
|
+
const origin = `${this.id}-${meth}`;
|
|
24540
|
+
log.trace(origin);
|
|
24541
|
+
|
|
24542
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
24543
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
24544
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24545
|
+
return callback(null, errorObj);
|
|
24546
|
+
}
|
|
24547
|
+
|
|
24548
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
24549
|
+
|
|
24550
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
24551
|
+
const queryParamsAvailable = {};
|
|
24552
|
+
const queryParams = {};
|
|
24553
|
+
const pathVars = [];
|
|
24554
|
+
const bodyVars = {};
|
|
24555
|
+
|
|
24556
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
24557
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
24558
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
24559
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
24560
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
24561
|
+
}
|
|
24562
|
+
});
|
|
24563
|
+
|
|
24564
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
24565
|
+
// see adapter code documentation for more information on the request object's fields
|
|
24566
|
+
const reqObj = {
|
|
24567
|
+
payload: bodyVars,
|
|
24568
|
+
uriPathVars: pathVars,
|
|
24569
|
+
uriQuery: queryParams
|
|
24570
|
+
};
|
|
24571
|
+
|
|
24572
|
+
try {
|
|
24573
|
+
// Make the call -
|
|
24574
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
24575
|
+
return this.requestHandlerInst.identifyRequest('Qkview', 'getExampleQkview', reqObj, true, (irReturnData, irReturnError) => {
|
|
24576
|
+
// if we received an error or their is no response on the results
|
|
24577
|
+
// return an error
|
|
24578
|
+
if (irReturnError) {
|
|
24579
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
24580
|
+
return callback(null, irReturnError);
|
|
24581
|
+
}
|
|
24582
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
24583
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getExampleQkview'], null, null, null);
|
|
24584
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24585
|
+
return callback(null, errorObj);
|
|
24586
|
+
}
|
|
24587
|
+
|
|
24588
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
24589
|
+
// return the response
|
|
24590
|
+
return callback(irReturnData, null);
|
|
24591
|
+
});
|
|
24592
|
+
} catch (ex) {
|
|
24593
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
24594
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24595
|
+
return callback(null, errorObj);
|
|
24596
|
+
}
|
|
24597
|
+
}
|
|
24598
|
+
|
|
24599
|
+
/**
|
|
24600
|
+
* @function retrieveQkviewTasks
|
|
24601
|
+
* @pronghornType method
|
|
24602
|
+
* @name retrieveQkviewTasks
|
|
24603
|
+
* @summary Retrieve Qkview Tasks
|
|
24604
|
+
*
|
|
24605
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
24606
|
+
* @return {object} results - An object containing the response of the action
|
|
24607
|
+
*
|
|
24608
|
+
* @route {GET} /retrieveQkviewTasks
|
|
24609
|
+
* @roles admin
|
|
24610
|
+
* @task true
|
|
24611
|
+
*/
|
|
24612
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
24613
|
+
retrieveQkviewTasks(callback) {
|
|
24614
|
+
const meth = 'adapter-retrieveQkviewTasks';
|
|
24615
|
+
const origin = `${this.id}-${meth}`;
|
|
24616
|
+
log.trace(origin);
|
|
24617
|
+
|
|
24618
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
24619
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
24620
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24621
|
+
return callback(null, errorObj);
|
|
24622
|
+
}
|
|
24623
|
+
|
|
24624
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
24625
|
+
|
|
24626
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
24627
|
+
const queryParamsAvailable = {};
|
|
24628
|
+
const queryParams = {};
|
|
24629
|
+
const pathVars = [];
|
|
24630
|
+
const bodyVars = {};
|
|
24631
|
+
|
|
24632
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
24633
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
24634
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
24635
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
24636
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
24637
|
+
}
|
|
24638
|
+
});
|
|
24639
|
+
|
|
24640
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
24641
|
+
// see adapter code documentation for more information on the request object's fields
|
|
24642
|
+
const reqObj = {
|
|
24643
|
+
payload: bodyVars,
|
|
24644
|
+
uriPathVars: pathVars,
|
|
24645
|
+
uriQuery: queryParams
|
|
24646
|
+
};
|
|
24647
|
+
|
|
24648
|
+
try {
|
|
24649
|
+
// Make the call -
|
|
24650
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
24651
|
+
return this.requestHandlerInst.identifyRequest('Qkview', 'retrieveQkviewTasks', reqObj, true, (irReturnData, irReturnError) => {
|
|
24652
|
+
// if we received an error or their is no response on the results
|
|
24653
|
+
// return an error
|
|
24654
|
+
if (irReturnError) {
|
|
24655
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
24656
|
+
return callback(null, irReturnError);
|
|
24657
|
+
}
|
|
24658
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
24659
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveQkviewTasks'], null, null, null);
|
|
24660
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24661
|
+
return callback(null, errorObj);
|
|
24662
|
+
}
|
|
24663
|
+
|
|
24664
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
24665
|
+
// return the response
|
|
24666
|
+
return callback(irReturnData, null);
|
|
24667
|
+
});
|
|
24668
|
+
} catch (ex) {
|
|
24669
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
24670
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24671
|
+
return callback(null, errorObj);
|
|
24672
|
+
}
|
|
24673
|
+
}
|
|
24674
|
+
|
|
24675
|
+
/**
|
|
24676
|
+
* @function generateaQkview
|
|
24677
|
+
* @pronghornType method
|
|
24678
|
+
* @name generateaQkview
|
|
24679
|
+
* @summary Generate a Qkview
|
|
24680
|
+
*
|
|
24681
|
+
* @param {object} body - body param
|
|
24682
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
24683
|
+
* @return {object} results - An object containing the response of the action
|
|
24684
|
+
*
|
|
24685
|
+
* @route {POST} /generateaQkview
|
|
24686
|
+
* @roles admin
|
|
24687
|
+
* @task true
|
|
24688
|
+
*/
|
|
24689
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
24690
|
+
generateaQkview(body, callback) {
|
|
24691
|
+
const meth = 'adapter-generateaQkview';
|
|
24692
|
+
const origin = `${this.id}-${meth}`;
|
|
24693
|
+
log.trace(origin);
|
|
24694
|
+
|
|
24695
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
24696
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
24697
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24698
|
+
return callback(null, errorObj);
|
|
24699
|
+
}
|
|
24700
|
+
|
|
24701
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
24702
|
+
if (body === undefined || body === null || body === '') {
|
|
24703
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
24704
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24705
|
+
return callback(null, errorObj);
|
|
24706
|
+
}
|
|
24707
|
+
|
|
24708
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
24709
|
+
const queryParamsAvailable = {};
|
|
24710
|
+
const queryParams = {};
|
|
24711
|
+
const pathVars = [];
|
|
24712
|
+
const bodyVars = body;
|
|
24713
|
+
|
|
24714
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
24715
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
24716
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
24717
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
24718
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
24719
|
+
}
|
|
24720
|
+
});
|
|
24721
|
+
|
|
24722
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
24723
|
+
// see adapter code documentation for more information on the request object's fields
|
|
24724
|
+
const reqObj = {
|
|
24725
|
+
payload: bodyVars,
|
|
24726
|
+
uriPathVars: pathVars,
|
|
24727
|
+
uriQuery: queryParams
|
|
24728
|
+
};
|
|
24729
|
+
|
|
24730
|
+
try {
|
|
24731
|
+
// Make the call -
|
|
24732
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
24733
|
+
return this.requestHandlerInst.identifyRequest('Qkview', 'generateaQkview', reqObj, true, (irReturnData, irReturnError) => {
|
|
24734
|
+
// if we received an error or their is no response on the results
|
|
24735
|
+
// return an error
|
|
24736
|
+
if (irReturnError) {
|
|
24737
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
24738
|
+
return callback(null, irReturnError);
|
|
24739
|
+
}
|
|
24740
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
24741
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['generateaQkview'], null, null, null);
|
|
24742
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24743
|
+
return callback(null, errorObj);
|
|
24744
|
+
}
|
|
24745
|
+
|
|
24746
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
24747
|
+
// return the response
|
|
24748
|
+
return callback(irReturnData, null);
|
|
24749
|
+
});
|
|
24750
|
+
} catch (ex) {
|
|
24751
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
24752
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24753
|
+
return callback(null, errorObj);
|
|
24754
|
+
}
|
|
24755
|
+
}
|
|
24756
|
+
|
|
24757
|
+
/**
|
|
24758
|
+
* @function queryBIGIQQkviewTask
|
|
24759
|
+
* @pronghornType method
|
|
24760
|
+
* @name queryBIGIQQkviewTask
|
|
24761
|
+
* @summary Query BIG-IQ Qkview Task
|
|
24762
|
+
*
|
|
24763
|
+
* @param {string} bIGIQQKVIEWTASKID - bIGIQQKVIEWTASKID param
|
|
24764
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
24765
|
+
* @return {object} results - An object containing the response of the action
|
|
24766
|
+
*
|
|
24767
|
+
* @route {POST} /queryBIGIQQkviewTask
|
|
24768
|
+
* @roles admin
|
|
24769
|
+
* @task true
|
|
24770
|
+
*/
|
|
24771
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
24772
|
+
queryBIGIQQkviewTask(bIGIQQKVIEWTASKID, callback) {
|
|
24773
|
+
const meth = 'adapter-queryBIGIQQkviewTask';
|
|
24774
|
+
const origin = `${this.id}-${meth}`;
|
|
24775
|
+
log.trace(origin);
|
|
24776
|
+
|
|
24777
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
24778
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
24779
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24780
|
+
return callback(null, errorObj);
|
|
24781
|
+
}
|
|
24782
|
+
|
|
24783
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
24784
|
+
if (bIGIQQKVIEWTASKID === undefined || bIGIQQKVIEWTASKID === null || bIGIQQKVIEWTASKID === '') {
|
|
24785
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['bIGIQQKVIEWTASKID'], null, null, null);
|
|
24786
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24787
|
+
return callback(null, errorObj);
|
|
24788
|
+
}
|
|
24789
|
+
|
|
24790
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
24791
|
+
const queryParamsAvailable = {};
|
|
24792
|
+
const queryParams = {};
|
|
24793
|
+
const pathVars = [bIGIQQKVIEWTASKID];
|
|
24794
|
+
const bodyVars = {};
|
|
24795
|
+
|
|
24796
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
24797
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
24798
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
24799
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
24800
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
24801
|
+
}
|
|
24802
|
+
});
|
|
24803
|
+
|
|
24804
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
24805
|
+
// see adapter code documentation for more information on the request object's fields
|
|
24806
|
+
const reqObj = {
|
|
24807
|
+
payload: bodyVars,
|
|
24808
|
+
uriPathVars: pathVars,
|
|
24809
|
+
uriQuery: queryParams
|
|
24810
|
+
};
|
|
24811
|
+
|
|
24812
|
+
try {
|
|
24813
|
+
// Make the call -
|
|
24814
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
24815
|
+
return this.requestHandlerInst.identifyRequest('Qkview', 'queryBIGIQQkviewTask', reqObj, true, (irReturnData, irReturnError) => {
|
|
24816
|
+
// if we received an error or their is no response on the results
|
|
24817
|
+
// return an error
|
|
24818
|
+
if (irReturnError) {
|
|
24819
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
24820
|
+
return callback(null, irReturnError);
|
|
24821
|
+
}
|
|
24822
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
24823
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['queryBIGIQQkviewTask'], null, null, null);
|
|
24824
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24825
|
+
return callback(null, errorObj);
|
|
24826
|
+
}
|
|
24827
|
+
|
|
24828
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
24829
|
+
// return the response
|
|
24830
|
+
return callback(irReturnData, null);
|
|
24831
|
+
});
|
|
24832
|
+
} catch (ex) {
|
|
24833
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
24834
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24835
|
+
return callback(null, errorObj);
|
|
24836
|
+
}
|
|
24837
|
+
}
|
|
24838
|
+
|
|
24839
|
+
/**
|
|
24840
|
+
* @function deleteBIGIQQkview
|
|
24841
|
+
* @pronghornType method
|
|
24842
|
+
* @name deleteBIGIQQkview
|
|
24843
|
+
* @summary Delete BIG-IQ Qkview
|
|
24844
|
+
*
|
|
24845
|
+
* @param {string} bIGIQQKVIEWTASKID - bIGIQQKVIEWTASKID param
|
|
24846
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
24847
|
+
* @return {object} results - An object containing the response of the action
|
|
24848
|
+
*
|
|
24849
|
+
* @route {POST} /deleteBIGIQQkview
|
|
24850
|
+
* @roles admin
|
|
24851
|
+
* @task true
|
|
24852
|
+
*/
|
|
24853
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
24854
|
+
deleteBIGIQQkview(bIGIQQKVIEWTASKID, callback) {
|
|
24855
|
+
const meth = 'adapter-deleteBIGIQQkview';
|
|
24856
|
+
const origin = `${this.id}-${meth}`;
|
|
24857
|
+
log.trace(origin);
|
|
24858
|
+
|
|
24859
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
24860
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
24861
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24862
|
+
return callback(null, errorObj);
|
|
24863
|
+
}
|
|
24864
|
+
|
|
24865
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
24866
|
+
if (bIGIQQKVIEWTASKID === undefined || bIGIQQKVIEWTASKID === null || bIGIQQKVIEWTASKID === '') {
|
|
24867
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['bIGIQQKVIEWTASKID'], null, null, null);
|
|
24868
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24869
|
+
return callback(null, errorObj);
|
|
24870
|
+
}
|
|
24871
|
+
|
|
24872
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
24873
|
+
const queryParamsAvailable = {};
|
|
24874
|
+
const queryParams = {};
|
|
24875
|
+
const pathVars = [bIGIQQKVIEWTASKID];
|
|
24876
|
+
const bodyVars = {};
|
|
24877
|
+
|
|
24878
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
24879
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
24880
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
24881
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
24882
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
24883
|
+
}
|
|
24884
|
+
});
|
|
24885
|
+
|
|
24886
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
24887
|
+
// see adapter code documentation for more information on the request object's fields
|
|
24888
|
+
const reqObj = {
|
|
24889
|
+
payload: bodyVars,
|
|
24890
|
+
uriPathVars: pathVars,
|
|
24891
|
+
uriQuery: queryParams
|
|
24892
|
+
};
|
|
24893
|
+
|
|
24894
|
+
try {
|
|
24895
|
+
// Make the call -
|
|
24896
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
24897
|
+
return this.requestHandlerInst.identifyRequest('Qkview', 'deleteBIGIQQkview', reqObj, false, (irReturnData, irReturnError) => {
|
|
24898
|
+
// if we received an error or their is no response on the results
|
|
24899
|
+
// return an error
|
|
24900
|
+
if (irReturnError) {
|
|
24901
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
24902
|
+
return callback(null, irReturnError);
|
|
24903
|
+
}
|
|
24904
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
24905
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteBIGIQQkview'], null, null, null);
|
|
24906
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24907
|
+
return callback(null, errorObj);
|
|
24908
|
+
}
|
|
24909
|
+
|
|
24910
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
24911
|
+
// return the response
|
|
24912
|
+
return callback(irReturnData, null);
|
|
24913
|
+
});
|
|
24914
|
+
} catch (ex) {
|
|
24915
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
24916
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24917
|
+
return callback(null, errorObj);
|
|
24918
|
+
}
|
|
24919
|
+
}
|
|
24920
|
+
|
|
24921
|
+
/**
|
|
24922
|
+
* @function queryBIGIPQkviewTask
|
|
24923
|
+
* @pronghornType method
|
|
24924
|
+
* @name queryBIGIPQkviewTask
|
|
24925
|
+
* @summary Query BIGIP Qkview Task
|
|
24926
|
+
*
|
|
24927
|
+
* @param {string} bIGIPQKVIEWTASKID - bIGIPQKVIEWTASKID param
|
|
24928
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
24929
|
+
* @return {object} results - An object containing the response of the action
|
|
24930
|
+
*
|
|
24931
|
+
* @route {POST} /queryBIGIPQkviewTask
|
|
24932
|
+
* @roles admin
|
|
24933
|
+
* @task true
|
|
24934
|
+
*/
|
|
24935
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
24936
|
+
queryBIGIPQkviewTask(bIGIPQKVIEWTASKID, callback) {
|
|
24937
|
+
const meth = 'adapter-queryBIGIPQkviewTask';
|
|
24938
|
+
const origin = `${this.id}-${meth}`;
|
|
24939
|
+
log.trace(origin);
|
|
24940
|
+
|
|
24941
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
24942
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
24943
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24944
|
+
return callback(null, errorObj);
|
|
24945
|
+
}
|
|
24946
|
+
|
|
24947
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
24948
|
+
if (bIGIPQKVIEWTASKID === undefined || bIGIPQKVIEWTASKID === null || bIGIPQKVIEWTASKID === '') {
|
|
24949
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['bIGIPQKVIEWTASKID'], null, null, null);
|
|
24950
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24951
|
+
return callback(null, errorObj);
|
|
24952
|
+
}
|
|
24953
|
+
|
|
24954
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
24955
|
+
const queryParamsAvailable = {};
|
|
24956
|
+
const queryParams = {};
|
|
24957
|
+
const pathVars = [bIGIPQKVIEWTASKID];
|
|
24958
|
+
const bodyVars = {};
|
|
24959
|
+
|
|
24960
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
24961
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
24962
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
24963
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
24964
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
24965
|
+
}
|
|
24966
|
+
});
|
|
24967
|
+
|
|
24968
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
24969
|
+
// see adapter code documentation for more information on the request object's fields
|
|
24970
|
+
const reqObj = {
|
|
24971
|
+
payload: bodyVars,
|
|
24972
|
+
uriPathVars: pathVars,
|
|
24973
|
+
uriQuery: queryParams
|
|
24974
|
+
};
|
|
24975
|
+
|
|
24976
|
+
try {
|
|
24977
|
+
// Make the call -
|
|
24978
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
24979
|
+
return this.requestHandlerInst.identifyRequest('Qkview', 'queryBIGIPQkviewTask', reqObj, true, (irReturnData, irReturnError) => {
|
|
24980
|
+
// if we received an error or their is no response on the results
|
|
24981
|
+
// return an error
|
|
24982
|
+
if (irReturnError) {
|
|
24983
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
24984
|
+
return callback(null, irReturnError);
|
|
24985
|
+
}
|
|
24986
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
24987
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['queryBIGIPQkviewTask'], null, null, null);
|
|
24988
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24989
|
+
return callback(null, errorObj);
|
|
24990
|
+
}
|
|
24991
|
+
|
|
24992
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
24993
|
+
// return the response
|
|
24994
|
+
return callback(irReturnData, null);
|
|
24995
|
+
});
|
|
24996
|
+
} catch (ex) {
|
|
24997
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
24998
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
24999
|
+
return callback(null, errorObj);
|
|
25000
|
+
}
|
|
25001
|
+
}
|
|
25002
|
+
|
|
25003
|
+
/**
|
|
25004
|
+
* @function deleteaBIGIQQkview
|
|
25005
|
+
* @pronghornType method
|
|
25006
|
+
* @name deleteaBIGIQQkview
|
|
25007
|
+
* @summary Delete a BIGIP Qkview
|
|
25008
|
+
*
|
|
25009
|
+
* @param {string} bIGIPQKVIEWTASKID - bIGIPQKVIEWTASKID param
|
|
25010
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25011
|
+
* @return {object} results - An object containing the response of the action
|
|
25012
|
+
*
|
|
25013
|
+
* @route {POST} /deleteaBIGIQQkview
|
|
25014
|
+
* @roles admin
|
|
25015
|
+
* @task true
|
|
25016
|
+
*/
|
|
25017
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25018
|
+
deleteaBIGIQQkview(bIGIPQKVIEWTASKID, callback) {
|
|
25019
|
+
const meth = 'adapter-deleteaBIGIQQkview';
|
|
25020
|
+
const origin = `${this.id}-${meth}`;
|
|
25021
|
+
log.trace(origin);
|
|
25022
|
+
|
|
25023
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25024
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25025
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25026
|
+
return callback(null, errorObj);
|
|
25027
|
+
}
|
|
25028
|
+
|
|
25029
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25030
|
+
if (bIGIPQKVIEWTASKID === undefined || bIGIPQKVIEWTASKID === null || bIGIPQKVIEWTASKID === '') {
|
|
25031
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['bIGIPQKVIEWTASKID'], null, null, null);
|
|
25032
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25033
|
+
return callback(null, errorObj);
|
|
25034
|
+
}
|
|
25035
|
+
|
|
25036
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25037
|
+
const queryParamsAvailable = {};
|
|
25038
|
+
const queryParams = {};
|
|
25039
|
+
const pathVars = [bIGIPQKVIEWTASKID];
|
|
25040
|
+
const bodyVars = {};
|
|
25041
|
+
|
|
25042
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25043
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25044
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25045
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25046
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25047
|
+
}
|
|
25048
|
+
});
|
|
25049
|
+
|
|
25050
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25051
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25052
|
+
const reqObj = {
|
|
25053
|
+
payload: bodyVars,
|
|
25054
|
+
uriPathVars: pathVars,
|
|
25055
|
+
uriQuery: queryParams
|
|
25056
|
+
};
|
|
25057
|
+
|
|
25058
|
+
try {
|
|
25059
|
+
// Make the call -
|
|
25060
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25061
|
+
return this.requestHandlerInst.identifyRequest('Qkview', 'deleteaBIGIQQkview', reqObj, false, (irReturnData, irReturnError) => {
|
|
25062
|
+
// if we received an error or their is no response on the results
|
|
25063
|
+
// return an error
|
|
25064
|
+
if (irReturnError) {
|
|
25065
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25066
|
+
return callback(null, irReturnError);
|
|
25067
|
+
}
|
|
25068
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25069
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteaBIGIQQkview'], null, null, null);
|
|
25070
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25071
|
+
return callback(null, errorObj);
|
|
25072
|
+
}
|
|
25073
|
+
|
|
25074
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25075
|
+
// return the response
|
|
25076
|
+
return callback(irReturnData, null);
|
|
25077
|
+
});
|
|
25078
|
+
} catch (ex) {
|
|
25079
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25080
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25081
|
+
return callback(null, errorObj);
|
|
25082
|
+
}
|
|
25083
|
+
}
|
|
25084
|
+
|
|
25085
|
+
/**
|
|
25086
|
+
* @function getExampleBIGIPiHealthReport
|
|
25087
|
+
* @pronghornType method
|
|
25088
|
+
* @name getExampleBIGIPiHealthReport
|
|
25089
|
+
* @summary EXAMPLE - BIG-IP iHealth Report
|
|
25090
|
+
*
|
|
25091
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25092
|
+
* @return {object} results - An object containing the response of the action
|
|
25093
|
+
*
|
|
25094
|
+
* @route {GET} /getExampleBIGIPiHealthReport
|
|
25095
|
+
* @roles admin
|
|
25096
|
+
* @task true
|
|
25097
|
+
*/
|
|
25098
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25099
|
+
getExampleBIGIPiHealthReport(callback) {
|
|
25100
|
+
const meth = 'adapter-getExampleBIGIPiHealthReport';
|
|
25101
|
+
const origin = `${this.id}-${meth}`;
|
|
25102
|
+
log.trace(origin);
|
|
25103
|
+
|
|
25104
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25105
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25106
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25107
|
+
return callback(null, errorObj);
|
|
25108
|
+
}
|
|
25109
|
+
|
|
25110
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25111
|
+
|
|
25112
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25113
|
+
const queryParamsAvailable = {};
|
|
25114
|
+
const queryParams = {};
|
|
25115
|
+
const pathVars = [];
|
|
25116
|
+
const bodyVars = {};
|
|
25117
|
+
|
|
25118
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25119
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25120
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25121
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25122
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25123
|
+
}
|
|
25124
|
+
});
|
|
25125
|
+
|
|
25126
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25127
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25128
|
+
const reqObj = {
|
|
25129
|
+
payload: bodyVars,
|
|
25130
|
+
uriPathVars: pathVars,
|
|
25131
|
+
uriQuery: queryParams
|
|
25132
|
+
};
|
|
25133
|
+
|
|
25134
|
+
try {
|
|
25135
|
+
// Make the call -
|
|
25136
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25137
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'getExampleBIGIPiHealthReport', reqObj, true, (irReturnData, irReturnError) => {
|
|
25138
|
+
// if we received an error or their is no response on the results
|
|
25139
|
+
// return an error
|
|
25140
|
+
if (irReturnError) {
|
|
25141
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25142
|
+
return callback(null, irReturnError);
|
|
25143
|
+
}
|
|
25144
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25145
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getExampleBIGIPiHealthReport'], null, null, null);
|
|
25146
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25147
|
+
return callback(null, errorObj);
|
|
25148
|
+
}
|
|
25149
|
+
|
|
25150
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25151
|
+
// return the response
|
|
25152
|
+
return callback(irReturnData, null);
|
|
25153
|
+
});
|
|
25154
|
+
} catch (ex) {
|
|
25155
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25156
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25157
|
+
return callback(null, errorObj);
|
|
25158
|
+
}
|
|
25159
|
+
}
|
|
25160
|
+
|
|
25161
|
+
/**
|
|
25162
|
+
* @function getExampleBIGIPiHealthUploads
|
|
25163
|
+
* @pronghornType method
|
|
25164
|
+
* @name getExampleBIGIPiHealthUploads
|
|
25165
|
+
* @summary EXAMPLE - BIG-IP iHealth Uploads
|
|
25166
|
+
*
|
|
25167
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25168
|
+
* @return {object} results - An object containing the response of the action
|
|
25169
|
+
*
|
|
25170
|
+
* @route {GET} /getExampleBIGIPiHealthUploads
|
|
25171
|
+
* @roles admin
|
|
25172
|
+
* @task true
|
|
25173
|
+
*/
|
|
25174
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25175
|
+
getExampleBIGIPiHealthUploads(callback) {
|
|
25176
|
+
const meth = 'adapter-getExampleBIGIPiHealthUploads';
|
|
25177
|
+
const origin = `${this.id}-${meth}`;
|
|
25178
|
+
log.trace(origin);
|
|
25179
|
+
|
|
25180
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25181
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25182
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25183
|
+
return callback(null, errorObj);
|
|
25184
|
+
}
|
|
25185
|
+
|
|
25186
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25187
|
+
|
|
25188
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25189
|
+
const queryParamsAvailable = {};
|
|
25190
|
+
const queryParams = {};
|
|
25191
|
+
const pathVars = [];
|
|
25192
|
+
const bodyVars = {};
|
|
25193
|
+
|
|
25194
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25195
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25196
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25197
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25198
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25199
|
+
}
|
|
25200
|
+
});
|
|
25201
|
+
|
|
25202
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25203
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25204
|
+
const reqObj = {
|
|
25205
|
+
payload: bodyVars,
|
|
25206
|
+
uriPathVars: pathVars,
|
|
25207
|
+
uriQuery: queryParams
|
|
25208
|
+
};
|
|
25209
|
+
|
|
25210
|
+
try {
|
|
25211
|
+
// Make the call -
|
|
25212
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25213
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'getExampleBIGIPiHealthUploads', reqObj, true, (irReturnData, irReturnError) => {
|
|
25214
|
+
// if we received an error or their is no response on the results
|
|
25215
|
+
// return an error
|
|
25216
|
+
if (irReturnError) {
|
|
25217
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25218
|
+
return callback(null, irReturnError);
|
|
25219
|
+
}
|
|
25220
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25221
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getExampleBIGIPiHealthUploads'], null, null, null);
|
|
25222
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25223
|
+
return callback(null, errorObj);
|
|
25224
|
+
}
|
|
25225
|
+
|
|
25226
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25227
|
+
// return the response
|
|
25228
|
+
return callback(irReturnData, null);
|
|
25229
|
+
});
|
|
25230
|
+
} catch (ex) {
|
|
25231
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25232
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25233
|
+
return callback(null, errorObj);
|
|
25234
|
+
}
|
|
25235
|
+
}
|
|
25236
|
+
|
|
25237
|
+
/**
|
|
25238
|
+
* @function getExampleBIGIPiHealthCredentials
|
|
25239
|
+
* @pronghornType method
|
|
25240
|
+
* @name getExampleBIGIPiHealthCredentials
|
|
25241
|
+
* @summary EXAMPLE - BIG-IP iHealth Credentials
|
|
25242
|
+
*
|
|
25243
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25244
|
+
* @return {object} results - An object containing the response of the action
|
|
25245
|
+
*
|
|
25246
|
+
* @route {GET} /getExampleBIGIPiHealthCredentials
|
|
25247
|
+
* @roles admin
|
|
25248
|
+
* @task true
|
|
25249
|
+
*/
|
|
25250
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25251
|
+
getExampleBIGIPiHealthCredentials(callback) {
|
|
25252
|
+
const meth = 'adapter-getExampleBIGIPiHealthCredentials';
|
|
25253
|
+
const origin = `${this.id}-${meth}`;
|
|
25254
|
+
log.trace(origin);
|
|
25255
|
+
|
|
25256
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25257
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25258
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25259
|
+
return callback(null, errorObj);
|
|
25260
|
+
}
|
|
25261
|
+
|
|
25262
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25263
|
+
|
|
25264
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25265
|
+
const queryParamsAvailable = {};
|
|
25266
|
+
const queryParams = {};
|
|
25267
|
+
const pathVars = [];
|
|
25268
|
+
const bodyVars = {};
|
|
25269
|
+
|
|
25270
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25271
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25272
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25273
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25274
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25275
|
+
}
|
|
25276
|
+
});
|
|
25277
|
+
|
|
25278
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25279
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25280
|
+
const reqObj = {
|
|
25281
|
+
payload: bodyVars,
|
|
25282
|
+
uriPathVars: pathVars,
|
|
25283
|
+
uriQuery: queryParams
|
|
25284
|
+
};
|
|
25285
|
+
|
|
25286
|
+
try {
|
|
25287
|
+
// Make the call -
|
|
25288
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25289
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'getExampleBIGIPiHealthCredentials', reqObj, true, (irReturnData, irReturnError) => {
|
|
25290
|
+
// if we received an error or their is no response on the results
|
|
25291
|
+
// return an error
|
|
25292
|
+
if (irReturnError) {
|
|
25293
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25294
|
+
return callback(null, irReturnError);
|
|
25295
|
+
}
|
|
25296
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25297
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getExampleBIGIPiHealthCredentials'], null, null, null);
|
|
25298
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25299
|
+
return callback(null, errorObj);
|
|
25300
|
+
}
|
|
25301
|
+
|
|
25302
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25303
|
+
// return the response
|
|
25304
|
+
return callback(irReturnData, null);
|
|
25305
|
+
});
|
|
25306
|
+
} catch (ex) {
|
|
25307
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25308
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25309
|
+
return callback(null, errorObj);
|
|
25310
|
+
}
|
|
25311
|
+
}
|
|
25312
|
+
|
|
25313
|
+
/**
|
|
25314
|
+
* @function getExampleBIGIPiHealthConfig
|
|
25315
|
+
* @pronghornType method
|
|
25316
|
+
* @name getExampleBIGIPiHealthConfig
|
|
25317
|
+
* @summary EXAMPLE - BIG-IP iHealth Config
|
|
25318
|
+
*
|
|
25319
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25320
|
+
* @return {object} results - An object containing the response of the action
|
|
25321
|
+
*
|
|
25322
|
+
* @route {GET} /getExampleBIGIPiHealthConfig
|
|
25323
|
+
* @roles admin
|
|
25324
|
+
* @task true
|
|
25325
|
+
*/
|
|
25326
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25327
|
+
getExampleBIGIPiHealthConfig(callback) {
|
|
25328
|
+
const meth = 'adapter-getExampleBIGIPiHealthConfig';
|
|
25329
|
+
const origin = `${this.id}-${meth}`;
|
|
25330
|
+
log.trace(origin);
|
|
25331
|
+
|
|
25332
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25333
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25334
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25335
|
+
return callback(null, errorObj);
|
|
25336
|
+
}
|
|
25337
|
+
|
|
25338
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25339
|
+
|
|
25340
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25341
|
+
const queryParamsAvailable = {};
|
|
25342
|
+
const queryParams = {};
|
|
25343
|
+
const pathVars = [];
|
|
25344
|
+
const bodyVars = {};
|
|
25345
|
+
|
|
25346
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25347
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25348
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25349
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25350
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25351
|
+
}
|
|
25352
|
+
});
|
|
25353
|
+
|
|
25354
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25355
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25356
|
+
const reqObj = {
|
|
25357
|
+
payload: bodyVars,
|
|
25358
|
+
uriPathVars: pathVars,
|
|
25359
|
+
uriQuery: queryParams
|
|
25360
|
+
};
|
|
25361
|
+
|
|
25362
|
+
try {
|
|
25363
|
+
// Make the call -
|
|
25364
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25365
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'getExampleBIGIPiHealthConfig', reqObj, true, (irReturnData, irReturnError) => {
|
|
25366
|
+
// if we received an error or their is no response on the results
|
|
25367
|
+
// return an error
|
|
25368
|
+
if (irReturnError) {
|
|
25369
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25370
|
+
return callback(null, irReturnError);
|
|
25371
|
+
}
|
|
25372
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25373
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getExampleBIGIPiHealthConfig'], null, null, null);
|
|
25374
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25375
|
+
return callback(null, errorObj);
|
|
25376
|
+
}
|
|
25377
|
+
|
|
25378
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25379
|
+
// return the response
|
|
25380
|
+
return callback(irReturnData, null);
|
|
25381
|
+
});
|
|
25382
|
+
} catch (ex) {
|
|
25383
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25384
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25385
|
+
return callback(null, errorObj);
|
|
25386
|
+
}
|
|
25387
|
+
}
|
|
25388
|
+
|
|
25389
|
+
/**
|
|
25390
|
+
* @function retrieveBIGIPiHealthReports
|
|
25391
|
+
* @pronghornType method
|
|
25392
|
+
* @name retrieveBIGIPiHealthReports
|
|
25393
|
+
* @summary Retrieve BIG-IP iHealth Reports
|
|
25394
|
+
*
|
|
25395
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25396
|
+
* @return {object} results - An object containing the response of the action
|
|
25397
|
+
*
|
|
25398
|
+
* @route {GET} /retrieveBIGIPiHealthReports
|
|
25399
|
+
* @roles admin
|
|
25400
|
+
* @task true
|
|
25401
|
+
*/
|
|
25402
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25403
|
+
retrieveBIGIPiHealthReports(callback) {
|
|
25404
|
+
const meth = 'adapter-retrieveBIGIPiHealthReports';
|
|
25405
|
+
const origin = `${this.id}-${meth}`;
|
|
25406
|
+
log.trace(origin);
|
|
25407
|
+
|
|
25408
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25409
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25410
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25411
|
+
return callback(null, errorObj);
|
|
25412
|
+
}
|
|
25413
|
+
|
|
25414
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25415
|
+
|
|
25416
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25417
|
+
const queryParamsAvailable = {};
|
|
25418
|
+
const queryParams = {};
|
|
25419
|
+
const pathVars = [];
|
|
25420
|
+
const bodyVars = {};
|
|
25421
|
+
|
|
25422
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25423
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25424
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25425
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25426
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25427
|
+
}
|
|
25428
|
+
});
|
|
25429
|
+
|
|
25430
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25431
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25432
|
+
const reqObj = {
|
|
25433
|
+
payload: bodyVars,
|
|
25434
|
+
uriPathVars: pathVars,
|
|
25435
|
+
uriQuery: queryParams
|
|
25436
|
+
};
|
|
25437
|
+
|
|
25438
|
+
try {
|
|
25439
|
+
// Make the call -
|
|
25440
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25441
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'retrieveBIGIPiHealthReports', reqObj, true, (irReturnData, irReturnError) => {
|
|
25442
|
+
// if we received an error or their is no response on the results
|
|
25443
|
+
// return an error
|
|
25444
|
+
if (irReturnError) {
|
|
25445
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25446
|
+
return callback(null, irReturnError);
|
|
25447
|
+
}
|
|
25448
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25449
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveBIGIPiHealthReports'], null, null, null);
|
|
25450
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25451
|
+
return callback(null, errorObj);
|
|
25452
|
+
}
|
|
25453
|
+
|
|
25454
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25455
|
+
// return the response
|
|
25456
|
+
return callback(irReturnData, null);
|
|
25457
|
+
});
|
|
25458
|
+
} catch (ex) {
|
|
25459
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25460
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25461
|
+
return callback(null, errorObj);
|
|
25462
|
+
}
|
|
25463
|
+
}
|
|
25464
|
+
|
|
25465
|
+
/**
|
|
25466
|
+
* @function generateBIGIPiHealthReport
|
|
25467
|
+
* @pronghornType method
|
|
25468
|
+
* @name generateBIGIPiHealthReport
|
|
25469
|
+
* @summary Generate BIG-IP iHealth Report
|
|
25470
|
+
*
|
|
25471
|
+
* @param {object} body - body param
|
|
25472
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25473
|
+
* @return {object} results - An object containing the response of the action
|
|
25474
|
+
*
|
|
25475
|
+
* @route {POST} /generateBIGIPiHealthReport
|
|
25476
|
+
* @roles admin
|
|
25477
|
+
* @task true
|
|
25478
|
+
*/
|
|
25479
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25480
|
+
generateBIGIPiHealthReport(body, callback) {
|
|
25481
|
+
const meth = 'adapter-generateBIGIPiHealthReport';
|
|
25482
|
+
const origin = `${this.id}-${meth}`;
|
|
25483
|
+
log.trace(origin);
|
|
25484
|
+
|
|
25485
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25486
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25487
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25488
|
+
return callback(null, errorObj);
|
|
25489
|
+
}
|
|
25490
|
+
|
|
25491
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25492
|
+
if (body === undefined || body === null || body === '') {
|
|
25493
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
25494
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25495
|
+
return callback(null, errorObj);
|
|
25496
|
+
}
|
|
25497
|
+
|
|
25498
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25499
|
+
const queryParamsAvailable = {};
|
|
25500
|
+
const queryParams = {};
|
|
25501
|
+
const pathVars = [];
|
|
25502
|
+
const bodyVars = body;
|
|
25503
|
+
|
|
25504
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25505
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25506
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25507
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25508
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25509
|
+
}
|
|
25510
|
+
});
|
|
25511
|
+
|
|
25512
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25513
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25514
|
+
const reqObj = {
|
|
25515
|
+
payload: bodyVars,
|
|
25516
|
+
uriPathVars: pathVars,
|
|
25517
|
+
uriQuery: queryParams
|
|
25518
|
+
};
|
|
25519
|
+
|
|
25520
|
+
try {
|
|
25521
|
+
// Make the call -
|
|
25522
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25523
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'generateBIGIPiHealthReport', reqObj, true, (irReturnData, irReturnError) => {
|
|
25524
|
+
// if we received an error or their is no response on the results
|
|
25525
|
+
// return an error
|
|
25526
|
+
if (irReturnError) {
|
|
25527
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25528
|
+
return callback(null, irReturnError);
|
|
25529
|
+
}
|
|
25530
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25531
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['generateBIGIPiHealthReport'], null, null, null);
|
|
25532
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25533
|
+
return callback(null, errorObj);
|
|
25534
|
+
}
|
|
25535
|
+
|
|
25536
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25537
|
+
// return the response
|
|
25538
|
+
return callback(irReturnData, null);
|
|
25539
|
+
});
|
|
25540
|
+
} catch (ex) {
|
|
25541
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25542
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25543
|
+
return callback(null, errorObj);
|
|
25544
|
+
}
|
|
25545
|
+
}
|
|
25546
|
+
|
|
25547
|
+
/**
|
|
25548
|
+
* @function retrieveBIGIPiHealthCredentials
|
|
25549
|
+
* @pronghornType method
|
|
25550
|
+
* @name retrieveBIGIPiHealthCredentials
|
|
25551
|
+
* @summary Retrieve BIG-IP iHealth Credentials
|
|
25552
|
+
*
|
|
25553
|
+
* @param {string} [filter] - filter param
|
|
25554
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25555
|
+
* @return {object} results - An object containing the response of the action
|
|
25556
|
+
*
|
|
25557
|
+
* @route {POST} /retrieveBIGIPiHealthCredentials
|
|
25558
|
+
* @roles admin
|
|
25559
|
+
* @task true
|
|
25560
|
+
*/
|
|
25561
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25562
|
+
retrieveBIGIPiHealthCredentials(filter, callback) {
|
|
25563
|
+
const meth = 'adapter-retrieveBIGIPiHealthCredentials';
|
|
25564
|
+
const origin = `${this.id}-${meth}`;
|
|
25565
|
+
log.trace(origin);
|
|
25566
|
+
|
|
25567
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25568
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25569
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25570
|
+
return callback(null, errorObj);
|
|
25571
|
+
}
|
|
25572
|
+
|
|
25573
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25574
|
+
|
|
25575
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25576
|
+
const queryParamsAvailable = { $filter: filter };
|
|
25577
|
+
const queryParams = {};
|
|
25578
|
+
const pathVars = [];
|
|
25579
|
+
const bodyVars = {};
|
|
25580
|
+
|
|
25581
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25582
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25583
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25584
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25585
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25586
|
+
}
|
|
25587
|
+
});
|
|
25588
|
+
|
|
25589
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25590
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25591
|
+
const reqObj = {
|
|
25592
|
+
payload: bodyVars,
|
|
25593
|
+
uriPathVars: pathVars,
|
|
25594
|
+
uriQuery: queryParams
|
|
25595
|
+
};
|
|
25596
|
+
|
|
25597
|
+
try {
|
|
25598
|
+
// Make the call -
|
|
25599
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25600
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'retrieveBIGIPiHealthCredentials', reqObj, true, (irReturnData, irReturnError) => {
|
|
25601
|
+
// if we received an error or their is no response on the results
|
|
25602
|
+
// return an error
|
|
25603
|
+
if (irReturnError) {
|
|
25604
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25605
|
+
return callback(null, irReturnError);
|
|
25606
|
+
}
|
|
25607
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25608
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveBIGIPiHealthCredentials'], null, null, null);
|
|
25609
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25610
|
+
return callback(null, errorObj);
|
|
25611
|
+
}
|
|
25612
|
+
|
|
25613
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25614
|
+
// return the response
|
|
25615
|
+
return callback(irReturnData, null);
|
|
25616
|
+
});
|
|
25617
|
+
} catch (ex) {
|
|
25618
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25619
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25620
|
+
return callback(null, errorObj);
|
|
25621
|
+
}
|
|
25622
|
+
}
|
|
25623
|
+
|
|
25624
|
+
/**
|
|
25625
|
+
* @function createTestBIGIPiHealthCredentials
|
|
25626
|
+
* @pronghornType method
|
|
25627
|
+
* @name createTestBIGIPiHealthCredentials
|
|
25628
|
+
* @summary Create Test BIG-IP iHealth Credentials
|
|
25629
|
+
*
|
|
25630
|
+
* @param {object} body - body param
|
|
25631
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25632
|
+
* @return {object} results - An object containing the response of the action
|
|
25633
|
+
*
|
|
25634
|
+
* @route {POST} /createTestBIGIPiHealthCredentials
|
|
25635
|
+
* @roles admin
|
|
25636
|
+
* @task true
|
|
25637
|
+
*/
|
|
25638
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25639
|
+
createTestBIGIPiHealthCredentials(body, callback) {
|
|
25640
|
+
const meth = 'adapter-createTestBIGIPiHealthCredentials';
|
|
25641
|
+
const origin = `${this.id}-${meth}`;
|
|
25642
|
+
log.trace(origin);
|
|
25643
|
+
|
|
25644
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25645
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25646
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25647
|
+
return callback(null, errorObj);
|
|
25648
|
+
}
|
|
25649
|
+
|
|
25650
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25651
|
+
if (body === undefined || body === null || body === '') {
|
|
25652
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
25653
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25654
|
+
return callback(null, errorObj);
|
|
25655
|
+
}
|
|
25656
|
+
|
|
25657
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25658
|
+
const queryParamsAvailable = {};
|
|
25659
|
+
const queryParams = {};
|
|
25660
|
+
const pathVars = [];
|
|
25661
|
+
const bodyVars = body;
|
|
25662
|
+
|
|
25663
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25664
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25665
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25666
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25667
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25668
|
+
}
|
|
25669
|
+
});
|
|
25670
|
+
|
|
25671
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25672
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25673
|
+
const reqObj = {
|
|
25674
|
+
payload: bodyVars,
|
|
25675
|
+
uriPathVars: pathVars,
|
|
25676
|
+
uriQuery: queryParams
|
|
25677
|
+
};
|
|
25678
|
+
|
|
25679
|
+
try {
|
|
25680
|
+
// Make the call -
|
|
25681
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25682
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'createTestBIGIPiHealthCredentials', reqObj, true, (irReturnData, irReturnError) => {
|
|
25683
|
+
// if we received an error or their is no response on the results
|
|
25684
|
+
// return an error
|
|
25685
|
+
if (irReturnError) {
|
|
25686
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25687
|
+
return callback(null, irReturnError);
|
|
25688
|
+
}
|
|
25689
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25690
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createTestBIGIPiHealthCredentials'], null, null, null);
|
|
25691
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25692
|
+
return callback(null, errorObj);
|
|
25693
|
+
}
|
|
25694
|
+
|
|
25695
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25696
|
+
// return the response
|
|
25697
|
+
return callback(irReturnData, null);
|
|
25698
|
+
});
|
|
25699
|
+
} catch (ex) {
|
|
25700
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25701
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25702
|
+
return callback(null, errorObj);
|
|
25703
|
+
}
|
|
25704
|
+
}
|
|
25705
|
+
|
|
25706
|
+
/**
|
|
25707
|
+
* @function retrieveBIGIPiHealthConfig
|
|
25708
|
+
* @pronghornType method
|
|
25709
|
+
* @name retrieveBIGIPiHealthConfig
|
|
25710
|
+
* @summary Retrieve BIG-IP iHealth Config
|
|
25711
|
+
*
|
|
25712
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25713
|
+
* @return {object} results - An object containing the response of the action
|
|
25714
|
+
*
|
|
25715
|
+
* @route {GET} /retrieveBIGIPiHealthConfig
|
|
25716
|
+
* @roles admin
|
|
25717
|
+
* @task true
|
|
25718
|
+
*/
|
|
25719
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25720
|
+
retrieveBIGIPiHealthConfig(callback) {
|
|
25721
|
+
const meth = 'adapter-retrieveBIGIPiHealthConfig';
|
|
25722
|
+
const origin = `${this.id}-${meth}`;
|
|
25723
|
+
log.trace(origin);
|
|
25724
|
+
|
|
25725
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25726
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25727
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25728
|
+
return callback(null, errorObj);
|
|
25729
|
+
}
|
|
25730
|
+
|
|
25731
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25732
|
+
|
|
25733
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25734
|
+
const queryParamsAvailable = {};
|
|
25735
|
+
const queryParams = {};
|
|
25736
|
+
const pathVars = [];
|
|
25737
|
+
const bodyVars = {};
|
|
25738
|
+
|
|
25739
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25740
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25741
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25742
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25743
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25744
|
+
}
|
|
25745
|
+
});
|
|
25746
|
+
|
|
25747
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25748
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25749
|
+
const reqObj = {
|
|
25750
|
+
payload: bodyVars,
|
|
25751
|
+
uriPathVars: pathVars,
|
|
25752
|
+
uriQuery: queryParams
|
|
25753
|
+
};
|
|
25754
|
+
|
|
25755
|
+
try {
|
|
25756
|
+
// Make the call -
|
|
25757
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25758
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'retrieveBIGIPiHealthConfig', reqObj, true, (irReturnData, irReturnError) => {
|
|
25759
|
+
// if we received an error or their is no response on the results
|
|
25760
|
+
// return an error
|
|
25761
|
+
if (irReturnError) {
|
|
25762
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25763
|
+
return callback(null, irReturnError);
|
|
25764
|
+
}
|
|
25765
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25766
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveBIGIPiHealthConfig'], null, null, null);
|
|
25767
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25768
|
+
return callback(null, errorObj);
|
|
25769
|
+
}
|
|
25770
|
+
|
|
25771
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25772
|
+
// return the response
|
|
25773
|
+
return callback(irReturnData, null);
|
|
25774
|
+
});
|
|
25775
|
+
} catch (ex) {
|
|
25776
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25777
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25778
|
+
return callback(null, errorObj);
|
|
25779
|
+
}
|
|
25780
|
+
}
|
|
25781
|
+
|
|
25782
|
+
/**
|
|
25783
|
+
* @function updateBIGIPiHealthConfig
|
|
25784
|
+
* @pronghornType method
|
|
25785
|
+
* @name updateBIGIPiHealthConfig
|
|
25786
|
+
* @summary Update BIG-IP iHealth Config
|
|
25787
|
+
*
|
|
25788
|
+
* @param {object} body - body param
|
|
25789
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25790
|
+
* @return {object} results - An object containing the response of the action
|
|
25791
|
+
*
|
|
25792
|
+
* @route {POST} /updateBIGIPiHealthConfig
|
|
25793
|
+
* @roles admin
|
|
25794
|
+
* @task true
|
|
25795
|
+
*/
|
|
25796
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25797
|
+
updateBIGIPiHealthConfig(body, callback) {
|
|
25798
|
+
const meth = 'adapter-updateBIGIPiHealthConfig';
|
|
25799
|
+
const origin = `${this.id}-${meth}`;
|
|
25800
|
+
log.trace(origin);
|
|
25801
|
+
|
|
25802
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25803
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25804
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25805
|
+
return callback(null, errorObj);
|
|
25806
|
+
}
|
|
25807
|
+
|
|
25808
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25809
|
+
if (body === undefined || body === null || body === '') {
|
|
25810
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
25811
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25812
|
+
return callback(null, errorObj);
|
|
25813
|
+
}
|
|
25814
|
+
|
|
25815
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25816
|
+
const queryParamsAvailable = {};
|
|
25817
|
+
const queryParams = {};
|
|
25818
|
+
const pathVars = [];
|
|
25819
|
+
const bodyVars = body;
|
|
25820
|
+
|
|
25821
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25822
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25823
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25824
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25825
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25826
|
+
}
|
|
25827
|
+
});
|
|
25828
|
+
|
|
25829
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25830
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25831
|
+
const reqObj = {
|
|
25832
|
+
payload: bodyVars,
|
|
25833
|
+
uriPathVars: pathVars,
|
|
25834
|
+
uriQuery: queryParams
|
|
25835
|
+
};
|
|
25836
|
+
|
|
25837
|
+
try {
|
|
25838
|
+
// Make the call -
|
|
25839
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25840
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'updateBIGIPiHealthConfig', reqObj, false, (irReturnData, irReturnError) => {
|
|
25841
|
+
// if we received an error or their is no response on the results
|
|
25842
|
+
// return an error
|
|
25843
|
+
if (irReturnError) {
|
|
25844
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25845
|
+
return callback(null, irReturnError);
|
|
25846
|
+
}
|
|
25847
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25848
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['updateBIGIPiHealthConfig'], null, null, null);
|
|
25849
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25850
|
+
return callback(null, errorObj);
|
|
25851
|
+
}
|
|
25852
|
+
|
|
25853
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25854
|
+
// return the response
|
|
25855
|
+
return callback(irReturnData, null);
|
|
25856
|
+
});
|
|
25857
|
+
} catch (ex) {
|
|
25858
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25859
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25860
|
+
return callback(null, errorObj);
|
|
25861
|
+
}
|
|
25862
|
+
}
|
|
25863
|
+
|
|
25864
|
+
/**
|
|
25865
|
+
* @function retrieveBIGIPiHealthUploads
|
|
25866
|
+
* @pronghornType method
|
|
25867
|
+
* @name retrieveBIGIPiHealthUploads
|
|
25868
|
+
* @summary Retrieve BIG-IP iHealth Uploads
|
|
25869
|
+
*
|
|
25870
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25871
|
+
* @return {object} results - An object containing the response of the action
|
|
25872
|
+
*
|
|
25873
|
+
* @route {GET} /retrieveBIGIPiHealthUploads
|
|
25874
|
+
* @roles admin
|
|
25875
|
+
* @task true
|
|
25876
|
+
*/
|
|
25877
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25878
|
+
retrieveBIGIPiHealthUploads(callback) {
|
|
25879
|
+
const meth = 'adapter-retrieveBIGIPiHealthUploads';
|
|
25880
|
+
const origin = `${this.id}-${meth}`;
|
|
25881
|
+
log.trace(origin);
|
|
25882
|
+
|
|
25883
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25884
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25885
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25886
|
+
return callback(null, errorObj);
|
|
25887
|
+
}
|
|
25888
|
+
|
|
25889
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25890
|
+
|
|
25891
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25892
|
+
const queryParamsAvailable = {};
|
|
25893
|
+
const queryParams = {};
|
|
25894
|
+
const pathVars = [];
|
|
25895
|
+
const bodyVars = {};
|
|
25896
|
+
|
|
25897
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25898
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25899
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25900
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25901
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25902
|
+
}
|
|
25903
|
+
});
|
|
25904
|
+
|
|
25905
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25906
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25907
|
+
const reqObj = {
|
|
25908
|
+
payload: bodyVars,
|
|
25909
|
+
uriPathVars: pathVars,
|
|
25910
|
+
uriQuery: queryParams
|
|
25911
|
+
};
|
|
25912
|
+
|
|
25913
|
+
try {
|
|
25914
|
+
// Make the call -
|
|
25915
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25916
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'retrieveBIGIPiHealthUploads', reqObj, true, (irReturnData, irReturnError) => {
|
|
25917
|
+
// if we received an error or their is no response on the results
|
|
25918
|
+
// return an error
|
|
25919
|
+
if (irReturnError) {
|
|
25920
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
25921
|
+
return callback(null, irReturnError);
|
|
25922
|
+
}
|
|
25923
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
25924
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveBIGIPiHealthUploads'], null, null, null);
|
|
25925
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25926
|
+
return callback(null, errorObj);
|
|
25927
|
+
}
|
|
25928
|
+
|
|
25929
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
25930
|
+
// return the response
|
|
25931
|
+
return callback(irReturnData, null);
|
|
25932
|
+
});
|
|
25933
|
+
} catch (ex) {
|
|
25934
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
25935
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25936
|
+
return callback(null, errorObj);
|
|
25937
|
+
}
|
|
25938
|
+
}
|
|
25939
|
+
|
|
25940
|
+
/**
|
|
25941
|
+
* @function createBIGIPiHealthUploadTask
|
|
25942
|
+
* @pronghornType method
|
|
25943
|
+
* @name createBIGIPiHealthUploadTask
|
|
25944
|
+
* @summary Create BIG-IP iHealth Upload Task
|
|
25945
|
+
*
|
|
25946
|
+
* @param {object} body - body param
|
|
25947
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
25948
|
+
* @return {object} results - An object containing the response of the action
|
|
25949
|
+
*
|
|
25950
|
+
* @route {POST} /createBIGIPiHealthUploadTask
|
|
25951
|
+
* @roles admin
|
|
25952
|
+
* @task true
|
|
25953
|
+
*/
|
|
25954
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
25955
|
+
createBIGIPiHealthUploadTask(body, callback) {
|
|
25956
|
+
const meth = 'adapter-createBIGIPiHealthUploadTask';
|
|
25957
|
+
const origin = `${this.id}-${meth}`;
|
|
25958
|
+
log.trace(origin);
|
|
25959
|
+
|
|
25960
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
25961
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
25962
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25963
|
+
return callback(null, errorObj);
|
|
25964
|
+
}
|
|
25965
|
+
|
|
25966
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
25967
|
+
if (body === undefined || body === null || body === '') {
|
|
25968
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
25969
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
25970
|
+
return callback(null, errorObj);
|
|
25971
|
+
}
|
|
25972
|
+
|
|
25973
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
25974
|
+
const queryParamsAvailable = {};
|
|
25975
|
+
const queryParams = {};
|
|
25976
|
+
const pathVars = [];
|
|
25977
|
+
const bodyVars = body;
|
|
25978
|
+
|
|
25979
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
25980
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
25981
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
25982
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
25983
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
25984
|
+
}
|
|
25985
|
+
});
|
|
25986
|
+
|
|
25987
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
25988
|
+
// see adapter code documentation for more information on the request object's fields
|
|
25989
|
+
const reqObj = {
|
|
25990
|
+
payload: bodyVars,
|
|
25991
|
+
uriPathVars: pathVars,
|
|
25992
|
+
uriQuery: queryParams
|
|
25993
|
+
};
|
|
25994
|
+
|
|
25995
|
+
try {
|
|
25996
|
+
// Make the call -
|
|
25997
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
25998
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'createBIGIPiHealthUploadTask', reqObj, true, (irReturnData, irReturnError) => {
|
|
25999
|
+
// if we received an error or their is no response on the results
|
|
26000
|
+
// return an error
|
|
26001
|
+
if (irReturnError) {
|
|
26002
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26003
|
+
return callback(null, irReturnError);
|
|
26004
|
+
}
|
|
26005
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26006
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createBIGIPiHealthUploadTask'], null, null, null);
|
|
26007
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26008
|
+
return callback(null, errorObj);
|
|
26009
|
+
}
|
|
26010
|
+
|
|
26011
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26012
|
+
// return the response
|
|
26013
|
+
return callback(irReturnData, null);
|
|
26014
|
+
});
|
|
26015
|
+
} catch (ex) {
|
|
26016
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26017
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26018
|
+
return callback(null, errorObj);
|
|
26019
|
+
}
|
|
26020
|
+
}
|
|
26021
|
+
|
|
26022
|
+
/**
|
|
26023
|
+
* @function queryUploadTaskStatus
|
|
26024
|
+
* @pronghornType method
|
|
26025
|
+
* @name queryUploadTaskStatus
|
|
26026
|
+
* @summary Query Upload Task Status
|
|
26027
|
+
*
|
|
26028
|
+
* @param {string} iHealthUploadTaskId - iHealthUploadTaskId param
|
|
26029
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26030
|
+
* @return {object} results - An object containing the response of the action
|
|
26031
|
+
*
|
|
26032
|
+
* @route {POST} /queryUploadTaskStatus
|
|
26033
|
+
* @roles admin
|
|
26034
|
+
* @task true
|
|
26035
|
+
*/
|
|
26036
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26037
|
+
queryUploadTaskStatus(iHealthUploadTaskId, callback) {
|
|
26038
|
+
const meth = 'adapter-queryUploadTaskStatus';
|
|
26039
|
+
const origin = `${this.id}-${meth}`;
|
|
26040
|
+
log.trace(origin);
|
|
26041
|
+
|
|
26042
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26043
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26044
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26045
|
+
return callback(null, errorObj);
|
|
26046
|
+
}
|
|
26047
|
+
|
|
26048
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
26049
|
+
if (iHealthUploadTaskId === undefined || iHealthUploadTaskId === null || iHealthUploadTaskId === '') {
|
|
26050
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['iHealthUploadTaskId'], null, null, null);
|
|
26051
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26052
|
+
return callback(null, errorObj);
|
|
26053
|
+
}
|
|
26054
|
+
|
|
26055
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
26056
|
+
const queryParamsAvailable = {};
|
|
26057
|
+
const queryParams = {};
|
|
26058
|
+
const pathVars = [iHealthUploadTaskId];
|
|
26059
|
+
const bodyVars = {};
|
|
26060
|
+
|
|
26061
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
26062
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
26063
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
26064
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
26065
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
26066
|
+
}
|
|
26067
|
+
});
|
|
26068
|
+
|
|
26069
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
26070
|
+
// see adapter code documentation for more information on the request object's fields
|
|
26071
|
+
const reqObj = {
|
|
26072
|
+
payload: bodyVars,
|
|
26073
|
+
uriPathVars: pathVars,
|
|
26074
|
+
uriQuery: queryParams
|
|
26075
|
+
};
|
|
26076
|
+
|
|
26077
|
+
try {
|
|
26078
|
+
// Make the call -
|
|
26079
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
26080
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'queryUploadTaskStatus', reqObj, true, (irReturnData, irReturnError) => {
|
|
26081
|
+
// if we received an error or their is no response on the results
|
|
26082
|
+
// return an error
|
|
26083
|
+
if (irReturnError) {
|
|
26084
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26085
|
+
return callback(null, irReturnError);
|
|
26086
|
+
}
|
|
26087
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26088
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['queryUploadTaskStatus'], null, null, null);
|
|
26089
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26090
|
+
return callback(null, errorObj);
|
|
26091
|
+
}
|
|
26092
|
+
|
|
26093
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26094
|
+
// return the response
|
|
26095
|
+
return callback(irReturnData, null);
|
|
26096
|
+
});
|
|
26097
|
+
} catch (ex) {
|
|
26098
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26099
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26100
|
+
return callback(null, errorObj);
|
|
26101
|
+
}
|
|
26102
|
+
}
|
|
26103
|
+
|
|
26104
|
+
/**
|
|
26105
|
+
* @function modifyTestBIGIPiHealthCredentials
|
|
26106
|
+
* @pronghornType method
|
|
26107
|
+
* @name modifyTestBIGIPiHealthCredentials
|
|
26108
|
+
* @summary Modify Test BIG-IP iHealth Credentials
|
|
26109
|
+
*
|
|
26110
|
+
* @param {string} credentialsId - credentialsId param
|
|
26111
|
+
* @param {object} body - body param
|
|
26112
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26113
|
+
* @return {object} results - An object containing the response of the action
|
|
26114
|
+
*
|
|
26115
|
+
* @route {POST} /modifyTestBIGIPiHealthCredentials
|
|
26116
|
+
* @roles admin
|
|
26117
|
+
* @task true
|
|
26118
|
+
*/
|
|
26119
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26120
|
+
modifyTestBIGIPiHealthCredentials(credentialsId, body, callback) {
|
|
26121
|
+
const meth = 'adapter-modifyTestBIGIPiHealthCredentials';
|
|
26122
|
+
const origin = `${this.id}-${meth}`;
|
|
26123
|
+
log.trace(origin);
|
|
26124
|
+
|
|
26125
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26126
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26127
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26128
|
+
return callback(null, errorObj);
|
|
26129
|
+
}
|
|
26130
|
+
|
|
26131
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
26132
|
+
if (credentialsId === undefined || credentialsId === null || credentialsId === '') {
|
|
26133
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['credentialsId'], null, null, null);
|
|
26134
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26135
|
+
return callback(null, errorObj);
|
|
26136
|
+
}
|
|
26137
|
+
if (body === undefined || body === null || body === '') {
|
|
26138
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
26139
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26140
|
+
return callback(null, errorObj);
|
|
26141
|
+
}
|
|
26142
|
+
|
|
26143
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
26144
|
+
const queryParamsAvailable = {};
|
|
26145
|
+
const queryParams = {};
|
|
26146
|
+
const pathVars = [credentialsId];
|
|
26147
|
+
const bodyVars = body;
|
|
26148
|
+
|
|
26149
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
26150
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
26151
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
26152
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
26153
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
26154
|
+
}
|
|
26155
|
+
});
|
|
26156
|
+
|
|
26157
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
26158
|
+
// see adapter code documentation for more information on the request object's fields
|
|
26159
|
+
const reqObj = {
|
|
26160
|
+
payload: bodyVars,
|
|
26161
|
+
uriPathVars: pathVars,
|
|
26162
|
+
uriQuery: queryParams
|
|
26163
|
+
};
|
|
26164
|
+
|
|
26165
|
+
try {
|
|
26166
|
+
// Make the call -
|
|
26167
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
26168
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'modifyTestBIGIPiHealthCredentials', reqObj, false, (irReturnData, irReturnError) => {
|
|
26169
|
+
// if we received an error or their is no response on the results
|
|
26170
|
+
// return an error
|
|
26171
|
+
if (irReturnError) {
|
|
26172
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26173
|
+
return callback(null, irReturnError);
|
|
26174
|
+
}
|
|
26175
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26176
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['modifyTestBIGIPiHealthCredentials'], null, null, null);
|
|
26177
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26178
|
+
return callback(null, errorObj);
|
|
26179
|
+
}
|
|
26180
|
+
|
|
26181
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26182
|
+
// return the response
|
|
26183
|
+
return callback(irReturnData, null);
|
|
26184
|
+
});
|
|
26185
|
+
} catch (ex) {
|
|
26186
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26187
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26188
|
+
return callback(null, errorObj);
|
|
26189
|
+
}
|
|
26190
|
+
}
|
|
26191
|
+
|
|
26192
|
+
/**
|
|
26193
|
+
* @function deleteTestBIGIPiHealthCredentials
|
|
26194
|
+
* @pronghornType method
|
|
26195
|
+
* @name deleteTestBIGIPiHealthCredentials
|
|
26196
|
+
* @summary Delete Test BIG-IP iHealth Credentials
|
|
26197
|
+
*
|
|
26198
|
+
* @param {string} credentialsId - credentialsId param
|
|
26199
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26200
|
+
* @return {object} results - An object containing the response of the action
|
|
26201
|
+
*
|
|
26202
|
+
* @route {POST} /deleteTestBIGIPiHealthCredentials
|
|
26203
|
+
* @roles admin
|
|
26204
|
+
* @task true
|
|
26205
|
+
*/
|
|
26206
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26207
|
+
deleteTestBIGIPiHealthCredentials(credentialsId, callback) {
|
|
26208
|
+
const meth = 'adapter-deleteTestBIGIPiHealthCredentials';
|
|
26209
|
+
const origin = `${this.id}-${meth}`;
|
|
26210
|
+
log.trace(origin);
|
|
26211
|
+
|
|
26212
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26213
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26214
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26215
|
+
return callback(null, errorObj);
|
|
26216
|
+
}
|
|
26217
|
+
|
|
26218
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
26219
|
+
if (credentialsId === undefined || credentialsId === null || credentialsId === '') {
|
|
26220
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['credentialsId'], null, null, null);
|
|
26221
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26222
|
+
return callback(null, errorObj);
|
|
26223
|
+
}
|
|
26224
|
+
|
|
26225
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
26226
|
+
const queryParamsAvailable = {};
|
|
26227
|
+
const queryParams = {};
|
|
26228
|
+
const pathVars = [credentialsId];
|
|
26229
|
+
const bodyVars = {};
|
|
26230
|
+
|
|
26231
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
26232
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
26233
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
26234
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
26235
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
26236
|
+
}
|
|
26237
|
+
});
|
|
26238
|
+
|
|
26239
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
26240
|
+
// see adapter code documentation for more information on the request object's fields
|
|
26241
|
+
const reqObj = {
|
|
26242
|
+
payload: bodyVars,
|
|
26243
|
+
uriPathVars: pathVars,
|
|
26244
|
+
uriQuery: queryParams
|
|
26245
|
+
};
|
|
26246
|
+
|
|
26247
|
+
try {
|
|
26248
|
+
// Make the call -
|
|
26249
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
26250
|
+
return this.requestHandlerInst.identifyRequest('BIGIPIHealth', 'deleteTestBIGIPiHealthCredentials', reqObj, false, (irReturnData, irReturnError) => {
|
|
26251
|
+
// if we received an error or their is no response on the results
|
|
26252
|
+
// return an error
|
|
26253
|
+
if (irReturnError) {
|
|
26254
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26255
|
+
return callback(null, irReturnError);
|
|
26256
|
+
}
|
|
26257
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26258
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteTestBIGIPiHealthCredentials'], null, null, null);
|
|
26259
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26260
|
+
return callback(null, errorObj);
|
|
26261
|
+
}
|
|
26262
|
+
|
|
26263
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26264
|
+
// return the response
|
|
26265
|
+
return callback(irReturnData, null);
|
|
26266
|
+
});
|
|
26267
|
+
} catch (ex) {
|
|
26268
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26269
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26270
|
+
return callback(null, errorObj);
|
|
26271
|
+
}
|
|
26272
|
+
}
|
|
26273
|
+
|
|
26274
|
+
/**
|
|
26275
|
+
* @function verifyProperSystemStatus
|
|
26276
|
+
* @pronghornType method
|
|
26277
|
+
* @name verifyProperSystemStatus
|
|
26278
|
+
* @summary Verify Proper System Status
|
|
26279
|
+
*
|
|
26280
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26281
|
+
* @return {object} results - An object containing the response of the action
|
|
26282
|
+
*
|
|
26283
|
+
* @route {GET} /verifyProperSystemStatus
|
|
26284
|
+
* @roles admin
|
|
26285
|
+
* @task true
|
|
26286
|
+
*/
|
|
26287
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26288
|
+
verifyProperSystemStatus(callback) {
|
|
26289
|
+
const meth = 'adapter-verifyProperSystemStatus';
|
|
26290
|
+
const origin = `${this.id}-${meth}`;
|
|
26291
|
+
log.trace(origin);
|
|
26292
|
+
|
|
26293
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26294
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26295
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26296
|
+
return callback(null, errorObj);
|
|
26297
|
+
}
|
|
26298
|
+
|
|
26299
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
26300
|
+
|
|
26301
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
26302
|
+
const queryParamsAvailable = {};
|
|
26303
|
+
const queryParams = {};
|
|
26304
|
+
const pathVars = [];
|
|
26305
|
+
const bodyVars = {};
|
|
26306
|
+
|
|
26307
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
26308
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
26309
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
26310
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
26311
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
26312
|
+
}
|
|
26313
|
+
});
|
|
26314
|
+
|
|
26315
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
26316
|
+
// see adapter code documentation for more information on the request object's fields
|
|
26317
|
+
const reqObj = {
|
|
26318
|
+
payload: bodyVars,
|
|
26319
|
+
uriPathVars: pathVars,
|
|
26320
|
+
uriQuery: queryParams
|
|
26321
|
+
};
|
|
26322
|
+
|
|
26323
|
+
try {
|
|
26324
|
+
// Make the call -
|
|
26325
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
26326
|
+
return this.requestHandlerInst.identifyRequest('BIGIQSystemClusterStatus', 'verifyProperSystemStatus', reqObj, true, (irReturnData, irReturnError) => {
|
|
26327
|
+
// if we received an error or their is no response on the results
|
|
26328
|
+
// return an error
|
|
26329
|
+
if (irReturnError) {
|
|
26330
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26331
|
+
return callback(null, irReturnError);
|
|
26332
|
+
}
|
|
26333
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26334
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['verifyProperSystemStatus'], null, null, null);
|
|
26335
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26336
|
+
return callback(null, errorObj);
|
|
26337
|
+
}
|
|
26338
|
+
|
|
26339
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26340
|
+
// return the response
|
|
26341
|
+
return callback(irReturnData, null);
|
|
26342
|
+
});
|
|
26343
|
+
} catch (ex) {
|
|
26344
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26345
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26346
|
+
return callback(null, errorObj);
|
|
26347
|
+
}
|
|
26348
|
+
}
|
|
26349
|
+
|
|
26350
|
+
/**
|
|
26351
|
+
* @function verifyProperHAStatus
|
|
26352
|
+
* @pronghornType method
|
|
26353
|
+
* @name verifyProperHAStatus
|
|
26354
|
+
* @summary Verify Proper HA Status
|
|
26355
|
+
*
|
|
26356
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26357
|
+
* @return {object} results - An object containing the response of the action
|
|
26358
|
+
*
|
|
26359
|
+
* @route {GET} /verifyProperHAStatus
|
|
26360
|
+
* @roles admin
|
|
26361
|
+
* @task true
|
|
26362
|
+
*/
|
|
26363
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26364
|
+
verifyProperHAStatus(callback) {
|
|
26365
|
+
const meth = 'adapter-verifyProperHAStatus';
|
|
26366
|
+
const origin = `${this.id}-${meth}`;
|
|
26367
|
+
log.trace(origin);
|
|
26368
|
+
|
|
26369
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26370
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26371
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26372
|
+
return callback(null, errorObj);
|
|
26373
|
+
}
|
|
26374
|
+
|
|
26375
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
26376
|
+
|
|
26377
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
26378
|
+
const queryParamsAvailable = {};
|
|
26379
|
+
const queryParams = {};
|
|
26380
|
+
const pathVars = [];
|
|
26381
|
+
const bodyVars = {};
|
|
26382
|
+
|
|
26383
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
26384
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
26385
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
26386
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
26387
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
26388
|
+
}
|
|
26389
|
+
});
|
|
26390
|
+
|
|
26391
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
26392
|
+
// see adapter code documentation for more information on the request object's fields
|
|
26393
|
+
const reqObj = {
|
|
26394
|
+
payload: bodyVars,
|
|
26395
|
+
uriPathVars: pathVars,
|
|
26396
|
+
uriQuery: queryParams
|
|
26397
|
+
};
|
|
26398
|
+
|
|
26399
|
+
try {
|
|
26400
|
+
// Make the call -
|
|
26401
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
26402
|
+
return this.requestHandlerInst.identifyRequest('BIGIQSystemClusterStatus', 'verifyProperHAStatus', reqObj, true, (irReturnData, irReturnError) => {
|
|
26403
|
+
// if we received an error or their is no response on the results
|
|
26404
|
+
// return an error
|
|
26405
|
+
if (irReturnError) {
|
|
26406
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26407
|
+
return callback(null, irReturnError);
|
|
26408
|
+
}
|
|
26409
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26410
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['verifyProperHAStatus'], null, null, null);
|
|
26411
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26412
|
+
return callback(null, errorObj);
|
|
26413
|
+
}
|
|
26414
|
+
|
|
26415
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26416
|
+
// return the response
|
|
26417
|
+
return callback(irReturnData, null);
|
|
26418
|
+
});
|
|
26419
|
+
} catch (ex) {
|
|
26420
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26421
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26422
|
+
return callback(null, errorObj);
|
|
26423
|
+
}
|
|
26424
|
+
}
|
|
26425
|
+
|
|
26426
|
+
/**
|
|
26427
|
+
* @function getExampleBackupRestoreTask
|
|
26428
|
+
* @pronghornType method
|
|
26429
|
+
* @name getExampleBackupRestoreTask
|
|
26430
|
+
* @summary EXAMPLE - Backup\/Restore Task
|
|
26431
|
+
*
|
|
26432
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26433
|
+
* @return {object} results - An object containing the response of the action
|
|
26434
|
+
*
|
|
26435
|
+
* @route {GET} /getExampleBackupRestoreTask
|
|
26436
|
+
* @roles admin
|
|
26437
|
+
* @task true
|
|
26438
|
+
*/
|
|
26439
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26440
|
+
getExampleBackupRestoreTask(callback) {
|
|
26441
|
+
const meth = 'adapter-getExampleBackupRestoreTask';
|
|
26442
|
+
const origin = `${this.id}-${meth}`;
|
|
26443
|
+
log.trace(origin);
|
|
26444
|
+
|
|
26445
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26446
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26447
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26448
|
+
return callback(null, errorObj);
|
|
26449
|
+
}
|
|
26450
|
+
|
|
26451
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
26452
|
+
|
|
26453
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
26454
|
+
const queryParamsAvailable = {};
|
|
26455
|
+
const queryParams = {};
|
|
26456
|
+
const pathVars = [];
|
|
26457
|
+
const bodyVars = {};
|
|
26458
|
+
|
|
26459
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
26460
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
26461
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
26462
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
26463
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
26464
|
+
}
|
|
26465
|
+
});
|
|
26466
|
+
|
|
26467
|
+
// if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
|
|
26468
|
+
let thisHeaderData = null;
|
|
26469
|
+
// if the additional headers was passed in as a string parse the json into an object
|
|
26470
|
+
if (thisHeaderData !== null && thisHeaderData.constructor === String) {
|
|
26471
|
+
try {
|
|
26472
|
+
// parse the additional headers object that was passed in
|
|
26473
|
+
thisHeaderData = JSON.parse(thisHeaderData);
|
|
26474
|
+
} catch (err) {
|
|
26475
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
|
|
26476
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26477
|
+
return callback(null, errorObj);
|
|
26478
|
+
}
|
|
26479
|
+
} else if (thisHeaderData === null) {
|
|
26480
|
+
thisHeaderData = { contentType: '' };
|
|
26481
|
+
}
|
|
26482
|
+
|
|
26483
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
26484
|
+
// see adapter code documentation for more information on the request object's fields
|
|
26485
|
+
const reqObj = {
|
|
26486
|
+
payload: bodyVars,
|
|
26487
|
+
uriPathVars: pathVars,
|
|
26488
|
+
uriQuery: queryParams,
|
|
26489
|
+
addlHeaders: thisHeaderData
|
|
26490
|
+
};
|
|
26491
|
+
|
|
26492
|
+
try {
|
|
26493
|
+
// Make the call -
|
|
26494
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
26495
|
+
return this.requestHandlerInst.identifyRequest('DeviceBackups', 'getExampleBackupRestoreTask', reqObj, true, (irReturnData, irReturnError) => {
|
|
26496
|
+
// if we received an error or their is no response on the results
|
|
26497
|
+
// return an error
|
|
26498
|
+
if (irReturnError) {
|
|
26499
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26500
|
+
return callback(null, irReturnError);
|
|
26501
|
+
}
|
|
26502
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26503
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getExampleBackupRestoreTask'], null, null, null);
|
|
26504
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26505
|
+
return callback(null, errorObj);
|
|
26506
|
+
}
|
|
26507
|
+
|
|
26508
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26509
|
+
// return the response
|
|
26510
|
+
return callback(irReturnData, null);
|
|
26511
|
+
});
|
|
26512
|
+
} catch (ex) {
|
|
26513
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26514
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26515
|
+
return callback(null, errorObj);
|
|
26516
|
+
}
|
|
26517
|
+
}
|
|
26518
|
+
|
|
26519
|
+
/**
|
|
26520
|
+
* @function retrieveallBackupTasks
|
|
26521
|
+
* @pronghornType method
|
|
26522
|
+
* @name retrieveallBackupTasks
|
|
26523
|
+
* @summary Retrieve all Backup Tasks
|
|
26524
|
+
*
|
|
26525
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26526
|
+
* @return {object} results - An object containing the response of the action
|
|
26527
|
+
*
|
|
26528
|
+
* @route {GET} /retrieveallBackupTasks
|
|
26529
|
+
* @roles admin
|
|
26530
|
+
* @task true
|
|
26531
|
+
*/
|
|
26532
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26533
|
+
retrieveallBackupTasks(callback) {
|
|
26534
|
+
const meth = 'adapter-retrieveallBackupTasks';
|
|
26535
|
+
const origin = `${this.id}-${meth}`;
|
|
26536
|
+
log.trace(origin);
|
|
26537
|
+
|
|
26538
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26539
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26540
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26541
|
+
return callback(null, errorObj);
|
|
26542
|
+
}
|
|
26543
|
+
|
|
26544
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
26545
|
+
|
|
26546
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
26547
|
+
const queryParamsAvailable = {};
|
|
26548
|
+
const queryParams = {};
|
|
26549
|
+
const pathVars = [];
|
|
26550
|
+
const bodyVars = {};
|
|
26551
|
+
|
|
26552
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
26553
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
26554
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
26555
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
26556
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
26557
|
+
}
|
|
26558
|
+
});
|
|
26559
|
+
|
|
26560
|
+
// if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
|
|
26561
|
+
let thisHeaderData = null;
|
|
26562
|
+
// if the additional headers was passed in as a string parse the json into an object
|
|
26563
|
+
if (thisHeaderData !== null && thisHeaderData.constructor === String) {
|
|
26564
|
+
try {
|
|
26565
|
+
// parse the additional headers object that was passed in
|
|
26566
|
+
thisHeaderData = JSON.parse(thisHeaderData);
|
|
26567
|
+
} catch (err) {
|
|
26568
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
|
|
26569
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26570
|
+
return callback(null, errorObj);
|
|
26571
|
+
}
|
|
26572
|
+
} else if (thisHeaderData === null) {
|
|
26573
|
+
thisHeaderData = { contentType: '' };
|
|
26574
|
+
}
|
|
26575
|
+
|
|
26576
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
26577
|
+
// see adapter code documentation for more information on the request object's fields
|
|
26578
|
+
const reqObj = {
|
|
26579
|
+
payload: bodyVars,
|
|
26580
|
+
uriPathVars: pathVars,
|
|
26581
|
+
uriQuery: queryParams,
|
|
26582
|
+
addlHeaders: thisHeaderData
|
|
26583
|
+
};
|
|
26584
|
+
|
|
26585
|
+
try {
|
|
26586
|
+
// Make the call -
|
|
26587
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
26588
|
+
return this.requestHandlerInst.identifyRequest('DeviceBackups', 'retrieveallBackupTasks', reqObj, true, (irReturnData, irReturnError) => {
|
|
26589
|
+
// if we received an error or their is no response on the results
|
|
26590
|
+
// return an error
|
|
26591
|
+
if (irReturnError) {
|
|
26592
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26593
|
+
return callback(null, irReturnError);
|
|
26594
|
+
}
|
|
26595
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26596
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveallBackupTasks'], null, null, null);
|
|
26597
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26598
|
+
return callback(null, errorObj);
|
|
26599
|
+
}
|
|
26600
|
+
|
|
26601
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26602
|
+
// return the response
|
|
26603
|
+
return callback(irReturnData, null);
|
|
26604
|
+
});
|
|
26605
|
+
} catch (ex) {
|
|
26606
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26607
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26608
|
+
return callback(null, errorObj);
|
|
26609
|
+
}
|
|
26610
|
+
}
|
|
26611
|
+
|
|
26612
|
+
/**
|
|
26613
|
+
* @function generateBackupofDevice
|
|
26614
|
+
* @pronghornType method
|
|
26615
|
+
* @name generateBackupofDevice
|
|
26616
|
+
* @summary Generate Backup of Device
|
|
26617
|
+
*
|
|
26618
|
+
* @param {object} body - body param
|
|
26619
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26620
|
+
* @return {object} results - An object containing the response of the action
|
|
26621
|
+
*
|
|
26622
|
+
* @route {POST} /generateBackupofDevice
|
|
26623
|
+
* @roles admin
|
|
26624
|
+
* @task true
|
|
26625
|
+
*/
|
|
26626
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26627
|
+
generateBackupofDevice(body, callback) {
|
|
26628
|
+
const meth = 'adapter-generateBackupofDevice';
|
|
26629
|
+
const origin = `${this.id}-${meth}`;
|
|
26630
|
+
log.trace(origin);
|
|
26631
|
+
|
|
26632
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26633
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26634
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26635
|
+
return callback(null, errorObj);
|
|
26636
|
+
}
|
|
26637
|
+
|
|
26638
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
26639
|
+
if (body === undefined || body === null || body === '') {
|
|
26640
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
26641
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26642
|
+
return callback(null, errorObj);
|
|
26643
|
+
}
|
|
26644
|
+
|
|
26645
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
26646
|
+
const queryParamsAvailable = {};
|
|
26647
|
+
const queryParams = {};
|
|
26648
|
+
const pathVars = [];
|
|
26649
|
+
const bodyVars = body;
|
|
26650
|
+
|
|
26651
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
26652
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
26653
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
26654
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
26655
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
26656
|
+
}
|
|
26657
|
+
});
|
|
26658
|
+
|
|
26659
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
26660
|
+
// see adapter code documentation for more information on the request object's fields
|
|
26661
|
+
const reqObj = {
|
|
26662
|
+
payload: bodyVars,
|
|
26663
|
+
uriPathVars: pathVars,
|
|
26664
|
+
uriQuery: queryParams
|
|
26665
|
+
};
|
|
26666
|
+
|
|
26667
|
+
try {
|
|
26668
|
+
// Make the call -
|
|
26669
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
26670
|
+
return this.requestHandlerInst.identifyRequest('DeviceBackups', 'generateBackupofDevice', reqObj, true, (irReturnData, irReturnError) => {
|
|
26671
|
+
// if we received an error or their is no response on the results
|
|
26672
|
+
// return an error
|
|
26673
|
+
if (irReturnError) {
|
|
26674
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26675
|
+
return callback(null, irReturnError);
|
|
26676
|
+
}
|
|
26677
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26678
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['generateBackupofDevice'], null, null, null);
|
|
26679
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26680
|
+
return callback(null, errorObj);
|
|
26681
|
+
}
|
|
26682
|
+
|
|
26683
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26684
|
+
// return the response
|
|
26685
|
+
return callback(irReturnData, null);
|
|
26686
|
+
});
|
|
26687
|
+
} catch (ex) {
|
|
26688
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26689
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26690
|
+
return callback(null, errorObj);
|
|
26691
|
+
}
|
|
26692
|
+
}
|
|
26693
|
+
|
|
26694
|
+
/**
|
|
26695
|
+
* @function queryBackupTaskStatus
|
|
26696
|
+
* @pronghornType method
|
|
26697
|
+
* @name queryBackupTaskStatus
|
|
26698
|
+
* @summary Query Backup Task Status
|
|
26699
|
+
*
|
|
26700
|
+
* @param {string} backupTaskId - backupTaskId param
|
|
26701
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26702
|
+
* @return {object} results - An object containing the response of the action
|
|
26703
|
+
*
|
|
26704
|
+
* @route {POST} /queryBackupTaskStatus
|
|
26705
|
+
* @roles admin
|
|
26706
|
+
* @task true
|
|
26707
|
+
*/
|
|
26708
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26709
|
+
queryBackupTaskStatus(backupTaskId, callback) {
|
|
26710
|
+
const meth = 'adapter-queryBackupTaskStatus';
|
|
26711
|
+
const origin = `${this.id}-${meth}`;
|
|
26712
|
+
log.trace(origin);
|
|
26713
|
+
|
|
26714
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26715
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26716
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26717
|
+
return callback(null, errorObj);
|
|
26718
|
+
}
|
|
26719
|
+
|
|
26720
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
26721
|
+
if (backupTaskId === undefined || backupTaskId === null || backupTaskId === '') {
|
|
26722
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['backupTaskId'], null, null, null);
|
|
26723
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26724
|
+
return callback(null, errorObj);
|
|
26725
|
+
}
|
|
26726
|
+
|
|
26727
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
26728
|
+
const queryParamsAvailable = {};
|
|
26729
|
+
const queryParams = {};
|
|
26730
|
+
const pathVars = [backupTaskId];
|
|
26731
|
+
const bodyVars = {};
|
|
26732
|
+
|
|
26733
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
26734
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
26735
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
26736
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
26737
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
26738
|
+
}
|
|
26739
|
+
});
|
|
26740
|
+
|
|
26741
|
+
// if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
|
|
26742
|
+
let thisHeaderData = null;
|
|
26743
|
+
// if the additional headers was passed in as a string parse the json into an object
|
|
26744
|
+
if (thisHeaderData !== null && thisHeaderData.constructor === String) {
|
|
26745
|
+
try {
|
|
26746
|
+
// parse the additional headers object that was passed in
|
|
26747
|
+
thisHeaderData = JSON.parse(thisHeaderData);
|
|
26748
|
+
} catch (err) {
|
|
26749
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
|
|
26750
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26751
|
+
return callback(null, errorObj);
|
|
26752
|
+
}
|
|
26753
|
+
} else if (thisHeaderData === null) {
|
|
26754
|
+
thisHeaderData = { contentType: '' };
|
|
26755
|
+
}
|
|
26756
|
+
|
|
26757
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
26758
|
+
// see adapter code documentation for more information on the request object's fields
|
|
26759
|
+
const reqObj = {
|
|
26760
|
+
payload: bodyVars,
|
|
26761
|
+
uriPathVars: pathVars,
|
|
26762
|
+
uriQuery: queryParams,
|
|
26763
|
+
addlHeaders: thisHeaderData
|
|
26764
|
+
};
|
|
26765
|
+
|
|
26766
|
+
try {
|
|
26767
|
+
// Make the call -
|
|
26768
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
26769
|
+
return this.requestHandlerInst.identifyRequest('DeviceBackups', 'queryBackupTaskStatus', reqObj, true, (irReturnData, irReturnError) => {
|
|
26770
|
+
// if we received an error or their is no response on the results
|
|
26771
|
+
// return an error
|
|
26772
|
+
if (irReturnError) {
|
|
26773
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26774
|
+
return callback(null, irReturnError);
|
|
26775
|
+
}
|
|
26776
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26777
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['queryBackupTaskStatus'], null, null, null);
|
|
26778
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26779
|
+
return callback(null, errorObj);
|
|
26780
|
+
}
|
|
26781
|
+
|
|
26782
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26783
|
+
// return the response
|
|
26784
|
+
return callback(irReturnData, null);
|
|
26785
|
+
});
|
|
26786
|
+
} catch (ex) {
|
|
26787
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26788
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26789
|
+
return callback(null, errorObj);
|
|
26790
|
+
}
|
|
26791
|
+
}
|
|
26792
|
+
|
|
26793
|
+
/**
|
|
26794
|
+
* @function deleteBackupFile
|
|
26795
|
+
* @pronghornType method
|
|
26796
|
+
* @name deleteBackupFile
|
|
26797
|
+
* @summary Delete Backup File
|
|
26798
|
+
*
|
|
26799
|
+
* @param {string} backupTaskId - backupTaskId param
|
|
26800
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26801
|
+
* @return {object} results - An object containing the response of the action
|
|
26802
|
+
*
|
|
26803
|
+
* @route {POST} /deleteBackupFile
|
|
26804
|
+
* @roles admin
|
|
26805
|
+
* @task true
|
|
26806
|
+
*/
|
|
26807
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26808
|
+
deleteBackupFile(backupTaskId, callback) {
|
|
26809
|
+
const meth = 'adapter-deleteBackupFile';
|
|
26810
|
+
const origin = `${this.id}-${meth}`;
|
|
26811
|
+
log.trace(origin);
|
|
26812
|
+
|
|
26813
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26814
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26815
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26816
|
+
return callback(null, errorObj);
|
|
26817
|
+
}
|
|
26818
|
+
|
|
26819
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
26820
|
+
if (backupTaskId === undefined || backupTaskId === null || backupTaskId === '') {
|
|
26821
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['backupTaskId'], null, null, null);
|
|
26822
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26823
|
+
return callback(null, errorObj);
|
|
26824
|
+
}
|
|
26825
|
+
|
|
26826
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
26827
|
+
const queryParamsAvailable = {};
|
|
26828
|
+
const queryParams = {};
|
|
26829
|
+
const pathVars = [backupTaskId];
|
|
26830
|
+
const bodyVars = {};
|
|
26831
|
+
|
|
26832
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
26833
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
26834
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
26835
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
26836
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
26837
|
+
}
|
|
26838
|
+
});
|
|
26839
|
+
|
|
26840
|
+
// if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
|
|
26841
|
+
let thisHeaderData = null;
|
|
26842
|
+
// if the additional headers was passed in as a string parse the json into an object
|
|
26843
|
+
if (thisHeaderData !== null && thisHeaderData.constructor === String) {
|
|
26844
|
+
try {
|
|
26845
|
+
// parse the additional headers object that was passed in
|
|
26846
|
+
thisHeaderData = JSON.parse(thisHeaderData);
|
|
26847
|
+
} catch (err) {
|
|
26848
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
|
|
26849
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26850
|
+
return callback(null, errorObj);
|
|
26851
|
+
}
|
|
26852
|
+
} else if (thisHeaderData === null) {
|
|
26853
|
+
thisHeaderData = { contentType: '' };
|
|
26854
|
+
}
|
|
26855
|
+
|
|
26856
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
26857
|
+
// see adapter code documentation for more information on the request object's fields
|
|
26858
|
+
const reqObj = {
|
|
26859
|
+
payload: bodyVars,
|
|
26860
|
+
uriPathVars: pathVars,
|
|
26861
|
+
uriQuery: queryParams,
|
|
26862
|
+
addlHeaders: thisHeaderData
|
|
26863
|
+
};
|
|
26864
|
+
|
|
26865
|
+
try {
|
|
26866
|
+
// Make the call -
|
|
26867
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
26868
|
+
return this.requestHandlerInst.identifyRequest('DeviceBackups', 'deleteBackupFile', reqObj, false, (irReturnData, irReturnError) => {
|
|
26869
|
+
// if we received an error or their is no response on the results
|
|
26870
|
+
// return an error
|
|
26871
|
+
if (irReturnError) {
|
|
26872
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26873
|
+
return callback(null, irReturnError);
|
|
26874
|
+
}
|
|
26875
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26876
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteBackupFile'], null, null, null);
|
|
26877
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26878
|
+
return callback(null, errorObj);
|
|
26879
|
+
}
|
|
26880
|
+
|
|
26881
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26882
|
+
// return the response
|
|
26883
|
+
return callback(irReturnData, null);
|
|
26884
|
+
});
|
|
26885
|
+
} catch (ex) {
|
|
26886
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26887
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26888
|
+
return callback(null, errorObj);
|
|
26889
|
+
}
|
|
26890
|
+
}
|
|
26891
|
+
|
|
26892
|
+
/**
|
|
26893
|
+
* @function generateBackupFileDownloadPathHash
|
|
26894
|
+
* @pronghornType method
|
|
26895
|
+
* @name generateBackupFileDownloadPathHash
|
|
26896
|
+
* @summary Generate Backup File Download Path Hash
|
|
26897
|
+
*
|
|
26898
|
+
* @param {object} body - body param
|
|
26899
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26900
|
+
* @return {object} results - An object containing the response of the action
|
|
26901
|
+
*
|
|
26902
|
+
* @route {POST} /generateBackupFileDownloadPathHash
|
|
26903
|
+
* @roles admin
|
|
26904
|
+
* @task true
|
|
26905
|
+
*/
|
|
26906
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26907
|
+
generateBackupFileDownloadPathHash(body, callback) {
|
|
26908
|
+
const meth = 'adapter-generateBackupFileDownloadPathHash';
|
|
26909
|
+
const origin = `${this.id}-${meth}`;
|
|
26910
|
+
log.trace(origin);
|
|
26911
|
+
|
|
26912
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26913
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26914
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26915
|
+
return callback(null, errorObj);
|
|
26916
|
+
}
|
|
26917
|
+
|
|
26918
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
26919
|
+
if (body === undefined || body === null || body === '') {
|
|
26920
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
26921
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26922
|
+
return callback(null, errorObj);
|
|
26923
|
+
}
|
|
26924
|
+
|
|
26925
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
26926
|
+
const queryParamsAvailable = {};
|
|
26927
|
+
const queryParams = {};
|
|
26928
|
+
const pathVars = [];
|
|
26929
|
+
const bodyVars = body;
|
|
26930
|
+
|
|
26931
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
26932
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
26933
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
26934
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
26935
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
26936
|
+
}
|
|
26937
|
+
});
|
|
26938
|
+
|
|
26939
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
26940
|
+
// see adapter code documentation for more information on the request object's fields
|
|
26941
|
+
const reqObj = {
|
|
26942
|
+
payload: bodyVars,
|
|
26943
|
+
uriPathVars: pathVars,
|
|
26944
|
+
uriQuery: queryParams
|
|
26945
|
+
};
|
|
26946
|
+
|
|
26947
|
+
try {
|
|
26948
|
+
// Make the call -
|
|
26949
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
26950
|
+
return this.requestHandlerInst.identifyRequest('DeviceBackups', 'generateBackupFileDownloadPathHash', reqObj, true, (irReturnData, irReturnError) => {
|
|
26951
|
+
// if we received an error or their is no response on the results
|
|
26952
|
+
// return an error
|
|
26953
|
+
if (irReturnError) {
|
|
26954
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
26955
|
+
return callback(null, irReturnError);
|
|
26956
|
+
}
|
|
26957
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
26958
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['generateBackupFileDownloadPathHash'], null, null, null);
|
|
26959
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26960
|
+
return callback(null, errorObj);
|
|
26961
|
+
}
|
|
26962
|
+
|
|
26963
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
26964
|
+
// return the response
|
|
26965
|
+
return callback(irReturnData, null);
|
|
26966
|
+
});
|
|
26967
|
+
} catch (ex) {
|
|
26968
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
26969
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26970
|
+
return callback(null, errorObj);
|
|
26971
|
+
}
|
|
26972
|
+
}
|
|
26973
|
+
|
|
26974
|
+
/**
|
|
26975
|
+
* @function downloadBackupFileusingPathHash
|
|
26976
|
+
* @pronghornType method
|
|
26977
|
+
* @name downloadBackupFileusingPathHash
|
|
26978
|
+
* @summary Download Backup File using Path Hash
|
|
26979
|
+
*
|
|
26980
|
+
* @param {string} pathHash - pathHash param
|
|
26981
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
26982
|
+
* @return {object} results - An object containing the response of the action
|
|
26983
|
+
*
|
|
26984
|
+
* @route {POST} /downloadBackupFileusingPathHash
|
|
26985
|
+
* @roles admin
|
|
26986
|
+
* @task true
|
|
26987
|
+
*/
|
|
26988
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
26989
|
+
downloadBackupFileusingPathHash(pathHash, callback) {
|
|
26990
|
+
const meth = 'adapter-downloadBackupFileusingPathHash';
|
|
26991
|
+
const origin = `${this.id}-${meth}`;
|
|
26992
|
+
log.trace(origin);
|
|
26993
|
+
|
|
26994
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
26995
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
26996
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
26997
|
+
return callback(null, errorObj);
|
|
26998
|
+
}
|
|
26999
|
+
|
|
27000
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27001
|
+
if (pathHash === undefined || pathHash === null || pathHash === '') {
|
|
27002
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['pathHash'], null, null, null);
|
|
27003
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27004
|
+
return callback(null, errorObj);
|
|
27005
|
+
}
|
|
27006
|
+
|
|
27007
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27008
|
+
const queryParamsAvailable = {};
|
|
27009
|
+
const queryParams = {};
|
|
27010
|
+
const pathVars = [pathHash];
|
|
27011
|
+
const bodyVars = {};
|
|
27012
|
+
|
|
27013
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27014
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27015
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27016
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27017
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27018
|
+
}
|
|
27019
|
+
});
|
|
27020
|
+
|
|
27021
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27022
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27023
|
+
const reqObj = {
|
|
27024
|
+
payload: bodyVars,
|
|
27025
|
+
uriPathVars: pathVars,
|
|
27026
|
+
uriQuery: queryParams
|
|
27027
|
+
};
|
|
27028
|
+
|
|
27029
|
+
try {
|
|
27030
|
+
// Make the call -
|
|
27031
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27032
|
+
return this.requestHandlerInst.identifyRequest('DeviceBackups', 'downloadBackupFileusingPathHash', reqObj, true, (irReturnData, irReturnError) => {
|
|
27033
|
+
// if we received an error or their is no response on the results
|
|
27034
|
+
// return an error
|
|
27035
|
+
if (irReturnError) {
|
|
27036
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27037
|
+
return callback(null, irReturnError);
|
|
27038
|
+
}
|
|
27039
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27040
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['downloadBackupFileusingPathHash'], null, null, null);
|
|
27041
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27042
|
+
return callback(null, errorObj);
|
|
27043
|
+
}
|
|
27044
|
+
|
|
27045
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27046
|
+
// return the response
|
|
27047
|
+
return callback(irReturnData, null);
|
|
27048
|
+
});
|
|
27049
|
+
} catch (ex) {
|
|
27050
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27051
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27052
|
+
return callback(null, errorObj);
|
|
27053
|
+
}
|
|
27054
|
+
}
|
|
27055
|
+
|
|
27056
|
+
/**
|
|
27057
|
+
* @function getExampleBIGIPscripts
|
|
27058
|
+
* @pronghornType method
|
|
27059
|
+
* @name getExampleBIGIPscripts
|
|
27060
|
+
* @summary EXAMPLE - BIG-IP scripts
|
|
27061
|
+
*
|
|
27062
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27063
|
+
* @return {object} results - An object containing the response of the action
|
|
27064
|
+
*
|
|
27065
|
+
* @route {GET} /getExampleBIGIPscripts
|
|
27066
|
+
* @roles admin
|
|
27067
|
+
* @task true
|
|
27068
|
+
*/
|
|
27069
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27070
|
+
getExampleBIGIPscripts(callback) {
|
|
27071
|
+
const meth = 'adapter-getExampleBIGIPscripts';
|
|
27072
|
+
const origin = `${this.id}-${meth}`;
|
|
27073
|
+
log.trace(origin);
|
|
27074
|
+
|
|
27075
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27076
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27077
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27078
|
+
return callback(null, errorObj);
|
|
27079
|
+
}
|
|
27080
|
+
|
|
27081
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27082
|
+
|
|
27083
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27084
|
+
const queryParamsAvailable = {};
|
|
27085
|
+
const queryParams = {};
|
|
27086
|
+
const pathVars = [];
|
|
27087
|
+
const bodyVars = {};
|
|
27088
|
+
|
|
27089
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27090
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27091
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27092
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27093
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27094
|
+
}
|
|
27095
|
+
});
|
|
27096
|
+
|
|
27097
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27098
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27099
|
+
const reqObj = {
|
|
27100
|
+
payload: bodyVars,
|
|
27101
|
+
uriPathVars: pathVars,
|
|
27102
|
+
uriQuery: queryParams
|
|
27103
|
+
};
|
|
27104
|
+
|
|
27105
|
+
try {
|
|
27106
|
+
// Make the call -
|
|
27107
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27108
|
+
return this.requestHandlerInst.identifyRequest('BIGIPTMSHScripting', 'getExampleBIGIPscripts', reqObj, true, (irReturnData, irReturnError) => {
|
|
27109
|
+
// if we received an error or their is no response on the results
|
|
27110
|
+
// return an error
|
|
27111
|
+
if (irReturnError) {
|
|
27112
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27113
|
+
return callback(null, irReturnError);
|
|
27114
|
+
}
|
|
27115
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27116
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getExampleBIGIPscripts'], null, null, null);
|
|
27117
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27118
|
+
return callback(null, errorObj);
|
|
27119
|
+
}
|
|
27120
|
+
|
|
27121
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27122
|
+
// return the response
|
|
27123
|
+
return callback(irReturnData, null);
|
|
27124
|
+
});
|
|
27125
|
+
} catch (ex) {
|
|
27126
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27127
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27128
|
+
return callback(null, errorObj);
|
|
27129
|
+
}
|
|
27130
|
+
}
|
|
27131
|
+
|
|
27132
|
+
/**
|
|
27133
|
+
* @function retrieveallBIGIPscripts
|
|
27134
|
+
* @pronghornType method
|
|
27135
|
+
* @name retrieveallBIGIPscripts
|
|
27136
|
+
* @summary Retrieve all BIG-IP scripts
|
|
27137
|
+
*
|
|
27138
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27139
|
+
* @return {object} results - An object containing the response of the action
|
|
27140
|
+
*
|
|
27141
|
+
* @route {GET} /retrieveallBIGIPscripts
|
|
27142
|
+
* @roles admin
|
|
27143
|
+
* @task true
|
|
27144
|
+
*/
|
|
27145
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27146
|
+
retrieveallBIGIPscripts(callback) {
|
|
27147
|
+
const meth = 'adapter-retrieveallBIGIPscripts';
|
|
27148
|
+
const origin = `${this.id}-${meth}`;
|
|
27149
|
+
log.trace(origin);
|
|
27150
|
+
|
|
27151
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27152
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27153
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27154
|
+
return callback(null, errorObj);
|
|
27155
|
+
}
|
|
27156
|
+
|
|
27157
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27158
|
+
|
|
27159
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27160
|
+
const queryParamsAvailable = {};
|
|
27161
|
+
const queryParams = {};
|
|
27162
|
+
const pathVars = [];
|
|
27163
|
+
const bodyVars = {};
|
|
27164
|
+
|
|
27165
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27166
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27167
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27168
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27169
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27170
|
+
}
|
|
27171
|
+
});
|
|
27172
|
+
|
|
27173
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27174
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27175
|
+
const reqObj = {
|
|
27176
|
+
payload: bodyVars,
|
|
27177
|
+
uriPathVars: pathVars,
|
|
27178
|
+
uriQuery: queryParams
|
|
27179
|
+
};
|
|
27180
|
+
|
|
27181
|
+
try {
|
|
27182
|
+
// Make the call -
|
|
27183
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27184
|
+
return this.requestHandlerInst.identifyRequest('BIGIPTMSHScripting', 'retrieveallBIGIPscripts', reqObj, true, (irReturnData, irReturnError) => {
|
|
27185
|
+
// if we received an error or their is no response on the results
|
|
27186
|
+
// return an error
|
|
27187
|
+
if (irReturnError) {
|
|
27188
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27189
|
+
return callback(null, irReturnError);
|
|
27190
|
+
}
|
|
27191
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27192
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveallBIGIPscripts'], null, null, null);
|
|
27193
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27194
|
+
return callback(null, errorObj);
|
|
27195
|
+
}
|
|
27196
|
+
|
|
27197
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27198
|
+
// return the response
|
|
27199
|
+
return callback(irReturnData, null);
|
|
27200
|
+
});
|
|
27201
|
+
} catch (ex) {
|
|
27202
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27203
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27204
|
+
return callback(null, errorObj);
|
|
27205
|
+
}
|
|
27206
|
+
}
|
|
27207
|
+
|
|
27208
|
+
/**
|
|
27209
|
+
* @function createaBIGIPscript
|
|
27210
|
+
* @pronghornType method
|
|
27211
|
+
* @name createaBIGIPscript
|
|
27212
|
+
* @summary Create a BIG-IP script
|
|
27213
|
+
*
|
|
27214
|
+
* @param {object} body - body param
|
|
27215
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27216
|
+
* @return {object} results - An object containing the response of the action
|
|
27217
|
+
*
|
|
27218
|
+
* @route {POST} /createaBIGIPscript
|
|
27219
|
+
* @roles admin
|
|
27220
|
+
* @task true
|
|
27221
|
+
*/
|
|
27222
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27223
|
+
createaBIGIPscript(body, callback) {
|
|
27224
|
+
const meth = 'adapter-createaBIGIPscript';
|
|
27225
|
+
const origin = `${this.id}-${meth}`;
|
|
27226
|
+
log.trace(origin);
|
|
27227
|
+
|
|
27228
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27229
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27230
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27231
|
+
return callback(null, errorObj);
|
|
27232
|
+
}
|
|
27233
|
+
|
|
27234
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27235
|
+
if (body === undefined || body === null || body === '') {
|
|
27236
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
27237
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27238
|
+
return callback(null, errorObj);
|
|
27239
|
+
}
|
|
27240
|
+
|
|
27241
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27242
|
+
const queryParamsAvailable = {};
|
|
27243
|
+
const queryParams = {};
|
|
27244
|
+
const pathVars = [];
|
|
27245
|
+
const bodyVars = body;
|
|
27246
|
+
|
|
27247
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27248
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27249
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27250
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27251
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27252
|
+
}
|
|
27253
|
+
});
|
|
27254
|
+
|
|
27255
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27256
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27257
|
+
const reqObj = {
|
|
27258
|
+
payload: bodyVars,
|
|
27259
|
+
uriPathVars: pathVars,
|
|
27260
|
+
uriQuery: queryParams
|
|
27261
|
+
};
|
|
27262
|
+
|
|
27263
|
+
try {
|
|
27264
|
+
// Make the call -
|
|
27265
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27266
|
+
return this.requestHandlerInst.identifyRequest('BIGIPTMSHScripting', 'createaBIGIPscript', reqObj, true, (irReturnData, irReturnError) => {
|
|
27267
|
+
// if we received an error or their is no response on the results
|
|
27268
|
+
// return an error
|
|
27269
|
+
if (irReturnError) {
|
|
27270
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27271
|
+
return callback(null, irReturnError);
|
|
27272
|
+
}
|
|
27273
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27274
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createaBIGIPscript'], null, null, null);
|
|
27275
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27276
|
+
return callback(null, errorObj);
|
|
27277
|
+
}
|
|
27278
|
+
|
|
27279
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27280
|
+
// return the response
|
|
27281
|
+
return callback(irReturnData, null);
|
|
27282
|
+
});
|
|
27283
|
+
} catch (ex) {
|
|
27284
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27285
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27286
|
+
return callback(null, errorObj);
|
|
27287
|
+
}
|
|
27288
|
+
}
|
|
27289
|
+
|
|
27290
|
+
/**
|
|
27291
|
+
* @function executeaBIGIPscript
|
|
27292
|
+
* @pronghornType method
|
|
27293
|
+
* @name executeaBIGIPscript
|
|
27294
|
+
* @summary Execute a BIG-IP script
|
|
27295
|
+
*
|
|
27296
|
+
* @param {object} body - body param
|
|
27297
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27298
|
+
* @return {object} results - An object containing the response of the action
|
|
27299
|
+
*
|
|
27300
|
+
* @route {POST} /executeaBIGIPscript
|
|
27301
|
+
* @roles admin
|
|
27302
|
+
* @task true
|
|
27303
|
+
*/
|
|
27304
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27305
|
+
executeaBIGIPscript(body, callback) {
|
|
27306
|
+
const meth = 'adapter-executeaBIGIPscript';
|
|
27307
|
+
const origin = `${this.id}-${meth}`;
|
|
27308
|
+
log.trace(origin);
|
|
27309
|
+
|
|
27310
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27311
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27312
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27313
|
+
return callback(null, errorObj);
|
|
27314
|
+
}
|
|
27315
|
+
|
|
27316
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27317
|
+
if (body === undefined || body === null || body === '') {
|
|
27318
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
27319
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27320
|
+
return callback(null, errorObj);
|
|
27321
|
+
}
|
|
27322
|
+
|
|
27323
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27324
|
+
const queryParamsAvailable = {};
|
|
27325
|
+
const queryParams = {};
|
|
27326
|
+
const pathVars = [];
|
|
27327
|
+
const bodyVars = body;
|
|
27328
|
+
|
|
27329
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27330
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27331
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27332
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27333
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27334
|
+
}
|
|
27335
|
+
});
|
|
27336
|
+
|
|
27337
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27338
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27339
|
+
const reqObj = {
|
|
27340
|
+
payload: bodyVars,
|
|
27341
|
+
uriPathVars: pathVars,
|
|
27342
|
+
uriQuery: queryParams
|
|
27343
|
+
};
|
|
27344
|
+
|
|
27345
|
+
try {
|
|
27346
|
+
// Make the call -
|
|
27347
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27348
|
+
return this.requestHandlerInst.identifyRequest('BIGIPTMSHScripting', 'executeaBIGIPscript', reqObj, true, (irReturnData, irReturnError) => {
|
|
27349
|
+
// if we received an error or their is no response on the results
|
|
27350
|
+
// return an error
|
|
27351
|
+
if (irReturnError) {
|
|
27352
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27353
|
+
return callback(null, irReturnError);
|
|
27354
|
+
}
|
|
27355
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27356
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['executeaBIGIPscript'], null, null, null);
|
|
27357
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27358
|
+
return callback(null, errorObj);
|
|
27359
|
+
}
|
|
27360
|
+
|
|
27361
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27362
|
+
// return the response
|
|
27363
|
+
return callback(irReturnData, null);
|
|
27364
|
+
});
|
|
27365
|
+
} catch (ex) {
|
|
27366
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27367
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27368
|
+
return callback(null, errorObj);
|
|
27369
|
+
}
|
|
27370
|
+
}
|
|
27371
|
+
|
|
27372
|
+
/**
|
|
27373
|
+
* @function queryBIGIPscriptstatus
|
|
27374
|
+
* @pronghornType method
|
|
27375
|
+
* @name queryBIGIPscriptstatus
|
|
27376
|
+
* @summary Query BIG-IP script status
|
|
27377
|
+
*
|
|
27378
|
+
* @param {string} scriptTaskId - scriptTaskId param
|
|
27379
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27380
|
+
* @return {object} results - An object containing the response of the action
|
|
27381
|
+
*
|
|
27382
|
+
* @route {POST} /queryBIGIPscriptstatus
|
|
27383
|
+
* @roles admin
|
|
27384
|
+
* @task true
|
|
27385
|
+
*/
|
|
27386
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27387
|
+
queryBIGIPscriptstatus(scriptTaskId, callback) {
|
|
27388
|
+
const meth = 'adapter-queryBIGIPscriptstatus';
|
|
27389
|
+
const origin = `${this.id}-${meth}`;
|
|
27390
|
+
log.trace(origin);
|
|
27391
|
+
|
|
27392
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27393
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27394
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27395
|
+
return callback(null, errorObj);
|
|
27396
|
+
}
|
|
27397
|
+
|
|
27398
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27399
|
+
if (scriptTaskId === undefined || scriptTaskId === null || scriptTaskId === '') {
|
|
27400
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['scriptTaskId'], null, null, null);
|
|
27401
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27402
|
+
return callback(null, errorObj);
|
|
27403
|
+
}
|
|
27404
|
+
|
|
27405
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27406
|
+
const queryParamsAvailable = {};
|
|
27407
|
+
const queryParams = {};
|
|
27408
|
+
const pathVars = [scriptTaskId];
|
|
27409
|
+
const bodyVars = {};
|
|
27410
|
+
|
|
27411
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27412
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27413
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27414
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27415
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27416
|
+
}
|
|
27417
|
+
});
|
|
27418
|
+
|
|
27419
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27420
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27421
|
+
const reqObj = {
|
|
27422
|
+
payload: bodyVars,
|
|
27423
|
+
uriPathVars: pathVars,
|
|
27424
|
+
uriQuery: queryParams
|
|
27425
|
+
};
|
|
27426
|
+
|
|
27427
|
+
try {
|
|
27428
|
+
// Make the call -
|
|
27429
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27430
|
+
return this.requestHandlerInst.identifyRequest('BIGIPTMSHScripting', 'queryBIGIPscriptstatus', reqObj, true, (irReturnData, irReturnError) => {
|
|
27431
|
+
// if we received an error or their is no response on the results
|
|
27432
|
+
// return an error
|
|
27433
|
+
if (irReturnError) {
|
|
27434
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27435
|
+
return callback(null, irReturnError);
|
|
27436
|
+
}
|
|
27437
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27438
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['queryBIGIPscriptstatus'], null, null, null);
|
|
27439
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27440
|
+
return callback(null, errorObj);
|
|
27441
|
+
}
|
|
27442
|
+
|
|
27443
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27444
|
+
// return the response
|
|
27445
|
+
return callback(irReturnData, null);
|
|
27446
|
+
});
|
|
27447
|
+
} catch (ex) {
|
|
27448
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27449
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27450
|
+
return callback(null, errorObj);
|
|
27451
|
+
}
|
|
27452
|
+
}
|
|
27453
|
+
|
|
27454
|
+
/**
|
|
27455
|
+
* @function retrieveallSoftwareImages
|
|
27456
|
+
* @pronghornType method
|
|
27457
|
+
* @name retrieveallSoftwareImages
|
|
27458
|
+
* @summary Retrieve all Software Images
|
|
27459
|
+
*
|
|
27460
|
+
* @param {string} [filter] - filter param
|
|
27461
|
+
* @param {string} [orderby] - orderby param
|
|
27462
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27463
|
+
* @return {object} results - An object containing the response of the action
|
|
27464
|
+
*
|
|
27465
|
+
* @route {POST} /retrieveallSoftwareImages
|
|
27466
|
+
* @roles admin
|
|
27467
|
+
* @task true
|
|
27468
|
+
*/
|
|
27469
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27470
|
+
retrieveallSoftwareImages(filter, orderby, callback) {
|
|
27471
|
+
const meth = 'adapter-retrieveallSoftwareImages';
|
|
27472
|
+
const origin = `${this.id}-${meth}`;
|
|
27473
|
+
log.trace(origin);
|
|
27474
|
+
|
|
27475
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27476
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27477
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27478
|
+
return callback(null, errorObj);
|
|
27479
|
+
}
|
|
27480
|
+
|
|
27481
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27482
|
+
|
|
27483
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27484
|
+
const queryParamsAvailable = { $filter: filter, $orderby: orderby };
|
|
27485
|
+
const queryParams = {};
|
|
27486
|
+
const pathVars = [];
|
|
27487
|
+
const bodyVars = {};
|
|
27488
|
+
|
|
27489
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27490
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27491
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27492
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27493
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27494
|
+
}
|
|
27495
|
+
});
|
|
27496
|
+
|
|
27497
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27498
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27499
|
+
const reqObj = {
|
|
27500
|
+
payload: bodyVars,
|
|
27501
|
+
uriPathVars: pathVars,
|
|
27502
|
+
uriQuery: queryParams
|
|
27503
|
+
};
|
|
27504
|
+
|
|
27505
|
+
try {
|
|
27506
|
+
// Make the call -
|
|
27507
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27508
|
+
return this.requestHandlerInst.identifyRequest('BIGIPSoftwareImageManagement', 'retrieveallSoftwareImages', reqObj, true, (irReturnData, irReturnError) => {
|
|
27509
|
+
// if we received an error or their is no response on the results
|
|
27510
|
+
// return an error
|
|
27511
|
+
if (irReturnError) {
|
|
27512
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27513
|
+
return callback(null, irReturnError);
|
|
27514
|
+
}
|
|
27515
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27516
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveallSoftwareImages'], null, null, null);
|
|
27517
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27518
|
+
return callback(null, errorObj);
|
|
27519
|
+
}
|
|
27520
|
+
|
|
27521
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27522
|
+
// return the response
|
|
27523
|
+
return callback(irReturnData, null);
|
|
27524
|
+
});
|
|
27525
|
+
} catch (ex) {
|
|
27526
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27527
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27528
|
+
return callback(null, errorObj);
|
|
27529
|
+
}
|
|
27530
|
+
}
|
|
27531
|
+
|
|
27532
|
+
/**
|
|
27533
|
+
* @function retrieveallBIGIPsandimageslots
|
|
27534
|
+
* @pronghornType method
|
|
27535
|
+
* @name retrieveallBIGIPsandimageslots
|
|
27536
|
+
* @summary Retrieve all BIG-IPs and image slots
|
|
27537
|
+
*
|
|
27538
|
+
* @param {string} [filter] - filter param
|
|
27539
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27540
|
+
* @return {object} results - An object containing the response of the action
|
|
27541
|
+
*
|
|
27542
|
+
* @route {POST} /retrieveallBIGIPsandimageslots
|
|
27543
|
+
* @roles admin
|
|
27544
|
+
* @task true
|
|
27545
|
+
*/
|
|
27546
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27547
|
+
retrieveallBIGIPsandimageslots(filter, callback) {
|
|
27548
|
+
const meth = 'adapter-retrieveallBIGIPsandimageslots';
|
|
27549
|
+
const origin = `${this.id}-${meth}`;
|
|
27550
|
+
log.trace(origin);
|
|
27551
|
+
|
|
27552
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27553
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27554
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27555
|
+
return callback(null, errorObj);
|
|
27556
|
+
}
|
|
27557
|
+
|
|
27558
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27559
|
+
|
|
27560
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27561
|
+
const queryParamsAvailable = { $filter: filter };
|
|
27562
|
+
const queryParams = {};
|
|
27563
|
+
const pathVars = [];
|
|
27564
|
+
const bodyVars = {};
|
|
27565
|
+
|
|
27566
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27567
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27568
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27569
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27570
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27571
|
+
}
|
|
27572
|
+
});
|
|
27573
|
+
|
|
27574
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27575
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27576
|
+
const reqObj = {
|
|
27577
|
+
payload: bodyVars,
|
|
27578
|
+
uriPathVars: pathVars,
|
|
27579
|
+
uriQuery: queryParams
|
|
27580
|
+
};
|
|
27581
|
+
|
|
27582
|
+
try {
|
|
27583
|
+
// Make the call -
|
|
27584
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27585
|
+
return this.requestHandlerInst.identifyRequest('BIGIPSoftwareImageManagement', 'retrieveallBIGIPsandimageslots', reqObj, true, (irReturnData, irReturnError) => {
|
|
27586
|
+
// if we received an error or their is no response on the results
|
|
27587
|
+
// return an error
|
|
27588
|
+
if (irReturnError) {
|
|
27589
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27590
|
+
return callback(null, irReturnError);
|
|
27591
|
+
}
|
|
27592
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27593
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveallBIGIPsandimageslots'], null, null, null);
|
|
27594
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27595
|
+
return callback(null, errorObj);
|
|
27596
|
+
}
|
|
27597
|
+
|
|
27598
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27599
|
+
// return the response
|
|
27600
|
+
return callback(irReturnData, null);
|
|
27601
|
+
});
|
|
27602
|
+
} catch (ex) {
|
|
27603
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27604
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27605
|
+
return callback(null, errorObj);
|
|
27606
|
+
}
|
|
27607
|
+
}
|
|
27608
|
+
|
|
27609
|
+
/**
|
|
27610
|
+
* @function retrievaallUpgradeTasks
|
|
27611
|
+
* @pronghornType method
|
|
27612
|
+
* @name retrievaallUpgradeTasks
|
|
27613
|
+
* @summary Retrieve all upgrade tasks
|
|
27614
|
+
*
|
|
27615
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27616
|
+
* @return {object} results - An object containing the response of the action
|
|
27617
|
+
*
|
|
27618
|
+
* @route {GET} /retrievaallUpgradeTasks
|
|
27619
|
+
* @roles admin
|
|
27620
|
+
* @task true
|
|
27621
|
+
*/
|
|
27622
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27623
|
+
retrievaallUpgradeTasks(callback) {
|
|
27624
|
+
const meth = 'adapter-retrievaallUpgradeTasks';
|
|
27625
|
+
const origin = `${this.id}-${meth}`;
|
|
27626
|
+
log.trace(origin);
|
|
27627
|
+
|
|
27628
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27629
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27630
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27631
|
+
return callback(null, errorObj);
|
|
27632
|
+
}
|
|
27633
|
+
|
|
27634
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27635
|
+
|
|
27636
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27637
|
+
const queryParamsAvailable = {};
|
|
27638
|
+
const queryParams = {};
|
|
27639
|
+
const pathVars = [];
|
|
27640
|
+
const bodyVars = {};
|
|
27641
|
+
|
|
27642
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27643
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27644
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27645
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27646
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27647
|
+
}
|
|
27648
|
+
});
|
|
27649
|
+
|
|
27650
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27651
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27652
|
+
const reqObj = {
|
|
27653
|
+
payload: bodyVars,
|
|
27654
|
+
uriPathVars: pathVars,
|
|
27655
|
+
uriQuery: queryParams
|
|
27656
|
+
};
|
|
27657
|
+
|
|
27658
|
+
try {
|
|
27659
|
+
// Make the call -
|
|
27660
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27661
|
+
return this.requestHandlerInst.identifyRequest('DeviceUpgrades', 'retrievaallUpgradeTasks', reqObj, true, (irReturnData, irReturnError) => {
|
|
27662
|
+
// if we received an error or their is no response on the results
|
|
27663
|
+
// return an error
|
|
27664
|
+
if (irReturnError) {
|
|
27665
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27666
|
+
return callback(null, irReturnError);
|
|
27667
|
+
}
|
|
27668
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27669
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrievaallUpgradeTasks'], null, null, null);
|
|
27670
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27671
|
+
return callback(null, errorObj);
|
|
27672
|
+
}
|
|
27673
|
+
|
|
27674
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27675
|
+
// return the response
|
|
27676
|
+
return callback(irReturnData, null);
|
|
27677
|
+
});
|
|
27678
|
+
} catch (ex) {
|
|
27679
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27680
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27681
|
+
return callback(null, errorObj);
|
|
27682
|
+
}
|
|
27683
|
+
}
|
|
27684
|
+
|
|
27685
|
+
/**
|
|
27686
|
+
* @function performSoftwareUpgrade
|
|
27687
|
+
* @pronghornType method
|
|
27688
|
+
* @name performSoftwareUpgrade
|
|
27689
|
+
* @summary Perform software upgrade
|
|
27690
|
+
*
|
|
27691
|
+
* @param {object} body - body param
|
|
27692
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27693
|
+
* @return {object} results - An object containing the response of the action
|
|
27694
|
+
*
|
|
27695
|
+
* @route {POST} /performSoftwareUpgrade
|
|
27696
|
+
* @roles admin
|
|
27697
|
+
* @task true
|
|
27698
|
+
*/
|
|
27699
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27700
|
+
performSoftwareUpgrade(body, callback) {
|
|
27701
|
+
const meth = 'adapter-performSoftwareUpgrade';
|
|
27702
|
+
const origin = `${this.id}-${meth}`;
|
|
27703
|
+
log.trace(origin);
|
|
27704
|
+
|
|
27705
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27706
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27707
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27708
|
+
return callback(null, errorObj);
|
|
27709
|
+
}
|
|
27710
|
+
|
|
27711
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27712
|
+
if (body === undefined || body === null || body === '') {
|
|
27713
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
27714
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27715
|
+
return callback(null, errorObj);
|
|
27716
|
+
}
|
|
27717
|
+
|
|
27718
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27719
|
+
const queryParamsAvailable = {};
|
|
27720
|
+
const queryParams = {};
|
|
27721
|
+
const pathVars = [];
|
|
27722
|
+
const bodyVars = body;
|
|
27723
|
+
|
|
27724
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27725
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27726
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27727
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27728
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27729
|
+
}
|
|
27730
|
+
});
|
|
27731
|
+
|
|
27732
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27733
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27734
|
+
const reqObj = {
|
|
27735
|
+
payload: bodyVars,
|
|
27736
|
+
uriPathVars: pathVars,
|
|
27737
|
+
uriQuery: queryParams
|
|
27738
|
+
};
|
|
27739
|
+
|
|
27740
|
+
try {
|
|
27741
|
+
// Make the call -
|
|
27742
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27743
|
+
return this.requestHandlerInst.identifyRequest('DeviceUpgrades', 'performSoftwareUpgrade', reqObj, true, (irReturnData, irReturnError) => {
|
|
27744
|
+
// if we received an error or their is no response on the results
|
|
27745
|
+
// return an error
|
|
27746
|
+
if (irReturnError) {
|
|
27747
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27748
|
+
return callback(null, irReturnError);
|
|
27749
|
+
}
|
|
27750
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27751
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['performSoftwareUpgrade'], null, null, null);
|
|
27752
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27753
|
+
return callback(null, errorObj);
|
|
27754
|
+
}
|
|
27755
|
+
|
|
27756
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27757
|
+
// return the response
|
|
27758
|
+
return callback(irReturnData, null);
|
|
27759
|
+
});
|
|
27760
|
+
} catch (ex) {
|
|
27761
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27762
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27763
|
+
return callback(null, errorObj);
|
|
27764
|
+
}
|
|
27765
|
+
}
|
|
27766
|
+
|
|
27767
|
+
/**
|
|
27768
|
+
* @function retrieveBIGIPdevices
|
|
27769
|
+
* @pronghornType method
|
|
27770
|
+
* @name retrieveBIGIPdevices
|
|
27771
|
+
* @summary Retrieve BIG-IP devices
|
|
27772
|
+
*
|
|
27773
|
+
* @param {string} [select] - select param
|
|
27774
|
+
* @param {string} [filter] - filter param
|
|
27775
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27776
|
+
* @return {object} results - An object containing the response of the action
|
|
27777
|
+
*
|
|
27778
|
+
* @route {POST} /retrieveBIGIPdevices
|
|
27779
|
+
* @roles admin
|
|
27780
|
+
* @task true
|
|
27781
|
+
*/
|
|
27782
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27783
|
+
retrieveBIGIPdevices(select, filter, callback) {
|
|
27784
|
+
const meth = 'adapter-retrieveBIGIPdevices';
|
|
27785
|
+
const origin = `${this.id}-${meth}`;
|
|
27786
|
+
log.trace(origin);
|
|
27787
|
+
|
|
27788
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27789
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27790
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27791
|
+
return callback(null, errorObj);
|
|
27792
|
+
}
|
|
27793
|
+
|
|
27794
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27795
|
+
|
|
27796
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27797
|
+
const queryParamsAvailable = { $select: select, $filter: filter };
|
|
27798
|
+
const queryParams = {};
|
|
27799
|
+
const pathVars = [];
|
|
27800
|
+
const bodyVars = {};
|
|
27801
|
+
|
|
27802
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27803
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27804
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27805
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27806
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27807
|
+
}
|
|
27808
|
+
});
|
|
27809
|
+
|
|
27810
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27811
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27812
|
+
const reqObj = {
|
|
27813
|
+
payload: bodyVars,
|
|
27814
|
+
uriPathVars: pathVars,
|
|
27815
|
+
uriQuery: queryParams
|
|
27816
|
+
};
|
|
27817
|
+
|
|
27818
|
+
try {
|
|
27819
|
+
// Make the call -
|
|
27820
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27821
|
+
return this.requestHandlerInst.identifyRequest('Device', 'retrieveBIGIPdevices', reqObj, true, (irReturnData, irReturnError) => {
|
|
27822
|
+
// if we received an error or their is no response on the results
|
|
27823
|
+
// return an error
|
|
27824
|
+
if (irReturnError) {
|
|
27825
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27826
|
+
return callback(null, irReturnError);
|
|
27827
|
+
}
|
|
27828
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27829
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveBIGIPdevices'], null, null, null);
|
|
27830
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27831
|
+
return callback(null, errorObj);
|
|
27832
|
+
}
|
|
27833
|
+
|
|
27834
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27835
|
+
// return the response
|
|
27836
|
+
return callback(irReturnData, null);
|
|
27837
|
+
});
|
|
27838
|
+
} catch (ex) {
|
|
27839
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27840
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27841
|
+
return callback(null, errorObj);
|
|
27842
|
+
}
|
|
27843
|
+
}
|
|
27844
|
+
|
|
27845
|
+
/**
|
|
27846
|
+
* @function retrieveDeviceGroups
|
|
27847
|
+
* @pronghornType method
|
|
27848
|
+
* @name retrieveDeviceGroups
|
|
27849
|
+
* @summary Retrieve Device Groups
|
|
27850
|
+
*
|
|
27851
|
+
* @param {string} [filter] - filter param
|
|
27852
|
+
* @param {string} [orderby] - orderby param
|
|
27853
|
+
* @param {string} [select] - select param
|
|
27854
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27855
|
+
* @return {object} results - An object containing the response of the action
|
|
27856
|
+
*
|
|
27857
|
+
* @route {POST} /retrieveDeviceGroups
|
|
27858
|
+
* @roles admin
|
|
27859
|
+
* @task true
|
|
27860
|
+
*/
|
|
27861
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27862
|
+
retrieveDeviceGroups(filter, orderby, select, callback) {
|
|
27863
|
+
const meth = 'adapter-retrieveDeviceGroups';
|
|
27864
|
+
const origin = `${this.id}-${meth}`;
|
|
27865
|
+
log.trace(origin);
|
|
27866
|
+
|
|
27867
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27868
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27869
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27870
|
+
return callback(null, errorObj);
|
|
27871
|
+
}
|
|
27872
|
+
|
|
27873
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27874
|
+
|
|
27875
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27876
|
+
const queryParamsAvailable = { $filter: filter, $orderby: orderby, $select: select };
|
|
27877
|
+
const queryParams = {};
|
|
27878
|
+
const pathVars = [];
|
|
27879
|
+
const bodyVars = {};
|
|
27880
|
+
|
|
27881
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27882
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27883
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27884
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27885
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27886
|
+
}
|
|
27887
|
+
});
|
|
27888
|
+
|
|
27889
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27890
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27891
|
+
const reqObj = {
|
|
27892
|
+
payload: bodyVars,
|
|
27893
|
+
uriPathVars: pathVars,
|
|
27894
|
+
uriQuery: queryParams
|
|
27895
|
+
};
|
|
27896
|
+
|
|
27897
|
+
try {
|
|
27898
|
+
// Make the call -
|
|
27899
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27900
|
+
return this.requestHandlerInst.identifyRequest('Device', 'retrieveDeviceGroups', reqObj, true, (irReturnData, irReturnError) => {
|
|
27901
|
+
// if we received an error or their is no response on the results
|
|
27902
|
+
// return an error
|
|
27903
|
+
if (irReturnError) {
|
|
27904
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27905
|
+
return callback(null, irReturnError);
|
|
27906
|
+
}
|
|
27907
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27908
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveDeviceGroups'], null, null, null);
|
|
27909
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27910
|
+
return callback(null, errorObj);
|
|
27911
|
+
}
|
|
27912
|
+
|
|
27913
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27914
|
+
// return the response
|
|
27915
|
+
return callback(irReturnData, null);
|
|
27916
|
+
});
|
|
27917
|
+
} catch (ex) {
|
|
27918
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
27919
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27920
|
+
return callback(null, errorObj);
|
|
27921
|
+
}
|
|
27922
|
+
}
|
|
27923
|
+
|
|
27924
|
+
/**
|
|
27925
|
+
* @function retrieveBIGIPHealthSummary
|
|
27926
|
+
* @pronghornType method
|
|
27927
|
+
* @name retrieveBIGIPHealthSummary
|
|
27928
|
+
* @summary Retrieve BIG-IP Health Summary
|
|
27929
|
+
*
|
|
27930
|
+
* @param {string} instanceUuid - instanceUuid param
|
|
27931
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
27932
|
+
* @return {object} results - An object containing the response of the action
|
|
27933
|
+
*
|
|
27934
|
+
* @route {POST} /retrieveBIGIPHealthSummary
|
|
27935
|
+
* @roles admin
|
|
27936
|
+
* @task true
|
|
27937
|
+
*/
|
|
27938
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
27939
|
+
retrieveBIGIPHealthSummary(instanceUuid, callback) {
|
|
27940
|
+
const meth = 'adapter-retrieveBIGIPHealthSummary';
|
|
27941
|
+
const origin = `${this.id}-${meth}`;
|
|
27942
|
+
log.trace(origin);
|
|
27943
|
+
|
|
27944
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
27945
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
27946
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27947
|
+
return callback(null, errorObj);
|
|
27948
|
+
}
|
|
27949
|
+
|
|
27950
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
27951
|
+
if (instanceUuid === undefined || instanceUuid === null || instanceUuid === '') {
|
|
27952
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['instanceUuid'], null, null, null);
|
|
27953
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27954
|
+
return callback(null, errorObj);
|
|
27955
|
+
}
|
|
27956
|
+
|
|
27957
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
27958
|
+
const queryParamsAvailable = {};
|
|
27959
|
+
const queryParams = {};
|
|
27960
|
+
const pathVars = [instanceUuid];
|
|
27961
|
+
const bodyVars = {};
|
|
27962
|
+
|
|
27963
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
27964
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
27965
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
27966
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
27967
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
27968
|
+
}
|
|
27969
|
+
});
|
|
27970
|
+
|
|
27971
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
27972
|
+
// see adapter code documentation for more information on the request object's fields
|
|
27973
|
+
const reqObj = {
|
|
27974
|
+
payload: bodyVars,
|
|
27975
|
+
uriPathVars: pathVars,
|
|
27976
|
+
uriQuery: queryParams
|
|
27977
|
+
};
|
|
27978
|
+
|
|
27979
|
+
try {
|
|
27980
|
+
// Make the call -
|
|
27981
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
27982
|
+
return this.requestHandlerInst.identifyRequest('Device', 'retrieveBIGIPHealthSummary', reqObj, true, (irReturnData, irReturnError) => {
|
|
27983
|
+
// if we received an error or their is no response on the results
|
|
27984
|
+
// return an error
|
|
27985
|
+
if (irReturnError) {
|
|
27986
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
27987
|
+
return callback(null, irReturnError);
|
|
27988
|
+
}
|
|
27989
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
27990
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveBIGIPHealthSummary'], null, null, null);
|
|
27991
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
27992
|
+
return callback(null, errorObj);
|
|
27993
|
+
}
|
|
27994
|
+
|
|
27995
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
27996
|
+
// return the response
|
|
27997
|
+
return callback(irReturnData, null);
|
|
27998
|
+
});
|
|
27999
|
+
} catch (ex) {
|
|
28000
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28001
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28002
|
+
return callback(null, errorObj);
|
|
28003
|
+
}
|
|
28004
|
+
}
|
|
28005
|
+
|
|
28006
|
+
/**
|
|
28007
|
+
* @function retrieveBIGIPDeviceImportTasks
|
|
28008
|
+
* @pronghornType method
|
|
28009
|
+
* @name retrieveBIGIPDeviceImportTasks
|
|
28010
|
+
* @summary Retrieve BIG-IP Device Import Tasks
|
|
28011
|
+
*
|
|
28012
|
+
* @param {string} [filter] - filter param
|
|
28013
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28014
|
+
* @return {object} results - An object containing the response of the action
|
|
28015
|
+
*
|
|
28016
|
+
* @route {POST} /retrieveBIGIPDeviceImportTasks
|
|
28017
|
+
* @roles admin
|
|
28018
|
+
* @task true
|
|
28019
|
+
*/
|
|
28020
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28021
|
+
retrieveBIGIPDeviceImportTasks(filter, callback) {
|
|
28022
|
+
const meth = 'adapter-retrieveBIGIPDeviceImportTasks';
|
|
28023
|
+
const origin = `${this.id}-${meth}`;
|
|
28024
|
+
log.trace(origin);
|
|
28025
|
+
|
|
28026
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28027
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28028
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28029
|
+
return callback(null, errorObj);
|
|
28030
|
+
}
|
|
28031
|
+
|
|
28032
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28033
|
+
|
|
28034
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28035
|
+
const queryParamsAvailable = { $filter: filter };
|
|
28036
|
+
const queryParams = {};
|
|
28037
|
+
const pathVars = [];
|
|
28038
|
+
const bodyVars = {};
|
|
28039
|
+
|
|
28040
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28041
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28042
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28043
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28044
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28045
|
+
}
|
|
28046
|
+
});
|
|
28047
|
+
|
|
28048
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28049
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28050
|
+
const reqObj = {
|
|
28051
|
+
payload: bodyVars,
|
|
28052
|
+
uriPathVars: pathVars,
|
|
28053
|
+
uriQuery: queryParams
|
|
28054
|
+
};
|
|
28055
|
+
|
|
28056
|
+
try {
|
|
28057
|
+
// Make the call -
|
|
28058
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28059
|
+
return this.requestHandlerInst.identifyRequest('DeviceImport', 'retrieveBIGIPDeviceImportTasks', reqObj, true, (irReturnData, irReturnError) => {
|
|
28060
|
+
// if we received an error or their is no response on the results
|
|
28061
|
+
// return an error
|
|
28062
|
+
if (irReturnError) {
|
|
28063
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28064
|
+
return callback(null, irReturnError);
|
|
28065
|
+
}
|
|
28066
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28067
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveBIGIPDeviceImportTasks'], null, null, null);
|
|
28068
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28069
|
+
return callback(null, errorObj);
|
|
28070
|
+
}
|
|
28071
|
+
|
|
28072
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28073
|
+
// return the response
|
|
28074
|
+
return callback(irReturnData, null);
|
|
28075
|
+
});
|
|
28076
|
+
} catch (ex) {
|
|
28077
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28078
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28079
|
+
return callback(null, errorObj);
|
|
28080
|
+
}
|
|
28081
|
+
}
|
|
28082
|
+
|
|
28083
|
+
/**
|
|
28084
|
+
* @function performBIGIPDeviceImportusingmachineId
|
|
28085
|
+
* @pronghornType method
|
|
28086
|
+
* @name performBIGIPDeviceImportusingmachineId
|
|
28087
|
+
* @summary Perform BIG-IP Device Import using machineId
|
|
28088
|
+
*
|
|
28089
|
+
* @param {object} body - body param
|
|
28090
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28091
|
+
* @return {object} results - An object containing the response of the action
|
|
28092
|
+
*
|
|
28093
|
+
* @route {POST} /performBIGIPDeviceImportusingmachineId
|
|
28094
|
+
* @roles admin
|
|
28095
|
+
* @task true
|
|
28096
|
+
*/
|
|
28097
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28098
|
+
performBIGIPDeviceImportusingmachineId(body, callback) {
|
|
28099
|
+
const meth = 'adapter-performBIGIPDeviceImportusingmachineId';
|
|
28100
|
+
const origin = `${this.id}-${meth}`;
|
|
28101
|
+
log.trace(origin);
|
|
28102
|
+
|
|
28103
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28104
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28105
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28106
|
+
return callback(null, errorObj);
|
|
28107
|
+
}
|
|
28108
|
+
|
|
28109
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28110
|
+
if (body === undefined || body === null || body === '') {
|
|
28111
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
28112
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28113
|
+
return callback(null, errorObj);
|
|
28114
|
+
}
|
|
28115
|
+
|
|
28116
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28117
|
+
const queryParamsAvailable = {};
|
|
28118
|
+
const queryParams = {};
|
|
28119
|
+
const pathVars = [];
|
|
28120
|
+
const bodyVars = body;
|
|
28121
|
+
|
|
28122
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28123
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28124
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28125
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28126
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28127
|
+
}
|
|
28128
|
+
});
|
|
28129
|
+
|
|
28130
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28131
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28132
|
+
const reqObj = {
|
|
28133
|
+
payload: bodyVars,
|
|
28134
|
+
uriPathVars: pathVars,
|
|
28135
|
+
uriQuery: queryParams
|
|
28136
|
+
};
|
|
28137
|
+
|
|
28138
|
+
try {
|
|
28139
|
+
// Make the call -
|
|
28140
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28141
|
+
return this.requestHandlerInst.identifyRequest('DeviceImport', 'performBIGIPDeviceImportusingmachineId', reqObj, true, (irReturnData, irReturnError) => {
|
|
28142
|
+
// if we received an error or their is no response on the results
|
|
28143
|
+
// return an error
|
|
28144
|
+
if (irReturnError) {
|
|
28145
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28146
|
+
return callback(null, irReturnError);
|
|
28147
|
+
}
|
|
28148
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28149
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['performBIGIPDeviceImportusingmachineId'], null, null, null);
|
|
28150
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28151
|
+
return callback(null, errorObj);
|
|
28152
|
+
}
|
|
28153
|
+
|
|
28154
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28155
|
+
// return the response
|
|
28156
|
+
return callback(irReturnData, null);
|
|
28157
|
+
});
|
|
28158
|
+
} catch (ex) {
|
|
28159
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28160
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28161
|
+
return callback(null, errorObj);
|
|
28162
|
+
}
|
|
28163
|
+
}
|
|
28164
|
+
|
|
28165
|
+
/**
|
|
28166
|
+
* @function performBIGIPDeviceImportusingImportTask
|
|
28167
|
+
* @pronghornType method
|
|
28168
|
+
* @name performBIGIPDeviceImportusingImportTask
|
|
28169
|
+
* @summary Perform BIG-IP Device Import using Import Task
|
|
28170
|
+
*
|
|
28171
|
+
* @param {string} deviceImportId - deviceImportId param
|
|
28172
|
+
* @param {object} body - body param
|
|
28173
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28174
|
+
* @return {object} results - An object containing the response of the action
|
|
28175
|
+
*
|
|
28176
|
+
* @route {POST} /performBIGIPDeviceImportusingImportTask
|
|
28177
|
+
* @roles admin
|
|
28178
|
+
* @task true
|
|
28179
|
+
*/
|
|
28180
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28181
|
+
performBIGIPDeviceImportusingImportTask(deviceImportId, body, callback) {
|
|
28182
|
+
const meth = 'adapter-performBIGIPDeviceImportusingImportTask';
|
|
28183
|
+
const origin = `${this.id}-${meth}`;
|
|
28184
|
+
log.trace(origin);
|
|
28185
|
+
|
|
28186
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28187
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28188
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28189
|
+
return callback(null, errorObj);
|
|
28190
|
+
}
|
|
28191
|
+
|
|
28192
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28193
|
+
if (deviceImportId === undefined || deviceImportId === null || deviceImportId === '') {
|
|
28194
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['deviceImportId'], null, null, null);
|
|
28195
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28196
|
+
return callback(null, errorObj);
|
|
28197
|
+
}
|
|
28198
|
+
if (body === undefined || body === null || body === '') {
|
|
28199
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
|
|
28200
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28201
|
+
return callback(null, errorObj);
|
|
28202
|
+
}
|
|
28203
|
+
|
|
28204
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28205
|
+
const queryParamsAvailable = {};
|
|
28206
|
+
const queryParams = {};
|
|
28207
|
+
const pathVars = [deviceImportId];
|
|
28208
|
+
const bodyVars = body;
|
|
28209
|
+
|
|
28210
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28211
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28212
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28213
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28214
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28215
|
+
}
|
|
28216
|
+
});
|
|
28217
|
+
|
|
28218
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28219
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28220
|
+
const reqObj = {
|
|
28221
|
+
payload: bodyVars,
|
|
28222
|
+
uriPathVars: pathVars,
|
|
28223
|
+
uriQuery: queryParams
|
|
28224
|
+
};
|
|
28225
|
+
|
|
28226
|
+
try {
|
|
28227
|
+
// Make the call -
|
|
28228
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28229
|
+
return this.requestHandlerInst.identifyRequest('DeviceImport', 'performBIGIPDeviceImportusingImportTask', reqObj, false, (irReturnData, irReturnError) => {
|
|
28230
|
+
// if we received an error or their is no response on the results
|
|
28231
|
+
// return an error
|
|
28232
|
+
if (irReturnError) {
|
|
28233
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28234
|
+
return callback(null, irReturnError);
|
|
28235
|
+
}
|
|
28236
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28237
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['performBIGIPDeviceImportusingImportTask'], null, null, null);
|
|
28238
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28239
|
+
return callback(null, errorObj);
|
|
28240
|
+
}
|
|
28241
|
+
|
|
28242
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28243
|
+
// return the response
|
|
28244
|
+
return callback(irReturnData, null);
|
|
28245
|
+
});
|
|
28246
|
+
} catch (ex) {
|
|
28247
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28248
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28249
|
+
return callback(null, errorObj);
|
|
28250
|
+
}
|
|
28251
|
+
}
|
|
28252
|
+
|
|
28253
|
+
/**
|
|
28254
|
+
* @function monitorImportTask
|
|
28255
|
+
* @pronghornType method
|
|
28256
|
+
* @name monitorImportTask
|
|
28257
|
+
* @summary Monitor Import Task
|
|
28258
|
+
*
|
|
28259
|
+
* @param {string} deviceImportId - deviceImportId param
|
|
28260
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28261
|
+
* @return {object} results - An object containing the response of the action
|
|
28262
|
+
*
|
|
28263
|
+
* @route {POST} /monitorImportTask
|
|
28264
|
+
* @roles admin
|
|
28265
|
+
* @task true
|
|
28266
|
+
*/
|
|
28267
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28268
|
+
monitorImportTask(deviceImportId, callback) {
|
|
28269
|
+
const meth = 'adapter-monitorImportTask';
|
|
28270
|
+
const origin = `${this.id}-${meth}`;
|
|
28271
|
+
log.trace(origin);
|
|
28272
|
+
|
|
28273
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28274
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28275
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28276
|
+
return callback(null, errorObj);
|
|
28277
|
+
}
|
|
28278
|
+
|
|
28279
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28280
|
+
if (deviceImportId === undefined || deviceImportId === null || deviceImportId === '') {
|
|
28281
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['deviceImportId'], null, null, null);
|
|
28282
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28283
|
+
return callback(null, errorObj);
|
|
28284
|
+
}
|
|
28285
|
+
|
|
28286
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28287
|
+
const queryParamsAvailable = {};
|
|
28288
|
+
const queryParams = {};
|
|
28289
|
+
const pathVars = [deviceImportId];
|
|
28290
|
+
const bodyVars = {};
|
|
28291
|
+
|
|
28292
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28293
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28294
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28295
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28296
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28297
|
+
}
|
|
28298
|
+
});
|
|
28299
|
+
|
|
28300
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28301
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28302
|
+
const reqObj = {
|
|
28303
|
+
payload: bodyVars,
|
|
28304
|
+
uriPathVars: pathVars,
|
|
28305
|
+
uriQuery: queryParams
|
|
28306
|
+
};
|
|
28307
|
+
|
|
28308
|
+
try {
|
|
28309
|
+
// Make the call -
|
|
28310
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28311
|
+
return this.requestHandlerInst.identifyRequest('DeviceImport', 'monitorImportTask', reqObj, true, (irReturnData, irReturnError) => {
|
|
28312
|
+
// if we received an error or their is no response on the results
|
|
28313
|
+
// return an error
|
|
28314
|
+
if (irReturnError) {
|
|
28315
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28316
|
+
return callback(null, irReturnError);
|
|
28317
|
+
}
|
|
28318
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28319
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['monitorImportTask'], null, null, null);
|
|
28320
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28321
|
+
return callback(null, errorObj);
|
|
28322
|
+
}
|
|
28323
|
+
|
|
28324
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28325
|
+
// return the response
|
|
28326
|
+
return callback(irReturnData, null);
|
|
28327
|
+
});
|
|
28328
|
+
} catch (ex) {
|
|
28329
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28330
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28331
|
+
return callback(null, errorObj);
|
|
28332
|
+
}
|
|
28333
|
+
}
|
|
28334
|
+
|
|
28335
|
+
/**
|
|
28336
|
+
* @function queryDevicebyDeviceReference
|
|
28337
|
+
* @pronghornType method
|
|
28338
|
+
* @name queryDevicebyDeviceReference
|
|
28339
|
+
* @summary Query Device by Device Reference
|
|
28340
|
+
*
|
|
28341
|
+
* @param {string} uuid - uuid param
|
|
28342
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28343
|
+
* @return {object} results - An object containing the response of the action
|
|
28344
|
+
*
|
|
28345
|
+
* @route {POST} /queryDevicebyDeviceReference
|
|
28346
|
+
* @roles admin
|
|
28347
|
+
* @task true
|
|
28348
|
+
*/
|
|
28349
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28350
|
+
queryDevicebyDeviceReference(uuid, callback) {
|
|
28351
|
+
const meth = 'adapter-queryDevicebyDeviceReference';
|
|
28352
|
+
const origin = `${this.id}-${meth}`;
|
|
28353
|
+
log.trace(origin);
|
|
28354
|
+
|
|
28355
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28356
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28357
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28358
|
+
return callback(null, errorObj);
|
|
28359
|
+
}
|
|
28360
|
+
|
|
28361
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28362
|
+
if (uuid === undefined || uuid === null || uuid === '') {
|
|
28363
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['uuid'], null, null, null);
|
|
28364
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28365
|
+
return callback(null, errorObj);
|
|
28366
|
+
}
|
|
28367
|
+
|
|
28368
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28369
|
+
const queryParamsAvailable = {};
|
|
28370
|
+
const queryParams = {};
|
|
28371
|
+
const pathVars = [uuid];
|
|
28372
|
+
const bodyVars = {};
|
|
28373
|
+
|
|
28374
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28375
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28376
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28377
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28378
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28379
|
+
}
|
|
28380
|
+
});
|
|
28381
|
+
|
|
28382
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28383
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28384
|
+
const reqObj = {
|
|
28385
|
+
payload: bodyVars,
|
|
28386
|
+
uriPathVars: pathVars,
|
|
28387
|
+
uriQuery: queryParams
|
|
28388
|
+
};
|
|
28389
|
+
|
|
28390
|
+
try {
|
|
28391
|
+
// Make the call -
|
|
28392
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28393
|
+
return this.requestHandlerInst.identifyRequest('BIGIPDeviceReferenceLookup', 'queryDevicebyDeviceReference', reqObj, true, (irReturnData, irReturnError) => {
|
|
28394
|
+
// if we received an error or their is no response on the results
|
|
28395
|
+
// return an error
|
|
28396
|
+
if (irReturnError) {
|
|
28397
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28398
|
+
return callback(null, irReturnError);
|
|
28399
|
+
}
|
|
28400
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28401
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['queryDevicebyDeviceReference'], null, null, null);
|
|
28402
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28403
|
+
return callback(null, errorObj);
|
|
28404
|
+
}
|
|
28405
|
+
|
|
28406
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28407
|
+
// return the response
|
|
28408
|
+
return callback(irReturnData, null);
|
|
28409
|
+
});
|
|
28410
|
+
} catch (ex) {
|
|
28411
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28412
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28413
|
+
return callback(null, errorObj);
|
|
28414
|
+
}
|
|
28415
|
+
}
|
|
28416
|
+
|
|
28417
|
+
/**
|
|
28418
|
+
* @function queryDSCGroup
|
|
28419
|
+
* @pronghornType method
|
|
28420
|
+
* @name queryDSCGroup
|
|
28421
|
+
* @summary Query DSC Group
|
|
28422
|
+
*
|
|
28423
|
+
* @param {string} [filter] - filter param
|
|
28424
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28425
|
+
* @return {object} results - An object containing the response of the action
|
|
28426
|
+
*
|
|
28427
|
+
* @route {POST} /queryDSCGroup
|
|
28428
|
+
* @roles admin
|
|
28429
|
+
* @task true
|
|
28430
|
+
*/
|
|
28431
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28432
|
+
queryDSCGroup(filter, callback) {
|
|
28433
|
+
const meth = 'adapter-queryDSCGroup';
|
|
28434
|
+
const origin = `${this.id}-${meth}`;
|
|
28435
|
+
log.trace(origin);
|
|
28436
|
+
|
|
28437
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28438
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28439
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28440
|
+
return callback(null, errorObj);
|
|
28441
|
+
}
|
|
28442
|
+
|
|
28443
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28444
|
+
|
|
28445
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28446
|
+
const queryParamsAvailable = { $filter: filter };
|
|
28447
|
+
const queryParams = {};
|
|
28448
|
+
const pathVars = [];
|
|
28449
|
+
const bodyVars = {};
|
|
28450
|
+
|
|
28451
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28452
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28453
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28454
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28455
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28456
|
+
}
|
|
28457
|
+
});
|
|
28458
|
+
|
|
28459
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28460
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28461
|
+
const reqObj = {
|
|
28462
|
+
payload: bodyVars,
|
|
28463
|
+
uriPathVars: pathVars,
|
|
28464
|
+
uriQuery: queryParams
|
|
28465
|
+
};
|
|
28466
|
+
|
|
28467
|
+
try {
|
|
28468
|
+
// Make the call -
|
|
28469
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28470
|
+
return this.requestHandlerInst.identifyRequest('BIGIPDeviceClustering', 'queryDSCGroup', reqObj, true, (irReturnData, irReturnError) => {
|
|
28471
|
+
// if we received an error or their is no response on the results
|
|
28472
|
+
// return an error
|
|
28473
|
+
if (irReturnError) {
|
|
28474
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28475
|
+
return callback(null, irReturnError);
|
|
28476
|
+
}
|
|
28477
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28478
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['queryDSCGroup'], null, null, null);
|
|
28479
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28480
|
+
return callback(null, errorObj);
|
|
28481
|
+
}
|
|
28482
|
+
|
|
28483
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28484
|
+
// return the response
|
|
28485
|
+
return callback(irReturnData, null);
|
|
28486
|
+
});
|
|
28487
|
+
} catch (ex) {
|
|
28488
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28489
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28490
|
+
return callback(null, errorObj);
|
|
28491
|
+
}
|
|
28492
|
+
}
|
|
28493
|
+
|
|
28494
|
+
/**
|
|
28495
|
+
* @function queryDSCGroupByGroupId
|
|
28496
|
+
* @pronghornType method
|
|
28497
|
+
* @name queryDSCGroupByGroupId
|
|
28498
|
+
* @summary Query DSC Group by group id
|
|
28499
|
+
*
|
|
28500
|
+
* @param {string} groupId - groupId param
|
|
28501
|
+
* @param {getCallback} callback - a callback function to return the result
|
|
28502
|
+
* @return {object} results - An object containing the response of the action
|
|
28503
|
+
*
|
|
28504
|
+
* @route {POST} /queryDSCGroupByGroupId
|
|
28505
|
+
* @roles admin
|
|
28506
|
+
* @task true
|
|
28507
|
+
*/
|
|
28508
|
+
/* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
|
|
28509
|
+
queryDSCGroupByGroupId(groupId, callback) {
|
|
28510
|
+
const meth = 'adapter-queryDSCGroupByGroupId';
|
|
28511
|
+
const origin = `${this.id}-${meth}`;
|
|
28512
|
+
log.trace(origin);
|
|
28513
|
+
|
|
28514
|
+
if (this.suspended && this.suspendMode === 'error') {
|
|
28515
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
|
|
28516
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28517
|
+
return callback(null, errorObj);
|
|
28518
|
+
}
|
|
28519
|
+
|
|
28520
|
+
/* HERE IS WHERE YOU VALIDATE DATA */
|
|
28521
|
+
if (groupId === undefined || groupId === null || groupId === '') {
|
|
28522
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['groupId'], null, null, null);
|
|
28523
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28524
|
+
return callback(null, errorObj);
|
|
28525
|
+
}
|
|
28526
|
+
|
|
28527
|
+
/* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
|
|
28528
|
+
const queryParamsAvailable = {};
|
|
28529
|
+
const queryParams = {};
|
|
28530
|
+
const pathVars = [groupId];
|
|
28531
|
+
const bodyVars = {};
|
|
28532
|
+
|
|
28533
|
+
// loop in template. long callback arg name to avoid identifier conflicts
|
|
28534
|
+
Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
|
|
28535
|
+
if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
|
|
28536
|
+
&& queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
|
|
28537
|
+
queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
|
|
28538
|
+
}
|
|
28539
|
+
});
|
|
28540
|
+
|
|
28541
|
+
// set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
|
|
28542
|
+
// see adapter code documentation for more information on the request object's fields
|
|
28543
|
+
const reqObj = {
|
|
28544
|
+
payload: bodyVars,
|
|
28545
|
+
uriPathVars: pathVars,
|
|
28546
|
+
uriQuery: queryParams
|
|
28547
|
+
};
|
|
28548
|
+
|
|
28549
|
+
try {
|
|
28550
|
+
// Make the call -
|
|
28551
|
+
// identifyRequest(entity, action, requestObj, returnDataFlag, callback)
|
|
28552
|
+
return this.requestHandlerInst.identifyRequest('BIGIPDeviceClustering', 'queryDSCGroupByGroupId', reqObj, true, (irReturnData, irReturnError) => {
|
|
28553
|
+
// if we received an error or their is no response on the results
|
|
28554
|
+
// return an error
|
|
28555
|
+
if (irReturnError) {
|
|
28556
|
+
/* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
|
|
28557
|
+
return callback(null, irReturnError);
|
|
28558
|
+
}
|
|
28559
|
+
if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
|
|
28560
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['queryDSCGroupByGroupId'], null, null, null);
|
|
28561
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28562
|
+
return callback(null, errorObj);
|
|
28563
|
+
}
|
|
28564
|
+
|
|
28565
|
+
/* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
|
|
28566
|
+
// return the response
|
|
28567
|
+
return callback(irReturnData, null);
|
|
28568
|
+
});
|
|
28569
|
+
} catch (ex) {
|
|
28570
|
+
const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
|
|
28571
|
+
log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
|
|
28572
|
+
return callback(null, errorObj);
|
|
28573
|
+
}
|
|
28574
|
+
}
|
|
24356
28575
|
}
|
|
24357
28576
|
|
|
24358
28577
|
module.exports = F5BigIQ;
|