Last active
July 31, 2018 15:20
-
-
Save npearce/fde5cfa422897bea144f50095f9cabde to your computer and use it in GitHub Desktop.
F5 iControl LX - How to access additional error response data (lines 25 & 26)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Apply the new, or modified, service definition to the BIG-IP | |
* @param {Object} service_def retireved from GitHub repo | |
* | |
* @returns {Object} AS3's declaration processing results | |
*/ | |
MyWorker.prototype.applyServiceDefinition = function (service_def) { | |
return new Promise((resolve, reject) => { | |
// Build the declaration POST message | |
var as3path = '/mgmt/shared/appsvcs/declare'; | |
var uri = this.restHelper.makeRestnodedUri(as3path); | |
var restOp = this.createRestOperation(uri, service_def); | |
// Send the declaration POST message to the BIG-IP | |
this.restRequestSender.sendPost(restOp) | |
.then((resp) => { | |
resolve(resp.body.results); | |
}) | |
.catch((err) => { | |
let errorStatusCode = err.getResponseOperation().getStatusCode(); | |
let errorBody = JSON.stringify(err.getResponseOperation().getBody(), '', '\t'); | |
logger.info('[MyWorker - ERROR] - applyServiceDefinition(): ' +errorStatusCode+ ':\n' +errorBody); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment