diff options
-rw-r--r-- | zte/vmanager/.gitignore | 4 | ||||
-rw-r--r-- | zte/vmanager/driver/interfaces/tests.py | 14 | ||||
-rw-r--r-- | zte/vmanager/driver/interfaces/urls.py | 14 | ||||
-rw-r--r-- | zte/vmanager/driver/interfaces/views.py | 16 | ||||
-rw-r--r-- | zte/vmanager/driver/pub/config/config.py | 4 | ||||
-rw-r--r-- | zte/vmanager/driver/swagger/swagger.json | 2 | ||||
-rw-r--r-- | zte/vmanager/driver/swagger/tests.py | 2 | ||||
-rw-r--r-- | zte/vmanager/driver/swagger/urls.py | 2 |
8 files changed, 31 insertions, 27 deletions
diff --git a/zte/vmanager/.gitignore b/zte/vmanager/.gitignore new file mode 100644 index 00000000..894eb54d --- /dev/null +++ b/zte/vmanager/.gitignore @@ -0,0 +1,4 @@ +.idea +logs/*.log +*.pyc +bash.exe.stackdump diff --git a/zte/vmanager/driver/interfaces/tests.py b/zte/vmanager/driver/interfaces/tests.py index 0fc179fd..fe4ecbdb 100644 --- a/zte/vmanager/driver/interfaces/tests.py +++ b/zte/vmanager/driver/interfaces/tests.py @@ -122,7 +122,7 @@ class InterfacesTest(TestCase): 'externalDataNetworkName': 'Flow_out_net', 'inputs':{}}} - response = self.client.post("/openoapi/ztevnfm/v1/ztevnfmid/vnfs", + response = self.client.post("/api/ztevnfm/v1/ztevnfmid/vnfs", data=json.dumps(req_data), content_type="application/json") self.assertEqual(str(status.HTTP_200_OK), response.status_code) expect_resp_data = {"jobid": "NF-CREATE-8-b384535c-9f45-11e6-8749-fa163e91c2f9", "vnfInstanceId": "8"} @@ -150,7 +150,7 @@ class InterfacesTest(TestCase): r2 = [0, json.JSONEncoder().encode({"vnfInstanceId": "1", "JobId": "1"}), "200"] mock_call_req.side_effect = [r1, r2] - response = self.client.post("/openoapi/ztevnfm/v1/ztevnfmid/vnfs/vbras_innstance_id/terminate") + response = self.client.post("/api/ztevnfm/v1/ztevnfmid/vnfs/vbras_innstance_id/terminate") self.assertEqual(str(status.HTTP_200_OK), response.status_code) expect_resp_data = {"jobid": "1", "vnfInstanceId": "1"} @@ -178,7 +178,7 @@ class InterfacesTest(TestCase): r2 = [0, json.JSONEncoder().encode({"vnfinstancestatus": "1"}), "200"] mock_call_req.side_effect = [r1, r2] - response = self.client.get("/openoapi/ztevnfm/v1/ztevnfmid/vnfs/vbras_innstance_id") + response = self.client.get("/api/ztevnfm/v1/ztevnfmid/vnfs/vbras_innstance_id") self.assertEqual(str(status.HTTP_200_OK), response.status_code) @@ -217,7 +217,7 @@ class InterfacesTest(TestCase): r1 = [0, json.JSONEncoder().encode(vnfm_info), '200'] r2 = [0, json.JSONEncoder().encode(resp_body), '200'] mock_call_req.side_effect = [r1, r2] - response = self.client.get("/openoapi/ztevmanagerdriver/v1/{vnfmid}/jobs/{jobid}?responseId={responseId}". + response = self.client.get("/api/ztevmanagerdriver/v1/{vnfmid}/jobs/{jobid}?responseId={responseId}". format( vnfmid=vnfm_info["vnfmId"], jobid=resp_body["jobid"], @@ -256,7 +256,7 @@ class InterfacesTest(TestCase): ]} mock_call_req.return_value = ret - response = self.client.put("/openoapi/ztevmanagerdriver/v1/resource/grant", + response = self.client.put("/api/ztevmanagerdriver/v1/resource/grant", data=json.dumps(req_data), content_type='application/json') self.assertEqual(str(status.HTTP_201_CREATED), response.status_code) @@ -335,7 +335,7 @@ class InterfacesTest(TestCase): "vmnumber": "3", "vmidlist ": ["vmuuid"]}]} mock_call_req.side_effect = [r1, r2] - response = self.client.post("/openoapi/ztevmanagerdriver/v1/vnfs/lifecyclechangesnotification", + response = self.client.post("/api/ztevmanagerdriver/v1/vnfs/lifecyclechangesnotification", data=json.dumps(req_data), content_type='application/json') self.assertEqual(str(status.HTTP_200_OK), response.status_code) @@ -415,7 +415,7 @@ class InterfacesTest(TestCase): } - response = self.client.post("/openoapi/ztevnfm/v1/vnfmid/vnfs/101/scale", + response = self.client.post("/api/ztevnfm/v1/vnfmid/vnfs/101/scale", data=json.dumps(scale_vnf_data), content_type='application/json') self.assertEqual(str(status.HTTP_202_ACCEPTED), response.status_code) diff --git a/zte/vmanager/driver/interfaces/urls.py b/zte/vmanager/driver/interfaces/urls.py index 43eb40a3..e3f55bb9 100644 --- a/zte/vmanager/driver/interfaces/urls.py +++ b/zte/vmanager/driver/interfaces/urls.py @@ -17,20 +17,20 @@ from django.conf.urls import url from driver.interfaces import views urlpatterns = [ - url(r'^openoapi/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/(?P<vnfmid>[0-9a-zA-Z\-\_]+)/vnfs$', views.instantiate_vnf, + url(r'^api/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/(?P<vnfmid>[0-9a-zA-Z\-\_]+)/vnfs$', views.instantiate_vnf, name='instantiate_vnf'), url( - r'^openoapi/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/(?P<vnfmid>[0-9a-zA-Z\-\_]+)/vnfs/(?P<vnfInstanceId>' + r'^api/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/(?P<vnfmid>[0-9a-zA-Z\-\_]+)/vnfs/(?P<vnfInstanceId>' r'[0-9a-zA-Z\-\_]+)/terminate$', views.terminate_vnf, name='terminate_vnf'), url( - r'^openoapi/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/(?P<vnfmid>[0-9a-zA-Z\-\_]+)/vnfs/(?P<vnfInstanceId>' + r'^api/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/(?P<vnfmid>[0-9a-zA-Z\-\_]+)/vnfs/(?P<vnfInstanceId>' r'[0-9a-zA-Z\-\_]+)$', views.query_vnf, name='query_vnf'), - url(r'^openoapi/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/(?P<vnfmid>[0-9a-zA-Z\-\_]+)/jobs/(?P<jobid>[0-9a-zA-Z\-\_]+)$', + url(r'^api/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/(?P<vnfmid>[0-9a-zA-Z\-\_]+)/jobs/(?P<jobid>[0-9a-zA-Z\-\_]+)$', views.operation_status, name='operation_status'), - url(r'^openoapi/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/resource/grant$', views.grantvnf, name='grantvnf'), - url(r'^openoapi/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/vnfs/lifecyclechangesnotification$', views.notify, name='notify'), - url(r'^openoapi/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/(?P<vnfmid>[0-9a-zA-Z\-\_]+)/vnfs/(?P<nfInstanceId>[0-9a-zA-Z\-\_]+)/scale$', + url(r'^api/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/resource/grant$', views.grantvnf, name='grantvnf'), + url(r'^api/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/vnfs/lifecyclechangesnotification$', views.notify, name='notify'), + url(r'^api/(?P<vnfmtype>[0-9a-zA-Z\-\_]+)/v1/(?P<vnfmid>[0-9a-zA-Z\-\_]+)/vnfs/(?P<nfInstanceId>[0-9a-zA-Z\-\_]+)/scale$', views.scale, name='scale'), url(r'^samples/$', views.samples, name='samples'), ] diff --git a/zte/vmanager/driver/interfaces/views.py b/zte/vmanager/driver/interfaces/views.py index af316f01..7b445255 100644 --- a/zte/vmanager/driver/interfaces/views.py +++ b/zte/vmanager/driver/interfaces/views.py @@ -51,24 +51,24 @@ def mapping_conv(keyword_map, rest_return): return resp_data -query_vnfd_url = "openoapi/nslcm/v1/vnfpackage/%s" -query_vnfm_url = "openoapi/extsys/v1/vnfms/%s" -query_package_url = "openoapi/nslcm/v1/vnfpackage/%s" +query_vnfd_url = "api/nslcm/v1/vnfpackage/%s" +query_vnfm_url = "api/extsys/v1/vnfms/%s" +query_package_url = "api/nslcm/v1/vnfpackage/%s" # Query VNFM by VNFMID def vnfm_get(vnfmid): - ret = req_by_msb("openoapi/extsys/v1/vnfms/%s" % vnfmid, "GET") + ret = req_by_msb("api/extsys/v1/vnfms/%s" % vnfmid, "GET") return ret def vnfd_get(vnfpackageid): - ret = req_by_msb("openoapi/nslcm/v1/vnfpackage/%s" % vnfpackageid, "GET") + ret = req_by_msb("api/nslcm/v1/vnfpackage/%s" % vnfpackageid, "GET") return ret def vnfpackage_get(csarid): - ret = req_by_msb("openoapi/nslcm/v1/vnfpackage/%s" % csarid, "GET") + ret = req_by_msb("api/nslcm/v1/vnfpackage/%s" % csarid, "GET") return ret @@ -297,7 +297,7 @@ def operation_status(request, *args, **kwargs): # Grant VNF Lifecycle Operation -grant_vnf_url = 'openoapi/nslcm/v1/ns/grantvnf' +grant_vnf_url = 'api/nslcm/v1/ns/grantvnf' grant_vnf_param_map = { "VNFMID": "", "NFVOID": "", @@ -357,7 +357,7 @@ def grantvnf(request, *args, **kwargs): # Notify LCM Events -notify_url = 'openoapi/nslcm/v1/ns/{vnfmid}/vnfs/{vnfInstanceId}/Notify' +notify_url = 'api/nslcm/v1/ns/{vnfmid}/vnfs/{vnfInstanceId}/Notify' notify_param_map = { "NFVOID": "", "VNFMID": "VNFMID", diff --git a/zte/vmanager/driver/pub/config/config.py b/zte/vmanager/driver/pub/config/config.py index 130fc346..346aaaf3 100644 --- a/zte/vmanager/driver/pub/config/config.py +++ b/zte/vmanager/driver/pub/config/config.py @@ -18,11 +18,11 @@ MSB_SERVICE_PORT = '80' # [register] REG_TO_MSB_WHEN_START = True -REG_TO_MSB_REG_URL = "/openoapi/microservices/v1/services" +REG_TO_MSB_REG_URL = "/api/microservices/v1/services" REG_TO_MSB_REG_PARAM = { "serviceName": "ztevmanagerdriver", "version": "v1", - "url": "/openoapi/ztevmanagerdriver/v1", + "url": "/api/ztevmanagerdriver/v1", "protocol": "REST", "visualRange": "1", "nodes": [{ diff --git a/zte/vmanager/driver/swagger/swagger.json b/zte/vmanager/driver/swagger/swagger.json index c15aa313..96d1399f 100644 --- a/zte/vmanager/driver/swagger/swagger.json +++ b/zte/vmanager/driver/swagger/swagger.json @@ -4,7 +4,7 @@ "version": "1.0.0", "title": "ZTE VNFM Driver Service rest API" }, - "basePath": "/openoapi/{vnfmtype}/v1", + "basePath": "/api/{vnfmtype}/v1", "tags": [ { "name": "ztevmanagerdriver" diff --git a/zte/vmanager/driver/swagger/tests.py b/zte/vmanager/driver/swagger/tests.py index 2bc8f8c0..20fe9805 100644 --- a/zte/vmanager/driver/swagger/tests.py +++ b/zte/vmanager/driver/swagger/tests.py @@ -26,6 +26,6 @@ class SwaggerViewTest(unittest.TestCase): pass def test_sample(self): - response = self.client.get("/openoapi/ztevmanagerdriver/v1/swagger.json") + response = self.client.get("/api/ztevmanagerdriver/v1/swagger.json") self.assertEqual(status.HTTP_200_OK, response.status_code, response.content) diff --git a/zte/vmanager/driver/swagger/urls.py b/zte/vmanager/driver/swagger/urls.py index 48378707..8e4a2e1d 100644 --- a/zte/vmanager/driver/swagger/urls.py +++ b/zte/vmanager/driver/swagger/urls.py @@ -16,5 +16,5 @@ from django.conf.urls import url from driver.swagger import views urlpatterns = [ - url(r'^openoapi/ztevmanagerdriver/v1/swagger.json$', views.SwaggerView.as_view()), + url(r'^api/ztevmanagerdriver/v1/swagger.json$', views.SwaggerView.as_view()), ] |