aboutsummaryrefslogtreecommitdiffstats
path: root/apps/templates/cms_opt_request.jsont_1707_v1
blob: 75ecbe56e6db869bfbf07112fbaf9cd3d9cdf790 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
  "transaction_id": "{{ transaction_id }}",
  "request_id": "{{ request_id }}",
  "start_date" : "{{ start_time }}",
  "end_date" : "{{ end_time }}",

  "change_elements" : [
  {% set comma = joiner(",") -%}
  {% for element in all_upgrades -%} {{ comma() }}
    {
      "id" : "{{ element.id }}",
      "failback_duration": {{ element.failback_duration }},
      {% if element.group_id -%}
        "group_id": "{{ element.group_id }}",
      {% endif %}
      {% if element.scheduled_on -%}
        "scheduled_on": "{{ element.scheduled_on }}",
      {% endif %}
      "duration": {{ element.duration }}
    }
  {% endfor -%}
  ],

  "constraints" : [
    {
      "type" : "general_concurrency_limit",
      "parameters": [{{ concurrency_limit }}]
    },

    {
      "type" : "allowed_forbidden_periods",
      "parameters" : [
      {% set comma = joiner(",") -%}
      {% for idx in all_pending -%} {{ comma() }}
        { "id" : "{{ idx.id }}",
          "allowed_periods": [ {{ allowed_periods }}]
        }
      {% endfor -%}
      ]
    },
    {
      "type" : "spatial_conflict",
      "parameters": [
      {% set comma = joiner(",") -%}
      {% for pserver, vce_list in vce_pserver_mapping.items() -%} {{ comma() }}
        {
          "spatial_entity": "{{ pserver }}",
          "affected_entities": {{ vce_list }}
        }
      {% endfor -%}
      ]
    },

    {
      "type" : "critical_periods",
      "parameters": [
      {% set comma = joiner(",") -%}
      {% for element, conflict_period in conflict_interval.items() -%} {{ comma() }}
        {
          "id" : "{{ element }}",
          "periods": [{{ conflict_period }}]
        }
      {% endfor -%}
      ]
    }
  ]
}