71828b09a1fe52d851e989adaf74acd481c99b88
[vfc/gvnfm/vnflcm.git] / lcm / lcm / nf / serializers / _links.py
1 # Copyright 2018 ZTE Corporation.
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 from link import linkSerializer
18
19
20 class _LinksSerializer(serializers.Serializer):
21     href = linkSerializer(
22         help_text="URI of this resource.",
23         required=True,
24         allow_null=False)
25     indicators = linkSerializer(
26         help_text="Indicators related to this VNF instance.",
27         required=False,
28         allow_null=True)
29     instantiate = linkSerializer(
30         help_text="Link to the instantiate task resource.",
31         required=False,
32         allow_null=True)
33     termiante = linkSerializer(
34         help_text="Link to the terminate task resource.",
35         required=False,
36         allow_null=True)
37     scale = linkSerializer(
38         help_text="Link to the scale task resource.",
39         required=False,
40         allow_null=True)
41     scaleToLevel = linkSerializer(
42         help_text="Link to the scale_to_level task resource.",
43         required=False,
44         allow_null=True)
45     changeFlavour = linkSerializer(
46         help_text="Link to the change_flavour task resource.",
47         required=False,
48         allow_null=True)
49     heal = linkSerializer(
50         help_text="Link to the heal task resource.",
51         required=False,
52         allow_null=True)
53     operate = linkSerializer(
54         help_text="Link to the operate task resource.",
55         required=False,
56         allow_null=True)
57     changeExtConn = linkSerializer(
58         help_text="Link to the change_ext_conn task resource.",
59         required=False,
60         allow_null=True)