Merge "Unique field moved to vnf policy"
[optf/osdf.git] / apps / templates / cms_opt_request_1702.jsont
1 {
2   "request_id": "{{ request_id }}",
3   "startdate" : "{{ start_time }}",
4   "enddate" : "{{ end_time }}",
5
6   "change_elements" : [
7 {% set comma = joiner(",") -%}
8 {% for element in all_upgrades -%} {{ comma() }} 
9     { "id" : "{{ element.id }}",
10     {% if element.scheduled -%} "scheduled_on": "{{ element.scheduled }}", {% endif -%}
11     "duration": {{ element.duration }}, {# duration in seconds #}
12     "failback_duration": {{ element.failback_duration }}, {# duration in seconds #}
13     "group_id": {{ element.group_id }}, {# duration in seconds #}
14     }{% endfor -%}
15   ],
16
17   "constraints" : [
18     {
19       "type" : "general_concurrency_limit",
20       "parameters" : [ {{ general_concurrency_limit }} ]
21     },
22
23     {
24       "type" : "allowed_forbidden_periods",
25       "parameters" : [
26 {% set comma = joiner(",") -%}
27 {% for idx in all_pending -%} {{ comma() }}
28         { "id" : "{{ idx.id }}",
29           "allowed_periods": [ {% set comma2 = joiner(",") -%}
30           {% for period in allowed_periods -%} {{ comma2() }} [{{ json.dumps(period[0]) }}, {{ json.dumps(period[1]) }}]
31           {% endfor -%} ] }{% endfor -%}
32       ]
33     }
34
35 {% if p_v_conflict is defined and p_v_conflict|length > 0 %}
36     ,
37     {
38       "type" : "critical_periods",
39       "description" : "Simultaneous upgrades",
40       "parameters" : [
41 {% set comma2 = joiner(",") -%}
42 {% for element in p_v_conflict -%} {{ comma2() }}
43         {
44           "id" : "{{ element[0]  }}",
45           "periods" : [{{ json.dumps(element[0]) }}, {{ json.dumps(element[1]) }}]
46         }
47 {% endfor -%}
48 {% endif %}
49
50 {% for pserver, vce_group in grouped_vces.items() -%} {{ comma() }}
51     ,
52     {
53           "id" : "{{ pserver  }}",
54           "name" : "VCE's on pserver {{ pserver }}",
55           "description": "Only some VCEs on a pserver can be upgraded at a time",
56           "max_num_upgrades" : {{ max_num_upgrades(vce_group) }},
57           "upgrades" : {{ json.dumps(vce_group) }}
58         }
59 {% endfor -%}
60       ]
61     }
62   ]
63 }