Update nf_pm serializer in vnflcm
[vfc/gvnfm/vnflcm.git] / lcm / lcm / nf_pm / serializers / create_pm_job_request.py
1 # Copyright (c) 2019, CMCC Technologies Co., Ltd.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License")
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 from rest_framework import serializers
16
17
18 class PmJobCriteriaSerializer(serializers.Serializer):
19     performanceMetric = serializers.ListField(help_text="This defines the types of performance metrics "
20                                                         "for the specified object instances, as specified "
21                                                         "in an external measurement specification",
22                                               required=False, allow_null=True)
23     performanceMetricGroup = serializers.ListField(help_text="Group of performance metrics",
24                                                    required=False, allow_null=True)
25     collectionPeriod = serializers.CharField(help_text="Specifies the periodicity at which the producer "
26                                                        "will collect performance information",
27                                              required=True, allow_null=False)
28     reportingPeriod = serializers.CharField(help_text="Specifies the periodicity at which the producer "
29                                                       "will report to the consumer",
30                                             required=True, allow_null=False)
31     reportingBoundary = serializers.DateField(help_text="dentifies a time boundary after which the reporting "
32                                                         "will stop.", required=False, allow_null=True)
33
34
35 class CreatePmJobRequestSerializer(serializers.Serializer):
36     objectInstanceIds = serializers.ListField(help_text="Identifiers of the VNF instances for which "
37                                                         "performance information is requested to be "
38                                                         "collected.", required=True, allow_null=False)
39     criteria = PmJobCriteriaSerializer(help_text="Criteria of the collection of performance information",
40                                        required=True, allow_null=False)