add health check to catalog 53/83953/1
authoryangyan <yangyanyj@chinamobile.com>
Tue, 2 Apr 2019 10:36:18 +0000 (18:36 +0800)
committeryangyan <yangyanyj@chinamobile.com>
Tue, 2 Apr 2019 10:36:29 +0000 (18:36 +0800)
Change-Id: I8a8b7dfc3a2324d13dc39c2997aed9e89e55cd09
Issue-ID: VFC-1329
Signed-off-by: yangyan <yangyanyj@chinamobile.com>
catalog/packages/urls.py
catalog/packages/views/health_check_views.py [new file with mode: 0644]

index 16301d3..f653b55 100755 (executable)
 from django.conf.urls import url
 
 from catalog.packages.views import vnf_package_views
-from catalog.packages.views.vnf_package_subscription_views import CreateQuerySubscriptionView, QueryTerminateSubscriptionView
+from catalog.packages.views.vnf_package_subscription_views import CreateQuerySubscriptionView,\
+    QueryTerminateSubscriptionView
 from catalog.packages.views.vnf_package_artifact_views import FetchVnfPkgmArtifactsView
 from catalog.packages.views import catalog_views, ns_descriptor_views, pnf_descriptor_views, nsdm_subscription_views
+from catalog.packages.views.health_check_views import HealthCheckView
 
 
 urlpatterns = [
@@ -65,4 +67,7 @@ urlpatterns = [
     # url(r'^api/vnfpkgm/v1/vnf_packages/(?P<vnfPkgId>[0-9a-zA-Z\-\_]+)/vnfd$', vnfd.as_view(), name='vnfd_r'),# url(r'^api/vnfpkgm/v1/vnf_packages/(?P<vnfPkgId>[0-9a-zA-Z\-\_]+)/artifacts/artifactPath$', artifacts.as_view(), name='artifacts_r'),
 
     # url(r'^api/vnfpkgm/v1/subscriptions/(?P<subscriptionId>[0-9a-zA-Z\-\_]+)$', vnfpkg_subscription.as_view(), name='subscription_rd'),
+
+    # health check
+    url(r'^api/vnfpkgm/v1/healthcheck$', HealthCheckView.as_view()),
 ]
diff --git a/catalog/packages/views/health_check_views.py b/catalog/packages/views/health_check_views.py
new file mode 100644 (file)
index 0000000..9df01f2
--- /dev/null
@@ -0,0 +1,24 @@
+# Copyright (c) 2019, CMCC Technologies Co., Ltd.
+
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+
+# http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# 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.
+
+import logging
+
+from rest_framework.views import APIView
+
+logger = logging.getLogger(__name__)
+
+
+class HealthCheckView(APIView):
+    logger.debug("Health check")
+    pass