Untitled
unknown
plain_text
a year ago
6.5 kB
8
Indexable
putApiTracing() {
if (this.activeOS == this.listOS.OS390) {
this.submitted = true;
let zosPostObject = {};
const quiesceChanged = this.updatetracingForm.value.quiesce != this.currentTracingNode['quiesced'].toLocaleLowerCase();
const quiesceOn = this.updatetracingForm.value.quiesce == 'on';
const quiesceOff = this.updatetracingForm.value.quiesce == 'off';
if (quiesceChanged) {
zosPostObject['quiesceNode'] = quiesceOn ? `(Q,${this.currentTracingNode['nodeName']})` : `(R,${this.currentTracingNode['nodeName']})`;
} else {
const debugLevel = this.updatetracingForm.value.debugLevel.toUpperCase();
if (this.headerTabConf.selectedTab == 'partners') {
if (debugLevel == '00000000') {
zosPostObject['nodeNameForTraceOff'] = this.currentTracingNode['nodeName'];
} else {
zosPostObject['nodeNameForTrace'] = `${this.currentTracingNode['nodeName']},${debugLevel}`;
}
} else if (this.headerTabConf.selectedTab == 'global') {
zosPostObject['debugLevel'] = debugLevel;
} else {
zosPostObject['debugLevel'] = debugLevel;
zosPostObject['serverName'] = this.currentTracingNode['nodeName'];
}
}
this.appService.masterWrapper(
{
params: {
'allparameters': zosPostObject,
'allconfig': this.commonUtilitiesLib.copy({
'verbtype': 'put',
'apiname': ['TRACING'],
'responseformat': { 'format': 'rest' }
})
}
}
).subscribe((success: any) => {
this.zosPartnerFlag = true;
this.toaster.success(this.translateService.instant('tracing.messages.successmessages'));
this.getApiTracing();
});
} else {
this.resetErrorFlags();
const changedValueObject = Object.keys(this.commonUtilitiesLib.getObjectDirtyKey(this.freshObjectFromGet, this.updatetracingForm.getRawValue()));
if (changedValueObject.length > 0) {
const outputFiles = ['PMGRoutputfilename', 'CMGRoutputfilename', 'SMGRoutputfilename', 'SMGRSNodeoutputfilename'];
outputFiles.forEach(file => {
if (this.updatetracingForm.value[file] != null && this.updatetracingForm.value[file].trim() === '') {
this.error[`${file.toLowerCase()}Path`] = true;
}
});
if (Object.values(this.error).some(flag => flag === true)) {
return;
}
const allparameters = {};
if (this.isWindowFlag) {
allparameters['fileName'] = this.updatetracingForm.value.outputfilename;
allparameters['maximumFileSize'] = `${this.updatetracingForm.value.maximumfilesizeText}${this.updatetracingForm.value.maximumfilesizedrop}`;
allparameters['wrapSetting'] = this.booleanToText(this.wrapSetting);
} else {
allparameters['pmgrOutputFile'] = this.checkForQuotes(this.updatetracingForm.value.PMGRoutputfilename);
allparameters['cmgrOutputFile'] = this.checkForQuotes(this.updatetracingForm.value.CMGRoutputfilename);
allparameters['fileName'] = this.checkForQuotes(this.updatetracingForm.value.SMGRoutputfilename);
allparameters['smgrSNodeOutputFile'] = this.checkForQuotes(this.updatetracingForm.value.SMGRSNodeoutputfilename);
}
const tracingOptions = [
{ type: 'processManager', param: 'PMGRoutputfiledestination', method: this.updateTracingOnOff },
{ type: 'commandManager', param: 'CMGRoutputfiledestination', method: this.updateTracingOnOff },
{ type: 'communicationResponse', param: null, method: this.updateTracingOnOff },
{ type: 'sessionManager', param: null, method: this.updateTracing, flag: this.isWindowFlag },
{ type: 'mainTrace', param: null, method: this.updateTracingOnOff, flag: this.isWindowFlag },
{ type: 'statTrace', param: 'outputfiledestination', method: this.updateTracingOnOff, flag: this.isWindowFlag },
{ type: 'sessionManager', param: 'SMGRSNodeoutputfilename', method: this.updateTracingOnOff, flag: !this.isWindowFlag },
{ type: 'sessionManagerSNode', param: 'SMGRSNodeoutputfilename', method: this.updateTracingOnOff, flag: !this.isWindowFlag },
];
tracingOptions.forEach(option => {
if (changedValueObject.includes(option.type) || (option.param && changedValueObject.includes(option.param))) {
if (option.flag === undefined || option.flag) {
const params = { level: this.updatetracingForm.value[option.type] };
params[option.type] = 'yes';
params[`${option.type}Node`] = option.type === 'sessionManagerSNode' ? 'snode' : 'pnode';
if (option.type === 'sessionManagerSNode') {
params['smgrSNodeOutputFile'] = allparameters['smgrSNodeOutputFile'];
} else if (option.type === 'processManager') {
params['pmgrOutputFile'] = allparameters['pmgrOutputFile'];
} else if (option.type === 'commandManager') {
params['cmgrOutputFile'] = allparameters['cmgrOutputFile'];
}
option.method(params);
}
}
});
if (this.arrayObjConfig.length > 0) {
this.appCommonService.syncApiCall(this.arrayObjConfig, () => {
this.getApiTracing();
});
}
if (this.arrayObj.length > 0) {
this.appCommonService.syncApiCall(this.arrayObj, () => {
this.toaster.success(this.translateService.instant('tracing.messages.successmessages'));
this.updatetracingForm.reset();
this.getApiTracing();
});
}
}
}
}
Editor is loading...
Leave a Comment