...
Drawio | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
The UML class diagram above shows the portion of the Policy Framework Object Model that applies to PolicyDevelopment and PolicyDeployment.
...
This section describes the architecture of the model driven system used to develop policy templates, types and to derive create concrete policies from those policy templates, and to parameterize concrete policies as executable policiesusing policy types. The output of Policy Design is deployment-ready artifacts in Maven and Policy metadata in the Policy Framework database.
Policies that are expressed via natural language or a model require some development work ahead of time for them to be translated into concrete runtime policies. Some Policy Domains will be setup and available in the platform during startup such as Control Loop Operational Policy Models, OOF placement Models, DCAE microservice models. Policy Model/Template/Rule Development type implementation development is done by an experienced developer.
Policy models/templates/rules are stored in Nexus. Nexus supports all major package types and has the flexibility to be configured for various environments such as development vs production. Thus, the production environment can be configured in a strict manner to allow only artifacts being pulled from specific repositories and block other repositories. While the development environment can be separately configured so offline development/testing can be performed with or without production policies. Policies are pulled and loaded into PDPs that are started and run as micro services. Dependencies are set in the policy artifact jar files themselves and not hard coded in the platform.
2.2.1 Policy Template Design
...
2.2.1 Policy Type Design
Policy Type Design is the task of creating policy types that capture the generic and vendor independent aspects of a policy for a particular domain use case. The policy type implementation specifies the model information, rules, and tasks that it a policy type requires to generate concrete policies.
A policy template type is developed for a certain type of PDP (for example XACML oriented for decision policies or Drools rules oriented for ECA policies). The design environment and tool chain for a policy template type is specific for the type of policy being designed. The policy template is available as a Maven artifact once it has been designed.
All policy templates types must implement the ONAP Policy Framework PolicyTemplate PolicyType interface. This interface allows PolicyDevelopment to manage policy templates types and to generate concrete policies from these policy templates types in a uniform way regardless of the domain that the policy template type is addressing or the PDP technology that will execute the policy. The interface is used by PolicyDevelopment to determine the PDP technology of the policy templatetype, the structure, type, and definition of the model information that must be supplied to the policy template type to generate a concrete policy, implementation .
The PolicyTypeImpl implementation (or raw policy) is the specification of the specific rules or tasks, the flow of the policy, its internal states and data structures and other relevant information. A PolicyTypeImpl is specific to a PDP technology, that is XACML, Drools, or APEX. A PolicyTypeImpl can be specific to a particular policy type, it can be more general, providing the implementation of a class of policy types, or the same policy type may have many implementations.
PolicyDevelopment provides the RESTful Policy Design API, which allows other components to query policy templatestypes and policy type implementations, to determine the model information, rules, or tasks that they require, to specialize policy flow, and to generate concrete policies from policy templatestypes. This API is used by the ONAP Policy Framework and other components such as PolicyDistribution to create concrete policies from policy templatestypes.
Consider a policy template type created for managing faults on vCPE equipment in a vendor independent way. The policy template type captures the generic logic required to manage the faults and specifies the vendor specific information that must be supplied to te the template for specific vendor vCPE VFs. The actual concrete actual vCPE policy that is used for managing particular vCPE equipment is generated created using the parameters specified in the policy template type together with the specific modeled information, rules and tasks in the policy type implementation for that vendor model of vCPE.
2.2.1
...
Generating Policy
...
The most straightforward way to create a policy template is to program it. Programming a policy template might simply mean creating and editing text files and manually generating the Maven artifact for the policy template.
...
Types
It is possible to generate policy types using MDD (Model Driven Development) techniques. Policy types are expressed using a DSL (Domain Specific Language) or a policy specification environment for a particular application domain. For example, policy types for specifying SLAs could be expressed in a SLA DSL and policy types for managing SON features could be generated from a visual SON management tool. The ONAP Policy framework provides an API that allows tool chains to create policy types. SDC uses this approach for generating Policy Types in the Policy Framework, see the Model driven Control Loop Design page.
2.2.1.2
...
Programming Policy
...
Type Implementations
The most straightforward way to create a policy type is to program it. Programming a policy type might simply mean creating and editing text files and manually creating the TOSCA Policy Type Yaml file and the policy type implementation for the policy type.
A more formal approach is preferred. For policy type implementations, programmers use a specific Eclipse project type for developing each type of implementation, a Policy Type Implementation SDK. The project is under source control in git. This Eclipse project is structured correctly for creating implementations for a specific type of PDP. It includes the correct POM files for generating the policy type implementation and has editors and perspectives that aid programmers in their work.
2.2.2 Policy Creation
PolicyDevelopment is a component for ingestion of models for policies and any optional support code, rules, tasks, or flow specifications. PolicyDevelopment can consume policy models organically and not require any development work. The PolicyCreation function of PolicyDevelopment creates a concrete policy from a policy template.
...