summaryrefslogtreecommitdiffstats
path: root/tosca2heat/heat-translator/doc
diff options
context:
space:
mode:
Diffstat (limited to 'tosca2heat/heat-translator/doc')
-rw-r--r--tosca2heat/heat-translator/doc/source/conf.py75
-rw-r--r--tosca2heat/heat-translator/doc/source/contributing.rst1
-rw-r--r--tosca2heat/heat-translator/doc/source/index.rst29
-rw-r--r--tosca2heat/heat-translator/doc/source/installation.rst15
-rw-r--r--tosca2heat/heat-translator/doc/source/usage.rst81
5 files changed, 201 insertions, 0 deletions
diff --git a/tosca2heat/heat-translator/doc/source/conf.py b/tosca2heat/heat-translator/doc/source/conf.py
new file mode 100644
index 0000000..23aa050
--- /dev/null
+++ b/tosca2heat/heat-translator/doc/source/conf.py
@@ -0,0 +1,75 @@
+# -*- coding: utf-8 -*-
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import os
+import sys
+
+sys.path.insert(0, os.path.abspath('../..'))
+# -- General configuration ----------------------------------------------------
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = [
+ 'sphinx.ext.autodoc',
+ #'sphinx.ext.intersphinx',
+ 'oslosphinx'
+]
+
+# autodoc generation is a bit aggressive and a nuisance when doing heavy
+# text edit cycles.
+# execute "export SPHINX_DEBUG=1" in your terminal to disable
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'heat-translator'
+copyright = u'2013, OpenStack Foundation'
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+add_module_names = True
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# -- Options for HTML output --------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. Major themes that come with
+# Sphinx are currently 'default' and 'sphinxdoc'.
+# html_theme_path = ["."]
+# html_theme = 'default'
+# html_static_path = ['static']
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = '%sdoc' % project
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass
+# [howto/manual]).
+latex_documents = [
+ ('index',
+ '%s.tex' % project,
+ u'%s Documentation' % project,
+ u'OpenStack Foundation', 'manual'),
+]
+
+# Example configuration for intersphinx: refer to the Python standard library.
+#intersphinx_mapping = {'http://docs.python.org/': None}
diff --git a/tosca2heat/heat-translator/doc/source/contributing.rst b/tosca2heat/heat-translator/doc/source/contributing.rst
new file mode 100644
index 0000000..8cb3146
--- /dev/null
+++ b/tosca2heat/heat-translator/doc/source/contributing.rst
@@ -0,0 +1 @@
+.. include:: ../../CONTRIBUTING.rst \ No newline at end of file
diff --git a/tosca2heat/heat-translator/doc/source/index.rst b/tosca2heat/heat-translator/doc/source/index.rst
new file mode 100644
index 0000000..dd3f04f
--- /dev/null
+++ b/tosca2heat/heat-translator/doc/source/index.rst
@@ -0,0 +1,29 @@
+.. heat-translator documentation master file, created by
+ sphinx-quickstart on Tue Jul 9 22:26:36 2013.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to heat-translator's documentation!
+===========================================
+
+The heat-translator tool is aimed to translate non-heat templates to OpenStack
+Heat Orchestration Template (HOT). Initially the tool is aimed to translate
+OASIS Topology and Orchestration Specification for Cloud Applications (TOSCA)
+to HOT. However, the tool can be easily extended to support any non-heat
+template format to produce HOT.
+
+Contents:
+
+.. toctree::
+ :maxdepth: 2
+
+ installation
+ usage
+ contributing
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
diff --git a/tosca2heat/heat-translator/doc/source/installation.rst b/tosca2heat/heat-translator/doc/source/installation.rst
new file mode 100644
index 0000000..71c5237
--- /dev/null
+++ b/tosca2heat/heat-translator/doc/source/installation.rst
@@ -0,0 +1,15 @@
+============
+Installation
+============
+
+Assuming that OpenStackClient (OSC) is available in your environment, you can easily install Heat-Translator to use with OSC by following three steps::
+
+ git clone https://github.com/openstack/heat-translator
+ cd heat-translator
+ sudo python setup.py install
+
+You can also clone the project and use it without any specific OpenStack environment set up as below::
+
+ git clone https://github.com/openstack/heat-translator
+
+Heat-Translator can be installed via PyPI package as well. Refer to https://pypi.python.org/pypi/heat-translator for available packages.
diff --git a/tosca2heat/heat-translator/doc/source/usage.rst b/tosca2heat/heat-translator/doc/source/usage.rst
new file mode 100644
index 0000000..ebad0e8
--- /dev/null
+++ b/tosca2heat/heat-translator/doc/source/usage.rst
@@ -0,0 +1,81 @@
+=====
+Usage
+=====
+
+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::
+
+ git clone https://github.com/openstack/heat-translator
+ cd heat-translator
+ sudo python setup.py install
+
+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 three ways.
+
+Translate and get output on command line. For example: ::
+
+ openstack translate template --template-file /home/openstack/heat-translator/translator/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/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
+
+
+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==<path to the YAML template> --template-type=<type of template e.g. tosca> --parameters="purpose=test"
+
+The heat_translator.py test program is at the root level of the project. The program has currently tested with TOSCA templates.
+It requires two arguments::
+
+1. Path to the file that needs to be translated. The file, flat yaml template or CSAR, can be specified as a local file in your
+system or via URL.
+2. Type of translation (e.g. tosca)
+
+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
+
+This should produce a translated Heat Orchestration Template on the command line. The translated content can be saved to a desired file by setting --output-file=<path>.
+For example: ::
+
+ python heat_translator.py --template-file=translator/tests/data/tosca_helloworld.yaml --template-type=tosca --output-file=/tmp/hot_helloworld.yaml
+
+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==<path to the YAML template> --template-type=<type of template e.g. tosca> --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
+
+Things To Consider
+------------------
+* When deploying the translated template with Heat, please ensure 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 currently.
+ Per the future plan, an image and flavor will be provided from an online repository.
+* The ``key_name`` property of Nova server is irrelevant to the TOSCA specification and can not be used in TOSCA template. In order to use it in
+ the translated templates, the user must provide it via parameters, and the heat-translator will set it to all resources of ``OS::Nova::Server`` type.
+* Since properties of TOSCA Compute OS and HOST capabilities are optional, the user should make sure that either they set these properties correctly
+ in the TOSCA template or provide them via CLI parameters in order to find best match of flavor and image.
+* The ``flavor`` and ``image`` properties of ``OS::Nova::Server`` resource is irrelevant to the TOSCA specification and can not be used in the TOSCA
+ template as such. Heat-Translator sets these properties in the translated template based on constraints defined per TOSCA Compute OS and HOST
+ capabilities. However, user may required to use these properties in template in certain circumstances, so in that case, TOSCA Compute can be extended
+ with these properties and later used in the node template. For a good example, refer to the ``translator/tests/data/test_tosca_flavor_and_image.yaml`` test
+ template.
+
654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086