aboutsummaryrefslogtreecommitdiffstats
path: root/osdf/templates/cms_opt_request_1702.jsont
blob: bcafa45c1497503a8f857386928e679e92ff304e (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
{
  "request_id": "{{ request_id }}",
  "startdate" : "{{ start_time }}",
  "enddate" : "{{ end_time }}",

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

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

    {
      "type" : "allowed_forbidden_periods",
      "parameters" : [
{% set comma = joiner(",") -%}
{% for idx in all_pending -%} {{ comma() }}
        { "id" : "{{ idx.id }}",
          "allowed_periods": [ {% set comma2 = joiner(",") -%}
          {% for period in allowed_periods -%} {{ comma2() }} [{{ json.dumps(period[0]) }}, {{ json.dumps(period[1]) }}]
          {% endfor -%} ] }{% endfor -%}
      ]
    }

{% if p_v_conflict is defined and p_v_conflict|length > 0 %}
    ,
    {
      "type" : "critical_periods",
      "description" : "Simultaneous upgrades",
      "parameters" : [
{% set comma2 = joiner(",") -%}
{% for element in p_v_conflict -%} {{ comma2() }}
        {
          "id" : "{{ element[0]  }}",
          "periods" : [{{ json.dumps(element[0]) }}, {{ json.dumps(element[1]) }}]
        }
{% endfor -%}
{% endif %}

{% for pserver, vce_group in grouped_vces.items() -%} {{ comma() }}
    ,
    {
          "id" : "{{ pserver  }}",
          "name" : "VCE's on pserver {{ pserver }}",
          "description": "Only some VCEs on a pserver can be upgraded at a time",
          "max_num_upgrades" : {{ max_num_upgrades(vce_group) }},
          "upgrades" : {{ json.dumps(vce_group) }}
        }
{% endfor -%}
      ]
    }
  ]
}