From 2f9040ba8efa493b190622971c6a8d708055e5ea Mon Sep 17 00:00:00 2001 From: spzala Date: Tue, 7 Jul 2015 07:42:16 -0700 Subject: [PATCH] Document usage of translator with OSC Update usage information for heat-translator OSC plugin Change-Id: I7baf0d6108cf46c63cb8550405a3a9940dbee571 --- doc/source/usage.rst | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 14ad376..8cdfe52 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -2,9 +2,32 @@ Usage ===== -Heat-Translator project is planned to be made available via python-heatclient. +Use Heat-Translator with OpenStackClient (OSC) +---------------------------------------------- +Assuming that OpenStackClient (OSC) is available in your environment, you can easily install Heat-Translator to use with OSC by following three steps:: -For now, it can be tested on the command line as below:: + git clone https://github.com/openstack/heat-translator + cd heat-translator + python setup.py install + +Once installation is complete, Heat-Transalator is ready to use. Currently you can use it in following two ways. + +Translate and get output on command line. For example: :: + + openstack translate template --template-file /home/openstack/heat-translator/translator/toscalib/tests/data/tosca_helloworld.yaml --template-type tosca + +Translate and save output of translated file to a desired destination. For example: :: + + openstack translate template --template-file /home/openstack/heat-translator/translator/toscalib/tests/data/tosca_helloworld.yaml --template-type tosca --output-file /tmp/hot_hellow_world.yaml + +You can learn more about available options by running following help command:: + + openstack help translate template + + +Use Heat-Translator on its own +------------------------------ +Heat-Translator can be used without any specific OpenStack environment set up as below:: git clone https://github.com/openstack/heat-translator python heat_translator.py --template-file== --template-type= --parameters="purpose=test" @@ -22,10 +45,11 @@ For example, a TOSCA hello world template can be translated by running the follo python heat_translator.py --template-file=translator/toscalib/tests/data/tosca_helloworld.yaml --template-type=tosca 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 a file. When deploy the translated template with Heat, please keep in mind that you have image registered in the Glance. The Heat-Translator +to destination file. + +When deploy the translated template with Heat, please keep in mind that you have image registered in the Glance. The Heat-Translator project sets flavor and image from a pre-defined set of values (as listed in /home/openstack/heat-translator/translator/hot/tosca/tosca_compute.py) with the best possible match to the constraints defined in the TOSCA template. If there is no possible match found, a null value is set for now. Per the future plan, an image and flavor will be provided from an online repository. -Once the project is made available in python-heatclient, it will be enabled to deploy translated output template seamlessly via Heat.