More examples of optimization policies and cleanup
[policy/xacml-pdp.git] / applications / optimization / src / test / resources / vCPE.policies.optimization.input.tosca.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0_0
2 topology_template:
3   policies:
4     -
5         OSDF_CASABLANCA.Affinity_Default:
6             type: onap.policies.optimization.AffinityPolicy
7             version: 1.0.0
8             type_version: 1.0.0
9             metadata:
10                 policy-id: OSDF_CASABLANCA.Affinity_Default
11                 policy-version: 1
12             properties:
13                 scope: []
14                 services: []
15                 resources: []
16                 geography: []
17                 identity: affinity_vCPE
18                 applicableResources: any
19                 affinityProperties:
20                     qualifier: same
21                     category: complex
22     -
23         OSDF_CASABLANCA.Affinity_Default_US:
24             type: onap.policies.optimization.AffinityPolicy
25             version: 1.0.0
26             type_version: 1.0.0
27             metadata:
28                 policy-id: OSDF_CASABLANCA.Affinity_Default_US
29                 policy-version: 1
30             properties:
31                 scope: []
32                 services: []
33                 resources: []
34                 geography: [US]
35                 identity: affinity_vCPE
36                 applicableResources: any
37                 affinityProperties:
38                     qualifier: same
39                     category: complex
40     -
41         OSDF_CASABLANCA.Affinity_Default_vCPE_US_0:
42             type: onap.policies.optimization.AffinityPolicy
43             version: 1.0.0
44             type_version: 1.0.0
45             metadata:
46                 policy-id: OSDF_CASABLANCA.Affinity_Default_vCPE_US_0
47                 policy-version: 1
48             properties:
49                 scope: []
50                 services: [vCPE]
51                 resources: []
52                 geography: [US]
53                 identity: affinity_vCPE
54                 applicableResources: any
55                 affinityProperties:
56                     qualifier: different
57                     category: complex
58     -
59         OSDF_CASABLANCA.Affinity_vCPE_US_Gold_1:
60             type: onap.policies.optimization.AffinityPolicy
61             version: 1.0.0
62             type_version: 1.0.0
63             metadata:
64                 policy-id: OSDF_CASABLANCA.Affinity_vCPE_1
65                 policy-version: 1
66             properties:
67                 scope: [gold]
68                 services: [vCPE]
69                 resources: [vGMuxInfra, vG]
70                 geography: [US, INTERNATIONAL]
71                 identity: affinity_vCPE
72                 applicableResources: any
73                 affinityProperties:
74                     qualifier: same
75                     category: availabilityZone
76     -
77         OSDF_CASABLANCA.Affinity_vCPE_US_Platinum_1:
78             type: onap.policies.optimization.AffinityPolicy
79             version: 1.0.0
80             type_version: 1.0.0
81             metadata:
82                 policy-id: OSDF_CASABLANCA.Affinity_vCPE_1
83                 policy-version: 1
84             properties:
85                 scope: [platinum]
86                 services: [vCPE]
87                 resources: [vGMuxInfra, vG]
88                 geography: [US, INTERNATIONAL]
89                 identity: affinity_vCPE
90                 applicableResources: any
91                 affinityProperties:
92                     qualifier: different
93                     category: availabilityZone
94     -
95         OSDF_CASABLANCA.Capacity_vG_1:
96             type: onap.policies.optimization.Vim_fit
97             version: 1.0.0
98             type_version: 1.0.0
99             metadata:
100                 policy-id: OSDF_CASABLANCA.Capacity_vG_1
101                 policy-version: 1
102             properties:
103                 scope: []
104                 services: [vCPE]
105                 resources: [vG]
106                 geography: [US, INTERNATIONAL]
107                 identity: capacity_vG
108                 applicableResources: any
109                 capacityProperty:
110                    controller: multicloud
111                    request: "{\"vCPU\": 10, \"Memory\": {\"quantity\": {\"get_param\": \"REQUIRED_MEM\"}, \"unit\": \"GB\"}, \"Storage\": {\"quantity\": {\"get_param\": \"REQUIRED_DISK\"}, \"unit\": \"GB\"}}"
112     -
113         OSDF_CASABLANCA.Capacity_vG_2:
114             type: onap.policies.optimization.Vim_fit
115             version: 1.0.0
116             type_version: 1.0.0
117             metadata:
118                 policy-id: OSDF_CASABLANCA.Capacity_vG_2
119                 policy-version: 1
120             properties:
121                 scope: []
122                 services: [vCPE]
123                 resources: [vG]
124                 geography: [US, INTERNATIONAL]
125                 identity: capacity_vG
126                 applicableResources: any
127                 capacityProperty:
128                    controller: multicloud
129                    request: "{\"vCPU\": 15, \"Memory\": {\"quantity\": {\"get_param\": \"REQUIRED_MEM\"}, \"unit\": \"MB\"}, \"Storage\": {\"quantity\": {\"get_param\": \"REQUIRED_DISK\"}, \"unit\": \"GB\"}}"
130     -
131         OSDF_CASABLANCA.Distance_vG_1:
132             type: onap.policies.optimization.DistancePolicy
133             version: 1.0.0
134             type_version: 1.0.0
135             metadata:
136                 policy-id: OSDF_CASABLANCA.Distance_vG_1
137                 policy-version: 1
138             properties:
139                 scope: [platinum]
140                 services: [vCPE]
141                 resources: [vG]
142                 geography: [US, INTERNATIONAL]
143                 identity: distance-vG
144                 applicableResources: any
145                 distanceProperties:
146                     locationInfo: customer_loc
147                     distance:
148                         value: 1500
149                         operator: "<"
150                         unit: km
151     -
152         OSDF_CASABLANCA.hpa_policy_Default:
153             type: onap.policies.optimization.HpaPolicy
154             version: 1.0.0
155             type_version: 1.0.0
156             metadata:
157                 policy-id: OSDF_CASABLANCA.hpa_policy_Default
158                 policy-version: 1
159             properties:
160                 scope: []
161                 services: []
162                 resources: []
163                 geography: []
164                 identity: hpa-vG
165                 flavorFeatures:
166                     -
167                          id: vg_1
168                          type: vnfc
169                          directives:
170                              -    type: flavor_directives
171                                   attributes:
172                                       -    attribute_name: flavor_label_vm_01
173                                            attribute_value: ""
174                          flavorProperties:
175                              -
176                                   hpa-feature: basicCapabilities
177                                   mandatory: True
178                                   architecture: generic
179                                   directives: []
180                                   hpa-feature-attributes:
181                                       -    hpa-attribute-key: numVirtualCpu
182                                            hpa-attribute-value: 8
183                                            operator: ['>=']
184                                            unit: ""
185                                       -    hpa-attribute-key: virtualMemSize
186                                            hpa-attribute-value: 6
187                                            operator: ['<=']
188                                            unit: ""
189                              -
190                                   hpa-feature: ovsDpdk
191                                   mandatory: False
192                                   architecture: generic
193                                   directives: []
194                                   hpa-feature-attributes:
195                                       -    hpa-attribute-key: dataProcessingAccelerationLibrary
196                                            hpa-attribute-value: ovsDpdk_version
197                                            operator: [=]
198                                            unit: ""
199     -
200         OSDF_CASABLANCA.hpa_policy_vG_1:
201             type: onap.policies.optimization.HpaPolicy
202             version: 1.0.0
203             type_version: 1.0.0
204             metadata:
205                 policy-id: OSDF_CASABLANCA.hpa_policy_vG_1
206                 policy-version: 1
207             properties:
208                 scope: []
209                 services: [vCPE, vOtherService]
210                 resources: [vG]
211                 geography: []
212                 identity: hpa-vG
213                 flavorFeatures:
214                     -
215                          id: vg_1
216                          type: vnfc
217                          directives:
218                              -    type: flavor_directives
219                                   attributes:
220                                       -    attribute_name: flavor_label_vm_01
221                                            attribute_value: ""
222                          flavorProperties:
223                              -
224                                   hpa-feature: basicCapabilities
225                                   mandatory: True
226                                   architecture: generic
227                                   directives: []
228                                   hpa-feature-attributes:
229                                       -    hpa-attribute-key: numVirtualCpu
230                                            hpa-attribute-value: 6
231                                            operator: ['>=']
232                                            unit: ""
233                                       -    hpa-attribute-key: virtualMemSize
234                                            hpa-attribute-value: 4
235                                            operator: ['<=']
236                                            unit: ""
237                              -
238                                   hpa-feature: ovsDpdk
239                                   mandatory: False
240                                   architecture: generic
241                                   directives: []
242                                   hpa-feature-attributes:
243                                       -    hpa-attribute-key: dataProcessingAccelerationLibrary
244                                            hpa-attribute-value: ovsDpdk_version
245                                            operator: [=]
246                                            unit: ""
247     -
248         OSDF_CASABLANCA.queryPolicy_vCPE:
249             type: onap.policies.optimization.QueryPolicy
250             version: 1.0.0
251             type_version: 1.0.0
252             metadata:
253                 policy-id: OSDF_CASABLANCA.queryPolicy_vCPE
254                 policy-version: 1
255             properties:
256                 scope: []
257                 services: [vCPE]
258                 resources: [vGMuxInfra, vG]
259                 geography: [US, INTERNATIONAL]
260                 identity: vCPE_Query_Policy
261                 queryProperties:
262                     -
263                         attribute: locationId
264                         attribute_location: customerLocation
265                         value: ""
266                     -
267                         attribute: id
268                         attribute_location: "vpnInfo.vpnId"
269                         value: ""
270                     -
271                         attribute: upstreamBW
272                         attribute_location: "vpnInfo.upstreamBW"
273                         value: ""
274                     -
275                         attribute: customerLatitude
276                         attribute_location: customerLatitude
277                         value: 1.1
278                     - 
279                         attribute: customerLongitude
280                         attribute_location: customerLongitude
281                         value: 2.2
282     -
283         OSDF_CASABLANCA.SubscriberPolicy_v1:
284             type: onap.policies.optimization.SubscriberPolicy
285             version: 1.0.0
286             type_version: 1.0.0
287             metadata:
288                 policy-id: OSDF_CASABLANCA.SubscriberPolicy_v1
289                 policy-version: 1
290             properties:
291                 scope: []
292                 services: [vCPE]
293                 identity: subscriber_vCPE
294                 properties:
295                     subscriberName: [subscriber_x, subscriber_y]
296                     subscriberRole: [platinum]
297                     provStatus: [CAPPED]
298     -
299         OSDF_CASABLANCA.SubscriberPolicy_v2:
300             type: onap.policies.optimization.SubscriberPolicy
301             version: 1.0.0
302             type_version: 1.0.0
303             metadata:
304                 policy-id: OSDF_CASABLANCA.SubscriberPolicy_v2
305                 policy-version: 1
306             properties:
307                 scope: []
308                 services: [vCPE]
309                 identity: subscriber_vCPE
310                 properties:
311                     subscriberName: [subscriber_a, subscriber_b]
312                     subscriberRole: [gold]
313                     provStatus: [CAPPED]
314     -
315         OSDF_CASABLANCA.vnfPolicy_vG:
316             type: onap.policies.optimization.VnfPolicy
317             version: 1.0.0
318             type_version: 1.0.0
319             metadata:
320                 policy-id: OSDF_CASABLANCA.vnfPolicy_vG
321                 policy-version: 1
322             properties:
323                 scope: []
324                 services: [vCPE]
325                 resources: [vG]
326                 geography: [US, INTERNATIONAL]
327                 identity: vnf_vG
328                 applicableResources: any
329                 vnfProperties:
330                     -
331                         inventoryProvider: aai
332                         serviceType: ""
333                         inventoryType: cloudRegionId
334                         customerId: ""