diff options
author | yangyan <yangyanyj@chinamobile.com> | 2019-04-02 18:36:18 +0800 |
---|---|---|
committer | yangyan <yangyanyj@chinamobile.com> | 2019-04-02 18:36:29 +0800 |
commit | 67f2cb6016e7504d67d0d890b1c4369cffba330b (patch) | |
tree | 677926ccb56431f9579c0825cf8ac67bac760cfb | |
parent | 5d77874acf20b5520863721f408f04f03d001a84 (diff) |
add health check to catalog
Change-Id: I8a8b7dfc3a2324d13dc39c2997aed9e89e55cd09
Issue-ID: VFC-1329
Signed-off-by: yangyan <yangyanyj@chinamobile.com>
-rwxr-xr-x | catalog/packages/urls.py | 7 | ||||
-rw-r--r-- | catalog/packages/views/health_check_views.py | 24 |
2 files changed, 30 insertions, 1 deletions
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<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 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 |