aboutsummaryrefslogtreecommitdiffstats
path: root/osdf/models/policy/placement/xacml/placementPolicies.xcore
blob: 866488e1593c71c1cb759769c47d5efda718b37e (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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
/*
 * ================================================================================
 * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

package org.onap.oof.osdf.policies.placement

import java.util.UUID

annotation "http://org.onap" as onap
annotation "http://org.onap.policy" as policy

type UUID  wraps UUID

/*
 * Comparison operators
 */
enum ComparisonOperator{
        less=1, grater=2, lessEqual=3, greaterEqual=4, equal=5, notEqual=6
}

enum TenantType{
        GW_TENANT_ID=1, PORTAL_TENANT_ID=2
}

/*
 * Computational operators
 */
enum ComputationalOperator{
        sum=1, product=2
}


/*
 * Qualifier types
 */
enum Qualifier{
        same=1, different=2
}

/*
 * Zone  category
 */
enum ZoneCategory{
        disaster=1, region=2, complex=3, time=4, maintenance=5
}

/*
 * Geographical region types
 */
enum GeoRegion{
        US=1, EMEA=2, AP=3, CALA=4, CA=5, INTERNATIONAL=6
}

/*
 * Parameters
 */
enum Parameter{
        distance=0, latency=1, cloud_version=2
        //thoughput=1, geoDistance=1, airDistance=2, latency=3, bandwidth=4
}


/*
 * The type of inventory defined in cloud
 */
enum InventoryType{
        service=1, cloud=2
}

/*
 * The type of network
 */
 enum NetworkType{
        ip=1
 }

/*
 * Objective functions.
 */

enum ObjectiveFunction{
        minimize=1, maximize=2
}

/*
 * This is a model of a condition.
 * @param parameter This is the parameter of interest.
 * @param operator This is a comparison operator.
 * @param value This is a value of a parameter
 */
class ConditionalInfo{
        @onap(^type = "configuration")
        Parameter parameter
        @onap(^type = "configuration")
        ComparisonOperator operator
        @onap(^type = "configuration")
        String value
}

enum LocationInfo{
        customer_loc=1, none=2, customer_pref_loc=3
}


/*
 * Model for distance to location property.
 * @param distanceCondition This is a distance condition.
 * @param locationInfo This is a location with respect to which distance condition is applied.
 */
class DistanceToLocationProperty{
        //distanceCondition.parameter must be distance.
        @onap(^type = "configuration")
        contains ConditionalInfo distanceCondition
        @onap(^type = "configuration")
        LocationInfo locationInfo
}

enum DistanceToLocationPolicyType{
        distance_to_location=1
}

/*
 * Model for distance to location policy.
 * @param identity This is an identity created by a user.
 * @param type This is the type of a policy.
 * @param resourceInstance This is a list of resource instances over which this policy is applied.
 * @param distanceToLocationProperty This is the distance properties of the policy.
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class DistanceToLocationPolicy extends OOFPolicyMetaInfo{
        @onap(^type = "configuration")
        @policy (matching = "true")
        DistanceToLocationPolicyType ^type
        @onap(^type = "configuration")
        String[] resourceInstanceType
        @onap(^type = "configuration")
        contains DistanceToLocationProperty distanceToLocationProperty
}

/*
 * The property associated with the NetworkBetweenDemandsPolicy.
 * @param latencyCondition The latency property associated with the policy.
 * @param locationInfo The customer location information.
 */
class NetworkToLocationProperty{
        //latencyCondition.parameter must be latency.
        @onap(^type = "configuration")
        contains ConditionalInfo latencyCondition
        @onap(^type = "configuration")
        LocationInfo locationInfo
}

enum NetworkToLocationPolicyType{
        network_to_location=1
}

/*
 * Network between demands policy.
 * @param type The type of a policy.
 * @param resourceInstanceType The resources associated with a policy.
 * @param networkToLocationProperty The property associated with the policy.
 */

@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class NetworkToLocationPolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        NetworkToLocationPolicyType ^type
        @onap(^type = "configuration")
        String[] resourceInstanceType
        @onap(^type = "configuration")
        contains NetworkToLocationProperty networkToLocationProperty
}

/*
 * The property associated with the NetworkBetweenDemandsPolicy.
 * @param latencyCondition The latency property associated with the policy.
 */
class NetworkBetweenDemandsProperty{
        //latencyCondition.parameter must be latency.
        @onap(^type = "configuration")
        contains ConditionalInfo latencyCondition
}

enum NetworkBetweenDemandsPolicyType{
        network_between_demands=1
}

/*
 * Network between demands policy.
 * @param type The type of a policy.
 * @param resourceInstanceType The resources associated with a policy.
 * @param networkBetweenDemandsProperty The property associated with the policy.
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class NetworkBetweenDemandsPolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        NetworkBetweenDemandsPolicyType ^type
        @onap(^type = "configuration")
        String[] resourceInstanceType
        @onap(^type = "configuration")
        contains NetworkBetweenDemandsProperty networkBetweenDemandsProperty
}


/*
 * Network roles supported a VNF placement
 * @param all A list of network roles.
 */
class NetworkRoles{
        @onap(^type = "configuration")
        String[] all
}

/*
 * Complex names supported by a VNF placement
 * @param any A list of complex names.
 */
class Complex{
        @onap(^type = "configuration")
        String[] any
}
/*
 * This are the cloud properties.
 * @param cloudVersion This is the version of cloud.
 * @param cloudType This is the type of cloud.
 * @param dataPlace This is the type of data plane.
 * @param hypervisor This is the type of hypervisor.
 * @param networkRoles This is a list of connected networks.
 * @param exclusivityGroups This is an exclusivity group Id
 * @param state State in which a VNF should be located.
 * @param country Country in which a VNF should be located.
 * @param getRegion Geographical region in which a VNF should be located.
 */
class cloudAttributeProperty{
        //cloudVersionCondition.parameter must be cloudVersion.
        @onap(^type = "configuration")
        String cloudVersion
        @onap(^type = "configuration")
        String cloudType
        @onap(^type = "configuration")
        String dataPlane
        @onap(^type = "configuration")
        String hypervisor
        @onap(^type = "configuration")
        contains NetworkRoles networkRoles
        @onap(^type = "configuration")
        contains Complex complex
        @onap(^type = "configuration")
        String exclusivityGroups
        @onap(^type = "configuration")
        String state
        @onap(^type = "configuration")
        String country
        @onap(^type = "configuration")
        GeoRegion geoRegion
        @onap(^type = "configuration")
    	String replicationRole

}

enum cloudAttributePolicyType{
        attribute=1
}

/*
 * Model for the cloud attribute policy.
 * @param type This is the type of a policy.
 * @param resourceInstance This is a list of resources over which the policy is applied.
 * @param cloudAttributeProperty This is the properties associated with the policy.
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class cloudAttributePolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        cloudAttributePolicyType ^type
        @onap(^type = "configuration")
        String[] resourceInstanceType
        @onap(^type = "configuration")
        contains cloudAttributeProperty cloudAttributeProperty
}

/*
 * The property associated with the capacity policy.
 * @param tenant The tenant whose capacity needs to be checked.
 * @param description The location of a heat template.
 */
class CapacityProperty{
        @onap(^type = "configuration")
        TenantType tenant
        @onap(^type = "configuration")
        String description
}

enum CapacityPolicyType{
        cloud_capacity=1
}

/*
 * Capacity policy
 * @param type The type of a policy.
 * @param resourceInstanceType The type of resources associated with a policy.
 * @param capacityProperty The property associated with a policy.
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class CapacityPolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        CapacityPolicyType ^type
        @onap(^type = "configuration")
        String[] resourceInstanceType
        @onap(^type = "configuration")
        contains CapacityProperty capacityProperty
}

enum InventoryGroupPolicyType{
        inventory_group = 1
}

/*
 * Model for the inventory group policy.
 * @param type This is the type of a policy.
 * @param resourceInstance This is a list of resources that must be grouped/paired
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class InventoryGroupPolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        InventoryGroupPolicyType ^type
        @onap(^type = "configuration")
        String[] resourceInstanceType
}

/*
 * This is the property associated with this policy.
 * @param controller onap controller.
 * @param request This should be key-value pairs to be sent in a request.
 */
class ResourceInstanceProperty{
        @onap(^type = "configuration")
        String controller
        @onap(^type = "configuration")
        String request
}

enum ResourceInstancePolicyType{
        instance_fit=1
}
/*
 * Model for the resource instance policy.
 * @param type This is the type of a policy.
 * @param resourceInstance This is a list of resources.
 * @param resourceInstanceProperty This is a property associated with each resource in the list.
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class ResourceInstancePolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        ResourceInstancePolicyType ^type
        @onap(^type = "configuration")
        String[] resourceInstanceType
        @onap(^type = "configuration")
        contains ResourceInstanceProperty resourceInstanceProperty

}

/*
 * This is the property associated with this policy.
 * @param controller onap controller
 * @param request This should be key-value pairs to be sent in a request.
 */
class ResourceRegionProperty{
        @onap(^type = "configuration")
        String controller
        @onap(^type = "configuration")
        String request
}

enum ResourceRegionPolicyType{
        region_fit=1
}

/*
 * Model for the resource region policy
 * @param type This is the type of a policy.
 * @param resourceInstance This is a list of resources.
 * @param resourceRegionProperty This is a property associated with this policy.
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class ResourceRegionPolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        ResourceRegionPolicyType ^type
        @onap(^type = "configuration")
        String[] resourceInstanceType
        @onap(^type = "configuration")
        contains ResourceRegionProperty resourceRegionProperty
}

/*
 * This is the property associated with zone policy.
 * @param qualifier This is the qualifier.
 * @param category This is the category of a zone.
 */
class ZoneProperty{
        @onap(^type = "configuration")
        Qualifier qualifier
        @onap(^type = "configuration")
        ZoneCategory category
}

enum ZonePolicyType{
        zone=1
}

/*
 * Model of the zone policy.
 * @param type This is the type of a policy.
 * @param resourceInstanceType This is a list of resources.
 * @param zoneProperty This is the property associated with the policy.
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)

class ZonePolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        ZonePolicyType ^type
        @onap(^type = "configuration")
        String[] resourceInstanceType
        @onap(^type = "configuration")
        contains ZoneProperty zoneProperty
}

/*
 * The property associated with a VNF type.
 * @param inventoryProvider The onap entity providing inventory information.
 * @param inventoryType The type of an inventory.
 * @param serviceId The id of a service.
 */
class VNFPolicyProperty{
        @onap(^type = "configuration")
        String inventoryProvider
        @onap(^type = "configuration")
        InventoryType inventoryType
        @onap(^type = "configuration")
        contains Attributes attributes
}

/*
 * The property associated with a Subscriber type.
 * @param subscriberName The name of a subscriber.
 * @param subscriberRole The role of a subscriber.
 * @param provStatus The provisioning status of a subscriber.
 */
class SubscriberPolicyProperty{
        @onap(^type = "configuration")
        String[] subscriberName
        @onap(^type = "configuration")
        String[] subscriberRole
        @onap(^type = "configuration")
        String[] provStatus
}

enum VNFPolicyType{
        vnfPolicy=1
}

enum SubscriberPolicyType{
        subscriberPolicy=1
}

class Attributes{
    @onap(^type = "configuration")
    String globalCustomerId
    @onap(^type = "configuration")
    String operationalStatus
    @onap(^type = "configuration")
    String[] orchestrationStatus
    @onap(^type = "configuration")
    String modelInvariantId
    @onap(^type = "configuration")
    String modelVersionId
    @onap(^type = "configuration")
    String equipmentRole
}

/*
 * Policy associated with a VNF.
 * @param resourceInstance This parameter identifies a specific VNF.
 * @param inventoryProvider This is the provider of inventory.
 * @param inventoryType This is the type of inventory.
 * @param serviceType The service associated with a VNF.
 * @param serviceId The Id associated with a service.
 * @param globalCustomerId The global id of a customer.
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class VNFPolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        VNFPolicyType ^type
        @onap(^type = "configuration")
        String[] resourceInstanceType
        @onap(^type = "configuration")
        contains VNFPolicyProperty[] property
}

/*
 * Policy associated with a Subscriber.
 * @param subscriberName The name of a subscriber.
 * @param subscriberRole The role of a subscriber.
 * @param provStatus The provisioning status of a subscriber.
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class SubscriberPolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        SubscriberPolicyType ^type
        @onap(^type = "configuration")
        contains SubscriberPolicyProperty[] property
}


/*
 * This is the property associated with this policy.
 * @param providerUrl This is the url of provider to check the capacity.
 * @param request This should be key-value pairs to be sent in a request.
 */
class InstanceReservationProperty{
        @onap(^type = "configuration")
        String controller
        @onap(^type = "configuration")
        String request
}

enum InstanceReservationPolicyType{
        instance_reservation=1
}
/*
 * Model for the resource instance policy.
 * @param identity This is an identity created by a user.
 * @param type This is the type of a policy.
 * @param resourceInstance This is a list of resources.
 * @param resourceInstanceProperty This is a property associated with each resource in the list.
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class InstanceReservationPolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        InstanceReservationPolicyType ^type
        @onap(^type = "configuration")
        String[] resourceInstanceType
        @onap(^type = "configuration")
        contains InstanceReservationProperty instanceReservationProperty

}

/*
 * This is a model of an operand.
 * @param parameter This is a parameter.
 * @param associativity This is a list of entities with which a parameter is associated.
 */
 /*
class Operand{
        @onap(^type = "configuration")
        Parameter parameter
        @onap(^type = "configuration")
        Entity associativity
}
*/

/*
 * This is the optimization function.
 * @param identity This is an identity of a function.
 * @param operation This is a computational operator.
 * @param leftOperand This is a left operand of a function.
 * @param rightOperand This is a right operand of a function.
 */
/*
class OptimizationFunction{
        @onap(^type = "configuration")
        ExpressionIdentity identity
        @onap(^type = "configuration")
        ComputationalOperator operation
        @onap(^type = "configuration")
        contains Operand[] operands
}
*/

/*
 * Properties associated with a sub-expression.
 * @param weight The weight of an expression.
 * @param parameter The parameter involved in an expression.
 * @param entity The entities involved in an expression.
 * @param operator The operator of an expression.
 * @param customerLocationInfo The location of a customer.
 */
class AttributeProperty{
        @onap(^type = "configuration")
        double weight
        @onap(^type = "configuration")
        Parameter parameter
        @onap(^type = "configuration")
        String[] resource
        @onap(^type = "configuration")
        ComputationalOperator operator
        @onap(^type = "configuration")
        LocationInfo customerLocationInfo
}

enum PlacementOptimizationPolicyType{
        placementOptimization=1
}

/*
 * @param operator An operator in an expression.
 * @param parameterAttributes Represents sub-expression
 */
class ObjectiveParameter{
        @onap(^type = "configuration")
        ComputationalOperator operator
        @onap(^type = "configuration")
        contains AttributeProperty[] parameterAttributes
}

/*
 * Model of the placement optimization policy.
 * @param type This is the type of a policy.
 * @param objective This is an objective function.
 * @param objectiveParameter The parameter/expression to be optimized.
 */
@policy (
    policyTemplate = "OOF-PLACEMENT"
)

class PlacementOptimizationPolicy extends OOFPolicyMetaInfo{
        @policy (matching = "true")
        @onap(^type = "configuration")
        PlacementOptimizationPolicyType ^type
        @onap(^type = "configuration")
        ObjectiveFunction objective
        @onap(^type = "configuration")
        contains ObjectiveParameter objectiveParameter
}


/*
 * Meta information required for oof policies.
 * @param identity This is a user-defined identity.
 * @param policyScope The scope of a policy
 */

@policy (
    policyTemplate = "OOF-PLACEMENT"
)
class OOFPolicyMetaInfo{
        @onap(^type = "configuration")
        String identity
        @onap(^type = "configuration")
        @policy (matching = "true")
        contains Scope policyScope
}

/*
 * Scopes in which a policy is applicable.
 * @param serviceType The type of a service.
 * @param networkType The type of a network
 * @param geoRigion The geographical region.
 * @param resourceInstanceType The resources associated with a policy/
 * @param subscriberRole 
 */
class Scope{
        @onap(^type = "configuration")
        @policy (matching = "true")
        String[] serviceType
        @onap(^type = "configuration")
        @policy (matching = "true")
        String[] networkType
        @onap(^type = "configuration")
        @policy (matching = "true")
        String[] geoRegion
        @onap(^type = "configuration")
        @policy (matching = "true")
        String[] resourceInstanceType
        @onap(^type = "configuration")
        @policy (matching = "true")
        String[] modelInvariantId
        @onap(^type = "configuration")
        @policy (matching = "true")
        String[] subscriberRole
}