aboutsummaryrefslogtreecommitdiffstats
path: root/osdf/models
diff options
context:
space:
mode:
Diffstat (limited to 'osdf/models')
-rwxr-xr-xosdf/models/api/common.py54
-rw-r--r--osdf/models/api/placementRequest.py124
-rw-r--r--osdf/models/api/placementResponse.py57
-rw-r--r--osdf/models/policy/cmso/xacml/placementPolicies.xcore718
-rw-r--r--osdf/models/policy/placement/xacml/placementPolicies.xcore728
5 files changed, 1681 insertions, 0 deletions
diff --git a/osdf/models/api/common.py b/osdf/models/api/common.py
new file mode 100755
index 0000000..0d2d0eb
--- /dev/null
+++ b/osdf/models/api/common.py
@@ -0,0 +1,54 @@
+# -------------------------------------------------------------------------
+# Copyright (c) 2015-2017 AT&T Intellectual Property
+#
+# 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.
+#
+# -------------------------------------------------------------------------
+#
+
+import datetime
+from pprint import pformat
+
+from dateutil.parser import parse
+from schematics.exceptions import ConversionError
+from schematics.models import Model
+from schematics.types import DateTimeType
+
+
+class OSDFModel(Model):
+ """Extends generic model with a couple of extra methods"""
+ def __str__(self):
+ """Return values of object's attributes -- excluding hidden or callable ones"""
+ def _str_format(x):
+ """Coerce as string for some special objects"""
+ return str(x) if isinstance(x, datetime.datetime) else x
+
+ z1 = dict((x, getattr(self, x)) for x in dir(self)
+ if not x.startswith("_") and not callable(getattr(self, x)))
+ z1 = dict((x, _str_format(y)) for x, y in z1.items())
+ return pformat(z1, depth=4, indent=2, width=1000)
+
+ def __repr__(self):
+ """Return values of object's attributes -- excluding hidden or callable ones"""
+ return self.__str__()
+
+
+class CustomISODateType(DateTimeType):
+ """Schematics doesn't support full ISO, so we use custom one"""
+ def to_native(self, value, context=None):
+ if isinstance(value, datetime.datetime):
+ return value
+ try:
+ return parse(value)
+ except:
+ raise ConversionError(u'Invalid timestamp {}'.format(value))
diff --git a/osdf/models/api/placementRequest.py b/osdf/models/api/placementRequest.py
new file mode 100644
index 0000000..73eac75
--- /dev/null
+++ b/osdf/models/api/placementRequest.py
@@ -0,0 +1,124 @@
+# -------------------------------------------------------------------------
+# Copyright (c) 2015-2017 AT&T Intellectual Property
+#
+# 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.
+#
+# -------------------------------------------------------------------------
+#
+
+from .common import OSDFModel
+from schematics.types import StringType, URLType, IntType, FloatType
+from schematics.types.compound import ModelType, ListType
+
+
+class RequestInfo(OSDFModel):
+ """Info for northbound request from client such as SO"""
+ transactionId = StringType(required=True)
+ requestId = StringType(required=True)
+ callbackUrl = URLType(required=True)
+ sourceId = StringType(required=True)
+ optimizer = ListType(StringType())
+ numSolutions = IntType()
+ timeout = IntType()
+ requestType = StringType()
+
+
+class CandidateInfo(OSDFModel):
+ """Preferred candidate for a resource (sent as part of a request from client)"""
+ candidateType = StringType(required=True)
+ candidates = ListType(StringType(required=True))
+
+
+class ResourceModelInfo(OSDFModel):
+ """Model information for a specific resource"""
+ modelCustomizationId = StringType(required=True)
+ modelInvariantId = StringType(required=True)
+ modelName = StringType()
+ modelVersion = StringType()
+ modelVersionId = StringType()
+ modelType = StringType()
+ operationalStatus = StringType()
+
+
+class ExistingLicenseInfo(OSDFModel):
+ entitlementPoolUUID = ListType(StringType())
+ licenseKeyGroupUUID = ListType(StringType())
+
+
+class LicenseDemand(OSDFModel):
+ resourceInstanceType = StringType(required=True)
+ serviceResourceId = StringType(required=True)
+ resourceModuleName = StringType(required=True)
+ resourceModelInfo = ModelType(ResourceModelInfo)
+ existingLicense = ModelType(ExistingLicenseInfo)
+
+
+class PlacementDemand(OSDFModel):
+ resourceInstanceType = StringType(required=True)
+ serviceResourceId = StringType(required=True)
+ resourceModuleName = StringType(required=True)
+ exclusionCandidateInfo = ListType(ModelType(CandidateInfo))
+ requiredCandidateInfo = ListType(ModelType(CandidateInfo))
+ resourceModelInfo = ModelType(ResourceModelInfo)
+ tenantId = StringType()
+ tenantName = StringType()
+
+
+class ExistingPlacementInfo(OSDFModel):
+ serviceInstanceId = StringType(required=True)
+
+
+class DemandInfo(OSDFModel):
+ """Requested resources (sent as part of a request from client)"""
+ placementDemand = ListType(ModelType(PlacementDemand))
+ licenseDemand = ListType(ModelType(LicenseDemand))
+
+
+class SubscriberInfo(OSDFModel):
+ """Details on the customer that subscribes to the VNFs"""
+ globalSubscriberId = StringType(required=True)
+ subscriberName = StringType()
+ subscriberCommonSiteId = StringType()
+
+
+class ServiceModelInfo(OSDFModel):
+ """ASDC Service model information"""
+ modelType = StringType(required=True)
+ modelInvariantId = StringType(required=True)
+ modelVersionId = StringType(required=True)
+ modelName = StringType(required=True)
+ modelVersion = StringType(required=True)
+
+
+class Location(OSDFModel):
+ latitude = FloatType(required=True)
+ longitude = FloatType(required=True)
+
+
+class PlacementInfo(OSDFModel):
+ """Information specific to placement optimization"""
+ serviceModelInfo = ModelType(ServiceModelInfo)
+ subscriberInfo = ModelType(SubscriberInfo)
+ demandInfo = ModelType(DemandInfo, required=True)
+ orderInfo = StringType()
+ policyId = ListType(StringType())
+ serviceInstanceId = StringType()
+ existingPlacement = ModelType(ExistingPlacementInfo)
+ location = ModelType(Location)
+ serviceType = StringType()
+
+
+class PlacementAPI(OSDFModel):
+ """Request for placement optimization (specific to optimization and additional metadata"""
+ requestInfo = ModelType(RequestInfo, required=True)
+ placementInfo = ModelType(PlacementInfo, required=True)
diff --git a/osdf/models/api/placementResponse.py b/osdf/models/api/placementResponse.py
new file mode 100644
index 0000000..e9746d6
--- /dev/null
+++ b/osdf/models/api/placementResponse.py
@@ -0,0 +1,57 @@
+# -------------------------------------------------------------------------
+# Copyright (c) 2015-2017 AT&T Intellectual Property
+#
+# 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.
+#
+# -------------------------------------------------------------------------
+#
+
+from .common import OSDFModel
+from schematics.types import StringType
+from schematics.types.compound import ModelType, ListType
+
+
+# TODO: update osdf.models
+
+class LicenseSolution(OSDFModel):
+ serviceResourceId = StringType(required=True)
+ resourceModuleName = StringType(required=True)
+ entitlementPoolList = ListType(StringType(required=True))
+ licenseKeyGroupList = ListType(StringType(required=True))
+
+
+class AssignmentInfo(OSDFModel):
+ variableName = StringType(required=True)
+ variableValue = StringType(required=True)
+
+
+class PlacementSolution(OSDFModel):
+ serviceResourceId = StringType(required=True)
+ resourceModuleName = StringType(required=True)
+ inventoryType = StringType(required=True)
+ serviceInstanceId = StringType()
+ cloudRegionId = StringType()
+ assignmentInfo = ListType(ModelType(AssignmentInfo))
+
+
+class SolutionInfo(OSDFModel):
+ placement = ListType(ModelType(PlacementSolution), min_size=1)
+ license = ListType(ModelType(LicenseSolution), min_size=1)
+
+
+class PlacementResponse(OSDFModel):
+ transactionId = StringType(required=True)
+ requestId = StringType(required=True)
+ requestState = StringType(required=True)
+ statusMessage = StringType(required=True)
+ solutionInfo = ModelType(SolutionInfo)
diff --git a/osdf/models/policy/cmso/xacml/placementPolicies.xcore b/osdf/models/policy/cmso/xacml/placementPolicies.xcore
new file mode 100644
index 0000000..3348cb0
--- /dev/null
+++ b/osdf/models/policy/cmso/xacml/placementPolicies.xcore
@@ -0,0 +1,718 @@
+/*
+ * This XCORE file contains models for the placement optimization policies in SNIRO.
+ * @author Ankitkumar Patel
+ * @version 0.0.1
+ * @since 2017-04-13
+ */
+
+package com.att.ecomp.sniro.policies.placement
+
+import java.util.UUID
+
+annotation "http://ecomp.att.com" as ecomp
+annotation "http://ecomp.att.com/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, aic_version=2
+ //thoughput=1, geoDistance=1, airDistance=2, latency=3, bandwidth=4
+}
+
+
+/*
+ * The type of inventory defined in AIC
+ */
+enum InventoryType{
+ service=1, cloud=2
+}
+
+/*
+ * The type of AT&T 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{
+ @ecomp(^type = "configuration")
+ Parameter parameter
+ @ecomp(^type = "configuration")
+ ComparisonOperator operator
+ @ecomp(^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.
+ @ecomp(^type = "configuration")
+ contains ConditionalInfo distanceCondition
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+class DistanceToLocationPolicy extends SniroPolicyMetaInfo{
+ @ecomp(^type = "configuration")
+ @policy (matching = "true")
+ DistanceToLocationPolicyType ^type
+ @ecomp(^type = "configuration")
+ String[] resourceInstanceType
+ @ecomp(^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.
+ @ecomp(^type = "configuration")
+ contains ConditionalInfo latencyCondition
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+class NetworkToLocationPolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ NetworkToLocationPolicyType ^type
+ @ecomp(^type = "configuration")
+ String[] resourceInstanceType
+ @ecomp(^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.
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+class NetworkBetweenDemandsPolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ NetworkBetweenDemandsPolicyType ^type
+ @ecomp(^type = "configuration")
+ String[] resourceInstanceType
+ @ecomp(^type = "configuration")
+ contains NetworkBetweenDemandsProperty networkBetweenDemandsProperty
+}
+
+
+/*
+ * Network roles supported a VNF placement
+ * @param all A list of network roles.
+ */
+class NetworkRoles{
+ @ecomp(^type = "configuration")
+ String[] all
+}
+
+/*
+ * Complex names supported by a VNF placement
+ * @param any A list of complex names.
+ */
+class Complex{
+ @ecomp(^type = "configuration")
+ String[] any
+}
+/*
+ * This are the AIC properties.
+ * @param aicVersion This is the version of AIC.
+ * @param aicType This is the type of AIC.
+ * @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 AicAttributeProperty{
+ //aicVersionCondition.parameter must be aicVersion.
+ @ecomp(^type = "configuration")
+ String aicVersion
+ @ecomp(^type = "configuration")
+ String aicType
+ @ecomp(^type = "configuration")
+ String dataPlane
+ @ecomp(^type = "configuration")
+ String hypervisor
+ @ecomp(^type = "configuration")
+ contains NetworkRoles networkRoles
+ @ecomp(^type = "configuration")
+ contains Complex complex
+ @ecomp(^type = "configuration")
+ String exclusivityGroups
+ @ecomp(^type = "configuration")
+ String state
+ @ecomp(^type = "configuration")
+ String country
+ @ecomp(^type = "configuration")
+ GeoRegion geoRegion
+ @ecomp(^type = "configuration")
+ String replicationRole
+
+}
+
+enum AicAttributePolicyType{
+ attribute=1
+}
+
+/*
+ * Model for the AIC 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 aicAttributeProperty This is the properties associated with the policy.
+ */
+@policy (
+ policyTemplate = "SNIRO-PLACEMENT"
+)
+class AicAttributePolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ AicAttributePolicyType ^type
+ @ecomp(^type = "configuration")
+ String[] resourceInstanceType
+ @ecomp(^type = "configuration")
+ contains AicAttributeProperty aicAttributeProperty
+}
+
+/*
+ * 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{
+ @ecomp(^type = "configuration")
+ TenantType tenant
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+class CapacityPolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ CapacityPolicyType ^type
+ @ecomp(^type = "configuration")
+ String[] resourceInstanceType
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+class InventoryGroupPolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ InventoryGroupPolicyType ^type
+ @ecomp(^type = "configuration")
+ String[] resourceInstanceType
+}
+
+/*
+ * This is the property associated with this policy.
+ * @param controller ECOMP controller.
+ * @param request This should be key-value pairs to be sent in a request.
+ */
+class ResourceInstanceProperty{
+ @ecomp(^type = "configuration")
+ String controller
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+class ResourceInstancePolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ ResourceInstancePolicyType ^type
+ @ecomp(^type = "configuration")
+ String[] resourceInstanceType
+ @ecomp(^type = "configuration")
+ contains ResourceInstanceProperty resourceInstanceProperty
+
+}
+
+/*
+ * This is the property associated with this policy.
+ * @param controller ECOMP controller
+ * @param request This should be key-value pairs to be sent in a request.
+ */
+class ResourceRegionProperty{
+ @ecomp(^type = "configuration")
+ String controller
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+class ResourceRegionPolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ ResourceRegionPolicyType ^type
+ @ecomp(^type = "configuration")
+ String[] resourceInstanceType
+ @ecomp(^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{
+ @ecomp(^type = "configuration")
+ Qualifier qualifier
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+
+class ZonePolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ ZonePolicyType ^type
+ @ecomp(^type = "configuration")
+ String[] resourceInstanceType
+ @ecomp(^type = "configuration")
+ contains ZoneProperty zoneProperty
+}
+
+/*
+ * The property associated with a VNF type.
+ * @param inventoryProvider The ECOMP entity providing inventory information.
+ * @param inventoryType The type of an inventory.
+ * @param serviceId The id of a service.
+ */
+class VNFPolicyProperty{
+ @ecomp(^type = "configuration")
+ String inventoryProvider
+ @ecomp(^type = "configuration")
+ InventoryType inventoryType
+ @ecomp(^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{
+ @ecomp(^type = "configuration")
+ String[] subscriberName
+ @ecomp(^type = "configuration")
+ String[] subscriberRole
+ @ecomp(^type = "configuration")
+ String[] provStatus
+}
+
+enum VNFPolicyType{
+ vnfPolicy=1
+}
+
+enum SubscriberPolicyType{
+ subscriberPolicy=1
+}
+
+class Attributes{
+ @ecomp(^type = "configuration")
+ String globalCustomerId
+ @ecomp(^type = "configuration")
+ String operationalStatus
+ @ecomp(^type = "configuration")
+ String[] orchestrationStatus
+ @ecomp(^type = "configuration")
+ String modelInvariantId
+ @ecomp(^type = "configuration")
+ String modelVersionId
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+class VNFPolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ VNFPolicyType ^type
+ @ecomp(^type = "configuration")
+ String[] resourceInstanceType
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+class SubscriberPolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ SubscriberPolicyType ^type
+ @ecomp(^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{
+ @ecomp(^type = "configuration")
+ String controller
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+class instanceReservationPolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ InstanceReservationPolicyType ^type
+ @ecomp(^type = "configuration")
+ String[] resourceInstanceType
+ @ecomp(^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{
+ @ecomp(^type = "configuration")
+ Parameter parameter
+ @ecomp(^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{
+ @ecomp(^type = "configuration")
+ ExpressionIdentity identity
+ @ecomp(^type = "configuration")
+ ComputationalOperator operation
+ @ecomp(^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{
+ @ecomp(^type = "configuration")
+ double weight
+ @ecomp(^type = "configuration")
+ Parameter parameter
+ @ecomp(^type = "configuration")
+ String[] resource
+ @ecomp(^type = "configuration")
+ ComputationalOperator operator
+ @ecomp(^type = "configuration")
+ LocationInfo customerLocationInfo
+}
+
+enum PlacementOptimizationPolicyType{
+ placementOptimization=1
+}
+
+/*
+ * @param operator An operator in an expression.
+ * @param parameterAttributes Represents sub-expression
+ */
+class ObjectiveParameter{
+ @ecomp(^type = "configuration")
+ ComputationalOperator operator
+ @ecomp(^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 = "SNIRO-PLACEMENT"
+)
+
+class PlacementOptimizationPolicy extends SniroPolicyMetaInfo{
+ @policy (matching = "true")
+ @ecomp(^type = "configuration")
+ PlacementOptimizationPolicyType ^type
+ @ecomp(^type = "configuration")
+ ObjectiveFunction objective
+ @ecomp(^type = "configuration")
+ contains ObjectiveParameter objectiveParameter
+}
+
+
+/*
+ * Meta information required for SNIRO policies.
+ * @param identity This is a user-defined identity.
+ * @param policyScope The scope of a policy
+ */
+
+@policy (
+ policyTemplate = "SNIRO"
+)
+class SniroPolicyMetaInfo{
+ @ecomp(^type = "configuration")
+ String identity
+ @ecomp(^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{
+ @ecomp(^type = "configuration")
+ @policy (matching = "true")
+ String[] serviceType
+ @ecomp(^type = "configuration")
+ @policy (matching = "true")
+ String[] networkType
+ @ecomp(^type = "configuration")
+ @policy (matching = "true")
+ String[] geoRegion
+ @ecomp(^type = "configuration")
+ @policy (matching = "true")
+ String[] resourceInstanceType
+ @ecomp(^type = "configuration")
+ @policy (matching = "true")
+ String[] modelInvariantId
+ @ecomp(^type = "configuration")
+ @policy (matching = "true")
+ String[] subscriberRole
+} \ No newline at end of file
diff --git a/osdf/models/policy/placement/xacml/placementPolicies.xcore b/osdf/models/policy/placement/xacml/placementPolicies.xcore
new file mode 100644
index 0000000..866488e
--- /dev/null
+++ b/osdf/models/policy/placement/xacml/placementPolicies.xcore
@@ -0,0 +1,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
+}