Support python3 uploaded to pypi websit
[parser.git] / docs / developer / design / policy2tosca.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
3
4 ==================
5 Parser polic2tosca
6 ==================
7
8 Problem description
9 -------------------
10 In NFV, various templates are utilized to describe the deployment requirements,
11 the post-instantiation records or other purposes.However in order to make these
12 templates adaptable and feasible for purpose like deployment orchestration/
13 automation,certain tooling mechanism that provides template translation is
14 necessary.When an end user needs to inject/remove policies from the TOSCA
15 file generated the policy2tosca module comes in as part of parser project.
16
17 Design
18 ------
19 The following modules are implemented in policy2tosca module.
20
21 CLIFF
22 -----
23 cliff is a framework for building command line programs. It uses plugins to
24 define sub-commands, output formatters, and other extensions.In policy2tosca
25 we use cliff to define the commands to inject or remove policies from
26 TOSCA templates.
27 Reference for PYANG: https://docs.openstack.org/developer/cliff/
28
29 policy2tosca
30 ------------
31 policy2tosca is a custom module written with the plugins of cliff where we
32 define adding/removing definitions and/or types of policies.
33 Following are the sub modules under policy2tosca
34     * add_definition.py: To inject a policy definition to the TOSCA template.
35     * add_type.py: To inject a policy type to the TOSCA template.
36     * del_definition.py: To remove a policy definition from the TOSCA template.
37     * del_type.py: To remove a policy type from the TOSCA template.
38
39 Input
40 -----
41 The user specifies the input in command line arguments for the policy2tosca
42 custom module with the source TOSCA file to which the policies should be
43 injected/removed.
44
45 Output
46 ------
47 The output TOSCA template will be the input TOSCA file with the
48 modification of policies.