Merge "JIRA:PARSER-17 Clean up documentation setup" into stable/brahmaputra
[parser.git] / docs / parser_docs / yang2tosca / yang2tosca.rst
1 ========================
2 Parser YANG2TOSCA
3 ========================
4
5 Overview
6 ===========================
7
8 Parser is an open source project and licensed under Apache 2. Parser will help
9 to provide a tooling mechanism, by parsing Telecom operators’ VNF descriptors
10 (YANG templates) into TOSCA templates and then further translate TOSCA
11 templates into certain common templates, which could be used in IaaS orchestration
12 projects like OpenStack Heat.
13
14 Prerequisites
15 ==========================
16
17 Parser requires the following to be installed.
18
19 1. PYANG
20 -----------------
21
22 Please follow the below installation steps.
23
24 Step 1: Clone pyang tool or download the zip file from the following link.
25                 git clone https://github.com/mbj4668/pyang.git
26                                 or
27                 wget https://github.com/mbj4668/pyang/archive/master.zip
28
29 Step 2: Change directory to the downloaded directory and run the setup file.
30                 cd pyang
31                 python setup.py
32
33 2. python-lxml
34 --------------------
35
36 Please follow the below installation link.
37         http://lxml.de/installation.html
38
39
40 Installation
41 ============================
42
43 Please follow the below installation steps to install parser.
44
45 Step 1: Clone the parser project.
46         git clone https://gerrit.opnfv.org/gerrit/parser
47
48 Execution
49 ===========================
50
51 Step 1: Change directory to where the scripts are present.
52         cd parser/yang2tosca
53
54 Step 2: Copy the YANG file which needs to be converted into TOSCA to
55         current (parser/yang2tosca) folder.
56
57 Step 3: Run the python script "parser.py" with the YANG file as an input option.
58                 python parser.py -n "YANG filename"
59         Example:
60                 python parser.py -n example.yaml
61
62 Step 4: Verify the TOSCA YAMl which file has been created with the same name
63         as the YANG file with a “_tosca” suffix.
64                 cat "YANG filename_tosca.yaml"
65         Example:
66                 cat example_tosca.yaml