Introduction
Tosca lab has 2 main scripts:
- model_create.py - to create tosca model artifacts from component spec
- policy_create.py - to create policy type artifacts from component spec
...
Script policy_create.py creates data_type that can be used by policy_type.
In context of Closed Loop, policy type describes how to create microservice policy (maybe operation policy in future) in Clamp.
Policy types and Data types are extracted by Clamp from CSAR file created by SDC.
...
Control Loop Artifacts
CSAR package contains 3 artifacts required by Clamp to create closed loop:
...
Let's take a look what are dependencies between them:
As you can see on scheme to
To deploy* closed loop Clamp uses DCEA_INVENTORY_BLUEPRINT.
Each node that is deployed has to have specified it's policy type.
From Analytic Microservice perspective it's policy type is a scheme of how microservice it's configuration should look like.
If node doesn't have specified policy type Clamp assumes it's default one onap.policy.monitoring.cdap.tca.hi.lo.app
Policy types described inside policies.yml can have sub-nodes. Those sub-nodes are data types. Their are They're described inside artifact data.yml.
...
...
*
...
It's simplification. Clamp requests DCAE to deploy microservice.
Tosca Lab policy create
Dublin constraint is that both data.yml and policies.yml are hardcoded and can't be changed/extended in runtime.
Script policy_create.py is able to create new policy type and data type that could be add to policies.yml and data.yml.
...
- node_types - containing root node and policy.nodes.my_custom_policy_type. This node is actually a policy_type. In future it should derive from onap.policies.Monitoring instead of policy.nodes.Root
- data_types - specifying data types (and sub-data types) used in node_type (policy_type)
Note: The default output_policy.yaml generated requires manual update before it can be used in rest of CL flow design. Follow steps documented here - Onboarding steps for DCAE MS through SDC/Policy/CLAMP (Dublin)#PolicyTypeCreation(Developmentphase) to make updates