From: yangyan Date: Tue, 2 Apr 2019 10:36:18 +0000 (+0800) Subject: add health check to catalog X-Git-Tag: 1.3.0~59 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=67f2cb6016e7504d67d0d890b1c4369cffba330b;p=vfc%2Fnfvo%2Fcatalog.git add health check to catalog Change-Id: I8a8b7dfc3a2324d13dc39c2997aed9e89e55cd09 Issue-ID: VFC-1329 Signed-off-by: yangyan --- diff --git a/catalog/packages/urls.py b/catalog/packages/urls.py index 16301d30..f653b555 100755 --- a/catalog/packages/urls.py +++ b/catalog/packages/urls.py @@ -15,9 +15,11 @@ 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[0-9a-zA-Z\-\_]+)/vnfd$', vnfd.as_view(), name='vnfd_r'),# url(r'^api/vnfpkgm/v1/vnf_packages/(?P[0-9a-zA-Z\-\_]+)/artifacts/artifactPath$', artifacts.as_view(), name='artifacts_r'), # url(r'^api/vnfpkgm/v1/subscriptions/(?P[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 index 00000000..9df01f2b --- /dev/null +++ b/catalog/packages/views/health_check_views.py @@ -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