Merge "Update the upstream of tosco-parser and heat-translator to stable release...
[parser.git] / docs / userguide / yang2tosca.rst
1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at
4 #
5 #    http://www.apache.org/licenses/LICENSE-2.0
6 #
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10 # implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 Execution
15 ===========================
16
17 Step 1: Change directory to where the scripts are present.
18
19 .. code-block:: bash
20
21     cd parser/yang2tosca
22
23 Step 2: Copy the YANG file which needs to be converted into TOSCA to
24         current (parser/yang2tosca) folder.
25
26 Step 3: Run the python script "parser.py" with the YANG file as an input option.
27
28 .. code-block:: bash
29
30     python parser.py -n "YANG filename"
31
32 Example:
33
34 .. code-block:: bash
35
36     python parser.py -n example.yaml
37
38 Step 4: Verify the TOSCA YAMl which file has been created with the same name
39         as the YANG file with a “_tosca” suffix.
40
41 .. code-block:: bash
42
43     cat "YANG filename_tosca.yaml"
44
45 Example:
46
47 .. code-block:: bash
48
49     cat example_tosca.yaml