Design timeBellow are the requirements to enable automation for a service within ONAP. For instantiation, the goal is to be able to automatically resolve all the HEAT environment /Helm variables, called cloud parameters. For post-instantiation, the goal is to configure the VNF with initial configuration.
Deck of Cards |
---|
|
Card |
---|
default | true |
---|
label | Prerequisite |
---|
| PrerequisiteGather the cloud parameters: Deck of Cards |
---|
|
Card |
---|
| Have the HEAT template along with the HEAT environment file. or Have the Helm chart along with the Values.yaml file (CDS supports, but whether SO → Multicloud support for Helm/K8S is different story) or ... |
Card |
---|
| Have the configuration template to apply on the VNF. - XML for NETCONF
- JSON / XML for RESTCONF
- not supported yet - CLI
|
|
- Identify which resources are static and dynamic
Create and fill-in the a table for all the dynamic values While doing so, identify the resources using the same process to be resolved; for instance, if two IPs has to be resolved through the same IPAM, the process the resolve the IP is the same. Card |
---|
| Here are the information to capture for each dynamic cloud parameters Resource name | Resource source, and how to resolve | Ingredients for resolution | Output of resolution |
---|
Either the cloud parameters name or the placeholder given for the dynamic property. |
Deck of Cards |
---|
|
Card |
---|
| Value will be given as input in the request. |
Card |
---|
| Value will be defaulted in the model. |
Card |
---|
| Value will be resolved by sending a query to the REST system
Auth | URL | URI | Payload | VERB |
---|
Supported Auth type Deck of Cards |
---|
|
Card |
---|
| Use token based authentication |
Card |
---|
| Use basic authentication |
Card |
---|
| Use SSL basic authentication - keystore type
- truststore
- truststore password
- keystore
- keystore password
|
|
| http(s)://<host>:<port> | /xyz | JSON formatted payload | HTTP method |
|
Card |
---|
| Value will be resolved by sending a SQL statement to the DB system
|
Card |
---|
| Value will be resolved through the execution of a script. |
|
| These are all the required parameters to process the resolution of that particular resources. Deck of Cards |
---|
|
Card |
---|
| List of placeholders used for |
Card |
---|
| List of placeholders used for |
|
| This is the expected result from the system, and you should know what value out of the response is of interest for you. If it's a JSON payload, then you should think about the json path to access to value of interest. |
|
|
Card |
---|
| Data dictionaryWhat is a data dictionary? For each unique identified dynamic resource, along with all their ingredients, we need to create a data dictionary. Here are the modeling guideline: CDS Modeling Concepts FIX ME - add generic DD model Bellow are examples of data dictionary for each resource source
Deck of Cards |
---|
|
Card |
---|
| Value will be pass as input. Code Block |
---|
theme | Eclipse |
---|
title | unit-number |
---|
| {
"tags": "unit-number",
"name": "unit-number",
"property": {
"description": "unit-number",
"type": "string"
},
"updated-by": "adetalhouet",
"sources": {
"input": {
"type": "source-input"
}
}
} |
|
Card |
---|
| Value will be defaulted. Code Block |
---|
theme | Eclipse |
---|
title | prefix-id |
---|
| {
"tags": "prefix-id",
"name": "prefix-id",
"property" :{
"description": "prefix-id",
"type": "integer"
},
"updated-by": "adetalhouet",
"sources": {
"default": {
"type": "source-default"
}
}
} |
|
Card |
---|
| Value will be resolved through REST. Modeling reference: CDS Modeling Concepts In this example, we're making a POST request to an IPAM system with no payload. Some ingredients are required to perform the query, in this case, $prefixId . Hence It is provided as an input-key-mapping and defined as a key-dependencies. Please refer to the modeling guideline for more in depth understanding. As part of this request, the expected response will be as bellow. What is of interest is the address field, as this is what we're trying to resolve. Code Block |
---|
theme | Eclipse |
---|
title | response |
---|
collapse | true |
---|
| {
"id": 4,
"address": "192.168.10.2/32",
"vrf": null,
"tenant": null,
"status": 1,
"role": null,
"interface": null,
"description": "",
"nat_inside": null,
"created": "2018-08-30",
"last_updated": "2018-08-30T14:59:05.277820Z"
} |
To tell the resolution framework what is of interest in the response, the path property can be used, which uses JSON_PATH, to get the value. Code Block |
---|
theme | Eclipse |
---|
title | create_netbox_ip_address |
---|
| {
"tags" : "oam-local-ipv4-address",
"name" : "create_netbox_ip",
"property" : {
"description" : "netbox ip",
"type" : "string"
},
"updated-by" : "adetalhouet",
"sources" : {
"primary-config-data" : {
"type" : "source-rest",
"properties" : {
"type" : "JSON",
"verb" : "POST",
"endpoint-selector" : "ipam-1",
"url-path" : "/api/ipam/prefixes/$prefixId/available-ips/",
"path" : "/address",
"input-key-mapping" : {
"prefixId" : "prefix-id"
},
"output-key-mapping" : {
"address" : "address"
},
"key-dependencies" : [ "prefix-id" ]
}
}
}
} |
|
Card |
---|
| Value will be resolved through a database. Modeling reference: CDS Modeling Concepts In this example, we're making a SQL to the primary database. Some ingredients are required to perform the query, in this case, $vfmoudleid . Hence It is provided as an input-key-mapping and defined as a key-dependencies. Please refer to the modeling guideline for more in depth understanding. As part of this request, the expected response will be as put in value . In the output-key-mapping section, that value will be mapped to the expected resource name to resolve. Code Block |
---|
theme | Eclipse |
---|
title | vf-module-type |
---|
| {
"name": "vf-module-type",
"tags": "vf-module-type",
"property": {
"description": "vf-module-type",
"type": "string"
},
"updated-by": "adetalhouet",
"sources": {
"primary-db": {
"type": "source-primary-db",
"properties": {
"type": "SQL",
"query": "select sdnctl.demo.value as value from sdnctl.demo where sdnctl.demo.id=:vfmoduleid",
"input-key-mapping": {
"vfmoduleid": "vf-module-number"
},
"output-key-mapping": {
"vf-module-type": "value"
},
"key-dependencies": [
"vf-module-number"
]
}
}
}
} |
|
Card |
---|
| Value will be resolved through a the execution of a script. Modeling reference: CDS Modeling Concepts In this example, we're making use of a Python script. Some ingredients are required to perform the query, in this case, $vf-module-type . Hence It is provided as a key-dependencies. Please refer to the modeling guideline for more in depth understanding. As part of this request, the expected response will set within the script itself. Code Block |
---|
theme | Eclipse |
---|
title | interface-description |
---|
| {
"tags": "interface-description",
"name": "interface-description",
"property": {
"description": "interface-description",
"type": "string"
},
"updated-by": "adetalhouet",
"sources": {
"capability": {
"type": "source-capability",
"properties": {
"script-type": "jython",
"script-class-reference": "Scripts/python/DescriptionExample.py",
"instance-dependencies": [],
"key-dependencies": [
"vf-module-type"
]
}
}
}
} |
The script itself is as followbellow. The key is to have the script class derived from the framework standards. In the case of resource resolution, the class to derive from is AbstractRAProcessor It will give the required methods to implement: process and recover , along with some utility functions, such as set_resource_data_value or addError . These functions either come from the AbstractRAProcessor class, or from the class it derived from. FIX ME - give more information about scriptingIf the resolution fail, the recover method will get called with the exception as parameter. Code Block |
---|
theme | Eclipse |
---|
title | Scripts/python/DescriptionExample.py |
---|
collapse | true |
---|
| # Copyright (c) 2019 Bell Canada.
#
# 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 abstract_ra_processor import AbstractRAProcessor
from blueprint_constants import *
from java.lang import Exception as JavaException
class DescriptionExample(AbstractRAProcessor):
def process(self, resource_assignment):
try:
# get key-dependencies resultvalue
value = self.raRuntimeService.getStringFromResolutionStore("vf-module-type")
# logic based on key-dependency outcome
result = ""
if value == "vfw":
result = "This is the Virtual Firewall entity"
elif value == "vsn":
result = "This is the Virtual Sink entity"
elif value == "vpg":
result = "This is the Virtual Packet Generator"
# set the value forof resource getting currently resolved
self.set_resource_data_value(resource_assignment, result)
except JavaException, err:
log.error("Java Exception in the script {}", err)
except Exception, err:
log.error("Python Exception in the script {}", err)
return None
def recover(self, runtime_exception, resource_assignment):
print self.addError(runtime_exception.getMessage())
return None
|
|
|
| Workflow | | Value will be resolved through REST., and output will be a complex type. Modeling reference: CDS Modeling Concepts In this example, we're making a POST request to an IPAM system with no payload. Some ingredients are required to perform the query, in this case, $prefixId . Hence It is provided as an input-key-mapping and defined as a key-dependencies. Please refer to the modeling guideline for more in depth understanding. As part of this request, the expected response will be as bellow. Code Block |
---|
theme | Eclipse |
---|
title | response |
---|
collapse | true |
---|
| {
"id": 4,
"address": "192.168.10.2/32",
"vrf": null,
"tenant": null,
"status": 1,
"role": null,
"interface": null,
"description": "",
"nat_inside": null,
"created": "2018-08-30",
"last_updated": "2018-08-30T14:59:05.277820Z"
} |
What is of interest is the address and id fields. For the process to return these two values, we need to create a custom data-type, as bellow Code Block |
---|
title | dt-netbox-ip |
---|
collapse | true |
---|
| {
"version": "1.0.0",
"description": "This is Netbox IP Data Type",
"properties |
|
|
WorkflowsThe following workflows are contracts established between SO, SDNC and CDS to cover the instantiation and the post-instantiation use cases. Deck of Cards |
---|
| Card |
---|
| resource-assignmentThis action is meant to assign resources needed to instantiate the service, e.g. to resolve all the cloud parameters. Also, this action has the ability to perform a dry-run, meaning that result from the resolution will be made visible to the user, to validate their accuracy. If user is fine with the result, he can proceed, else, (TDB) he will have opportunity to re-trigger the resolution. ContextThis action is triggered by Generic-Resource-API (GR-API) within SDNC as part of the AssignBB orchestrated by SO. It will be triggered for the service, and each VNF(s) and VF-Module(s) (referred as entity bellow). See SO Building blocks Assignment. | Property | Description |
---|
artifact-name | This action will require resource accumulator templates; this will be cover during the (TODO Add link) component explanation. Key point here is that these templates are identified using artifact prefix. See CDS Modeling Concepts So in order to know for which entity the action is triggered, this is required as input is required. | resolution-key | The dry-run functionality requires the ability to retrieve the resolution that has been made later point in time in the process The combination of the artifact-name and the resolution-key will be used to uniquely identify the result. | Another input is mandatory, resolution-key Code Block |
---|
{
"workflows": {
"resource-assignment": {
"steps": {
"resource-assignment-process"address": {
"descriptionrequired": "Resource Assign Workflow"true,
"targettype": "resource-assignment-processstring"
},
},"id": {
"inputsrequired": {true,
"artifact-name": {
"required": true,"type": "integer"
}
"type": "list",
"entry_schema": {
"type": "string"
}
},
"resolution-key": {
"required": true,
},
"derived_from": "tosca.datatypes.Root"
} |
The type of the data dictionary will be dt-netbox-ip . To tell the resolution framework what is of interest in the response, the output-key-mapping section is used. The process will map the output-key-mapping to the defined data-type. Code Block |
---|
theme | Eclipse |
---|
title | create_netbox_ip_address |
---|
| {
"tags" : "oam-local-ipv4-address",
"name" : "create_netbox_ip",
"property" : {
"description" : "netbox ip",
"type" : "stringdt-netbox-ip"
},
}"updated-by" : "adetalhouet",
"sources" : }{
}
}
} |
Card |
---|
| config-assignThis action is meant to assign all the resources and mesh the templates needed for the configuration to apply post-instantiation. This action is triggered by SO during after the AssignBB has been executed for Service, VNF and VF-Module.
Card |
---|
| config-deployThis action is meant to push the configuration templates defined during the config-assign step for the post-instantiation. This action is triggered by SO during after the CreateBB has been executed for all the VF-Modules. artifactsCombinaison of templates with respective mappings Scripts using Netconf or Restconf to push configure the network element |
"primary-config-data" : {
"type" : "source-rest",
"properties" : {
"type" : "JSON",
"verb" : "POST",
"endpoint-selector" : "ipam-1",
"url-path" : "/api/ipam/prefixes/$prefixId/available-ips/",
"path" : "",
"input-key-mapping" : {
"prefixId" : "prefix-id"
},
"output-key-mapping" : {
"address" : "address",
"id" : "id"
},
"key-dependencies" : [ "prefix-id" ]
}
}
}
} |
|
|
|
Card |
---|
| WorkflowsThe following workflows are contracts established between SO, SDNC and CDS to cover the instantiation and the post-instantiation use cases. Please refer to the modeling guide to understand workflow concept: CDS Modeling Concepts
Deck of Cards |
---|
|
Card |
---|
| resource-assignmentThis action is meant to assign resources needed to instantiate the service, e.g. to resolve all the cloud parameters. Also, this action has the ability to perform a dry-run, meaning that result from the resolution will be made visible to the user. If user is fine with the result, he can proceed, else, (TDB) he will have opportunity to re-trigger the resolution. ContextThis action is triggered by Generic-Resource-API (GR-API) within SDNC as part of the AssignBB orchestrated by SO. It will be triggered for the service, and each VNF(s) and VF-Module(s) (referred as entity bellow). See SO Building blocks Assignment. StepsThis is a single action type of workflow, hence the target will refer to a node_template of type component-resource-resolution Property | Description |
---|
artifact-name | This action will require resource accumulator templates for each VNF and VF-Module; this will be covered during the resource-assignment-processcomponent explanation. These templates are identified using artifact prefix. See CDS Modeling Concepts So in order to know for which entity the action is triggered, this is required as input is required. | resolution-key | The dry-run functionality requires the ability to retrieve the resolution that has been made later point in time in the process. The combination of the artifact-name and the resolution-key will be used to uniquely identify the result. |
OutputIn order to perform dry-run, it is necessary to provide the meshed resolved template as output. To do so, the use of CDS Modeling Concepts expression is required. Also, as mentioned here CDS Modeling Concepts, the resource resolution component node will populate an attribute named assignment-params with the result. ExampleHere is an example of the resource-assignment workflow: Code Block |
---|
theme | Eclipse |
---|
title | resource-assignment |
---|
| {
"workflows": {
"resource-assignment": {
"steps": {
"resource-assignment-process": {
"description": "Resource Assign Workflow",
"target": "resource-assignment-process"
}
},
"inputs": {
"artifact-name": {
"required": true,
"type": "string"
},
"resolution-key": {
"required": true,
"type": "string"
},
"resource-assignment-properties": {
"description": "Dynamic PropertyDefinition for workflow(resource-assignment).",
"required": true,
"type": "dt-resource-assignment-properties"
}
},
"outputs": {
"dry-run": {
"type": "json",
"value": {
"get_attribute": [
"SELF",
"assignment-params"
]
}
}
}
}
}
} |
|
Card |
---|
| config-assignThis action is meant to assign all the resources and mesh the templates needed for the configuration to apply during post-instantiation (day0 config). If user is fine with the result, he can proceed, else, (TDB) he will have opportunity to re-trigger the resolution. ContextThis action is triggered by SO after the AssignBB has been executed for Service, VNF and VF-Module. It corresponds to the ConfigAssignBB. See SO Building blocks Assignment. StepsThis is a single action type of workflow, hence the target will refer to a node_template of type component-resource-resolution Property | Description |
---|
resolution-key | The dry-run functionality requires the ability to retrieve the resolution that has been made later point in time in the process. The combination of the artifact-name and the resolution-key will be used to uniquely identify the result. |
OutputIn order to perform dry-run, it is necessary to provide the meshed resolved template as output. To do so, the use of CDS Modeling Concepts expression is required. Also, as mentioned here CDS Modeling Concepts, the resource resolution component node will populate an attribute named assignment-params with the result. ExampleHere is an example of the config-assign workflow: Code Block |
---|
theme | Eclipse |
---|
title | config-assign |
---|
| {
"workflows": {
"config-assign": {
"steps": {
"config-assign-process": {
"description": "Config Assign Workflow",
"target": "config-assign-process"
}
},
"inputs": {
"resolution-key": {
"required": true,
"type": "string"
},
"config-assign-properties": {
"description": "Dynamic PropertyDefinition for workflow(config-assign).",
"required": true,
"type": "dt-config-assign-properties"
}
},
"outputs": {
"dry-run": {
"type": "json",
"value": {
"get_attribute": [
"SELF",
"assignment-params"
]
}
}
}
}
}
} |
|
Card |
---|
| config-deployThis action is meant to push the configuration templates defined during the config-assign step for the post-instantiation. This action is triggered by SO during after the CreateBB has been executed for all the VF-Modules. ContextThis action is triggered by SO after the CreateVnfBB has been executed. It corresponds to the ConfigDeployBB. See SO Building blocks Assignment. StepsThis is a single action type of workflow, hence the target will refer to a node_template of type component-netconf-executor or component-jython-executor or component-restconf-executor.
Property | Description |
---|
resolution-key | Needed to retrieve the resolution that has been made earlier point in time in the process. The combination of the artifact-name and the resolution-key will be used to uniquely identify the result. |
OutputSUCCESS or FAILURE ExampleHere is an example of the config-deploy workflow: Code Block |
---|
theme | Eclipse |
---|
title | config-deploy |
---|
| {
"workflow": {
"config-deploy": {
"steps": {
"config-deploy": {
"description": "Config Deploy using Python (Netconf) script",
"target": "config-deploy-process"
}
},
"inputs": {
"resolution-key": {
"required": true,
"type": "string"
},
"config-deploy-properties": {
"description": "Dynamic PropertyDefinition for workflow(config-deploy).",
"required": true,
"type": "dt-config-deploy-properties"
}
}
}
}
} |
|
|
|
Card |
---|
|
Deck of Cards |
---|
|
Card |
---|
label | resource-assignment-process |
---|
| resource-assignment-process |
Card |
---|
label | config-assign-process |
---|
| config-assign-process |
Card |
---|
label | config-deploy-process |
---|
| config-deploy-process |
|
| Card |
---|
| Deck of Cards |
---|
| Card |
---|
| resource-assignmentThis action is meant to assign resources needed to instantiate the service. The goal is to resolved all the HEAT environment variables. This action is triggered by Generic-Resource-API (GR-API) within SDNC as part of the AssignBB orchestrated by SO. Hence it will be triggered for each VNF(s) and VF-Module(s). In order to know for which entity the action is triggered, one input is required, that is the artifact prefix (see bellow for explanation). artifactstemplatescriptsIf any of the mapping uses a source capabbility to resolve a parameters. |
Card |
---|
| config-assignThis action is meant to assign all the resources and mesh the templates needed for the configuration to apply post-instantiation. This action is triggered by SO during after the AssignBB has been executed for Service, VNF and VF-Module. artifactsCombinaison of templates with respective mappings Scripts if needed |
Card |
---|
| config-deployThis action is meant to push the configuration templates defined during the config-assign step for the post-instantiation. This action is triggered by SO during after the CreateBB has been executed for all the VF-Modules. artifactsCombinaison of templates with respective mappings Scripts using Netconf or Restconf to push configure the network element |
|
|
|
|