@itentialopensource/adapter-f5_bigiq 0.3.0 → 0.3.2

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/adapter.js CHANGED
@@ -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
@@ -24912,22 +25001,22 @@ class F5BigIQ extends AdapterBaseCl {
24912
25001
  }
24913
25002
 
24914
25003
  /**
24915
- * @function deleteaBIGIPQkview
25004
+ * @function deleteaBIGIQQkview
24916
25005
  * @pronghornType method
24917
- * @name deleteaBIGIPQkview
25006
+ * @name deleteaBIGIQQkview
24918
25007
  * @summary Delete a BIGIP Qkview
24919
25008
  *
24920
25009
  * @param {string} bIGIPQKVIEWTASKID - bIGIPQKVIEWTASKID param
24921
25010
  * @param {getCallback} callback - a callback function to return the result
24922
25011
  * @return {object} results - An object containing the response of the action
24923
25012
  *
24924
- * @route {POST} /deleteaBIGIPQkview
25013
+ * @route {POST} /deleteaBIGIQQkview
24925
25014
  * @roles admin
24926
25015
  * @task true
24927
25016
  */
24928
25017
  /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
24929
- deleteaBIGIPQkview(bIGIPQKVIEWTASKID, callback) {
24930
- const meth = 'adapter-deleteaBIGIPQkview';
25018
+ deleteaBIGIQQkview(bIGIPQKVIEWTASKID, callback) {
25019
+ const meth = 'adapter-deleteaBIGIQQkview';
24931
25020
  const origin = `${this.id}-${meth}`;
24932
25021
  log.trace(origin);
24933
25022
 
@@ -24969,7 +25058,7 @@ class F5BigIQ extends AdapterBaseCl {
24969
25058
  try {
24970
25059
  // Make the call -
24971
25060
  // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
24972
- return this.requestHandlerInst.identifyRequest('Qkview', 'deleteaBIGIPQkview', reqObj, false, (irReturnData, irReturnError) => {
25061
+ return this.requestHandlerInst.identifyRequest('Qkview', 'deleteaBIGIQQkview', reqObj, false, (irReturnData, irReturnError) => {
24973
25062
  // if we received an error or their is no response on the results
24974
25063
  // return an error
24975
25064
  if (irReturnError) {
@@ -24977,7 +25066,7 @@ class F5BigIQ extends AdapterBaseCl {
24977
25066
  return callback(null, irReturnError);
24978
25067
  }
24979
25068
  if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
24980
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteaBIGIPQkview'], null, null, null);
25069
+ const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteaBIGIQQkview'], null, null, null);
24981
25070
  log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
24982
25071
  return callback(null, errorObj);
24983
25072
  }
@@ -26375,29 +26464,12 @@ class F5BigIQ extends AdapterBaseCl {
26375
26464
  }
26376
26465
  });
26377
26466
 
26378
- // if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
26379
- let thisHeaderData = null;
26380
- // if the additional headers was passed in as a string parse the json into an object
26381
- if (thisHeaderData !== null && thisHeaderData.constructor === String) {
26382
- try {
26383
- // parse the additional headers object that was passed in
26384
- thisHeaderData = JSON.parse(thisHeaderData);
26385
- } catch (err) {
26386
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
26387
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
26388
- return callback(null, errorObj);
26389
- }
26390
- } else if (thisHeaderData === null) {
26391
- thisHeaderData = { contentType: '' };
26392
- }
26393
-
26394
26467
  // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
26395
26468
  // see adapter code documentation for more information on the request object's fields
26396
26469
  const reqObj = {
26397
26470
  payload: bodyVars,
26398
26471
  uriPathVars: pathVars,
26399
- uriQuery: queryParams,
26400
- addlHeaders: thisHeaderData
26472
+ uriQuery: queryParams
26401
26473
  };
26402
26474
 
26403
26475
  try {
@@ -26468,29 +26540,12 @@ class F5BigIQ extends AdapterBaseCl {
26468
26540
  }
26469
26541
  });
26470
26542
 
26471
- // if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
26472
- let thisHeaderData = null;
26473
- // if the additional headers was passed in as a string parse the json into an object
26474
- if (thisHeaderData !== null && thisHeaderData.constructor === String) {
26475
- try {
26476
- // parse the additional headers object that was passed in
26477
- thisHeaderData = JSON.parse(thisHeaderData);
26478
- } catch (err) {
26479
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
26480
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
26481
- return callback(null, errorObj);
26482
- }
26483
- } else if (thisHeaderData === null) {
26484
- thisHeaderData = { contentType: '' };
26485
- }
26486
-
26487
26543
  // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
26488
26544
  // see adapter code documentation for more information on the request object's fields
26489
26545
  const reqObj = {
26490
26546
  payload: bodyVars,
26491
26547
  uriPathVars: pathVars,
26492
- uriQuery: queryParams,
26493
- addlHeaders: thisHeaderData
26548
+ uriQuery: queryParams
26494
26549
  };
26495
26550
 
26496
26551
  try {
@@ -26649,29 +26704,12 @@ class F5BigIQ extends AdapterBaseCl {
26649
26704
  }
26650
26705
  });
26651
26706
 
26652
- // if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
26653
- let thisHeaderData = null;
26654
- // if the additional headers was passed in as a string parse the json into an object
26655
- if (thisHeaderData !== null && thisHeaderData.constructor === String) {
26656
- try {
26657
- // parse the additional headers object that was passed in
26658
- thisHeaderData = JSON.parse(thisHeaderData);
26659
- } catch (err) {
26660
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
26661
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
26662
- return callback(null, errorObj);
26663
- }
26664
- } else if (thisHeaderData === null) {
26665
- thisHeaderData = { contentType: '' };
26666
- }
26667
-
26668
26707
  // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
26669
26708
  // see adapter code documentation for more information on the request object's fields
26670
26709
  const reqObj = {
26671
26710
  payload: bodyVars,
26672
26711
  uriPathVars: pathVars,
26673
- uriQuery: queryParams,
26674
- addlHeaders: thisHeaderData
26712
+ uriQuery: queryParams
26675
26713
  };
26676
26714
 
26677
26715
  try {
@@ -26748,29 +26786,12 @@ class F5BigIQ extends AdapterBaseCl {
26748
26786
  }
26749
26787
  });
26750
26788
 
26751
- // if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
26752
- let thisHeaderData = null;
26753
- // if the additional headers was passed in as a string parse the json into an object
26754
- if (thisHeaderData !== null && thisHeaderData.constructor === String) {
26755
- try {
26756
- // parse the additional headers object that was passed in
26757
- thisHeaderData = JSON.parse(thisHeaderData);
26758
- } catch (err) {
26759
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
26760
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
26761
- return callback(null, errorObj);
26762
- }
26763
- } else if (thisHeaderData === null) {
26764
- thisHeaderData = { contentType: '' };
26765
- }
26766
-
26767
26789
  // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
26768
26790
  // see adapter code documentation for more information on the request object's fields
26769
26791
  const reqObj = {
26770
26792
  payload: bodyVars,
26771
26793
  uriPathVars: pathVars,
26772
- uriQuery: queryParams,
26773
- addlHeaders: thisHeaderData
26794
+ uriQuery: queryParams
26774
26795
  };
26775
26796
 
26776
26797
  try {
@@ -28483,1918 +28504,6 @@ class F5BigIQ extends AdapterBaseCl {
28483
28504
  return callback(null, errorObj);
28484
28505
  }
28485
28506
  }
28486
-
28487
- /**
28488
- * @function retrieveLicenseInformation
28489
- * @pronghornType method
28490
- * @name retrieveLicenseInformation
28491
- * @summary Retrieve License Information
28492
- *
28493
- * @param {getCallback} callback - a callback function to return the result
28494
- * @return {object} results - An object containing the response of the action
28495
- *
28496
- * @route {GET} /retrieveLicenseInformation
28497
- * @roles admin
28498
- * @task true
28499
- */
28500
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
28501
- retrieveLicenseInformation(callback) {
28502
- const meth = 'adapter-retrieveLicenseInformation';
28503
- const origin = `${this.id}-${meth}`;
28504
- log.trace(origin);
28505
-
28506
- if (this.suspended && this.suspendMode === 'error') {
28507
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
28508
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28509
- return callback(null, errorObj);
28510
- }
28511
-
28512
- /* HERE IS WHERE YOU VALIDATE DATA */
28513
-
28514
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
28515
- const queryParamsAvailable = {};
28516
- const queryParams = {};
28517
- const pathVars = [];
28518
- const bodyVars = {};
28519
-
28520
- // loop in template. long callback arg name to avoid identifier conflicts
28521
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
28522
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
28523
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
28524
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
28525
- }
28526
- });
28527
-
28528
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
28529
- // see adapter code documentation for more information on the request object's fields
28530
- const reqObj = {
28531
- payload: bodyVars,
28532
- uriPathVars: pathVars,
28533
- uriQuery: queryParams
28534
- };
28535
-
28536
- try {
28537
- // Make the call -
28538
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
28539
- return this.requestHandlerInst.identifyRequest('Licensing', 'retrieveLicenseInformation', reqObj, true, (irReturnData, irReturnError) => {
28540
- // if we received an error or their is no response on the results
28541
- // return an error
28542
- if (irReturnError) {
28543
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
28544
- return callback(null, irReturnError);
28545
- }
28546
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
28547
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveLicenseInformation'], null, null, null);
28548
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28549
- return callback(null, errorObj);
28550
- }
28551
-
28552
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
28553
- // return the response
28554
- return callback(irReturnData, null);
28555
- });
28556
- } catch (ex) {
28557
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
28558
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28559
- return callback(null, errorObj);
28560
- }
28561
- }
28562
-
28563
- /**
28564
- * @function activateReactiveLicense
28565
- * @pronghornType method
28566
- * @name activateReactiveLicense
28567
- * @summary Activate\/Reactive License
28568
- *
28569
- * @param {string} body - body param
28570
- * @param {getCallback} callback - a callback function to return the result
28571
- * @return {object} results - An object containing the response of the action
28572
- *
28573
- * @route {POST} /activateReactiveLicense
28574
- * @roles admin
28575
- * @task true
28576
- */
28577
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
28578
- activateReactiveLicense(body, callback) {
28579
- const meth = 'adapter-activateReactiveLicense';
28580
- const origin = `${this.id}-${meth}`;
28581
- log.trace(origin);
28582
-
28583
- if (this.suspended && this.suspendMode === 'error') {
28584
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
28585
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28586
- return callback(null, errorObj);
28587
- }
28588
-
28589
- /* HERE IS WHERE YOU VALIDATE DATA */
28590
- if (body === undefined || body === null || body === '') {
28591
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
28592
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28593
- return callback(null, errorObj);
28594
- }
28595
-
28596
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
28597
- const queryParamsAvailable = {};
28598
- const queryParams = {};
28599
- const pathVars = [];
28600
- const bodyVars = { body };
28601
-
28602
- // loop in template. long callback arg name to avoid identifier conflicts
28603
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
28604
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
28605
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
28606
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
28607
- }
28608
- });
28609
-
28610
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
28611
- // see adapter code documentation for more information on the request object's fields
28612
- const reqObj = {
28613
- payload: bodyVars,
28614
- uriPathVars: pathVars,
28615
- uriQuery: queryParams
28616
- };
28617
-
28618
- try {
28619
- // Make the call -
28620
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
28621
- return this.requestHandlerInst.identifyRequest('Licensing', 'activateReactiveLicense', reqObj, true, (irReturnData, irReturnError) => {
28622
- // if we received an error or their is no response on the results
28623
- // return an error
28624
- if (irReturnError) {
28625
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
28626
- return callback(null, irReturnError);
28627
- }
28628
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
28629
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['activateReactiveLicense'], null, null, null);
28630
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28631
- return callback(null, errorObj);
28632
- }
28633
-
28634
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
28635
- // return the response
28636
- return callback(irReturnData, null);
28637
- });
28638
- } catch (ex) {
28639
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
28640
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28641
- return callback(null, errorObj);
28642
- }
28643
- }
28644
-
28645
- /**
28646
- * @function showBIGIPLicenseExample
28647
- * @pronghornType method
28648
- * @name showBIGIPLicenseExample
28649
- * @summary Show BIG-IP License Example
28650
- *
28651
- * @param {getCallback} callback - a callback function to return the result
28652
- * @return {object} results - An object containing the response of the action
28653
- *
28654
- * @route {GET} /showBIGIPLicenseExample
28655
- * @roles admin
28656
- * @task true
28657
- */
28658
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
28659
- showBIGIPLicenseExample(callback) {
28660
- const meth = 'adapter-showBIGIPLicenseExample';
28661
- const origin = `${this.id}-${meth}`;
28662
- log.trace(origin);
28663
-
28664
- if (this.suspended && this.suspendMode === 'error') {
28665
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
28666
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28667
- return callback(null, errorObj);
28668
- }
28669
-
28670
- /* HERE IS WHERE YOU VALIDATE DATA */
28671
-
28672
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
28673
- const queryParamsAvailable = {};
28674
- const queryParams = {};
28675
- const pathVars = [];
28676
- const bodyVars = {};
28677
-
28678
- // loop in template. long callback arg name to avoid identifier conflicts
28679
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
28680
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
28681
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
28682
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
28683
- }
28684
- });
28685
-
28686
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
28687
- // see adapter code documentation for more information on the request object's fields
28688
- const reqObj = {
28689
- payload: bodyVars,
28690
- uriPathVars: pathVars,
28691
- uriQuery: queryParams
28692
- };
28693
-
28694
- try {
28695
- // Make the call -
28696
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
28697
- return this.requestHandlerInst.identifyRequest('Licensing', 'showBIGIPLicenseExample', reqObj, true, (irReturnData, irReturnError) => {
28698
- // if we received an error or their is no response on the results
28699
- // return an error
28700
- if (irReturnError) {
28701
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
28702
- return callback(null, irReturnError);
28703
- }
28704
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
28705
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['showBIGIPLicenseExample'], null, null, null);
28706
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28707
- return callback(null, errorObj);
28708
- }
28709
-
28710
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
28711
- // return the response
28712
- return callback(irReturnData, null);
28713
- });
28714
- } catch (ex) {
28715
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
28716
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28717
- return callback(null, errorObj);
28718
- }
28719
- }
28720
-
28721
- /**
28722
- * @function retrievesoftwareprovisioningFeatures
28723
- * @pronghornType method
28724
- * @name retrievesoftwareprovisioningFeatures
28725
- * @summary Retrieve software provisioning (features)
28726
- *
28727
- * @param {getCallback} callback - a callback function to return the result
28728
- * @return {object} results - An object containing the response of the action
28729
- *
28730
- * @route {GET} /retrievesoftwareprovisioningFeatures
28731
- * @roles admin
28732
- * @task true
28733
- */
28734
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
28735
- retrievesoftwareprovisioningFeatures(callback) {
28736
- const meth = 'adapter-retrievesoftwareprovisioningFeatures';
28737
- const origin = `${this.id}-${meth}`;
28738
- log.trace(origin);
28739
-
28740
- if (this.suspended && this.suspendMode === 'error') {
28741
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
28742
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28743
- return callback(null, errorObj);
28744
- }
28745
-
28746
- /* HERE IS WHERE YOU VALIDATE DATA */
28747
-
28748
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
28749
- const queryParamsAvailable = {};
28750
- const queryParams = {};
28751
- const pathVars = [];
28752
- const bodyVars = {};
28753
-
28754
- // loop in template. long callback arg name to avoid identifier conflicts
28755
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
28756
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
28757
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
28758
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
28759
- }
28760
- });
28761
-
28762
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
28763
- // see adapter code documentation for more information on the request object's fields
28764
- const reqObj = {
28765
- payload: bodyVars,
28766
- uriPathVars: pathVars,
28767
- uriQuery: queryParams
28768
- };
28769
-
28770
- try {
28771
- // Make the call -
28772
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
28773
- return this.requestHandlerInst.identifyRequest('DeviceInfo', 'retrievesoftwareprovisioningFeatures', reqObj, true, (irReturnData, irReturnError) => {
28774
- // if we received an error or their is no response on the results
28775
- // return an error
28776
- if (irReturnError) {
28777
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
28778
- return callback(null, irReturnError);
28779
- }
28780
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
28781
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrievesoftwareprovisioningFeatures'], null, null, null);
28782
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28783
- return callback(null, errorObj);
28784
- }
28785
-
28786
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
28787
- // return the response
28788
- return callback(irReturnData, null);
28789
- });
28790
- } catch (ex) {
28791
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
28792
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28793
- return callback(null, errorObj);
28794
- }
28795
- }
28796
-
28797
- /**
28798
- * @function runCommandAsRootUser
28799
- * @pronghornType method
28800
- * @name runCommandAsRootUser
28801
- * @summary Run command as root user
28802
- *
28803
- * @param {object} body - body param
28804
- * @param {getCallback} callback - a callback function to return the result
28805
- * @return {object} results - An object containing the response of the action
28806
- *
28807
- * @route {POST} /runCommandAsRootUser
28808
- * @roles admin
28809
- * @task true
28810
- */
28811
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
28812
- runCommandAsRootUser(body, callback) {
28813
- const meth = 'adapter-runCommandAsRootUser';
28814
- const origin = `${this.id}-${meth}`;
28815
- log.trace(origin);
28816
-
28817
- if (this.suspended && this.suspendMode === 'error') {
28818
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
28819
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28820
- return callback(null, errorObj);
28821
- }
28822
-
28823
- /* HERE IS WHERE YOU VALIDATE DATA */
28824
- if (body === undefined || body === null || body === '') {
28825
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
28826
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28827
- return callback(null, errorObj);
28828
- }
28829
-
28830
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
28831
- const queryParamsAvailable = {};
28832
- const queryParams = {};
28833
- const pathVars = [];
28834
- const bodyVars = body;
28835
-
28836
- // loop in template. long callback arg name to avoid identifier conflicts
28837
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
28838
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
28839
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
28840
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
28841
- }
28842
- });
28843
-
28844
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
28845
- // see adapter code documentation for more information on the request object's fields
28846
- const reqObj = {
28847
- payload: bodyVars,
28848
- uriPathVars: pathVars,
28849
- uriQuery: queryParams
28850
- };
28851
-
28852
- try {
28853
- // Make the call -
28854
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
28855
- return this.requestHandlerInst.identifyRequest('DeviceInfo', 'runCommandAsRootUser', reqObj, true, (irReturnData, irReturnError) => {
28856
- // if we received an error or their is no response on the results
28857
- // return an error
28858
- if (irReturnError) {
28859
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
28860
- return callback(null, irReturnError);
28861
- }
28862
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
28863
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['runCommandAsRootUser'], null, null, null);
28864
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28865
- return callback(null, errorObj);
28866
- }
28867
-
28868
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
28869
- // return the response
28870
- return callback(irReturnData, null);
28871
- });
28872
- } catch (ex) {
28873
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
28874
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28875
- return callback(null, errorObj);
28876
- }
28877
- }
28878
-
28879
- /**
28880
- * @function retrieveallsoftwareimages
28881
- * @pronghornType method
28882
- * @name retrieveallsoftwareimages
28883
- * @summary Retrieve all software images
28884
- *
28885
- * @param {getCallback} callback - a callback function to return the result
28886
- * @return {object} results - An object containing the response of the action
28887
- *
28888
- * @route {GET} /retrieveallsoftwareimages
28889
- * @roles admin
28890
- * @task true
28891
- */
28892
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
28893
- retrieveallsoftwareimages(callback) {
28894
- const meth = 'adapter-retrieveallsoftwareimages';
28895
- const origin = `${this.id}-${meth}`;
28896
- log.trace(origin);
28897
-
28898
- if (this.suspended && this.suspendMode === 'error') {
28899
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
28900
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28901
- return callback(null, errorObj);
28902
- }
28903
-
28904
- /* HERE IS WHERE YOU VALIDATE DATA */
28905
-
28906
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
28907
- const queryParamsAvailable = {};
28908
- const queryParams = {};
28909
- const pathVars = [];
28910
- const bodyVars = {};
28911
-
28912
- // loop in template. long callback arg name to avoid identifier conflicts
28913
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
28914
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
28915
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
28916
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
28917
- }
28918
- });
28919
-
28920
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
28921
- // see adapter code documentation for more information on the request object's fields
28922
- const reqObj = {
28923
- payload: bodyVars,
28924
- uriPathVars: pathVars,
28925
- uriQuery: queryParams
28926
- };
28927
-
28928
- try {
28929
- // Make the call -
28930
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
28931
- return this.requestHandlerInst.identifyRequest('SoftwareManagement', 'retrieveallsoftwareimages', reqObj, true, (irReturnData, irReturnError) => {
28932
- // if we received an error or their is no response on the results
28933
- // return an error
28934
- if (irReturnError) {
28935
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
28936
- return callback(null, irReturnError);
28937
- }
28938
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
28939
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveallsoftwareimages'], null, null, null);
28940
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28941
- return callback(null, errorObj);
28942
- }
28943
-
28944
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
28945
- // return the response
28946
- return callback(irReturnData, null);
28947
- });
28948
- } catch (ex) {
28949
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
28950
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28951
- return callback(null, errorObj);
28952
- }
28953
- }
28954
-
28955
- /**
28956
- * @function retrieveallhotfiximages
28957
- * @pronghornType method
28958
- * @name retrieveallhotfiximages
28959
- * @summary Retrieve all hotfix images
28960
- *
28961
- * @param {getCallback} callback - a callback function to return the result
28962
- * @return {object} results - An object containing the response of the action
28963
- *
28964
- * @route {GET} /retrieveallhotfiximages
28965
- * @roles admin
28966
- * @task true
28967
- */
28968
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
28969
- retrieveallhotfiximages(callback) {
28970
- const meth = 'adapter-retrieveallhotfiximages';
28971
- const origin = `${this.id}-${meth}`;
28972
- log.trace(origin);
28973
-
28974
- if (this.suspended && this.suspendMode === 'error') {
28975
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
28976
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
28977
- return callback(null, errorObj);
28978
- }
28979
-
28980
- /* HERE IS WHERE YOU VALIDATE DATA */
28981
-
28982
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
28983
- const queryParamsAvailable = {};
28984
- const queryParams = {};
28985
- const pathVars = [];
28986
- const bodyVars = {};
28987
-
28988
- // loop in template. long callback arg name to avoid identifier conflicts
28989
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
28990
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
28991
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
28992
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
28993
- }
28994
- });
28995
-
28996
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
28997
- // see adapter code documentation for more information on the request object's fields
28998
- const reqObj = {
28999
- payload: bodyVars,
29000
- uriPathVars: pathVars,
29001
- uriQuery: queryParams
29002
- };
29003
-
29004
- try {
29005
- // Make the call -
29006
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29007
- return this.requestHandlerInst.identifyRequest('SoftwareManagement', 'retrieveallhotfiximages', reqObj, true, (irReturnData, irReturnError) => {
29008
- // if we received an error or their is no response on the results
29009
- // return an error
29010
- if (irReturnError) {
29011
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29012
- return callback(null, irReturnError);
29013
- }
29014
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29015
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveallhotfiximages'], null, null, null);
29016
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29017
- return callback(null, errorObj);
29018
- }
29019
-
29020
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29021
- // return the response
29022
- return callback(irReturnData, null);
29023
- });
29024
- } catch (ex) {
29025
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29026
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29027
- return callback(null, errorObj);
29028
- }
29029
- }
29030
-
29031
- /**
29032
- * @function retrieveallLTMcertificateobjects
29033
- * @pronghornType method
29034
- * @name retrieveallLTMcertificateobjects
29035
- * @summary Retrieve all LTM certificate objects
29036
- *
29037
- * @param {getCallback} callback - a callback function to return the result
29038
- * @return {object} results - An object containing the response of the action
29039
- *
29040
- * @route {GET} /retrieveallLTMcertificateobjects
29041
- * @roles admin
29042
- * @task true
29043
- */
29044
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29045
- retrieveallLTMcertificateobjects(callback) {
29046
- const meth = 'adapter-retrieveallLTMcertificateobjects';
29047
- const origin = `${this.id}-${meth}`;
29048
- log.trace(origin);
29049
-
29050
- if (this.suspended && this.suspendMode === 'error') {
29051
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29052
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29053
- return callback(null, errorObj);
29054
- }
29055
-
29056
- /* HERE IS WHERE YOU VALIDATE DATA */
29057
-
29058
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29059
- const queryParamsAvailable = {};
29060
- const queryParams = {};
29061
- const pathVars = [];
29062
- const bodyVars = {};
29063
-
29064
- // loop in template. long callback arg name to avoid identifier conflicts
29065
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29066
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29067
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29068
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29069
- }
29070
- });
29071
-
29072
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29073
- // see adapter code documentation for more information on the request object's fields
29074
- const reqObj = {
29075
- payload: bodyVars,
29076
- uriPathVars: pathVars,
29077
- uriQuery: queryParams
29078
- };
29079
-
29080
- try {
29081
- // Make the call -
29082
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29083
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'retrieveallLTMcertificateobjects', reqObj, true, (irReturnData, irReturnError) => {
29084
- // if we received an error or their is no response on the results
29085
- // return an error
29086
- if (irReturnError) {
29087
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29088
- return callback(null, irReturnError);
29089
- }
29090
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29091
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveallLTMcertificateobjects'], null, null, null);
29092
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29093
- return callback(null, errorObj);
29094
- }
29095
-
29096
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29097
- // return the response
29098
- return callback(irReturnData, null);
29099
- });
29100
- } catch (ex) {
29101
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29102
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29103
- return callback(null, errorObj);
29104
- }
29105
- }
29106
-
29107
- /**
29108
- * @function createOverwriteSSLCertificatefromUpload
29109
- * @pronghornType method
29110
- * @name createOverwriteSSLCertificatefromUpload
29111
- * @summary Create\/Overwrite SSL Certificate from Upload
29112
- *
29113
- * @param {object} body - body param
29114
- * @param {getCallback} callback - a callback function to return the result
29115
- * @return {object} results - An object containing the response of the action
29116
- *
29117
- * @route {POST} /createOverwriteSSLCertificatefromUpload
29118
- * @roles admin
29119
- * @task true
29120
- */
29121
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29122
- createOverwriteSSLCertificatefromUpload(body, callback) {
29123
- const meth = 'adapter-createOverwriteSSLCertificatefromUpload';
29124
- const origin = `${this.id}-${meth}`;
29125
- log.trace(origin);
29126
-
29127
- if (this.suspended && this.suspendMode === 'error') {
29128
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29129
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29130
- return callback(null, errorObj);
29131
- }
29132
-
29133
- /* HERE IS WHERE YOU VALIDATE DATA */
29134
- if (body === undefined || body === null || body === '') {
29135
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
29136
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29137
- return callback(null, errorObj);
29138
- }
29139
-
29140
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29141
- const queryParamsAvailable = {};
29142
- const queryParams = {};
29143
- const pathVars = [];
29144
- const bodyVars = body;
29145
-
29146
- // loop in template. long callback arg name to avoid identifier conflicts
29147
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29148
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29149
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29150
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29151
- }
29152
- });
29153
-
29154
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29155
- // see adapter code documentation for more information on the request object's fields
29156
- const reqObj = {
29157
- payload: bodyVars,
29158
- uriPathVars: pathVars,
29159
- uriQuery: queryParams
29160
- };
29161
-
29162
- try {
29163
- // Make the call -
29164
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29165
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'createOverwriteSSLCertificatefromUpload', reqObj, true, (irReturnData, irReturnError) => {
29166
- // if we received an error or their is no response on the results
29167
- // return an error
29168
- if (irReturnError) {
29169
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29170
- return callback(null, irReturnError);
29171
- }
29172
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29173
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createOverwriteSSLCertificatefromUpload'], null, null, null);
29174
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29175
- return callback(null, errorObj);
29176
- }
29177
-
29178
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29179
- // return the response
29180
- return callback(irReturnData, null);
29181
- });
29182
- } catch (ex) {
29183
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29184
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29185
- return callback(null, errorObj);
29186
- }
29187
- }
29188
-
29189
- /**
29190
- * @function retrieveallLTMprivatekeyobjects
29191
- * @pronghornType method
29192
- * @name retrieveallLTMprivatekeyobjects
29193
- * @summary Retrieve all LTM private key objects
29194
- *
29195
- * @param {getCallback} callback - a callback function to return the result
29196
- * @return {object} results - An object containing the response of the action
29197
- *
29198
- * @route {GET} /retrieveallLTMprivatekeyobjects
29199
- * @roles admin
29200
- * @task true
29201
- */
29202
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29203
- retrieveallLTMprivatekeyobjects(callback) {
29204
- const meth = 'adapter-retrieveallLTMprivatekeyobjects';
29205
- const origin = `${this.id}-${meth}`;
29206
- log.trace(origin);
29207
-
29208
- if (this.suspended && this.suspendMode === 'error') {
29209
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29210
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29211
- return callback(null, errorObj);
29212
- }
29213
-
29214
- /* HERE IS WHERE YOU VALIDATE DATA */
29215
-
29216
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29217
- const queryParamsAvailable = {};
29218
- const queryParams = {};
29219
- const pathVars = [];
29220
- const bodyVars = {};
29221
-
29222
- // loop in template. long callback arg name to avoid identifier conflicts
29223
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29224
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29225
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29226
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29227
- }
29228
- });
29229
-
29230
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29231
- // see adapter code documentation for more information on the request object's fields
29232
- const reqObj = {
29233
- payload: bodyVars,
29234
- uriPathVars: pathVars,
29235
- uriQuery: queryParams
29236
- };
29237
-
29238
- try {
29239
- // Make the call -
29240
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29241
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'retrieveallLTMprivatekeyobjects', reqObj, true, (irReturnData, irReturnError) => {
29242
- // if we received an error or their is no response on the results
29243
- // return an error
29244
- if (irReturnError) {
29245
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29246
- return callback(null, irReturnError);
29247
- }
29248
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29249
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveallLTMprivatekeyobjects'], null, null, null);
29250
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29251
- return callback(null, errorObj);
29252
- }
29253
-
29254
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29255
- // return the response
29256
- return callback(irReturnData, null);
29257
- });
29258
- } catch (ex) {
29259
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29260
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29261
- return callback(null, errorObj);
29262
- }
29263
- }
29264
-
29265
- /**
29266
- * @function createOverwriteSSLKeyfromUpload
29267
- * @pronghornType method
29268
- * @name createOverwriteSSLKeyfromUpload
29269
- * @summary Create\/Overwrite SSL Key from Upload
29270
- *
29271
- * @param {object} body - body param
29272
- * @param {getCallback} callback - a callback function to return the result
29273
- * @return {object} results - An object containing the response of the action
29274
- *
29275
- * @route {POST} /createOverwriteSSLKeyfromUpload
29276
- * @roles admin
29277
- * @task true
29278
- */
29279
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29280
- createOverwriteSSLKeyfromUpload(body, callback) {
29281
- const meth = 'adapter-createOverwriteSSLKeyfromUpload';
29282
- const origin = `${this.id}-${meth}`;
29283
- log.trace(origin);
29284
-
29285
- if (this.suspended && this.suspendMode === 'error') {
29286
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29287
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29288
- return callback(null, errorObj);
29289
- }
29290
-
29291
- /* HERE IS WHERE YOU VALIDATE DATA */
29292
- if (body === undefined || body === null || body === '') {
29293
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
29294
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29295
- return callback(null, errorObj);
29296
- }
29297
-
29298
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29299
- const queryParamsAvailable = {};
29300
- const queryParams = {};
29301
- const pathVars = [];
29302
- const bodyVars = body;
29303
-
29304
- // loop in template. long callback arg name to avoid identifier conflicts
29305
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29306
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29307
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29308
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29309
- }
29310
- });
29311
-
29312
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29313
- // see adapter code documentation for more information on the request object's fields
29314
- const reqObj = {
29315
- payload: bodyVars,
29316
- uriPathVars: pathVars,
29317
- uriQuery: queryParams
29318
- };
29319
-
29320
- try {
29321
- // Make the call -
29322
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29323
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'createOverwriteSSLKeyfromUpload', reqObj, true, (irReturnData, irReturnError) => {
29324
- // if we received an error or their is no response on the results
29325
- // return an error
29326
- if (irReturnError) {
29327
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29328
- return callback(null, irReturnError);
29329
- }
29330
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29331
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createOverwriteSSLKeyfromUpload'], null, null, null);
29332
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29333
- return callback(null, errorObj);
29334
- }
29335
-
29336
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29337
- // return the response
29338
- return callback(irReturnData, null);
29339
- });
29340
- } catch (ex) {
29341
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29342
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29343
- return callback(null, errorObj);
29344
- }
29345
- }
29346
-
29347
- /**
29348
- * @function retrieveallcertificatefiles
29349
- * @pronghornType method
29350
- * @name retrieveallcertificatefiles
29351
- * @summary Retrieve all certificate files
29352
- *
29353
- * @param {getCallback} callback - a callback function to return the result
29354
- * @return {object} results - An object containing the response of the action
29355
- *
29356
- * @route {GET} /retrieveallcertificatefiles
29357
- * @roles admin
29358
- * @task true
29359
- */
29360
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29361
- retrieveallcertificatefiles(callback) {
29362
- const meth = 'adapter-retrieveallcertificatefiles';
29363
- const origin = `${this.id}-${meth}`;
29364
- log.trace(origin);
29365
-
29366
- if (this.suspended && this.suspendMode === 'error') {
29367
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29368
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29369
- return callback(null, errorObj);
29370
- }
29371
-
29372
- /* HERE IS WHERE YOU VALIDATE DATA */
29373
-
29374
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29375
- const queryParamsAvailable = {};
29376
- const queryParams = {};
29377
- const pathVars = [];
29378
- const bodyVars = {};
29379
-
29380
- // loop in template. long callback arg name to avoid identifier conflicts
29381
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29382
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29383
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29384
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29385
- }
29386
- });
29387
-
29388
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29389
- // see adapter code documentation for more information on the request object's fields
29390
- const reqObj = {
29391
- payload: bodyVars,
29392
- uriPathVars: pathVars,
29393
- uriQuery: queryParams
29394
- };
29395
-
29396
- try {
29397
- // Make the call -
29398
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29399
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'retrieveallcertificatefiles', reqObj, true, (irReturnData, irReturnError) => {
29400
- // if we received an error or their is no response on the results
29401
- // return an error
29402
- if (irReturnError) {
29403
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29404
- return callback(null, irReturnError);
29405
- }
29406
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29407
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveallcertificatefiles'], null, null, null);
29408
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29409
- return callback(null, errorObj);
29410
- }
29411
-
29412
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29413
- // return the response
29414
- return callback(irReturnData, null);
29415
- });
29416
- } catch (ex) {
29417
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29418
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29419
- return callback(null, errorObj);
29420
- }
29421
- }
29422
-
29423
- /**
29424
- * @function retrieveallkeyfiles
29425
- * @pronghornType method
29426
- * @name retrieveallkeyfiles
29427
- * @summary Retrieve all key files
29428
- *
29429
- * @param {getCallback} callback - a callback function to return the result
29430
- * @return {object} results - An object containing the response of the action
29431
- *
29432
- * @route {GET} /retrieveallkeyfiles
29433
- * @roles admin
29434
- * @task true
29435
- */
29436
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29437
- retrieveallkeyfiles(callback) {
29438
- const meth = 'adapter-retrieveallkeyfiles';
29439
- const origin = `${this.id}-${meth}`;
29440
- log.trace(origin);
29441
-
29442
- if (this.suspended && this.suspendMode === 'error') {
29443
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29444
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29445
- return callback(null, errorObj);
29446
- }
29447
-
29448
- /* HERE IS WHERE YOU VALIDATE DATA */
29449
-
29450
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29451
- const queryParamsAvailable = {};
29452
- const queryParams = {};
29453
- const pathVars = [];
29454
- const bodyVars = {};
29455
-
29456
- // loop in template. long callback arg name to avoid identifier conflicts
29457
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29458
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29459
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29460
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29461
- }
29462
- });
29463
-
29464
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29465
- // see adapter code documentation for more information on the request object's fields
29466
- const reqObj = {
29467
- payload: bodyVars,
29468
- uriPathVars: pathVars,
29469
- uriQuery: queryParams
29470
- };
29471
-
29472
- try {
29473
- // Make the call -
29474
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29475
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'retrieveallkeyfiles', reqObj, true, (irReturnData, irReturnError) => {
29476
- // if we received an error or their is no response on the results
29477
- // return an error
29478
- if (irReturnError) {
29479
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29480
- return callback(null, irReturnError);
29481
- }
29482
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29483
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveallkeyfiles'], null, null, null);
29484
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29485
- return callback(null, errorObj);
29486
- }
29487
-
29488
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29489
- // return the response
29490
- return callback(irReturnData, null);
29491
- });
29492
- } catch (ex) {
29493
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29494
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29495
- return callback(null, errorObj);
29496
- }
29497
- }
29498
-
29499
- /**
29500
- * @function retrieveallclientSSLprofiles
29501
- * @pronghornType method
29502
- * @name retrieveallclientSSLprofiles
29503
- * @summary Retrieve all client SSL profiles
29504
- *
29505
- * @param {getCallback} callback - a callback function to return the result
29506
- * @return {object} results - An object containing the response of the action
29507
- *
29508
- * @route {GET} /retrieveallclientSSLprofiles
29509
- * @roles admin
29510
- * @task true
29511
- */
29512
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29513
- retrieveallclientSSLprofiles(callback) {
29514
- const meth = 'adapter-retrieveallclientSSLprofiles';
29515
- const origin = `${this.id}-${meth}`;
29516
- log.trace(origin);
29517
-
29518
- if (this.suspended && this.suspendMode === 'error') {
29519
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29520
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29521
- return callback(null, errorObj);
29522
- }
29523
-
29524
- /* HERE IS WHERE YOU VALIDATE DATA */
29525
-
29526
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29527
- const queryParamsAvailable = {};
29528
- const queryParams = {};
29529
- const pathVars = [];
29530
- const bodyVars = {};
29531
-
29532
- // loop in template. long callback arg name to avoid identifier conflicts
29533
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29534
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29535
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29536
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29537
- }
29538
- });
29539
-
29540
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29541
- // see adapter code documentation for more information on the request object's fields
29542
- const reqObj = {
29543
- payload: bodyVars,
29544
- uriPathVars: pathVars,
29545
- uriQuery: queryParams
29546
- };
29547
-
29548
- try {
29549
- // Make the call -
29550
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29551
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'retrieveallclientSSLprofiles', reqObj, true, (irReturnData, irReturnError) => {
29552
- // if we received an error or their is no response on the results
29553
- // return an error
29554
- if (irReturnError) {
29555
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29556
- return callback(null, irReturnError);
29557
- }
29558
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29559
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['retrieveallclientSSLprofiles'], null, null, null);
29560
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29561
- return callback(null, errorObj);
29562
- }
29563
-
29564
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29565
- // return the response
29566
- return callback(irReturnData, null);
29567
- });
29568
- } catch (ex) {
29569
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29570
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29571
- return callback(null, errorObj);
29572
- }
29573
- }
29574
-
29575
- /**
29576
- * @function createClientSSLProfile
29577
- * @pronghornType method
29578
- * @name createClientSSLProfile
29579
- * @summary Create Client SSL Profile
29580
- *
29581
- * @param {object} body - body param
29582
- * @param {getCallback} callback - a callback function to return the result
29583
- * @return {object} results - An object containing the response of the action
29584
- *
29585
- * @route {POST} /createClientSSLProfile
29586
- * @roles admin
29587
- * @task true
29588
- */
29589
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29590
- createClientSSLProfile(body, callback) {
29591
- const meth = 'adapter-createClientSSLProfile';
29592
- const origin = `${this.id}-${meth}`;
29593
- log.trace(origin);
29594
-
29595
- if (this.suspended && this.suspendMode === 'error') {
29596
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29597
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29598
- return callback(null, errorObj);
29599
- }
29600
-
29601
- /* HERE IS WHERE YOU VALIDATE DATA */
29602
- if (body === undefined || body === null || body === '') {
29603
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
29604
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29605
- return callback(null, errorObj);
29606
- }
29607
-
29608
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29609
- const queryParamsAvailable = {};
29610
- const queryParams = {};
29611
- const pathVars = [];
29612
- const bodyVars = body;
29613
-
29614
- // loop in template. long callback arg name to avoid identifier conflicts
29615
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29616
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29617
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29618
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29619
- }
29620
- });
29621
-
29622
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29623
- // see adapter code documentation for more information on the request object's fields
29624
- const reqObj = {
29625
- payload: bodyVars,
29626
- uriPathVars: pathVars,
29627
- uriQuery: queryParams
29628
- };
29629
-
29630
- try {
29631
- // Make the call -
29632
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29633
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'createClientSSLProfile', reqObj, true, (irReturnData, irReturnError) => {
29634
- // if we received an error or their is no response on the results
29635
- // return an error
29636
- if (irReturnError) {
29637
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29638
- return callback(null, irReturnError);
29639
- }
29640
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29641
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['createClientSSLProfile'], null, null, null);
29642
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29643
- return callback(null, errorObj);
29644
- }
29645
-
29646
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29647
- // return the response
29648
- return callback(irReturnData, null);
29649
- });
29650
- } catch (ex) {
29651
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29652
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29653
- return callback(null, errorObj);
29654
- }
29655
- }
29656
-
29657
- /**
29658
- * @function getClientSSLProfileAPIExample
29659
- * @pronghornType method
29660
- * @name getClientSSLProfileAPIExample
29661
- * @summary Client SSL Profile API Example
29662
- *
29663
- * @param {getCallback} callback - a callback function to return the result
29664
- * @return {object} results - An object containing the response of the action
29665
- *
29666
- * @route {GET} /getClientSSLProfileAPIExample
29667
- * @roles admin
29668
- * @task true
29669
- */
29670
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29671
- getClientSSLProfileAPIExample(callback) {
29672
- const meth = 'adapter-getClientSSLProfileAPIExample';
29673
- const origin = `${this.id}-${meth}`;
29674
- log.trace(origin);
29675
-
29676
- if (this.suspended && this.suspendMode === 'error') {
29677
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29678
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29679
- return callback(null, errorObj);
29680
- }
29681
-
29682
- /* HERE IS WHERE YOU VALIDATE DATA */
29683
-
29684
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29685
- const queryParamsAvailable = {};
29686
- const queryParams = {};
29687
- const pathVars = [];
29688
- const bodyVars = {};
29689
-
29690
- // loop in template. long callback arg name to avoid identifier conflicts
29691
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29692
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29693
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29694
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29695
- }
29696
- });
29697
-
29698
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29699
- // see adapter code documentation for more information on the request object's fields
29700
- const reqObj = {
29701
- payload: bodyVars,
29702
- uriPathVars: pathVars,
29703
- uriQuery: queryParams
29704
- };
29705
-
29706
- try {
29707
- // Make the call -
29708
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29709
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'getClientSSLProfileAPIExample', reqObj, true, (irReturnData, irReturnError) => {
29710
- // if we received an error or their is no response on the results
29711
- // return an error
29712
- if (irReturnError) {
29713
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29714
- return callback(null, irReturnError);
29715
- }
29716
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29717
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['getClientSSLProfileAPIExample'], null, null, null);
29718
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29719
- return callback(null, errorObj);
29720
- }
29721
-
29722
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29723
- // return the response
29724
- return callback(irReturnData, null);
29725
- });
29726
- } catch (ex) {
29727
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29728
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29729
- return callback(null, errorObj);
29730
- }
29731
- }
29732
-
29733
- /**
29734
- * @function uploadSSLCertificate
29735
- * @pronghornType method
29736
- * @name uploadSSLCertificate
29737
- * @summary Upload SSL Certificate
29738
- *
29739
- * @param {string} file - file param
29740
- * @param {getCallback} callback - a callback function to return the result
29741
- * @return {object} results - An object containing the response of the action
29742
- *
29743
- * @route {POST} /uploadSSLCertificate
29744
- * @roles admin
29745
- * @task true
29746
- */
29747
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29748
- uploadSSLCertificate(file, callback) {
29749
- const meth = 'adapter-uploadSSLCertificate';
29750
- const origin = `${this.id}-${meth}`;
29751
- log.trace(origin);
29752
-
29753
- if (this.suspended && this.suspendMode === 'error') {
29754
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29755
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29756
- return callback(null, errorObj);
29757
- }
29758
-
29759
- /* HERE IS WHERE YOU VALIDATE DATA */
29760
- if (file === undefined || file === null || file === '') {
29761
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['file'], null, null, null);
29762
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29763
- return callback(null, errorObj);
29764
- }
29765
-
29766
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29767
- const queryParamsAvailable = {};
29768
- const queryParams = {};
29769
- const pathVars = [];
29770
- const bodyVars = {};
29771
-
29772
- // loop in template. long callback arg name to avoid identifier conflicts
29773
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29774
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29775
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29776
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29777
- }
29778
- });
29779
-
29780
- // if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
29781
- let thisHeaderData = null;
29782
- // if the additional headers was passed in as a string parse the json into an object
29783
- if (thisHeaderData !== null && thisHeaderData.constructor === String) {
29784
- try {
29785
- // parse the additional headers object that was passed in
29786
- thisHeaderData = JSON.parse(thisHeaderData);
29787
- } catch (err) {
29788
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
29789
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29790
- return callback(null, errorObj);
29791
- }
29792
- } else if (thisHeaderData === null) {
29793
- thisHeaderData = { contentType: '', contentRange: '' };
29794
- }
29795
-
29796
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29797
- // see adapter code documentation for more information on the request object's fields
29798
- const reqObj = {
29799
- payload: bodyVars,
29800
- uriPathVars: pathVars,
29801
- uriQuery: queryParams,
29802
- addlHeaders: thisHeaderData
29803
- };
29804
-
29805
- try {
29806
- // Make the call -
29807
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29808
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'uploadSSLCertificate', reqObj, true, (irReturnData, irReturnError) => {
29809
- // if we received an error or their is no response on the results
29810
- // return an error
29811
- if (irReturnError) {
29812
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29813
- return callback(null, irReturnError);
29814
- }
29815
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29816
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['uploadSSLCertificate'], null, null, null);
29817
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29818
- return callback(null, errorObj);
29819
- }
29820
-
29821
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29822
- // return the response
29823
- return callback(irReturnData, null);
29824
- });
29825
- } catch (ex) {
29826
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29827
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29828
- return callback(null, errorObj);
29829
- }
29830
- }
29831
-
29832
- /**
29833
- * @function uploadSSLKey
29834
- * @pronghornType method
29835
- * @name uploadSSLKey
29836
- * @summary Upload SSL Key
29837
- *
29838
- * @param {string} file - file param
29839
- * @param {getCallback} callback - a callback function to return the result
29840
- * @return {object} results - An object containing the response of the action
29841
- *
29842
- * @route {POST} /uploadSSLKey
29843
- * @roles admin
29844
- * @task true
29845
- */
29846
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29847
- uploadSSLKey(file, callback) {
29848
- const meth = 'adapter-uploadSSLKey';
29849
- const origin = `${this.id}-${meth}`;
29850
- log.trace(origin);
29851
-
29852
- if (this.suspended && this.suspendMode === 'error') {
29853
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29854
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29855
- return callback(null, errorObj);
29856
- }
29857
-
29858
- /* HERE IS WHERE YOU VALIDATE DATA */
29859
- if (file === undefined || file === null || file === '') {
29860
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['file'], null, null, null);
29861
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29862
- return callback(null, errorObj);
29863
- }
29864
-
29865
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29866
- const queryParamsAvailable = {};
29867
- const queryParams = {};
29868
- const pathVars = [];
29869
- const bodyVars = {};
29870
-
29871
- // loop in template. long callback arg name to avoid identifier conflicts
29872
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29873
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29874
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29875
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29876
- }
29877
- });
29878
-
29879
- // if you want to expose addlHeaders to workflow, add it to the method signature here and in pronghorn.json
29880
- let thisHeaderData = null;
29881
- // if the additional headers was passed in as a string parse the json into an object
29882
- if (thisHeaderData !== null && thisHeaderData.constructor === String) {
29883
- try {
29884
- // parse the additional headers object that was passed in
29885
- thisHeaderData = JSON.parse(thisHeaderData);
29886
- } catch (err) {
29887
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'addlHeaders string must be a stringified JSON', [], null, null, null);
29888
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29889
- return callback(null, errorObj);
29890
- }
29891
- } else if (thisHeaderData === null) {
29892
- thisHeaderData = { contentType: '', contentRange: '' };
29893
- }
29894
-
29895
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29896
- // see adapter code documentation for more information on the request object's fields
29897
- const reqObj = {
29898
- payload: bodyVars,
29899
- uriPathVars: pathVars,
29900
- uriQuery: queryParams,
29901
- addlHeaders: thisHeaderData
29902
- };
29903
-
29904
- try {
29905
- // Make the call -
29906
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29907
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'uploadSSLKey', reqObj, true, (irReturnData, irReturnError) => {
29908
- // if we received an error or their is no response on the results
29909
- // return an error
29910
- if (irReturnError) {
29911
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29912
- return callback(null, irReturnError);
29913
- }
29914
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29915
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['uploadSSLKey'], null, null, null);
29916
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29917
- return callback(null, errorObj);
29918
- }
29919
-
29920
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
29921
- // return the response
29922
- return callback(irReturnData, null);
29923
- });
29924
- } catch (ex) {
29925
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
29926
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29927
- return callback(null, errorObj);
29928
- }
29929
- }
29930
-
29931
- /**
29932
- * @function attachClientSSLProfiletoVirtualServer
29933
- * @pronghornType method
29934
- * @name attachClientSSLProfiletoVirtualServer
29935
- * @summary Attach Client SSL Profile to Virtual Server
29936
- *
29937
- * @param {object} body - body param
29938
- * @param {getCallback} callback - a callback function to return the result
29939
- * @return {object} results - An object containing the response of the action
29940
- *
29941
- * @route {POST} /attachClientSSLProfiletoVirtualServer
29942
- * @roles admin
29943
- * @task true
29944
- */
29945
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
29946
- attachClientSSLProfiletoVirtualServer(body, callback) {
29947
- const meth = 'adapter-attachClientSSLProfiletoVirtualServer';
29948
- const origin = `${this.id}-${meth}`;
29949
- log.trace(origin);
29950
-
29951
- if (this.suspended && this.suspendMode === 'error') {
29952
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
29953
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29954
- return callback(null, errorObj);
29955
- }
29956
-
29957
- /* HERE IS WHERE YOU VALIDATE DATA */
29958
- if (body === undefined || body === null || body === '') {
29959
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
29960
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29961
- return callback(null, errorObj);
29962
- }
29963
-
29964
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
29965
- const queryParamsAvailable = {};
29966
- const queryParams = {};
29967
- const pathVars = [];
29968
- const bodyVars = body;
29969
-
29970
- // loop in template. long callback arg name to avoid identifier conflicts
29971
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
29972
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
29973
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
29974
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
29975
- }
29976
- });
29977
-
29978
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
29979
- // see adapter code documentation for more information on the request object's fields
29980
- const reqObj = {
29981
- payload: bodyVars,
29982
- uriPathVars: pathVars,
29983
- uriQuery: queryParams
29984
- };
29985
-
29986
- try {
29987
- // Make the call -
29988
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
29989
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'attachClientSSLProfiletoVirtualServer', reqObj, true, (irReturnData, irReturnError) => {
29990
- // if we received an error or their is no response on the results
29991
- // return an error
29992
- if (irReturnError) {
29993
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
29994
- return callback(null, irReturnError);
29995
- }
29996
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
29997
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['attachClientSSLProfiletoVirtualServer'], null, null, null);
29998
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
29999
- return callback(null, errorObj);
30000
- }
30001
-
30002
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
30003
- // return the response
30004
- return callback(irReturnData, null);
30005
- });
30006
- } catch (ex) {
30007
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
30008
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30009
- return callback(null, errorObj);
30010
- }
30011
- }
30012
-
30013
- /**
30014
- * @function detachClientSSLProfilefromVirtualServer
30015
- * @pronghornType method
30016
- * @name detachClientSSLProfilefromVirtualServer
30017
- * @summary Detach Client SSL Profile from Virtual Server
30018
- *
30019
- * @param {getCallback} callback - a callback function to return the result
30020
- * @return {object} results - An object containing the response of the action
30021
- *
30022
- * @route {GET} /detachClientSSLProfilefromVirtualServer
30023
- * @roles admin
30024
- * @task true
30025
- */
30026
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
30027
- detachClientSSLProfilefromVirtualServer(callback) {
30028
- const meth = 'adapter-detachClientSSLProfilefromVirtualServer';
30029
- const origin = `${this.id}-${meth}`;
30030
- log.trace(origin);
30031
-
30032
- if (this.suspended && this.suspendMode === 'error') {
30033
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
30034
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30035
- return callback(null, errorObj);
30036
- }
30037
-
30038
- /* HERE IS WHERE YOU VALIDATE DATA */
30039
-
30040
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
30041
- const queryParamsAvailable = {};
30042
- const queryParams = {};
30043
- const pathVars = [];
30044
- const bodyVars = {};
30045
-
30046
- // loop in template. long callback arg name to avoid identifier conflicts
30047
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
30048
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
30049
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
30050
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
30051
- }
30052
- });
30053
-
30054
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
30055
- // see adapter code documentation for more information on the request object's fields
30056
- const reqObj = {
30057
- payload: bodyVars,
30058
- uriPathVars: pathVars,
30059
- uriQuery: queryParams
30060
- };
30061
-
30062
- try {
30063
- // Make the call -
30064
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
30065
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'detachClientSSLProfilefromVirtualServer', reqObj, false, (irReturnData, irReturnError) => {
30066
- // if we received an error or their is no response on the results
30067
- // return an error
30068
- if (irReturnError) {
30069
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
30070
- return callback(null, irReturnError);
30071
- }
30072
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
30073
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['detachClientSSLProfilefromVirtualServer'], null, null, null);
30074
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30075
- return callback(null, errorObj);
30076
- }
30077
-
30078
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
30079
- // return the response
30080
- return callback(irReturnData, null);
30081
- });
30082
- } catch (ex) {
30083
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
30084
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30085
- return callback(null, errorObj);
30086
- }
30087
- }
30088
-
30089
- /**
30090
- * @function deleteClientSSLProfile
30091
- * @pronghornType method
30092
- * @name deleteClientSSLProfile
30093
- * @summary Delete Client SSL Profile
30094
- *
30095
- * @param {getCallback} callback - a callback function to return the result
30096
- * @return {object} results - An object containing the response of the action
30097
- *
30098
- * @route {GET} /deleteClientSSLProfile
30099
- * @roles admin
30100
- * @task true
30101
- */
30102
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
30103
- deleteClientSSLProfile(callback) {
30104
- const meth = 'adapter-deleteClientSSLProfile';
30105
- const origin = `${this.id}-${meth}`;
30106
- log.trace(origin);
30107
-
30108
- if (this.suspended && this.suspendMode === 'error') {
30109
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
30110
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30111
- return callback(null, errorObj);
30112
- }
30113
-
30114
- /* HERE IS WHERE YOU VALIDATE DATA */
30115
-
30116
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
30117
- const queryParamsAvailable = {};
30118
- const queryParams = {};
30119
- const pathVars = [];
30120
- const bodyVars = {};
30121
-
30122
- // loop in template. long callback arg name to avoid identifier conflicts
30123
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
30124
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
30125
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
30126
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
30127
- }
30128
- });
30129
-
30130
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
30131
- // see adapter code documentation for more information on the request object's fields
30132
- const reqObj = {
30133
- payload: bodyVars,
30134
- uriPathVars: pathVars,
30135
- uriQuery: queryParams
30136
- };
30137
-
30138
- try {
30139
- // Make the call -
30140
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
30141
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'deleteClientSSLProfile', reqObj, false, (irReturnData, irReturnError) => {
30142
- // if we received an error or their is no response on the results
30143
- // return an error
30144
- if (irReturnError) {
30145
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
30146
- return callback(null, irReturnError);
30147
- }
30148
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
30149
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteClientSSLProfile'], null, null, null);
30150
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30151
- return callback(null, errorObj);
30152
- }
30153
-
30154
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
30155
- // return the response
30156
- return callback(irReturnData, null);
30157
- });
30158
- } catch (ex) {
30159
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
30160
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30161
- return callback(null, errorObj);
30162
- }
30163
- }
30164
-
30165
- /**
30166
- * @function deleteSSLCertificate
30167
- * @pronghornType method
30168
- * @name deleteSSLCertificate
30169
- * @summary Delete SSL Certificate
30170
- *
30171
- * @param {getCallback} callback - a callback function to return the result
30172
- * @return {object} results - An object containing the response of the action
30173
- *
30174
- * @route {GET} /deleteSSLCertificate
30175
- * @roles admin
30176
- * @task true
30177
- */
30178
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
30179
- deleteSSLCertificate(callback) {
30180
- const meth = 'adapter-deleteSSLCertificate';
30181
- const origin = `${this.id}-${meth}`;
30182
- log.trace(origin);
30183
-
30184
- if (this.suspended && this.suspendMode === 'error') {
30185
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
30186
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30187
- return callback(null, errorObj);
30188
- }
30189
-
30190
- /* HERE IS WHERE YOU VALIDATE DATA */
30191
-
30192
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
30193
- const queryParamsAvailable = {};
30194
- const queryParams = {};
30195
- const pathVars = [];
30196
- const bodyVars = {};
30197
-
30198
- // loop in template. long callback arg name to avoid identifier conflicts
30199
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
30200
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
30201
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
30202
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
30203
- }
30204
- });
30205
-
30206
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
30207
- // see adapter code documentation for more information on the request object's fields
30208
- const reqObj = {
30209
- payload: bodyVars,
30210
- uriPathVars: pathVars,
30211
- uriQuery: queryParams
30212
- };
30213
-
30214
- try {
30215
- // Make the call -
30216
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
30217
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'deleteSSLCertificate', reqObj, false, (irReturnData, irReturnError) => {
30218
- // if we received an error or their is no response on the results
30219
- // return an error
30220
- if (irReturnError) {
30221
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
30222
- return callback(null, irReturnError);
30223
- }
30224
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
30225
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteSSLCertificate'], null, null, null);
30226
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30227
- return callback(null, errorObj);
30228
- }
30229
-
30230
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
30231
- // return the response
30232
- return callback(irReturnData, null);
30233
- });
30234
- } catch (ex) {
30235
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
30236
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30237
- return callback(null, errorObj);
30238
- }
30239
- }
30240
-
30241
- /**
30242
- * @function deleteCryptoSSLKey
30243
- * @pronghornType method
30244
- * @name deleteCryptoSSLKey
30245
- * @summary Delete SSL Key
30246
- *
30247
- * @param {getCallback} callback - a callback function to return the result
30248
- * @return {object} results - An object containing the response of the action
30249
- *
30250
- * @route {GET} /deleteCryptoSSLKey
30251
- * @roles admin
30252
- * @task true
30253
- */
30254
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
30255
- deleteCryptoSSLKey(callback) {
30256
- const meth = 'adapter-deleteCryptoSSLKey';
30257
- const origin = `${this.id}-${meth}`;
30258
- log.trace(origin);
30259
-
30260
- if (this.suspended && this.suspendMode === 'error') {
30261
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
30262
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30263
- return callback(null, errorObj);
30264
- }
30265
-
30266
- /* HERE IS WHERE YOU VALIDATE DATA */
30267
-
30268
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
30269
- const queryParamsAvailable = {};
30270
- const queryParams = {};
30271
- const pathVars = [];
30272
- const bodyVars = {};
30273
-
30274
- // loop in template. long callback arg name to avoid identifier conflicts
30275
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
30276
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
30277
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
30278
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
30279
- }
30280
- });
30281
-
30282
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
30283
- // see adapter code documentation for more information on the request object's fields
30284
- const reqObj = {
30285
- payload: bodyVars,
30286
- uriPathVars: pathVars,
30287
- uriQuery: queryParams
30288
- };
30289
-
30290
- try {
30291
- // Make the call -
30292
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
30293
- return this.requestHandlerInst.identifyRequest('SSLManagement', 'deleteCryptoSSLKey', reqObj, false, (irReturnData, irReturnError) => {
30294
- // if we received an error or their is no response on the results
30295
- // return an error
30296
- if (irReturnError) {
30297
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
30298
- return callback(null, irReturnError);
30299
- }
30300
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
30301
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['deleteCryptoSSLKey'], null, null, null);
30302
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30303
- return callback(null, errorObj);
30304
- }
30305
-
30306
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
30307
- // return the response
30308
- return callback(irReturnData, null);
30309
- });
30310
- } catch (ex) {
30311
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
30312
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30313
- return callback(null, errorObj);
30314
- }
30315
- }
30316
-
30317
- /**
30318
- * @function saveConfiguration
30319
- * @pronghornType method
30320
- * @name saveConfiguration
30321
- * @summary Save Configuration
30322
- *
30323
- * @param {object} body - body param
30324
- * @param {getCallback} callback - a callback function to return the result
30325
- * @return {object} results - An object containing the response of the action
30326
- *
30327
- * @route {POST} /saveConfiguration
30328
- * @roles admin
30329
- * @task true
30330
- */
30331
- /* YOU CAN CHANGE THE PARAMETERS YOU TAKE IN HERE AND IN THE pronghorn.json FILE */
30332
- saveConfiguration(body, callback) {
30333
- const meth = 'adapter-saveConfiguration';
30334
- const origin = `${this.id}-${meth}`;
30335
- log.trace(origin);
30336
-
30337
- if (this.suspended && this.suspendMode === 'error') {
30338
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'AD.600', [], null, null, null);
30339
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30340
- return callback(null, errorObj);
30341
- }
30342
-
30343
- /* HERE IS WHERE YOU VALIDATE DATA */
30344
- if (body === undefined || body === null || body === '') {
30345
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Missing Data', ['body'], null, null, null);
30346
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30347
- return callback(null, errorObj);
30348
- }
30349
-
30350
- /* HERE IS WHERE YOU SET THE DATA TO PASS INTO REQUEST */
30351
- const queryParamsAvailable = {};
30352
- const queryParams = {};
30353
- const pathVars = [];
30354
- const bodyVars = body;
30355
-
30356
- // loop in template. long callback arg name to avoid identifier conflicts
30357
- Object.keys(queryParamsAvailable).forEach((thisKeyInQueryParamsAvailable) => {
30358
- if (queryParamsAvailable[thisKeyInQueryParamsAvailable] !== undefined && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== null
30359
- && queryParamsAvailable[thisKeyInQueryParamsAvailable] !== '') {
30360
- queryParams[thisKeyInQueryParamsAvailable] = queryParamsAvailable[thisKeyInQueryParamsAvailable];
30361
- }
30362
- });
30363
-
30364
- // set up the request object - payload, uriPathVars, uriQuery, uriOptions, addlHeaders, authData, callProperties, filter, priority, event
30365
- // see adapter code documentation for more information on the request object's fields
30366
- const reqObj = {
30367
- payload: bodyVars,
30368
- uriPathVars: pathVars,
30369
- uriQuery: queryParams
30370
- };
30371
-
30372
- try {
30373
- // Make the call -
30374
- // identifyRequest(entity, action, requestObj, returnDataFlag, callback)
30375
- return this.requestHandlerInst.identifyRequest('Configuration', 'saveConfiguration', reqObj, true, (irReturnData, irReturnError) => {
30376
- // if we received an error or their is no response on the results
30377
- // return an error
30378
- if (irReturnError) {
30379
- /* HERE IS WHERE YOU CAN ALTER THE ERROR MESSAGE */
30380
- return callback(null, irReturnError);
30381
- }
30382
- if (!Object.hasOwnProperty.call(irReturnData, 'response')) {
30383
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Invalid Response', ['saveConfiguration'], null, null, null);
30384
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30385
- return callback(null, errorObj);
30386
- }
30387
-
30388
- /* HERE IS WHERE YOU CAN ALTER THE RETURN DATA */
30389
- // return the response
30390
- return callback(irReturnData, null);
30391
- });
30392
- } catch (ex) {
30393
- const errorObj = this.requestHandlerInst.formatErrorObject(this.id, meth, 'Caught Exception', null, null, null, ex);
30394
- log.error(`${origin}: ${errorObj.IAPerror.displayString}`);
30395
- return callback(null, errorObj);
30396
- }
30397
- }
30398
28507
  }
30399
28508
 
30400
28509
  module.exports = F5BigIQ;