From 7b2d647d06a61c288ed849c441d82f8198049386 Mon Sep 17 00:00:00 2001 From: spzala Date: Wed, 16 Dec 2015 20:25:13 -0800 Subject: [PATCH] Update usage documentation A new command line arg for template validation is added and documentation needs to be updated accordingly. Change-Id: I7e2c6c4376198b723ea89872320f9c3687621b9b Implements: blueprint template-validation-only --- doc/source/usage.rst | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 0d2e8e2a..1a0eabbb 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -12,7 +12,7 @@ Assuming that OpenStackClient (OSC) is available in your environment, you can ea Alternatively, you can install a particular release of Heat-Translator as available at https://pypi.python.org/pypi/heat-translator. -Once installation is complete, Heat-Translator is ready to use. Currently you can use it in following two ways. +Once installation is complete, Heat-Translator is ready to use. Currently you can use it in following three ways. Translate and get output on command line. For example: :: @@ -22,6 +22,10 @@ Translate and save output of translated file to a desired destination. For examp openstack translate template --template-file /home/openstack/heat-translator/translator/tests/data/tosca_helloworld.yaml --template-type tosca --output-file /tmp/hot_hello_world.yaml +Do not translate but only validate template file. For example: :: + + openstack translate template --template-file /home/openstack/heat-translator/translator/tests/data/tosca_helloworld.yaml --template-type tosca --validate-only=true + You can learn more about available options by running following help command:: openstack help translate template @@ -41,8 +45,6 @@ It requires two arguments:: system or via URL. 2. Type of translation (e.g. tosca) -An optional argument can be provided to handle user inputs parameters. - For example, a TOSCA hello world template can be translated by running the following command from the project location:: python heat_translator.py --template-file=translator/tests/data/tosca_helloworld.yaml --template-type=tosca @@ -50,6 +52,11 @@ For example, a TOSCA hello world template can be translated by running the follo This should produce a translated Heat Orchestration Template on the command line. In the near future, new options will be added to save the output to destination file. +An optional argument can be provided to handle user inputs parameters. Also, a template file can only be validated instead of translation by using --validate-only=true +optional argument. The command below shows an example usage:: + + python heat_translator.py --template-file== --template-type= --validate-only=true + Alternatively, you can install a particular release of Heat-Translator as available at https://pypi.python.org/pypi/heat-translator. In this case, you can simply run translation via CLI entry point:: heat-translator --template-file=translator/tests/data/tosca_helloworld.yaml --template-type=tosca