...
Interfaces
- NST selection Request (from SO)
- Input: Service profiler parameters.
{
"requestInfo":{
"transactionId":"c86b3019-39f4-4cd3-b847-b22afe9f36dc",
"requestId":"c86b3019-39f4-4cd3-b847-b22afe9f36dc",
"sourceId":"so",
"timeout":600,
"callbackUrl":"http://0.0.0.0:9000/callback/"
},
"serviceProfile":{
"serviceProfileParameters":{
"latency":20,
"areaTrafficCapDL" : 10000,
"coverageAreaTAList" : "India"
}}
}
- Input: Service profiler parameters.
- Fetch Optimization policies
- vnfPolicy - it will identify the inventoryProvider and inventoryType - Forms demand policy.
- Attribute policy - for storing the serviceprofileparameters and its value as attribute - value pair- Constraint policy.
- QueryPolicy - Its used to query the serviceprofileparameters from the input so that it can be added as a value to the attribute.
- NST selection request - HASHAS
- Demand: NST
- Constraint: Attribute policy for matching whether nst templates have these attributes.
- Fetch NST metadata from AAI
- Output: List of all NSTs metadata .metadata
- Sample Request:
curl --user AAI:AAI -X GET -H "X-FromAppId:AAI" -H "X-TransactionId:get_aai_subscr" -H "Accept:application/json" -H "Content-Type:application/json" -k "https://10.31.4.27:30233/aai/v21/service-design-and-creation/models?model-role=NST&depth=2"
Sample Response:
Code Block { "model":[ { "model-invariant-id":"50cd1233-dbec-4a46-a24f-46345a23635e", "model-type":"service", "model-role":"NST", "resource-version":"1607656942756", "model-vers":{ "model-ver":[ { "model-version-id":"bac7e4cb-c27e-48a8-999e-87531f192a1d", "model-name":"EmbbNST", "model-version":"1.0", "model-description":"TestNst", "resource-version":"1607656942756", "model-elements":{ "model-element":[ { "model-element-uuid":"23ecdf3f-f3fa-4715-8a86-65dc33c60cd2", "new-data-del-flag":"T", "cardinality":"unbounded", "resource-version":"1607656942756", "relationship-list":{ "relationship":[ { "related-to":"model-ver", "relationship-label":"org.onap.relationships.inventory.IsA", "related-link":"/aai/v21/service-design-and-creation/models/model/82194af1-3c2c-485a-8f44-420e22a9eaa4/model-vers/model-ver/46b92144-923a-4d20-b85a-3cbd847668a9", "relationship-data":[ { "relationship-key":"model.model-invariant-id", "relationship-value":"82194af1-3c2c-485a-8f44-420e22a9eaa4" }, { "relationship-key":"model-ver.model-version-id", "relationship-value":"46b92144-923a-4d20-b85a-3cbd847668a9" } ], "related-to-property":[ { "property-key":"model-ver.model-name", "property-value":"service-instance" } ] } ] } } ] } } ] } } ] }
- Fetch NST candidate from SDC
- Input: NST metadata
- Sample Request:
curl -X GET -H "authorization: Basic YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=" -H "x-ecomp-instanceid:AAI" -H 'Accept:application/octet-stream' -k https://10.31.4.27:30204/sdc/v1/catalog/services/bac7e4cb-c27e-48a8-999e-87531f192a1d/toscaModel
- Output: List of NST candidates matching the metadata
- Sample Response:
View file name nst.csar height 250
- Run optimization - taking attribute constraint, the candidates are filtered out matching the attributes.
- Solution list is formed
- Solution List. Solution object have nst candidates matching the input service profile params.
...
{ } | "name": "EmbbNst", "id": "EmbbNst_1", "latency": 20, "uplink": 5, "downlink": 8, "reliability": 95, "areaTrafficCapDL": 10, "areaTrafficCapUL": 100, "maxNumberofUEs": 10000, "areas": " area1|area2", "expDataRateDL": 10, "expDataRateUL": 1000, "resourceSharingLevel": "shared", "coverageAreaTAList": "Beijing;Beijing;HaidanDistrict;WanshouluStreet", "modelinvariantuuid": "7d7df980-cb81-45f8-bad9-4e5ad2876393", "modeluuid": "fe6c82b9-4e53-4322-a671-e2d8637bfbb7", "uniqueness": true, "inventory_type":"nst", "candidate_id": "EmbbNst_ID", "cost": 2 |
...
Sample Has Template:
Code Block |
---|
{
"name":"urllc_sample",
"files":{
},
"limit":10,
"num_solution":"1",
"timeout":1200,
"template":{
"homing_template_version":"2020-08-13",
"demands":{
"nst_demand":[
{
"inventory_provider":"aai",
"inventory_type":"nst",
"unique":"true",
"region":"RegionOne",
"filtering_attributes":{
"model-role":"nst"
}
}
]
},
"constraints":{
"nst_Threshold":{
"type":"threshold",
"demands":[
"nst_demand"
],
"properties":{
"evaluate":[
{
"attribute":"latency",
"operator":"lte",
"threshold":30,
"unit":"ms"
}
]
}
} },
"optimization":{
"goal": "minimize",
"operation_function": {
"operator": "sum",
"operands": [{
"function": "attribute",
"params": {
"demand": "nst_demand",
"attribute": "latency"
}
}]
}
}
}
} |
Consumed APIs
GET NST metadata from AAI
GET NST cabdidates from SDC by the metadata got
Policies:
Attribute policy
Code Block { "Threshold_nst": { "metadata": { "policy-id": "Threshold_nst", "policy-version": 1 }, "properties": { "geography": [], "identity": "Threshold_nst", "resources": [ "nst" ], "scope": [ "OSDF_GUILIN" ], "services": [ "nst" ], "thresholdProperties": [ { "attribute": "latency", "operator": "lte", "threshold": { "get_param": "latency" }, "unit": "ms" }, { "attribute": "reliability", "operator": "gte", "threshold": { "get_param": "reliability" }, "unit": "" } ] }, "type": "onap.policies.optimization.resource.ThresholdPolicy", "type_version": "1.0.0", "version": "1.0.0" } }
2. Query Policy
Code Block | ||
---|---|---|
| ||
{
"queryPolicy_nst": {
"type": "onap.policies.optimization.service.QueryPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
"policy-id": "queryPolicy_nst",
"policy-version": 1
},
"properties": {
"scope": [
"OSDF_GUILIN"
],
"services": [
"nst"
],
"geography": [],
"identity": "queryPolicy_nst",
"queryProperties": [
{
"attribute": "latency",
"attribute_location": "latency"
},
{
"attribute": "reliability",
"attribute_location": "reliability"
}
]
}
}
}
|
3. vnf policy
Code Block |
---|
{
"vnfPolicy_nst": {
"type": "onap.policies.optimization.resource.VnfPolicy",
"version": "1.0.0",
"type_version": "1.0.0",
"metadata": {
"policy-id": "vnfPolicy_nst",
"policy-version": 1
},
"properties": {
"scope": [
"OSDF_GUILIN",
],
"resources": [
"nst"
],
"services": [
"nst"
],
"identity": "vnf_nst",
"applicableResources": "any",
"vnfProperties": [
{
"inventory_provider":"aai",
"inventory_type":"nst",
"unique":"true",
"region":"RegionOne",
"filtering_attributes":{
"service-role":"nst"
}
}
]
}
}
} |
Code Block | ||
---|---|---|
| ||
{
"nst_minimize_latency": {
"metadata": {
"policy-id": "nst_minimize_latency",
"policy-version": 1
},
"properties": {
"geography": [],
"identity": "optimization",
"goal": "minimize",
"operation_function": {
"operator": "sum",
"operands": [
{
"function": "attribute",
"params": {
"attribute": "latency",
"demand": "nst"
}
}
]
},
"resources": [
"nst"
],
"scope": [
"OSDF_GUILIN"
],
"services": [
"nst"
]
},
"type": "onap.policies.optimization.resource.OptimizationPolicy",
"type_version": "2.0.0",
"version": "1.0.0"
}
} |