summaryrefslogtreecommitdiffstats
path: root/applications/guard/src/test/resources/test-policies.yaml
blob: c92006e385896b03c33aff8fc57f46774c3475f3 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
tosca_definitions_version: tosca_simple_yaml_1_1_0
topology_template:
  policies:
    -
      frequency-default:
        type: onap.policies.controlloop.guard.common.FrequencyLimiter
        type_version: 1.0.0
        version: 1.0.0
        description: |
            This is the default APPC Restart frequency limiter policy for all control loops.
        metadata:
          policy-id: frequency-default
          policy-version: 1.0.0
        properties:
          actor: APPC
          operation: Restart
          timeWindow: 10
          timeUnits: minute
          limit: 1
    -
      frequency-loop-1:
        type: onap.policies.controlloop.guard.common.FrequencyLimiter
        type_version: 1.0.0
        version: 1.0.0
        description: |
            This frequency limiter is for APPC Restart on a specific control loop. It allows more restarts.
        metadata:
          policy-id: frequency-loop-1
          policy-version: 1.0.0
        properties:
          actor: APPC
          operation: Restart
          id: loop-1
          timeWindow: 10
          timeUnits: minute
          limit: 3
    -
      frequency-loop-3:
        type: onap.policies.controlloop.guard.common.FrequencyLimiter
        type_version: 1.0.0
        version: 1.0.0
        description: |
            This frequency limiter is for APPC Restart on a specific control loop. It allows
            NO restarts in a time frame.
        metadata:
          policy-id: frequency-loop-3
          policy-version: 1.0.0
        properties:
          actor: APPC
          operation: Restart
          timeRange:
            start_time: 08:00:00Z
            end_time: 23:59:59Z
          id: loop-3
          timeWindow: 8
          timeUnits: hour
          limit: 0
    -
      minmax-default:
        type: onap.policies.controlloop.guard.common.MinMax
        type_version: 1.0.0
        version: 1.0.0
        metadata:
          policy-id : minmax-default
          policy-version: 1.0.0
        properties:
          actor: SO
          operation: VF Module Create
          target: vf-module-id-1
          min: 1
          max: 5
    -
      minmax-vfmodule-loop2:
        type: onap.policies.controlloop.guard.common.MinMax
        type_version: 1.0.0
        version: 1.0.0
        metadata:
          policy-id : minmax-vfmodule-loop2
          policy-version: 1.0.0
        properties:
          actor: SO
          operation: VF Module Create
          id: loop-2
          target: vf-module-id-2
          min: 3
          max: 6
    -
      blacklist-1:
        type: onap.policies.controlloop.guard.common.Blacklist
        type_version: 1.0.0
        version: 1.0.0
        metadata:
          policy-id : blacklist-1
          policy-version: 1.0.0
        properties:
          actor: APPC
          operation: Migrate
          id: loop-5
          blacklist:
              - vnf1
              - vnf2
    -
      filter-1:
        type: onap.policies.controlloop.guard.common.Filter
        type_version: 1.0.0
        version: 1.0.0
        metadata:
          policy-id : filter-1
          policy-version: 1.0.0
        properties:
          actor: APPC
          operation: "*"
          id: loop-1
          algorithm: blacklist-overrides
          filters:
          - field: "generic-vnf.vnf-id"
            function: "string-equal"
            filter: "vf-module-id-2"
            blacklist: true
          - field: "generic-vnf.vnf-name"
            function: "string-equal-ignore-case"
            filter: "vf-MODULE-id-2"
            blacklist: true
          - field: "generic-vnf.vnf-type"
            function: "string-starts-with"
            filter: "vf-module"
            blacklist: true
          - field: "generic-vnf.nf-naming-code"
            function: "string-regexp-match"
            filter: "[0-9][a-zA-Z]+"
            blacklist: true
          - field: "vserver.vserver-id"
            function: "string-contains"
            filter: "myserver"
            blacklist: true
          - field: "cloud-region.cloud-region-id"
            function: "string-ends-with"
            filter: "mycloud"
            blacklist: false
          - field: "cloud-region.cloud-region-id"
            function: "string-greater-than"
            filter: "00"
            blacklist: false
          - field: "cloud-region.cloud-region-id"
            function: "string-greater-than-or-equal"
            filter: "00"
            blacklist: false
          - field: "cloud-region.cloud-region-id"
            function: "string-less-than"
            filter: "99"
            blacklist: false
          - field: "cloud-region.cloud-region-id"
            function: "string-less-than-or-equal"
            filter: "99"
            blacklist: false
    -
      unknown-1:
        type: onap.policies.controlloop.guard.common.Unknown
        type_version: 1.0.0
        version: 1.0.0
        metadata:
          policy-id : unknown-1
          policy-version: 1.0.0
        properties:
          actor: APPC
          operation: Migrate
          id: loop-5
          blacklist:
              - vnf1
              - vnf2