diff options
Diffstat (limited to 'lcm')
-rw-r--r-- | lcm/ns/views/deprecated/create_ns_view.py | 13 | ||||
-rw-r--r-- | lcm/ns/views/deprecated/get_del_ns_view.py | 6 | ||||
-rw-r--r-- | lcm/ns/views/deprecated/heal_ns_view.py | 6 | ||||
-rw-r--r-- | lcm/ns/views/deprecated/inst_ns_view.py | 6 | ||||
-rw-r--r-- | lcm/ns/views/deprecated/scale_ns_views.py | 6 | ||||
-rw-r--r-- | lcm/ns/views/deprecated/term_ns_view.py | 6 | ||||
-rw-r--r-- | lcm/ns/views/deprecated/update_ns_view.py | 6 | ||||
-rw-r--r-- | lcm/ns/views/sol/heal_ns_view.py | 10 | ||||
-rw-r--r-- | lcm/ns/views/sol/instantiate_ns_views.py | 10 | ||||
-rw-r--r-- | lcm/ns/views/sol/lcm_op_occs_view.py | 14 | ||||
-rw-r--r-- | lcm/ns/views/sol/ns_instances_views.py | 32 | ||||
-rw-r--r-- | lcm/ns/views/sol/scale_ns_views.py | 10 | ||||
-rw-r--r-- | lcm/ns/views/sol/subscriptions_view.py | 16 | ||||
-rw-r--r-- | lcm/ns/views/sol/terminate_ns_view.py | 12 | ||||
-rw-r--r-- | lcm/ns/views/sol/update_ns_view.py | 10 |
15 files changed, 159 insertions, 4 deletions
diff --git a/lcm/ns/views/deprecated/create_ns_view.py b/lcm/ns/views/deprecated/create_ns_view.py index 8042515d..dbb6feba 100644 --- a/lcm/ns/views/deprecated/create_ns_view.py +++ b/lcm/ns/views/deprecated/create_ns_view.py @@ -32,6 +32,9 @@ logger = logging.getLogger(__name__) class CreateNSView(APIView): + """ + + """ @swagger_auto_schema( request_body=None, responses={ @@ -41,6 +44,11 @@ class CreateNSView(APIView): ) @view_safe_call_with_log(logger=logger) def get(self, request): + """ + Query multiple NS instances + :param request: + :return: + """ logger.debug("CreateNSView::get") ret = GetNSInfoService().get_ns_info() logger.debug("CreateNSView::get::ret=%s", ret) @@ -59,6 +67,11 @@ class CreateNSView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request): + """ + Create a NS instance resource + :param request: + :return: + """ logger.debug("Enter CreateNS: %s", request.data) req_serializer = _CreateNsReqSerializer(data=request.data) if not req_serializer.is_valid(): diff --git a/lcm/ns/views/deprecated/get_del_ns_view.py b/lcm/ns/views/deprecated/get_del_ns_view.py index 89e780a9..9dba6efc 100644 --- a/lcm/ns/views/deprecated/get_del_ns_view.py +++ b/lcm/ns/views/deprecated/get_del_ns_view.py @@ -38,6 +38,12 @@ class NSDetailView(APIView): ) @view_safe_call_with_log(logger=logger) def get(self, request, ns_instance_id): + """ + Read an individual NS instance resource + :param request: + :param ns_instance_id: + :return: + """ logger.debug("Enter NSDetailView::get ns(%s)", ns_instance_id) ns_filter = {"ns_inst_id": ns_instance_id} ret = GetNSInfoService(ns_filter).get_ns_info() diff --git a/lcm/ns/views/deprecated/heal_ns_view.py b/lcm/ns/views/deprecated/heal_ns_view.py index 7dc5b509..01abe047 100644 --- a/lcm/ns/views/deprecated/heal_ns_view.py +++ b/lcm/ns/views/deprecated/heal_ns_view.py @@ -40,6 +40,12 @@ class NSHealView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request, ns_instance_id): + """ + Heal a NS instance + :param request: + :param ns_instance_id: + :return: + """ logger.debug("Enter HealNSView::post %s, %s", ns_instance_id, request.data) req_serializer = _HealNsReqSerializer(data=request.data) if not req_serializer.is_valid(): diff --git a/lcm/ns/views/deprecated/inst_ns_view.py b/lcm/ns/views/deprecated/inst_ns_view.py index a3ad1904..042ae818 100644 --- a/lcm/ns/views/deprecated/inst_ns_view.py +++ b/lcm/ns/views/deprecated/inst_ns_view.py @@ -38,6 +38,12 @@ class NSInstView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request, ns_instance_id): + """ + Instantiate a NS + :param request: + :param ns_instance_id: + :return: + """ logger.debug("Enter NSInstView::post::ns_instance_id=%s", ns_instance_id) logger.debug("request.data=%s", request.data) req_serializer = _InstantNsReqSerializer(data=request.data) diff --git a/lcm/ns/views/deprecated/scale_ns_views.py b/lcm/ns/views/deprecated/scale_ns_views.py index b60982c7..5430a2a7 100644 --- a/lcm/ns/views/deprecated/scale_ns_views.py +++ b/lcm/ns/views/deprecated/scale_ns_views.py @@ -40,6 +40,12 @@ class NSManualScaleView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request, ns_instance_id): + """ + Scale a NS instance + :param request: + :param ns_instance_id: + :return: + """ logger.debug("Enter NSManualScaleView::post %s, %s", request.data, ns_instance_id) req_serializer = _ManualScaleNsReqSerializer(data=request.data) if not req_serializer.is_valid(): diff --git a/lcm/ns/views/deprecated/term_ns_view.py b/lcm/ns/views/deprecated/term_ns_view.py index 0e3a485f..6c58ce80 100644 --- a/lcm/ns/views/deprecated/term_ns_view.py +++ b/lcm/ns/views/deprecated/term_ns_view.py @@ -42,6 +42,12 @@ class NSTerminateView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request, ns_instance_id): + """ + Terminate a NS instance + :param request: + :param ns_instance_id: + :return: + """ logger.debug("Enter TerminateNSView::post %s", request.data) req_serializer = _TerminateNsReqSerializer(data=request.data) if not req_serializer.is_valid(): diff --git a/lcm/ns/views/deprecated/update_ns_view.py b/lcm/ns/views/deprecated/update_ns_view.py index cd423f87..7d920e75 100644 --- a/lcm/ns/views/deprecated/update_ns_view.py +++ b/lcm/ns/views/deprecated/update_ns_view.py @@ -42,6 +42,12 @@ class NSUpdateView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request, ns_instance_id): + """ + Updates a NS instance + :param request: + :param ns_instance_id: + :return: + """ logger.debug("Enter UpdateNSView::post %s, %s", request.data, ns_instance_id) req_serializer = UpdateNsReqSerializer(data=request.data) if not req_serializer.is_valid(): diff --git a/lcm/ns/views/sol/heal_ns_view.py b/lcm/ns/views/sol/heal_ns_view.py index 721fc5fb..f37d13dd 100644 --- a/lcm/ns/views/sol/heal_ns_view.py +++ b/lcm/ns/views/sol/heal_ns_view.py @@ -30,6 +30,10 @@ logger = logging.getLogger(__name__) class HealNSView(APIView): + """ + This task resource represents the "Heal NS" operation. + The client can use this resource to request healing a NS instance. + """ @swagger_auto_schema( request_body=HealNsReqSerializer(), responses={ @@ -39,6 +43,12 @@ class HealNSView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request, ns_instance_id): + """ + The POST method requests to heal a NS instance resource. + :param request: + :param ns_instance_id: + :return: + """ logger.debug("Enter HealNSView::post nsInstanceId:%s, request.data:%s" % (ns_instance_id, request.data)) req_serializer = HealNsReqSerializer(data=request.data) if not req_serializer.is_valid(): diff --git a/lcm/ns/views/sol/instantiate_ns_views.py b/lcm/ns/views/sol/instantiate_ns_views.py index 08066be1..c3c37510 100644 --- a/lcm/ns/views/sol/instantiate_ns_views.py +++ b/lcm/ns/views/sol/instantiate_ns_views.py @@ -29,6 +29,10 @@ logger = logging.getLogger(__name__) class InstantiateNsView(APIView): + """ + This task resource represents the "Instantiate NS" operation. The client can use this resource to instantiate a NS + instance. + """ @swagger_auto_schema( request_body=InstantNsReqSerializer(), responses={ @@ -38,6 +42,12 @@ class InstantiateNsView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request, ns_instance_id): + """ + The POST method requests to instantiate a NS instance resource. + :param request: + :param ns_instance_id: + :return: + """ logger.debug("Enter InstantiateNsView::post::ns_instance_id=%s", ns_instance_id) logger.debug("request.data=%s", request.data) diff --git a/lcm/ns/views/sol/lcm_op_occs_view.py b/lcm/ns/views/sol/lcm_op_occs_view.py index 09625333..88d0470d 100644 --- a/lcm/ns/views/sol/lcm_op_occs_view.py +++ b/lcm/ns/views/sol/lcm_op_occs_view.py @@ -68,7 +68,8 @@ class QueryMultiNsLcmOpOccs(APIView): logger.debug("QueryMultiNsLcmOpOccs--get::> %s" % request.query_params) if request.query_params and not set(request.query_params).issubset(set(VALID_FILTERS)): - problem_details_serializer = get_problem_details_serializer(status.HTTP_400_BAD_REQUEST, "Not a valid filter") + problem_details_serializer = get_problem_details_serializer(status.HTTP_400_BAD_REQUEST, + "Not a valid filter") return Response(data=problem_details_serializer.data, status=status.HTTP_400_BAD_REQUEST) resp_data = QueryNsLcmOpOcc(request.query_params).query_multi_ns_lcm_op_occ() if len(resp_data) == 0: @@ -87,6 +88,11 @@ class QueryMultiNsLcmOpOccs(APIView): class QuerySingleNsLcmOpOcc(APIView): + """ + This resource represents NS lifecycle management operation occurrences. + The client can use this resource to query status information about multiple NS lifecycle management operation occurrences. + """ + @swagger_auto_schema( responses={ status.HTTP_200_OK: NSLCMOpOccSerializer(), @@ -95,6 +101,12 @@ class QuerySingleNsLcmOpOcc(APIView): ) @view_safe_call_with_log(logger=logger) def get(self, request, lcmopoccid): + """ + The client can use this method to query status information about multiple NS lifecycle management operation occurrences. + :param request: + :param lcmopoccid: + :return: + """ logger.debug("QuerySingleNsLcmOpOcc--get::> %s" % request.query_params) resp_data = QueryNsLcmOpOcc(request.query_params, diff --git a/lcm/ns/views/sol/ns_instances_views.py b/lcm/ns/views/sol/ns_instances_views.py index e03aee00..2acc0b3b 100644 --- a/lcm/ns/views/sol/ns_instances_views.py +++ b/lcm/ns/views/sol/ns_instances_views.py @@ -33,6 +33,10 @@ logger = logging.getLogger(__name__) class NSInstancesView(APIView): + """ + This resource represents NS instances. + """ + @swagger_auto_schema( request_body=None, responses={ @@ -42,6 +46,11 @@ class NSInstancesView(APIView): ) @view_safe_call_with_log(logger=logger) def get(self, request): + """ + Query multiple NS instances + :param request: + :return: + """ logger.debug(request.query_params) logger.debug("CreateNSView::get") @@ -61,6 +70,11 @@ class NSInstancesView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request): + """ + Create a NS instance resource + :param request: + :return: + """ logger.debug("Enter NSInstancesView::POST ns_instances: Header:%s, Body: %s" % (request.META, request.data)) globalCustomerId = request.META.get("HTTP_GLOBALCUSTOMERID", None) @@ -95,6 +109,10 @@ class NSInstancesView(APIView): class IndividualNsInstanceView(APIView): + """ + This resource represents an individual NS instance. + """ + @swagger_auto_schema( request_body=None, responses={ @@ -104,7 +122,12 @@ class IndividualNsInstanceView(APIView): ) @view_safe_call_with_log(logger=logger) def get(self, request, ns_instance_id): - + """ + The GET method retrieves information about a NS instance by reading an individual NS instance resource. + :param request: + :param ns_instance_id: + :return: + """ logger.debug("Enter NSDetailView::get ns(%s)", ns_instance_id) ns_filter = {"ns_inst_id": ns_instance_id} ret = GetNSInfoService(ns_filter).get_ns_info(is_sol=True) @@ -125,7 +148,12 @@ class IndividualNsInstanceView(APIView): ) @view_safe_call_with_log(logger=logger) def delete(self, request, ns_instance_id): - + """ + This method deletes an individual NS instance resource. + :param request: + :param ns_instance_id: + :return: + """ logger.debug("Enter NSDetailView::delete ns(%s)", ns_instance_id) DeleteNsService(ns_instance_id).do_biz() return Response(data={}, status=status.HTTP_204_NO_CONTENT) diff --git a/lcm/ns/views/sol/scale_ns_views.py b/lcm/ns/views/sol/scale_ns_views.py index 9968314b..9825dcb6 100644 --- a/lcm/ns/views/sol/scale_ns_views.py +++ b/lcm/ns/views/sol/scale_ns_views.py @@ -30,6 +30,10 @@ logger = logging.getLogger(__name__) class ScaleNSView(APIView): + """ + This task resource represents the "Scale NS" operation. + The client can use this resource to request to scale a NS instance. + """ @swagger_auto_schema( request_body=ScaleNsRequestSerializer(help_text="NS Scale"), responses={ @@ -39,6 +43,12 @@ class ScaleNSView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request, ns_instance_id): + """ + The POST method requests to scale a NS instance resource. + :param request: + :param ns_instance_id: + :return: + """ logger.debug("Enter ScaleNSView::post %s, %s", request.data, ns_instance_id) req_serializer = ScaleNsRequestSerializer(data=request.data) diff --git a/lcm/ns/views/sol/subscriptions_view.py b/lcm/ns/views/sol/subscriptions_view.py index b60f128c..426b4635 100644 --- a/lcm/ns/views/sol/subscriptions_view.py +++ b/lcm/ns/views/sol/subscriptions_view.py @@ -54,7 +54,10 @@ def get_problem_details_serializer(status_code, error_message): class SubscriptionsView(APIView): - + """ + This resource represents subscriptions. + The client can use this resource to subscribe to notifications related to NS lifecycle management, and to query its subscriptions. + """ @swagger_auto_schema( request_body=LccnSubscriptionRequestSerializer(), responses={ @@ -65,6 +68,11 @@ class SubscriptionsView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request): + """ + The POST method creates a new subscription. + :param request: + :return: + """ logger.debug("SubscribeNotification--post::> %s" % request.data) lccn_subscription_request_serializer = LccnSubscriptionRequestSerializer( @@ -106,6 +114,12 @@ class SubscriptionsView(APIView): ) @view_safe_call_with_log(logger=logger) def get(self, request): + """ + The GET method queries the list of active subscriptions of the functional block that invokes the method. + It can be used e.g. for resynchronization after error situations. + :param request: + :return: + """ logger.debug("SubscribeNotification--get::> %s" % request.query_params) if request.query_params and not set(request.query_params).issubset(set(VALID_FILTERS)): diff --git a/lcm/ns/views/sol/terminate_ns_view.py b/lcm/ns/views/sol/terminate_ns_view.py index 0983b460..31b63ada 100644 --- a/lcm/ns/views/sol/terminate_ns_view.py +++ b/lcm/ns/views/sol/terminate_ns_view.py @@ -32,6 +32,10 @@ logger = logging.getLogger(__name__) class TerminateNsView(APIView): + """ + This task resource represents the "Terminate NS" operation. + The client can use this resource to terminate a NS instance. + """ @swagger_auto_schema( request_body=TerminateNsReqSerializer(), @@ -42,6 +46,14 @@ class TerminateNsView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request, ns_instance_id): + """ + The POST method terminates a NS instance. + This method can only be used with a NS instance in the INSTANTIATEDstate. + Terminating a NS instance does not delete the NS instance identifier, but rather transitions the NS into the NOT_INSTANTIATED state. + :param request: + :param ns_instance_id: + :return: + """ job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.TERMINATE, ns_instance_id) logger.debug("Enter TerminateNSView::post %s", request.data) diff --git a/lcm/ns/views/sol/update_ns_view.py b/lcm/ns/views/sol/update_ns_view.py index db6d6072..26d3136a 100644 --- a/lcm/ns/views/sol/update_ns_view.py +++ b/lcm/ns/views/sol/update_ns_view.py @@ -32,6 +32,10 @@ logger = logging.getLogger(__name__) class UpdateNSView(APIView): + """ + This task resource represents the "Update NS" operation. + The client can use this resource to update a NS instance. + """ @swagger_auto_schema( request_body=UpdateNsReqSerializer(), responses={ @@ -41,6 +45,12 @@ class UpdateNSView(APIView): ) @view_safe_call_with_log(logger=logger) def post(self, request, ns_instance_id): + """ + The POST method requests to update a NS instance resource. + :param request: + :param ns_instance_id: + :return: + """ job_id = JobUtil.create_job(JOB_TYPE.NS, JOB_ACTION.UPDATE, ns_instance_id) logger.debug("Enter UpdateNSView::post %s, %s", request.data, ns_instance_id) |