docs
node_modules
.npmrc
-npm-debug.log
\ No newline at end of file
+npm-debug.log
+config.json
\ No newline at end of file
"server": "SET_TO_YOUR_SERVER_IP",
"port": 8285,
- "prefix":"sdc1/feProxy/onboarding-api/v1.0",
- "vf_prefix":"sdc1/feProxy/rest/v1"
+
+ "prefix" : {
+ "onboarding":"sdc1/feProxy/onboarding-api/v1.0",
+ "vf":"sdc1/feProxy/rest/v1",
+ "activity_spec":"sdc1/feProxy/activityspec-api/v1"
+
+ }
}
\ No newline at end of file
const fs = require('fs');
require('node-zip');
-function _request(context, method, path, data, isBinary=false, isVFCall=false) {
- let server = (isVFCall) ? context.vf_server : context.onboarding_server;
+function _request(context, method, path, data, isBinary=false, prefix='onboarding') {
+ let server = context.server + '/' + context.prefix[prefix];
+
let options = {
method: method,
url: server + path,
this.context.inputData.tags[0] = result.data.name;
this.context.inputData.vendorName = result.data.vendorName;
this.context.inputData.csarUUID = this.context.item.id;
- return util.request(this.context, 'POST', '/catalog/resources', this.context.inputData, false, true);
+ return util.request(this.context, 'POST', '/catalog/resources', this.context.inputData, false, 'vf');
});
});
} else {
this.context.server = config.server;
}
- this.context.onboarding_server = (config.protocol + '://' + this.context.server + ':' + config.port + '/' + config.prefix);
- this.context.vf_server = (config.protocol + '://' + this.context.server + ':' + config.port + '/' + config.vf_prefix);
+ this.context.server = (config.protocol + '://' + this.context.server + ':' + config.port);
this.context.headers = {};
this.context.inputData = null;
this.context.responseData = null;
+ this.context.prefix = config.prefix;
+
this.setServer = function(server) {
- this.context.onboarding_server = (config.protocol + '://' +server + ':' + config.port + '/' + config.prefix);
- this.context.vf_server = (config.protocol + '://' +server + ':' + config.port + '/' + config.vf_prefix);
+ this.context.server = (config.protocol + '://' + this.context.server + ':' + config.port);
}
setDefaultTimeout(60 * 1000);