a218b8a310b6656cd5f8e5638b6fc04a0d00469b
[optf/osdf.git] / osdf / templates / plc_opt_request.jsont
1 {\r
2   "name": "{{ name }}",\r
3   "files": "{{ files }}",\r
4   "timeout": "{{ timeout }}",\r
5   "num_solution": "{{ limit }}",\r
6   "template": {\r
7     "CUST_ID": "{{ cust_id }}",\r
8     "E2EVPNKEY": "{{ e2evpnkey }}",\r
9     "UCPEHOST": "{{ ucpehost }}",\r
10     "WAN_PORT1_UP": "{{ wan_port1_up }}",\r
11     "WAN_PORT1_DOWN": "{{ wan_port1_down }}",\r
12     "EFFECTIVE_BANDWIDTH": "{{ effective_bandwidth }}",\r
13     "SERVICE_INST": "{{ service_inst }}",\r
14     "locations": {\r
15       "customer_loc": {\r
16         "host_name": "{{ ucpehost }}"\r
17       }\r
18     },\r
19     "demands": [\r
20       {% set comma=joiner(",") %}\r
21       {% for demand in demand_list %} {{ comma() }}\r
22       {\r
23         "{{ demand.vnf_name }}": [\r
24           {% set comma2=joiner(",") %}\r
25           {% for property in demand.property %}\r
26             "inventory_provider": {{ property.inventory_provider }},\r
27             "inventory_type": {{ property.inventory_type }},\r
28             "service_type": {{ property.service_type }},\r
29             "customer_id": {{ property.customer_id }},\r
30             "candidate_id": {{ property.candidate_id }}\r
31           {% endfor %}\r
32         ]\r
33       }\r
34       {% endfor %}\r
35     ],\r
36     "constraints": {\r
37       {% set comma_main=joiner(",") %}\r
38 \r
39       {% if attribute_policy_list %} {{ comma_main() }} {% endif %}\r
40       {% set comma=joiner(",") %}\r
41       {% for attribute in attribute_policy_list %} {{ comma() }}\r
42       attribute['identity'] : {\r
43         "type": {{ attribute['type'] }},\r
44         "demands": {{ attribute['demands'] }},\r
45         "properties": {\r
46           "evaluate": {\r
47             "hypervisor": {{ attribute['property']['hypervisor'] }},\r
48             "aic_version": {{ attribute['property']['aicVersion'] }},\r
49             "aic_type": {{ attribute['property']['aicType'] }},\r
50             "dataplane": {{ attribute['property']['datatype'] }},\r
51             "network_roles": {{ attribute['property']['networkRoles'] }},\r
52             "complex": {{ attribute['property']['complex'] }}\r
53           }\r
54         }\r
55       }\r
56       {% endfor %}\r
57 \r
58       {% if distance_to_location_policy_list %} {{ comma_main() }} {% endif %}\r
59       {% set comma=joiner(",") %}\r
60       {% for distance_location in distance_to_location_policy_list %} {{ comma() }}\r
61       distance_location['identity'] : {\r
62         "type": {{ distance_location['type'] }},\r
63         "demands": {{ distance_location['demands'] }},\r
64         "properties": {\r
65           "distance": {{ distance_location['property']['distance'] }},\r
66           "location": {{ distance_location['property']['location'] }}\r
67         }\r
68       }\r
69       {% endfor %}\r
70 \r
71       {% if inventory_policy_list %} {{ comma_main() }} {% endif %}\r
72       {% set comma=joiner(",") %}\r
73       {% for inventory in inventory_policy_list %} {{ comma() }}\r
74       inventory['identity'] : {\r
75         "type": {{ inventory['type'] }},\r
76         "demands": {{ inventory['demands'] }}\r
77       }\r
78       {% endfor %}\r
79 \r
80       {% if resource_instance_policy_list %} {{ comma_main() }} {% endif %}\r
81       {% set comma=joiner(",") %}\r
82       {% for resource_instance in resource_instance_policy_list %} {{ comma() }}\r
83       resource_instance['identity'] : {\r
84         "type": {{ resource_instance['type'] }},\r
85         "demands": {{ resource_instance['demands'] }},\r
86         "properties": {\r
87           "controller": {{ resource_instance['property']['controller'] }},\r
88           "request": {{ resource_instance['property']['request'] }}\r
89         }\r
90       }\r
91       {% endfor %}\r
92 \r
93       {% if resource_region_policy_list %} {{ comma_main() }} {% endif %}\r
94       {% set comma=joiner(",") %}\r
95       {% for resource_region in resource_region_policy_list %} {{ comma() }}\r
96       resource_region['identity'] : {\r
97         "type": {{ resource_region['type'] }},\r
98         "demands": {{ resource_region['demands'] }},\r
99         "properties": {\r
100           "controller": {{ resource_region['property']['controller'] }},\r
101           "request": {{ resource_region['property']['request'] }}\r
102         }\r
103       }\r
104       {% endfor %}\r
105 \r
106       {% if zone_policy_list %} {{ comma_main() }} {% endif %}\r
107       {% set comma=joiner(",") %}\r
108       {% for zone in zone_policy_list %} {{ comma() }}\r
109       zone['identity'] : {\r
110         "type": {{ zone['type'] }},\r
111         "demands": {{ zone['demands'] }},\r
112         "properties": {\r
113           "qualifier": {{ resource_region['property']['qualifier'] }},\r
114           "category": {{ resource_region['property']['category'] }}\r
115         }\r
116       }\r
117       {% endfor %}\r
118 \r
119       {%  if optmization_policy_list %} {{ comma_main() }} {% endif %}\r
120       {% set comma=joiner(",") %}\r
121       {% for optimization in optimization_policy_list %} {{ comma() }}\r
122       "optimization" : {\r
123         {{ optimization['objective'] }}: {\r
124           "sum": [\r
125             {% set comma2=joiner(",") %}\r
126             {% for parameter in optimization['parameter'] %} {{ comma() }}\r
127             {\r
128               "product": [\r
129                 {{ parameter['weight'] }},\r
130                 {\r
131                   "distance_between": [{{ parameter['customerLocation'] }},{{ parameter['demand'] }}]\r
132                 }\r
133               ]\r
134             }\r
135             {% endfor %}\r
136           ]\r
137         }\r
138       }\r
139       {% endfor %}\r
140     }\r
141   }\r
142 }\r