summaryrefslogtreecommitdiffstats
path: root/src/app/test
diff options
context:
space:
mode:
authorMohamed Asgar Samiulla(ma926a) <ma926a@us.att.com>2018-04-02 19:00:49 +0530
committerSkip Wonnell <skip@att.com>2018-04-09 11:24:18 -0500
commitd7dffc2d1c65788e68a7fabdc16e5afd90de0f67 (patch)
treea5fef0028c4c325f11c464c8cfb39858ecc5ac8b /src/app/test
parentf27d5549734324727a5432f6ff663b0880425f47 (diff)
[Appc-1806] Login for Test screen, test api urls.
Test API urls corrected and vserverid removed from poll request. Issue-ID: APPC-831 Change-Id: I0bc616888afee8683ccbf5238980e97c6ca51af6 Signed-off-by: Mohamed Asgar Samiulla(ma926a) <ma926a@us.att.com>
Diffstat (limited to 'src/app/test')
-rw-r--r--src/app/test/test.component.spec.ts157
-rw-r--r--src/app/test/test.component.ts22
2 files changed, 93 insertions, 86 deletions
diff --git a/src/app/test/test.component.spec.ts b/src/app/test/test.component.spec.ts
index 15dde6c..997cd26 100644
--- a/src/app/test/test.component.spec.ts
+++ b/src/app/test/test.component.spec.ts
@@ -16,11 +16,13 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-
============LICENSE_END============================================
*/
-import { async, ComponentFixture, TestBed, inject } from '@angular/core/testing';
+/* tslint:disable:no-unused-variable */
+
+// Modules
+import { async, ComponentFixture, TestBed,inject } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
@@ -34,7 +36,10 @@ import 'rxjs/add/observable/from';
import 'rxjs/add/observable/empty';
import 'rxjs/add/observable/throw';
+// Component
import { TestComponent } from './test.component';
+
+// Services
import { NotificationService } from '../shared/services/notification.service';
import { ParamShareService } from '.././shared/services/paramShare.service';
import { MappingEditorService } from '../shared/services/mapping-editor.service';
@@ -44,7 +49,7 @@ import { environment } from '../.././environments/environment';
import { NgProgress } from 'ngx-progressbar';
import { NgProgressModule } from 'ngx-progressbar';
-describe('TestComponent', () => {
+describe( 'TestComponent', () => {
let component: TestComponent;
let fixture: ComponentFixture<TestComponent>;
@@ -52,19 +57,19 @@ describe('TestComponent', () => {
TestBed.configureTestingModule({
declarations: [TestComponent],
imports: [
- FormsModule,
- RouterTestingModule,
- SimpleNotificationsModule,
- HttpModule,
- NgProgressModule
+ FormsModule,
+ RouterTestingModule,
+ SimpleNotificationsModule,
+ HttpModule,
+ NgProgressModule
],
providers: [
- NotificationService,
- ParamShareService,
- MappingEditorService,
- HttpUtilService,
- UtilityService,
- NgProgress, MockBackend, BaseRequestOptions,
+ NotificationService,
+ ParamShareService,
+ MappingEditorService,
+ HttpUtilService,
+ UtilityService,
+ NgProgress,MockBackend, BaseRequestOptions,
{
provide: Http,
useFactory: (backend: MockBackend, defaultOptions: BaseRequestOptions) => {
@@ -74,7 +79,7 @@ describe('TestComponent', () => {
}
]
})
- .compileComponents();
+ .compileComponents();
}));
beforeEach(() => {
@@ -84,28 +89,26 @@ describe('TestComponent', () => {
});
it('should ...', inject([HttpUtilService], (service: HttpUtilService) => {
- let spy = spyOn(service, 'post').and.returnValue(Observable.empty());
fixture.detectChanges(); // onInit()
component.pollTestStatus();
-
+
expect(service).toBeTruthy();
-
}));
-
+
// Test download Method
describe('Test download Method', () => {
it('Should have download method', () => {
expect(component.download).toBeDefined();
});
- it('test if apiRequest if true', inject([SimpleNotificationsModule], (service: SimpleNotificationsModule) => {
- component.apiRequest = '{"input":{"common-header":{"timestamp":"2018-03-05T07:41:14.329Z","api-ver":"2.00","originator-id":"CDT","request-id":"1520235674330","sub-request-id":"1520235674330","flags":{"mode":"NORMAL","force":"TRUE","ttl":3600}},"action":"ConfigModify","action-identifiers":{"vnf-id":"testVnf","vserver-id":"test"},"payload":""';
+ it('test if apiRequest if true', inject( [SimpleNotificationsModule], (service: SimpleNotificationsModule) => {
+ component.apiRequest = '{"input":{"common-header":{"timestamp":"2018-03-05T07:41:14.329Z","api-ver":"2.00","originator-id":"CDT","request-id":"1520235674330","sub-request-id":"1520235674330","flags":{"mode":"NORMAL","force":"TRUE","ttl":3600}},"action":"ConfigModify","action-identifiers":{"vnf-id":"ibcx0001","vserver-id":"test"},"payload":""';
component.apiResponse = '';
- component.action = 'ConfigModify';
- component.actionIdentifiers['vnf-id'] = 'testVnf';
+ component.action = 'ConfigModify';
+ component.actionIdentifiers['vnf-id'] = 'ibcx0001';
let fileName = 'test_' + component.action + '_' + component.actionIdentifiers['vnf-id'] + '_request';
- let theJSON = component.apiRequest;
+ let theJSON = component.apiRequest;
var blob = new Blob([theJSON], {
type: 'text/json'
});
@@ -123,10 +126,10 @@ describe('TestComponent', () => {
}));
it('test method if apiResponse is true', () => {
- component.apiResponse = '{"input":{"common-header":{"timestamp":"2018-03-05T07:41:14.329Z","api-ver":"2.00","originator-id":"CDT","request-id":"1520235674330","sub-request-id":"1520235674330","flags":{"mode":"NORMAL","force":"TRUE","ttl":3600}},"action":"ConfigModify","action-identifiers":{"vnf-id":"testvnf","vserver-id":"test"},"payload":""';
+ component.apiResponse = '{"input":{"common-header":{"timestamp":"2018-03-05T07:41:14.329Z","api-ver":"2.00","originator-id":"CDT","request-id":"1520235674330","sub-request-id":"1520235674330","flags":{"mode":"NORMAL","force":"TRUE","ttl":3600}},"action":"ConfigModify","action-identifiers":{"vnf-id":"ibcx0001","vserver-id":"test"},"payload":""';
component.apiRequest = '';
- component.action = 'ConfigModify';
- component.actionIdentifiers['vnf-id'] = 'testvnf';
+ component.action = 'ConfigModify';
+ component.actionIdentifiers['vnf-id'] = 'ibcx0001';
let fileName = 'test_' + component.action + '_' + component.actionIdentifiers['vnf-id'] + '_response';
let theJSON = component.apiRequest;
var blob = new Blob([theJSON], {
@@ -152,7 +155,7 @@ describe('TestComponent', () => {
});
it('Test abortTest Method', () => {
- const temp = component.abortTest();
+ component.abortTest();
expect(component.enableBrowse).toBeTruthy();
expect(component.enableTestButton).toBeTruthy();
expect(component.enablePollButton).toBeTruthy();
@@ -177,9 +180,9 @@ describe('TestComponent', () => {
it('should execute if file extension is XLS, XLSX', () => {
let reader = new FileReader();
- let file = new File(["testing"], "foo.XLS", { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" })
+ let file = new File(["testing"], "foo.XLS", {type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"})
let fileExtension = 'XLS';
- let event = { isTrusted: true, type: "change", target: { files: [file] } }
+ let event = { isTrusted: true, type: "change", target: {files: [file]} }
component.upload(event);
@@ -189,10 +192,10 @@ describe('TestComponent', () => {
it('should return an error if file extension is not XLS, XLSX', () => {
let reader = new FileReader();
- let file = new File(["testing"], "foo.doc", { type: "" })
+ let file = new File(["testing"], "foo.doc", {type: ""})
let fileExtension = 'doc';
- let event = { isTrusted: true, type: "change", target: { files: [file] } }
-
+ let event = { isTrusted: true, type: "change", target: {files: [file]} }
+
component.upload(event);
expect(reader instanceof FileReader).toBeTruthy();
@@ -200,7 +203,7 @@ describe('TestComponent', () => {
});
it('Should return an error is files length is not equal to 1', () => {
-
+
});
});
@@ -208,11 +211,11 @@ describe('TestComponent', () => {
describe('Test processUploadedFile Method', () => {
it('should return valid payload', () => {
let data = [
- { "TagName": "action", "Value": "ConfigModify" },
- { "List Name": "action-identifiers", "TagName": "vserver-id", "Value": "test" },
- { "List Name": "payload", "List Name_1": "request-parameters", "TagName": "vnf-name", "Value": "testVnf" },
- { "List Name": "payload", "List Name_1": "request-parameters", "List Name_2": "[vm]", "List Name_3": "vnfc", "TagName": "vnfc-name", "Value": "testVnfcName" },
- { "List Name": "payload", "List Name_1": "configuration-parameters", "TagName": "testConfigParam", "Value": "testConfigValue" }
+ {"TagName":"action","Value":"ConfigModify"},
+ {"List Name":"action-identifiers","TagName":"vserver-id","Value":"test"},
+ {"List Name":"payload","List Name_1":"request-parameters","TagName":"vnf-name","Value":"ibcx0001"},
+ {"List Name":"payload","List Name_1":"request-parameters","List Name_2":"[vm]","List Name_3":"vnfc","TagName":"vnfc-name","Value":"ibcx0001vm001ssc001"},
+ {"List Name":"payload","List Name_1":"configuration-parameters","TagName":"CORE_NETWORK_DEFAULT_GATEWAY","Value":"192.168.30.44"}
]
let payload = component.processUploadedFile(data);
@@ -221,9 +224,9 @@ describe('TestComponent', () => {
// Test uploadedFileResult Method
describe('Test uploadedFileResult', () => {
- it('should return success message', inject([SimpleNotificationsModule], (service: SimpleNotificationsModule) => {
- component.action = 'ConfigModify';
- component.actionIdentifiers['vnf-id'] = 'testvnf';
+ it('should return success message', inject([SimpleNotificationsModule],(service: SimpleNotificationsModule) => {
+ component.action = 'ConfigModify';
+ component.actionIdentifiers['vnf-id'] = 'ibcx0001';
component.uploadedFileResult();
@@ -231,7 +234,7 @@ describe('TestComponent', () => {
}));
it('should return error message', inject([SimpleNotificationsModule], (service: SimpleNotificationsModule) => {
- component.action = '';
+ component.action = '';
component.actionIdentifiers['vnf-id'] = '';
component.uploadedFileResult();
@@ -242,28 +245,27 @@ describe('TestComponent', () => {
// Test constructTestPayload Method
describe('Test constructTestPayload Method', () => {
- //3rd , 4th columnd, tag name , tag value
it('Should have constructTestPayload method', () => {
expect(component.constructTestPayload).toBeDefined();
});
it('test if listName2, listName3 are undefined', () => {
- let temp = component.constructTestPayload(undefined, undefined, 'vnfc-type', 'testvnfc');
- expect(component.subPayload['vnfc-type']).toEqual('testvnfc')
+ let temp = component.constructTestPayload(undefined, undefined, 'vnfc-type', 'vISBC - ssc');
+ expect(component.subPayload['vnfc-type']).toEqual('vISBC - ssc')
});
it('test if lastName2 is not undefined', () => {
- let temp = component.constructTestPayload(['vm'], undefined, 'vnfc-type', 'testvnfc');
- expect(typeof (component.vmJson)).toEqual('object');
- expect(typeof (component.vnfcJson)).toEqual('object');
- expect(component.vmJson['vnfc-type']).toBe('testvnfc');
+ let temp = component.constructTestPayload(['vm'], undefined, 'vnfc-type', 'vISBC - ssc');
+ expect(typeof(component.vmJson)).toEqual('object');
+ expect(typeof(component.vnfcJson)).toEqual('object');
+ expect(component.vmJson['vnfc-type']).toBe('vISBC - ssc');
expect(component.flag).toBe(0);
});
it('test if lastNmae2, lastName3 are not undefined', () => {
- let temp = component.constructTestPayload(['vm'], 'vnfc', 'vnfc-type', 'testvnfc');
- expect(component.vnfcJson['vnfc-type']).toEqual('testvnfc');
- expect(component.vmJson['vnfc']['vnfc-type']).toEqual('testvnfc');
+ let temp = component.constructTestPayload(['vm'], 'vnfc', 'vnfc-type', 'vISBC - ssc');
+ expect(component.vnfcJson['vnfc-type']).toEqual('vISBC - ssc');
+ expect(component.vmJson['vnfc']['vnfc-type']).toEqual('vISBC - ssc');
expect(component.flag).toBe(1);
})
});
@@ -285,28 +287,28 @@ describe('TestComponent', () => {
expect(component.testVnf).toBeDefined();
});
- it('should return response on success', inject([MockBackend], (mockBackend: MockBackend) => {
+ it('should return response on success', inject([MockBackend], (mockBackend: MockBackend) => {
let mockData = 'testing';
let response = new ResponseOptions({
body: JSON.stringify(mockData)
});
const baseResponse = new Response(response);
mockBackend.connections.subscribe(
- (c: MockConnection) => {
+ (c: MockConnection) => {
c.mockRespond(baseResponse)
}
);
- component.action = 'ConfigModify';
-
+ component.action = 'ConfigModify';
+
component.testVnf();
}));
- it('should return an error if fails', inject([HttpUtilService], (httpUtilService: HttpUtilService) => {
+ it('should return an error if fails', inject([HttpUtilService],( httpUtilService: HttpUtilService) => {
let error = 'Error in connecting to APPC Server';
let spy = spyOn(httpUtilService, 'post').and.returnValue(Observable.throw(error));
- component.action = 'ConfigModify';
-
+ component.action = 'ConfigModify';
+
component.testVnf();
expect(spy).toHaveBeenCalled();
@@ -317,11 +319,9 @@ describe('TestComponent', () => {
}));
it('test setTimeout', inject([NgProgress], (ngProgress: NgProgress) => {
- let spy = spyOn(ngProgress, 'done');
- component.action = 'ConfigModify';
-
+ component.action = 'ConfigModify';
+
component.testVnf();
-
}));
});
@@ -334,7 +334,7 @@ describe('TestComponent', () => {
it('should call fake server', inject([MockBackend], (mockBackend: MockBackend) => {
component.requestId = new Date().getTime().toString();
component.actionIdentifiers['vnf-id'] = 123456;
- let mockData = { "output": { "common-header": { "originator-id": "CDT", "sub-request-id": "653018029941", "timestamp": "2018-02-12T07:27:21.448Z", "api-ver": "2.00", "request-id": "653018029941", "flags": { "force": "TRUE", "mode": "NORMAL", "ttl": 3600 } }, "payload": "{\"status-reason\":\"FAILED\",\"status\":\"FAILED\"}", "status": { "message": "SUCCESS - request has been processed successfully", "code": 400 } } };
+ let mockData = { "output": { "common-header": { "originator-id": "CDT", "sub-request-id": "653018029941", "timestamp": "2018-02-12T07:27:21.448Z", "api-ver": "2.00", "request-id": "653018029941", "flags": { "force": "TRUE", "mode": "NORMAL", "ttl": 3600 } }, "payload": "{\"status-reason\":\"FAILED\",\"status\":\"FAILED\"}", "status": { "message": "SUCCESS - request has been processed successfully", "code": 400 } } } ;
let response = new ResponseOptions({
body: JSON.stringify(mockData)
});
@@ -342,14 +342,14 @@ describe('TestComponent', () => {
mockBackend.connections.subscribe(
(c: MockConnection) => c.mockRespond(baseResponse)
);
-
+
component.pollTestStatus();
}));
it('should call fake server if status is success', inject([MockBackend], (mockBackend: MockBackend) => {
component.requestId = new Date().getTime().toString();
component.actionIdentifiers['vnf-id'] = 123456;
- let mockData = { "output": { "common-header": { "originator-id": "CDT", "sub-request-id": "653018029941", "timestamp": "2018-02-12T07:27:21.448Z", "api-ver": "2.00", "request-id": "653018029941", "flags": { "force": "TRUE", "mode": "NORMAL", "ttl": 3600 } }, "payload": "{\"status-reason\":\"SUCCESS\",\"status\":\"SUCCESS\"}", "status": { "message": "SUCCESS - request has been processed successfully", "code": 400 } } };
+ let mockData = { "output": { "common-header": { "originator-id": "CDT", "sub-request-id": "653018029941", "timestamp": "2018-02-12T07:27:21.448Z", "api-ver": "2.00", "request-id": "653018029941", "flags": { "force": "TRUE", "mode": "NORMAL", "ttl": 3600 } }, "payload": "{\"status-reason\":\"SUCCESS\",\"status\":\"SUCCESS\"}", "status": { "message": "SUCCESS - request has been processed successfully", "code": 400 } } } ;
let response = new ResponseOptions({
body: JSON.stringify(mockData)
});
@@ -357,15 +357,14 @@ describe('TestComponent', () => {
mockBackend.connections.subscribe(
(c: MockConnection) => c.mockRespond(baseResponse)
);
-
+
component.pollTestStatus();
}));
- it('should check error condition on polling where timestamp and test status are not available', inject([MockBackend], (mockBackend: MockBackend) => {
+ it('should execute else part if timeStamp && status && statusReason are false', inject([MockBackend], (mockBackend: MockBackend) => {
component.requestId = new Date().getTime().toString();
component.actionIdentifiers['vnf-id'] = 123456;
- //let mockData = { "output": { "common-header": { "originator-id": "CDT", "sub-request-id": "653018029941", "timestamp": "2018-02-12T07:27:21.448Z", "api-ver": "2.00", "request-id": "653018029941", "flags": { "force": "TRUE", "mode": "NORMAL", "ttl": 3600 } }, "payload": "{\"status-reason\":\"FAILED\",\"status\":\"\"}", "status": { "message": "SUCCESS - request has been processed successfully", "code": 400 } } } ;
- let mockData = { "output": { "common-header": { "timestamp": "2018-03-21T14:20:30.910Z", "api-ver": "2.00", "request-id": "1521642030910", "flags": { "force": "TRUE", "mode": "NORMAL", "ttl": 3600 }, "originator-id": "CDT", "sub-request-id": "1521642030910" }, "status": { "message": "INVALID INPUT PARAMETER - vserver-id", "code": 301 } } };
+ let mockData = { "output": { "common-header": { "originator-id": "CDT", "sub-request-id": "653018029941", "timestamp": "2018-02-12T07:27:21.448Z", "api-ver": "2.00", "request-id": "653018029941", "flags": { "force": "TRUE", "mode": "NORMAL", "ttl": 3600 } }, "payload": "{\"status-reason\":\"FAILED\",\"status\":\"\"}", "status": { "message": "SUCCESS - request has been processed successfully", "code": 400 } } } ;
let response = new ResponseOptions({
body: JSON.stringify(mockData)
});
@@ -373,14 +372,15 @@ describe('TestComponent', () => {
mockBackend.connections.subscribe(
(c: MockConnection) => c.mockRespond(baseResponse)
);
-
+
component.pollTestStatus();
}));
- it('should execute else part if timeStamp && status && statusReason are false', inject([MockBackend], (mockBackend: MockBackend) => {
+ it('should check error condition on polling where timestamp and test status are not available', inject([MockBackend], (mockBackend: MockBackend) => {
component.requestId = new Date().getTime().toString();
component.actionIdentifiers['vnf-id'] = 123456;
- let mockData = { "output": { "common-header": { "originator-id": "CDT", "sub-request-id": "653018029941", "timestamp": "2018-02-12T07:27:21.448Z", "api-ver": "2.00", "request-id": "653018029941", "flags": { "force": "TRUE", "mode": "NORMAL", "ttl": 3600 } }, "payload": "{\"status-reason\":\"FAILED\",\"status\":\"\"}", "status": { "message": "SUCCESS - request has been processed successfully", "code": 400 } } };
+ //let mockData = { "output": { "common-header": { "originator-id": "CDT", "sub-request-id": "653018029941", "timestamp": "2018-02-12T07:27:21.448Z", "api-ver": "2.00", "request-id": "653018029941", "flags": { "force": "TRUE", "mode": "NORMAL", "ttl": 3600 } }, "payload": "{\"status-reason\":\"FAILED\",\"status\":\"\"}", "status": { "message": "SUCCESS - request has been processed successfully", "code": 400 } } } ;
+ let mockData={"output":{"common-header":{"timestamp":"2018-03-21T14:20:30.910Z","api-ver":"2.00","request-id":"1521642030910","flags":{"force":"TRUE","mode":"NORMAL","ttl":3600},"originator-id":"CDT","sub-request-id":"1521642030910"},"status":{"message":"INVALID INPUT PARAMETER - vserver-id","code":301}}};
let response = new ResponseOptions({
body: JSON.stringify(mockData)
});
@@ -388,7 +388,7 @@ describe('TestComponent', () => {
mockBackend.connections.subscribe(
(c: MockConnection) => c.mockRespond(baseResponse)
);
-
+
component.pollTestStatus();
}));
@@ -408,7 +408,7 @@ describe('TestComponent', () => {
component.pollTestStatus();
}));
});
-
+
// Test getUrlEndPoint Method
describe('Test getUrlEndPoint Method', () => {
it('Should have getUrlEndPoint method', () => {
@@ -429,6 +429,9 @@ describe('TestComponent', () => {
expect(component.getUrlEndPoint('upgradeprecheck')).toEqual('upgrade-pre-check');
expect(component.getUrlEndPoint('upgradesoftware')).toEqual('upgrade-software');
expect(component.getUrlEndPoint('DeFaultCASE')).toEqual('defaultcase');
+ expect(component.getUrlEndPoint('upgradebackup')).toEqual('upgrad-ebackup');
+ expect(component.getUrlEndPoint('attachvolume')).toEqual('attach-volume');
+ expect(component.getUrlEndPoint('detachvolume')).toEqual('detach-volume');
});
});
-}) \ No newline at end of file
+})
diff --git a/src/app/test/test.component.ts b/src/app/test/test.component.ts
index dd8871e..18d6541 100644
--- a/src/app/test/test.component.ts
+++ b/src/app/test/test.component.ts
@@ -16,7 +16,6 @@ distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-
============LICENSE_END============================================
*/
@@ -101,7 +100,7 @@ export class TestComponent implements OnInit {
public pollCounter = 0;
public enableCounterDiv: boolean = false;
public enableDownload: boolean = false;
-
+ private userId = localStorage['userId'];
constructor(private location: Location, private activeRoutes: ActivatedRoute, private notificationService: NotificationService, private nService: NotificationsService, private router: Router, private paramShareService: ParamShareService, private mappingEditorService: MappingEditorService, private httpUtil: HttpUtilService,
private utiltiy: UtilityService, private ngProgress: NgProgress) {
@@ -198,7 +197,6 @@ export class TestComponent implements OnInit {
- console.log('Array data ==' + arrData[0]);
this.vmPayload = [];
this.subPayload = {};
this.vmJson = {};
@@ -333,9 +331,7 @@ export class TestComponent implements OnInit {
}
constructRequest() {
- console.log('payload==' + JSON.stringify(this.payload));
let timeStamp = new Date().toISOString();
- console.log('timestamp==' + timeStamp);
let reqId;
this.requestId = reqId = new Date().getTime().toString();
let data = {
@@ -343,7 +339,7 @@ export class TestComponent implements OnInit {
'common-header': {
'timestamp': timeStamp,
'api-ver': '2.00',
- 'originator-id': 'CDT',
+ 'originator-id': this.userId,
'request-id': this.requestId,
'sub-request-id': this.requestId,
'flags': {
@@ -367,9 +363,9 @@ export class TestComponent implements OnInit {
this.enablePollButton = false;
this.timer = Observable.interval(10000);
this.subscribe = this.timer.subscribe((t) => this.pollTestStatus());
- //console.log('full payload==' + JSON.stringify(this.apiRequest));
this.ngProgress.start();
this.apiRequest = JSON.stringify(this.constructRequest());
+
this.httpUtil.post(
{
url: environment.testVnf + this.getUrlEndPoint(this.action.toLowerCase()), data: this.apiRequest
@@ -405,7 +401,7 @@ export class TestComponent implements OnInit {
'common-header': {
'timestamp': timeStamp,
'api-ver': '2.00',
- 'originator-id': 'CDT',
+ 'originator-id': this.userId,
'request-id': reqId,
'sub-request-id': reqId,
'flags': {
@@ -415,7 +411,9 @@ export class TestComponent implements OnInit {
}
},
'action': 'ActionStatus',
- 'action-identifiers': this.actionIdentifiers,
+ 'action-identifiers': {
+ 'vnf-id' : this.actionIdentifiers['vnf-id']
+ },
'payload': '{"request-id":' + this.requestId + '}'
}
};
@@ -509,6 +507,12 @@ export class TestComponent implements OnInit {
return 'upgrade-pre-check';
case 'upgradesoftware':
return 'upgrade-software';
+ case 'upgradebackup':
+ return 'upgrade-backup';
+ case 'attachvolume':
+ return 'attach-volume';
+ case 'detachvolume':
+ return 'detach-volume';
default:
return action.toLowerCase();
}