Updating the docs to include NST selection enhancements
[optf/has.git] / docs / sections / example.rst
1 Example Conductor Templates
2 ===========================
3
4 Example 1
5 ---------
6
7 .. code:: json
8
9     {
10       "name": "yyy-yyy-yyyy",
11       "files": {},
12       "timeout": 600,
13       "limit": 1,
14       "num_solutions": 10,
15       "template": {
16         "homing_template_version": "2018-02-01",
17         "parameters": {
18           "service_name": "",
19           "service_id": "d61b2543-5914-4b8f-8e81-81e38575b8ec",
20           "customer_lat": 32.89748,
21           "customer_long": -97.040443
22         },
23         "locations": {
24           "customer_loc": {
25             "latitude": {
26               "get_param": "customer_lat"
27             },
28             "longitude": {
29               "get_param": "customer_long"
30             }
31           }
32         },
33         "demands": {
34           "vGMuxInfra": [
35             {
36               "inventory_provider": "aai",
37               "inventory_type": "service",
38               "service_type": "vGMuxInfra-xx",
39               "attributes": {
40                 "customer-id": "",
41                 "orchestration-status": "",
42                 "model-invariant-id": "b3dc6465-942c-42af-8464-2bf85b6e504b",
43                 "model-version-id": "ba3b8981-9a9c-4945-92aa-486234ec321f",
44                 "service-type": "vGMuxInfra-xx",
45                 "equipment-role": "",
46                 "global-customer-id": "SDN-ETHERNET-INTERNET"
47               }
48             }
49           ],
50           "vG": [
51             {
52               "inventory_provider": "aai",
53               "inventory_type": "cloud",
54               "service_type": "71d563e8-e714-4393-8f99-cc480144a05e"
55             }
56           ]
57         },
58         "constraints": {
59           "affinity_vCPE": {
60             "type": "zone",
61             "demands": [
62               "vGMuxInfra",
63               "vG"
64             ],
65             "properties": {
66               "category": "complex",
67               "qualifier": "same"
68             }
69           }
70         },
71         "optimization": {
72           "minimize": {
73             "sum": [
74               {
75                 "product": [
76                   "1",
77                   {
78                     "distance_between": [
79                       "customer_loc",
80                       "vGMuxInfra"
81                     ]
82                   }
83                 ]
84               },
85               {
86                 "product": [
87                   "1",
88                   {
89                     "distance_between": [
90                       "customer_loc",
91                       "vG"
92                     ]
93                   }
94                 ]
95               }
96             ]
97           }
98         }
99       }
100     }
101
102 The example template is for the placement of vG and vGMuxInfra. It has
103 an affinity constraint which specifies that both the vnfs must be in
104 the same complex. The optimiation here is to minimize the sum of the
105 distances of the vnfs from the customer location.
106
107 Example 2
108 ---------
109
110 .. code:: json
111
112     {
113       "files": {},
114       "limit": 1,
115       "num_solutions": 10,
116       "name": "a2e3e0cc-3a97-44fc-8a08-1b86143fbdd3",
117       "template": {
118         "constraints": {
119           "affinity_vCPE": {
120             "demands": [
121               "vgMuxAR",
122               "vGW"
123             ],
124             "properties": {
125               "category": "complex",
126               "qualifier": "same"
127             },
128             "type": "zone"
129           },
130           "distance-vGMuxAR": {
131             "demands": [
132               "vgMuxAR"
133             ],
134             "properties": {
135               "distance": "< 500 km",
136               "location": "customer_loc"
137             },
138             "type": "distance_to_location"
139           },
140           "distance-vGW": {
141             "demands": [
142               "vGW"
143             ],
144             "properties": {
145               "distance": "< 1500 km",
146               "location": "customer_loc"
147             },
148             "type": "distance_to_location"
149           }
150         },
151         "demands": {
152           "vGW": [
153             {
154               "attributes": {
155                 "model-invariant-id": "782c87a6-b712-47d1-9c5b-1ea2cd9a2dd5",
156                 "model-version-id": "9877dbbe-8ada-40a2-8adb-f6f26f1ad9ab"
157               },
158               "inventory_provider": "aai",
159               "inventory_type": "cloud",
160               "service_type": "c3e0e82b-3367-48ce-ab00-27dc2e91a34a"
161             }
162           ],
163           "vgMuxAR": [
164             {
165               "attributes": {
166                 "global-customer-id": "SDN-ETHERNET-INTERNET",
167                 "model-invariant-id": "565d5b75-11b8-41be-9991-ee03a0049159",
168                 "model-version-id": "61414c6c-6082-4e03-9824-bf53c3582b78"
169               },
170               "inventory_provider": "aai",
171               "inventory_type": "service",
172               "service_type": "46b29078-8442-4ea3-bea6-9199a7d514d4"
173             }
174           ]
175         },
176         "homing_template_version": "2017-10-10",
177         "locations": {
178           "customer_loc": {
179             "latitude": {
180               "get_param": "customer_lat"
181             },
182             "longitude": {
183               "get_param": "customer_long"
184             }
185           }
186         },
187         "optimization": {
188           "minimize": {
189             "sum": [
190               {
191                 "product": [
192                   "1",
193                   {
194                     "distance_between": [
195                       "customer_loc",
196                       "vgMuxAR"
197                     ]
198                   }
199                 ]
200               },
201               {
202                 "product": [
203                   "1",
204                   {
205                     "distance_between": [
206                       "customer_loc",
207                       "vGW"
208                     ]
209                   }
210                 ]
211               }
212             ]
213           }
214         },
215         "parameters": {
216           "customer_lat": 32.89748,
217           "customer_long": 97.040443,
218           "service_id": "0dbb9d5f-27d9-429b-bc36-293e9fab7731",
219           "service_name": ""
220         }
221       },
222       "timeout": 600
223     }
224
225 This is similar to the first example except that it has an additional distance
226 constraint which specifies that the distance of each vnf from the customer
227 location must be less than 500km.
228
229 Example 3
230 ---------
231
232 .. code:: json
233
234     {
235         "files": {},
236         "limit": 10,
237         "name": "urllc_sample",
238         "num_solution": "10",
239         "template": {
240             "constraints": {
241                 "URLLC_core_Threshold": {
242                     "demands": [
243                         "URLLC_core"
244                     ],
245                     "properties": {
246                         "evaluate": [
247                             {
248                                 "attribute": "latency",
249                                 "operator": "lte",
250                                 "threshold": 30,
251                                 "unit": "ms"
252                             }
253                         ]
254                     },
255                     "type": "threshold"
256                 },
257                 "URLLC_ran_Threshold": {
258                     "demands": [
259                         "URLLC_ran"
260                     ],
261                     "properties": {
262                         "evaluate": [
263                             {
264                                 "attribute": "latency",
265                                 "operator": "lte",
266                                 "threshold": 30,
267                                 "unit": "ms"
268                             }
269                         ]
270                     },
271                     "type": "threshold"
272                 }
273             },
274             "demands": {
275                 "URLLC_core": [
276                     {
277                         "filtering_attributes": {
278                             "model-invariant-id": "21d57d4b-52ad-4d3c-a798-248b5bb9124a",
279                             "model-version-id": "bfba363e-e39c-4bd9-a9d5-1371c28f4d22",
280                             "orchestration-status": "active",
281                             "service-role": "nssi"
282                         },
283                         "inventory_provider": "aai",
284                         "inventory_type": "nssi",
285                         "region": "RegionOne",
286                         "unique": "true"
287                     }
288                 ],
289                 "URLLC_ran": [
290                     {
291                         "filtering_attributes": {
292                             "model-invariant-id": "aa2d56ea-773d-11ea-bc55-0242ac130003",
293                             "model-version-id": "d6296806-773d-11ea-bc55-0242ac130003",
294                             "orchestration-status": "active",
295                             "service-role": "nssi"
296                         },
297                         "inventory_provider": "aai",
298                         "inventory_type": "nssi",
299                         "region": "RegionOne",
300                         "unique": "true"
301                     }
302                 ]
303             },
304             "homing_template_version": "2018-02-01"
305         },
306         "timeout": 1200
307     }
308
309 This template is for the selecting the NSSI instances for Network
310 Slicing use case. The demand here is the Slice subnets and the threshold
311 constraint specifies that the latency of the the subnets must be less
312 than a particular threshold.
313
314
315 Example 4
316 ---------
317
318 .. code:: json
319
320         {
321                 "name":"urllc_sample",
322                 "files":{
323  
324                 },
325                 "limit":10,
326                 "num_solution":"1",
327                 "timeout":1200,
328                 "template":{
329                         "homing_template_version":"2020-08-13",
330                         "demands":{
331                         "nst_demand":[
332                                 {
333                "inventory_provider":"aai",
334                "inventory_type":"nst",
335                "unique":"true",
336                "region":"RegionOne",
337                "filtering_attributes":{
338                   "model-role":"nst"
339                                         }
340                                 }
341                         ]
342                 },
343                 "constraints":{
344                         "nst_Threshold":{
345             "type":"threshold",
346             "demands":[
347                "nst_demand"
348             ],
349             "properties":{
350                "evaluate":[
351                   {
352                      "attribute":"latency",
353                      "operator":"lte",
354                      "threshold":30,
355                      "unit":"ms"
356                   }
357                ]
358              }
359            }
360             },
361                 "optimization":{
362                         "goal": "minimize",
363                         "operation_function": {
364                                 "operator": "sum",
365                                 "operands": [{
366                                 "function": "attribute",
367                                 "params": {
368                   "demand": "nst_demand",
369                   "attribute": "latency"
370                                 }
371                                 }]
372                         }
373             }
374           }
375         }
376
377 This template is for the selecting the NST templates for Network
378 Slicing use case. The demand here is the slice templates and the threshold
379 constraint specifies that the latency of the the templates must be less
380 than a particular threshold.
381
382 Contact
383 -------
384
385 Shankar Narayanan shankarpnsn@gmail.com