diff --git a/src/app/components/preferences/common/symbols/symbols.component.ts b/src/app/components/preferences/common/symbols/symbols.component.ts index 7dbbb527..e7a13d95 100644 --- a/src/app/components/preferences/common/symbols/symbols.component.ts +++ b/src/app/components/preferences/common/symbols/symbols.component.ts @@ -77,6 +77,6 @@ export class SymbolsComponent implements OnInit { } getImageSourceForTemplate(symbol: string) { - return `${this.server.protocol}//${this.server.host}:${this.server.port}/v2/symbols/${symbol}/raw`; + return `${this.server.protocol}//${this.server.host}:${this.server.port}/v3/symbols/${symbol}/raw`; } } diff --git a/src/app/components/project-map/import-appliance/import-appliance.component.ts b/src/app/components/project-map/import-appliance/import-appliance.component.ts index f080506a..1cee4164 100644 --- a/src/app/components/project-map/import-appliance/import-appliance.component.ts +++ b/src/app/components/project-map/import-appliance/import-appliance.component.ts @@ -149,6 +149,6 @@ export class ImportApplianceComponent implements OnInit { } private getUploadPath(server: Server, emulator: string, filename: string) { - return `${server.protocol}//${server.host}:${server.port}/v2/${emulator}/images/${filename}`; + return `${server.protocol}//${server.host}:${server.port}/v3/${emulator}/images/${filename}`; } } diff --git a/src/app/components/project-map/project-map.component.ts b/src/app/components/project-map/project-map.component.ts index c5a090cd..12b1d766 100644 --- a/src/app/components/project-map/project-map.component.ts +++ b/src/app/components/project-map/project-map.component.ts @@ -234,7 +234,7 @@ export class ProjectMapComponent implements OnInit, OnDestroy { this.nodesDataSource.changes.subscribe((nodes: Node[]) => { if (!this.server) return; nodes.forEach(async (node: Node) => { - node.symbol_url = `${this.server.protocol}//${this.server.host}:${this.server.port}/v2/symbols/${node.symbol}/raw`; + node.symbol_url = `${this.server.protocol}//${this.server.host}:${this.server.port}/v3/symbols/${node.symbol}/raw`; if (node.width == 0 && node.height == 0) { let symbolDimensions = await this.symbolService.getDimensions(this.server, node.symbol).toPromise(); diff --git a/src/app/components/projects/import-project-dialog/import-project-dialog.component.spec.ts b/src/app/components/projects/import-project-dialog/import-project-dialog.component.spec.ts index 7874b206..a179b902 100644 --- a/src/app/components/projects/import-project-dialog/import-project-dialog.component.spec.ts +++ b/src/app/components/projects/import-project-dialog/import-project-dialog.component.spec.ts @@ -47,11 +47,11 @@ export class MockedProjectService { } getUploadPath(server: Server, uuid: string, project_name: string) { - return `http://${server.host}:${server.port}/v2/projects/${uuid}/import?name=${project_name}`; + return `http://${server.host}:${server.port}/v3/projects/${uuid}/import?name=${project_name}`; } getExportPath(server: Server, project: Project) { - return `http://${server.host}:${server.port}/v2/projects/${project.project_id}/export`; + return `http://${server.host}:${server.port}/v3/projects/${project.project_id}/export`; } } diff --git a/src/app/components/template/template.component.ts b/src/app/components/template/template.component.ts index 29d4482d..be276855 100644 --- a/src/app/components/template/template.component.ts +++ b/src/app/components/template/template.component.ts @@ -128,7 +128,7 @@ export class TemplateComponent implements OnInit, OnDestroy { } getImageSourceForTemplate(template: Template) { - return `${this.server.protocol}//${this.server.host}:${this.server.port}/v2/symbols/${template.symbol}/raw`; + return `${this.server.protocol}//${this.server.host}:${this.server.port}/v3/symbols/${template.symbol}/raw`; } ngOnDestroy() { diff --git a/src/app/services/appliances.service.ts b/src/app/services/appliances.service.ts index d9bff93d..7285d441 100644 --- a/src/app/services/appliances.service.ts +++ b/src/app/services/appliances.service.ts @@ -17,7 +17,7 @@ export class ApplianceService { } getUploadPath(server: Server, emulator: string, filename: string) { - return `${server.protocol}//${server.host}:${server.port}/v2/compute/${emulator}/images/${filename}`; + return `${server.protocol}//${server.host}:${server.port}/v3/compute/${emulator}/images/${filename}`; } updateAppliances(server: Server): Observable { diff --git a/src/app/services/built-in-templates.service.spec.ts b/src/app/services/built-in-templates.service.spec.ts index 50f87f90..eee94c8d 100644 --- a/src/app/services/built-in-templates.service.spec.ts +++ b/src/app/services/built-in-templates.service.spec.ts @@ -51,7 +51,7 @@ describe('BuiltInTemplatesService', () => { service.saveTemplate(server, cloudtemplate).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates/1'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates/1'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual(cloudtemplate); })); @@ -71,7 +71,7 @@ describe('BuiltInTemplatesService', () => { service.saveTemplate(server, ethernethubtemplate).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates/2'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates/2'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual(ethernethubtemplate); })); @@ -91,7 +91,7 @@ describe('BuiltInTemplatesService', () => { service.saveTemplate(server, ethernetswitchtemplate).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates/3'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates/3'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual(ethernetswitchtemplate); })); @@ -112,7 +112,7 @@ describe('BuiltInTemplatesService', () => { service.addTemplate(server, cloudtemplate).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual(cloudtemplate); })); @@ -132,7 +132,7 @@ describe('BuiltInTemplatesService', () => { service.addTemplate(server, ethernethubtemplate).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual(ethernethubtemplate); })); @@ -152,7 +152,7 @@ describe('BuiltInTemplatesService', () => { service.addTemplate(server, ethernetswitchtemplate).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual(ethernetswitchtemplate); })); diff --git a/src/app/services/compute.service.ts b/src/app/services/compute.service.ts index ab8c1d7f..36e83e7a 100644 --- a/src/app/services/compute.service.ts +++ b/src/app/services/compute.service.ts @@ -14,7 +14,7 @@ export class ComputeService { } getUploadPath(server: Server, emulator: string, filename: string) { - return `${server.protocol}//${server.host}:${server.port}/v2/${emulator}/images/${filename}`; + return `${server.protocol}//${server.host}:${server.port}/v3/${emulator}/images/${filename}`; } getStatistics(server: Server): Observable { diff --git a/src/app/services/drawing.service.spec.ts b/src/app/services/drawing.service.spec.ts index 1ff105b3..3307f869 100644 --- a/src/app/services/drawing.service.spec.ts +++ b/src/app/services/drawing.service.spec.ts @@ -44,7 +44,7 @@ describe('DrawingService', () => { service.updatePosition(server, project, drawing, 10, 20).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/drawings/id'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/drawings/id'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual({ x: 10, @@ -59,7 +59,7 @@ describe('DrawingService', () => { service.updatePosition(server, project, drawing, 10.1, 20.6).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/drawings/id'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/drawings/id'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual({ x: 10, @@ -75,7 +75,7 @@ describe('DrawingService', () => { service.updateSizeAndPosition(server, drawing, 100, 100, svgSample).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/drawings/id'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/drawings/id'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual({ x: 100, @@ -94,7 +94,7 @@ describe('DrawingService', () => { service.updateSizeAndPosition(server, drawing, 100.1, 100.6, svgSample).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/drawings/id'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/drawings/id'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual({ x: 100, @@ -117,7 +117,7 @@ describe('DrawingService', () => { service.update(server, drawing).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/drawings/id'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/drawings/id'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual({ x: 10, @@ -136,7 +136,7 @@ describe('DrawingService', () => { service.delete(server, drawing).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/drawings/id'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/drawings/id'); expect(req.request.method).toEqual('DELETE'); })); @@ -153,7 +153,7 @@ describe('DrawingService', () => { service.duplicate(server, drawing.project_id, drawing).subscribe(); - const req = httpTestingController.expectOne(`http://127.0.0.1:3080/v2/projects/${drawing.project_id}/drawings`); + const req = httpTestingController.expectOne(`http://127.0.0.1:3080/v3/projects/${drawing.project_id}/drawings`); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({ svg: drawing.svg, diff --git a/src/app/services/http-server.service.spec.ts b/src/app/services/http-server.service.spec.ts index bb17bce4..619fb68d 100644 --- a/src/app/services/http-server.service.spec.ts +++ b/src/app/services/http-server.service.spec.ts @@ -76,7 +76,7 @@ describe('HttpServer', () => { it('should make GET query for get method', () => { service.get(server, '/test').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('GET'); expect(req.request.responseType).toEqual('json'); }); @@ -89,7 +89,7 @@ describe('HttpServer', () => { expect(data).toEqual(testData); }); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('GET'); expect(req.request.responseType).toEqual('json'); @@ -115,7 +115,7 @@ describe('HttpServer', () => { it('should make GET query for getText method', () => { service.getText(server, '/test').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('GET'); expect(req.request.responseType).toEqual('text'); }); @@ -130,7 +130,7 @@ describe('HttpServer', () => { }) .subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('GET'); expect(req.request.responseType).toEqual('text'); }); @@ -138,7 +138,7 @@ describe('HttpServer', () => { it('should make POST query for post method', () => { service.post(server, '/test', { test: '1' }).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('POST'); expect(req.request.responseType).toEqual('json'); }); @@ -146,7 +146,7 @@ describe('HttpServer', () => { it('should make PUT query for put method', () => { service.put(server, '/test', { test: '1' }).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('PUT'); expect(req.request.responseType).toEqual('json'); }); @@ -154,7 +154,7 @@ describe('HttpServer', () => { it('should make DELETE query for delete method', () => { service.delete(server, '/test').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('DELETE'); expect(req.request.responseType).toEqual('json'); }); @@ -162,7 +162,7 @@ describe('HttpServer', () => { it('should make PATCH query for patch method', () => { service.patch(server, '/test', { test: '1' }).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('PATCH'); expect(req.request.responseType).toEqual('json'); }); @@ -170,7 +170,7 @@ describe('HttpServer', () => { it('should make HEAD query for head method', () => { service.head(server, '/test').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('HEAD'); expect(req.request.responseType).toEqual('json'); }); @@ -178,7 +178,7 @@ describe('HttpServer', () => { it('should make OPTIONS query for options method', () => { service.options(server, '/test').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('OPTIONS'); expect(req.request.responseType).toEqual('json'); }); @@ -190,7 +190,7 @@ describe('HttpServer', () => { service.get(server, '/test').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('GET'); expect(req.request.responseType).toEqual('json'); expect(req.request.headers.get('Authorization')).toEqual('Basic bG9naW46cGFzc3dvcmQ='); @@ -209,7 +209,7 @@ describe('HttpServer', () => { }) .subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/test'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/test'); expect(req.request.method).toEqual('GET'); expect(req.request.responseType).toEqual('json'); expect(req.request.headers.get('Authorization')).toEqual('Basic bG9naW46cGFzc3dvcmQ='); @@ -228,7 +228,7 @@ describe('HttpServer', () => { }) .subscribe(); - const req = httpTestingController.expectOne('/v2/test'); - expect(req.request.url).toBe('/v2/test'); + const req = httpTestingController.expectOne('/v3/test'); + expect(req.request.url).toBe('/v3/test'); }); }); diff --git a/src/app/services/ios.service.ts b/src/app/services/ios.service.ts index 8880d7f0..cda4105d 100644 --- a/src/app/services/ios.service.ts +++ b/src/app/services/ios.service.ts @@ -14,7 +14,7 @@ export class IosService { } getImagePath(server: Server, filename: string): string { - return `${server.protocol}//${server.host}:${server.port}/v2/compute/dynamips/images/${filename}`; + return `${server.protocol}//${server.host}:${server.port}/v3/compute/dynamips/images/${filename}`; } getTemplates(server: Server): Observable { diff --git a/src/app/services/iou.service.ts b/src/app/services/iou.service.ts index 064555d9..d427cc9d 100644 --- a/src/app/services/iou.service.ts +++ b/src/app/services/iou.service.ts @@ -22,7 +22,7 @@ export class IouService { } getImagePath(server: Server, filename: string): string { - return `${server.protocol}//${server.host}:${server.port}/v2/compute/iou/images/${filename}`; + return `${server.protocol}//${server.host}:${server.port}/v3/compute/iou/images/${filename}`; } addTemplate(server: Server, iouTemplate: any): Observable { diff --git a/src/app/services/link.service.spec.ts b/src/app/services/link.service.spec.ts index 2e6b4310..18ba9c31 100644 --- a/src/app/services/link.service.spec.ts +++ b/src/app/services/link.service.spec.ts @@ -53,7 +53,7 @@ describe('LinkService', () => { service.createLink(server, sourceNode, sourcePort, targetNode, targetPort, 0, 0, 10, 10).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/links'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/links'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({ nodes: [ diff --git a/src/app/services/node.service.spec.ts b/src/app/services/node.service.spec.ts index 856f7847..8815a2dc 100644 --- a/src/app/services/node.service.spec.ts +++ b/src/app/services/node.service.spec.ts @@ -46,7 +46,7 @@ describe('NodeService', () => { service.start(server, node).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/nodes/id/start'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/nodes/id/start'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({}); })); @@ -58,7 +58,7 @@ describe('NodeService', () => { service.stop(server, node).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/nodes/id/stop'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/nodes/id/stop'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({}); })); @@ -70,7 +70,7 @@ describe('NodeService', () => { service.suspend(server, node).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/nodes/id/suspend'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/nodes/id/suspend'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({}); })); @@ -82,7 +82,7 @@ describe('NodeService', () => { service.reload(server, node).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/nodes/id/reload'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/nodes/id/reload'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({}); })); @@ -94,7 +94,7 @@ describe('NodeService', () => { service.startAll(server, project).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/1/nodes/start'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/1/nodes/start'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({}); })); @@ -106,7 +106,7 @@ describe('NodeService', () => { service.stopAll(server, project).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/1/nodes/stop'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/1/nodes/stop'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({}); })); @@ -118,7 +118,7 @@ describe('NodeService', () => { service.suspendAll(server, project).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/1/nodes/suspend'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/1/nodes/suspend'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({}); })); @@ -130,7 +130,7 @@ describe('NodeService', () => { service.reloadAll(server, project).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/1/nodes/reload'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/1/nodes/reload'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({}); })); @@ -143,7 +143,7 @@ describe('NodeService', () => { service.createFromTemplate(server, project, template, 10, 20, 'compute').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/templates/mytemplate'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/templates/mytemplate'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({ x: 10, @@ -162,7 +162,7 @@ describe('NodeService', () => { service.updatePosition(server, project, node, 10, 20).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/nodes/id'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/nodes/id'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual({ x: 10, @@ -180,7 +180,7 @@ describe('NodeService', () => { service.updatePosition(server, project, node, 10.1, 20.6).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/nodes/id'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/nodes/id'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual({ x: 10, @@ -202,7 +202,7 @@ describe('NodeService', () => { service.updateLabel(server, node, label).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/nodes/id'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/nodes/id'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual({ label: { @@ -225,7 +225,7 @@ describe('NodeService', () => { service.update(server, node).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/nodes/id'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/nodes/id'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual({ x: 10, @@ -241,7 +241,7 @@ describe('NodeService', () => { service.delete(server, node).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/nodes/id'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/nodes/id'); expect(req.request.method).toEqual('DELETE'); })); @@ -253,7 +253,7 @@ describe('NodeService', () => { service.duplicate(server, node).subscribe(); const req = httpTestingController.expectOne( - `http://127.0.0.1:3080/v2/projects/${node.project_id}/nodes/${node.node_id}/duplicate` + `http://127.0.0.1:3080/v3/projects/${node.project_id}/nodes/${node.node_id}/duplicate` ); expect(req.request.method).toEqual('POST'); })); diff --git a/src/app/services/nodeConsole.service.ts b/src/app/services/nodeConsole.service.ts index e34f557c..85b3463a 100644 --- a/src/app/services/nodeConsole.service.ts +++ b/src/app/services/nodeConsole.service.ts @@ -63,7 +63,7 @@ export class NodeConsoleService { protocol = "wss" } - return `${protocol}://${server.host}:${server.port}/v2/projects/${node.project_id}/nodes/${node.node_id}/console/ws` + return `${protocol}://${server.host}:${server.port}/v3/projects/${node.project_id}/nodes/${node.node_id}/console/ws` } } diff --git a/src/app/services/notification.service.ts b/src/app/services/notification.service.ts index e99bc78b..9877ffc8 100644 --- a/src/app/services/notification.service.ts +++ b/src/app/services/notification.service.ts @@ -9,7 +9,7 @@ export class NotificationService { protocol = "wss" } - return `${protocol}://${server.host}:${server.port}/v2/notifications/ws`; + return `${protocol}://${server.host}:${server.port}/v3/notifications/ws`; } @@ -19,6 +19,6 @@ export class NotificationService { protocol = "wss" } - return `${protocol}://${server.host}:${server.port}/v2/projects/${project_id}/notifications/ws`; + return `${protocol}://${server.host}:${server.port}/v3/projects/${project_id}/notifications/ws`; } } diff --git a/src/app/services/project.service.spec.ts b/src/app/services/project.service.spec.ts index c8414777..8e8ffa8b 100644 --- a/src/app/services/project.service.spec.ts +++ b/src/app/services/project.service.spec.ts @@ -90,14 +90,14 @@ describe('ProjectService', () => { it('should get the project', () => { service.get(server, 'myproject').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject'); expect(req.request.method).toEqual('GET'); }); it('should open the project', () => { service.open(server, 'myproject').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/open'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/open'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({}); }); @@ -105,7 +105,7 @@ describe('ProjectService', () => { it('should close the project', () => { service.close(server, 'myproject').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/close'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/close'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({}); }); @@ -113,42 +113,42 @@ describe('ProjectService', () => { it('should list projects', () => { service.list(server).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects'); expect(req.request.method).toEqual('GET'); }); it('should get nodes of project', () => { service.nodes(server, 'myproject').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/nodes'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/nodes'); expect(req.request.method).toEqual('GET'); }); it('should get links of project', () => { service.links(server, 'myproject').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/links'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/links'); expect(req.request.method).toEqual('GET'); }); it('should get drawings of project', () => { service.drawings(server, 'myproject').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/drawings'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/drawings'); expect(req.request.method).toEqual('GET'); }); it('should delete the project', () => { service.delete(server, 'myproject').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject'); expect(req.request.method).toEqual('DELETE'); }); it('should duplicate the project', () => { service.duplicate(server, 'projectId', 'projectName').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/projectId/duplicate'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/projectId/duplicate'); expect(req.request.method).toEqual('POST'); }); diff --git a/src/app/services/project.service.ts b/src/app/services/project.service.ts index da15f856..6796f05b 100644 --- a/src/app/services/project.service.ts +++ b/src/app/services/project.service.ts @@ -83,11 +83,11 @@ export class ProjectService { } getUploadPath(server: Server, uuid: string, project_name: string) { - return `${server.protocol}//${server.host}:${server.port}/v2/projects/${uuid}/import?name=${project_name}`; + return `${server.protocol}//${server.host}:${server.port}/v3/projects/${uuid}/import?name=${project_name}`; } getExportPath(server: Server, project: Project) { - return `${server.protocol}//${server.host}:${server.port}/v2/projects/${project.project_id}/export`; + return `${server.protocol}//${server.host}:${server.port}/v3/projects/${project.project_id}/export`; } export(server: Server, project_id: string): Observable { diff --git a/src/app/services/qemu.service.spec.ts b/src/app/services/qemu.service.spec.ts index 5cbd0b60..15885269 100644 --- a/src/app/services/qemu.service.spec.ts +++ b/src/app/services/qemu.service.spec.ts @@ -82,7 +82,7 @@ describe('QemuService', () => { service.saveTemplate(server, template).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates/1'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates/1'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual(template); })); @@ -135,7 +135,7 @@ describe('QemuService', () => { service.addTemplate(server, template).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual(template); })); diff --git a/src/app/services/qemu.service.ts b/src/app/services/qemu.service.ts index 924a944d..064efb9a 100644 --- a/src/app/services/qemu.service.ts +++ b/src/app/services/qemu.service.ts @@ -20,7 +20,7 @@ export class QemuService { } getImagePath(server: Server, filename: string): string { - return `${server.protocol}//${server.host}:${server.port}/v2/compute/qemu/images/${filename}`; + return `${server.protocol}//${server.host}:${server.port}/v3/compute/qemu/images/${filename}`; } getBinaries(server: Server): Observable { diff --git a/src/app/services/snapshot.service.spec.ts b/src/app/services/snapshot.service.spec.ts index a014e499..aa54af09 100644 --- a/src/app/services/snapshot.service.spec.ts +++ b/src/app/services/snapshot.service.spec.ts @@ -40,7 +40,7 @@ describe('SnapshotService', () => { const snapshot = new Snapshot(); service.create(server, 'myproject', snapshot).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/snapshots'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/snapshots'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual(snapshot); })); @@ -48,7 +48,7 @@ describe('SnapshotService', () => { it('should list snapshots', inject([SnapshotService], (service: SnapshotService) => { service.list(server, 'myproject').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/projects/myproject/snapshots'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/projects/myproject/snapshots'); expect(req.request.method).toEqual('GET'); })); }); diff --git a/src/app/services/symbol.service.spec.ts b/src/app/services/symbol.service.spec.ts index 6c62bf9c..2d8fdcf3 100644 --- a/src/app/services/symbol.service.spec.ts +++ b/src/app/services/symbol.service.spec.ts @@ -38,14 +38,14 @@ describe('SymbolService', () => { it('should list symbols', inject([SymbolService], (service: SymbolService) => { service.list(server).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/symbols'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/symbols'); expect(req.request.method).toEqual('GET'); })); it('should get raw symbol', inject([SymbolService], (service: SymbolService) => { service.raw(server, ':my/tested.png').subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/symbols/:my/tested.png/raw'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/symbols/:my/tested.png/raw'); expect(req.request.method).toEqual('GET'); })); diff --git a/src/app/services/template.service.spec.ts b/src/app/services/template.service.spec.ts index 64613ada..27c535c7 100644 --- a/src/app/services/template.service.spec.ts +++ b/src/app/services/template.service.spec.ts @@ -34,7 +34,7 @@ describe('TemplateService', () => { service.list(server).subscribe(() => {}); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates'); - expect(req.request.url).toBe('http://127.0.0.1:3080/v2/templates'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates'); + expect(req.request.url).toBe('http://127.0.0.1:3080/v3/templates'); }); }); diff --git a/src/app/services/version.service.spec.ts b/src/app/services/version.service.spec.ts index c41afa55..e541c367 100644 --- a/src/app/services/version.service.spec.ts +++ b/src/app/services/version.service.spec.ts @@ -47,7 +47,7 @@ describe('VersionService', () => { it('should get version', inject([VersionService], (service: VersionService) => { service.get(server).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/version'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/version'); expect(req.request.method).toEqual('GET'); })); }); diff --git a/src/app/services/virtual-box.service.spec.ts b/src/app/services/virtual-box.service.spec.ts index 9a0bb559..fae3f8b0 100644 --- a/src/app/services/virtual-box.service.spec.ts +++ b/src/app/services/virtual-box.service.spec.ts @@ -63,7 +63,7 @@ describe('VirtualBoxService', () => { service.saveTemplate(server, template).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates/1'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates/1'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual(template); })); @@ -97,7 +97,7 @@ describe('VirtualBoxService', () => { service.addTemplate(server, template).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual(template); })); @@ -105,7 +105,7 @@ describe('VirtualBoxService', () => { it('should get available virtual machines', inject([VirtualBoxService], (service: VirtualBoxService) => { service.getVirtualMachines(server).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/compute/virtualbox/vms'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/compute/virtualbox/vms'); expect(req.request.method).toEqual('GET'); })); }); diff --git a/src/app/services/vmware.service.spec.ts b/src/app/services/vmware.service.spec.ts index d34db839..759c8ae1 100644 --- a/src/app/services/vmware.service.spec.ts +++ b/src/app/services/vmware.service.spec.ts @@ -62,7 +62,7 @@ describe('VmwareService', () => { service.saveTemplate(server, template).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates/1'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates/1'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual(template); })); @@ -95,7 +95,7 @@ describe('VmwareService', () => { service.addTemplate(server, template).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual(template); })); @@ -103,7 +103,7 @@ describe('VmwareService', () => { it('should get available virtual machines', inject([VmwareService], (service: VmwareService) => { service.getVirtualMachines(server).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/compute/vmware/vms'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/compute/vmware/vms'); expect(req.request.method).toEqual('GET'); })); }); diff --git a/src/app/services/vpcs.service.spec.ts b/src/app/services/vpcs.service.spec.ts index 44ded133..c98318bf 100644 --- a/src/app/services/vpcs.service.spec.ts +++ b/src/app/services/vpcs.service.spec.ts @@ -51,7 +51,7 @@ describe('VpcsService', () => { service.saveTemplate(server, template).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates/1'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates/1'); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual(template); })); @@ -73,7 +73,7 @@ describe('VpcsService', () => { service.addTemplate(server, template).subscribe(); - const req = httpTestingController.expectOne('http://127.0.0.1:3080/v2/templates'); + const req = httpTestingController.expectOne('http://127.0.0.1:3080/v3/templates'); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual(template); }));