http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/PKG-INFO ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/PKG-INFO b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/PKG-INFO new file mode 100644 index 0000000..46a0050 --- /dev/null +++ b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/PKG-INFO @@ -0,0 +1,189 @@ +Metadata-Version: 1.1 +Name: apache-ariatosca +Version: 0.1.1 +Summary: ARIA +Home-page: http://ariatosca.incubator.apache.org/ +Author: ARIA +Author-email: [email protected] +License: Apache License 2.0 +Download-URL: https://dist.apache.org/repos/dist/release/incubator/ariatosca/0.1.1-incubating +Description: ARIA + ==== + + |Build Status| |Appveyor Build Status| |License| |PyPI release| |Python Versions| |Wheel| + |Contributors| |Open Pull Requests| |Closed Pull Requests| + + + What is ARIA? + ------------- + + `ARIA <http://ariatosca.incubator.apache.org/>`__ is a an open-source, + `TOSCA <https://www.oasis-open.org/committees/tosca/>`__-based, lightweight library and CLI for + orchestration and for consumption by projects building TOSCA-based solutions for resources and + services orchestration. + + ARIA can be utilized by any organization that wants to implement TOSCA-based orchestration in its + solutions, whether a multi-cloud enterprise application, or an NFV or SDN solution for multiple + virtual infrastructure managers. + + With ARIA, you can utilize TOSCA's cloud portability out-of-the-box, to develop, test and run your + applications, from template to deployment. + + ARIA is an incubation project under the `Apache Software Foundation <https://www.apache.org/>`__. + + + Installation + ------------ + + ARIA is `available on PyPI <https://pypi.python.org/pypi/apache-ariatosca>`__. + + ARIA requires Python 2.6/2.7. Python 3 is currently not supported. + + To install ARIA directly from PyPI (using a ``wheel``), use:: + + pip install --upgrade pip setuptools + pip install apache-ariatosca + + To install ARIA from source, download the source tarball from + `PyPI <https://pypi.python.org/pypi/apache-ariatosca>`__, extract and ``cd`` into the extract dir, and run:: + + pip install --upgrade pip setuptools + pip install . + + | The source package comes along with relevant examples, documentation, ``requirements.txt`` (for installing specifically the frozen dependencies' versions with which ARIA was tested) and more. + | + | + | ARIA has additional optional dependencies. These are required for running operations over SSH. + | Below are instructions on how to install these dependencies, including required system dependencies per OS. + | + | Note: These dependencies may have varying licenses which may not be compatible with Apache license 2.0. + | + + **Ubuntu/Debian** (tested on Ubuntu14.04, Ubuntu16.04):: + + apt-get install -y python-dev gcc libffi-dev libssl-dev + pip install aria[ssh] + + **Centos** (tested on Centos6.6, Centos7):: + + yum install -y python-devel gcc libffi-devel openssl-devel + pip install aria[ssh] + + **Archlinux**:: + + pacman -Syu --noconfirm python2 gcc libffi openssl + pip2 install aria[ssh] + + **Windows** (tested on Win10):: + + # no additional system requirements are needed + pip install aria[ssh] + + **MacOS**:: + + # TODO + + + + To install ``pip``, either use your distro's package management system, or run:: + + wget http://bootstrap.pypa.io/get-pip.py + python get-pip.py + + + + Getting Started + --------------- + + This section will describe how to run a simple "Hello World" example. + + First, provide ARIA with the ARIA "hello world" service-template and name it (e.g. + ``my-service-template``):: + + aria service-templates store examples/hello-world/helloworld.yaml my-service-template + + Now create a service based on this service-template and name it (e.g. ``my-service``):: + + aria services create my-service -t my-service-template + + Finally, start an ``install`` workflow execution on ``my-service`` like so:: + + aria executions start install -s my-service + + You should now have a simple web-server running on your local machine. You can try visiting + ``http://localhost:9090`` to view your deployed application. + + To uninstall and clean your environment, follow these steps:: + + aria executions start uninstall -s my-service + aria services delete my-service + aria service-templates delete my-service-template + + + Contribution + ------------ + + You are welcome and encouraged to participate and contribute to the ARIA project. + + Please see our guide to + `Contributing to ARIA <https://cwiki.apache.org/confluence/display/ARIATOSCA/Contributing+to+ARIA>`__. + + Feel free to also provide feedback on the mailing lists (see `Resources <#user-content-resources>`__ + section). + + + Resources + --------- + + - `ARIA homepage <http://ariatosca.incubator.apache.org/>`__ + - `ARIA wiki <https://cwiki.apache.org/confluence/display/AriaTosca>`__ + - `Issue tracker <https://issues.apache.org/jira/browse/ARIA>`__ + + - Dev mailing list: [email protected] + - User mailing list: [email protected] + + Subscribe by sending a mail to ``<group>[email protected]`` (e.g. + ``[email protected]``). See information on how to subscribe to mailing + lists `here <https://www.apache.org/foundation/mailinglists.html>`__. + + For past correspondence, see the + `dev mailing list archive <https://lists.apache.org/[email protected]>`__. + + + License + ------- + + ARIA is licensed under the + `Apache License 2.0 <https://github.com/apache/incubator-ariatosca/blob/master/LICENSE>`__. + + .. |Build Status| image:: https://img.shields.io/travis/apache/incubator-ariatosca/master.svg + :target: https://travis-ci.org/apache/incubator-ariatosca + .. |Appveyor Build Status| image:: https://img.shields.io/appveyor/ci/ApacheSoftwareFoundation/incubator-ariatosca/master.svg + :target: https://ci.appveyor.com/project/ApacheSoftwareFoundation/incubator-ariatosca/history + .. |License| image:: https://img.shields.io/github/license/apache/incubator-ariatosca.svg + :target: http://www.apache.org/licenses/LICENSE-2.0 + .. |PyPI release| image:: https://img.shields.io/pypi/v/apache-ariatosca.svg + :target: https://pypi.python.org/pypi/apache-ariatosca + .. |Python Versions| image:: https://img.shields.io/pypi/pyversions/apache-ariatosca.svg + .. |Wheel| image:: https://img.shields.io/pypi/wheel/apache-ariatosca.svg + .. |Contributors| image:: https://img.shields.io/github/contributors/apache/incubator-ariatosca.svg + .. |Open Pull Requests| image:: https://img.shields.io/github/issues-pr/apache/incubator-ariatosca.svg + :target: https://github.com/apache/incubator-ariatosca/pulls + .. |Closed Pull Requests| image:: https://img.shields.io/github/issues-pr-closed-raw/apache/incubator-ariatosca.svg + :target: https://github.com/apache/incubator-ariatosca/pulls?q=is%3Apr+is%3Aclosed + +Platform: any +Classifier: Development Status :: 4 - Beta +Classifier: Environment :: Console +Classifier: Environment :: Web Environment +Classifier: Intended Audience :: Developers +Classifier: Intended Audience :: System Administrators +Classifier: License :: OSI Approved :: Apache Software License +Classifier: Operating System :: OS Independent +Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2 +Classifier: Programming Language :: Python :: 2.6 +Classifier: Programming Language :: Python :: 2.7 +Classifier: Topic :: Software Development :: Libraries :: Python Modules +Classifier: Topic :: System :: Networking +Classifier: Topic :: System :: Systems Administration
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/SOURCES.txt ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/SOURCES.txt b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/SOURCES.txt new file mode 100644 index 0000000..30bcd9e --- /dev/null +++ b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/SOURCES.txt @@ -0,0 +1,378 @@ +CHANGELOG.rst +CONTRIBUTING +DISCLAIMER +LICENSE +MANIFEST.in +NOTICE +README.rst +VERSION +requirements.in +requirements.txt +setup.py +apache_ariatosca.egg-info/PKG-INFO +apache_ariatosca.egg-info/SOURCES.txt +apache_ariatosca.egg-info/dependency_links.txt +apache_ariatosca.egg-info/entry_points.txt +apache_ariatosca.egg-info/not-zip-safe +apache_ariatosca.egg-info/requires.txt +apache_ariatosca.egg-info/top_level.txt +aria/__init__.py +aria/core.py +aria/exceptions.py +aria/extension.py +aria/logger.py +aria/cli/__init__.py +aria/cli/ascii_art.py +aria/cli/color.py +aria/cli/csar.py +aria/cli/defaults.py +aria/cli/env.py +aria/cli/exceptions.py +aria/cli/execution_logging.py +aria/cli/helptexts.py +aria/cli/inputs.py +aria/cli/logger.py +aria/cli/main.py +aria/cli/service_template_utils.py +aria/cli/table.py +aria/cli/utils.py +aria/cli/commands/__init__.py +aria/cli/commands/executions.py +aria/cli/commands/logs.py +aria/cli/commands/node_templates.py +aria/cli/commands/nodes.py +aria/cli/commands/plugins.py +aria/cli/commands/reset.py +aria/cli/commands/service_templates.py +aria/cli/commands/services.py +aria/cli/commands/workflows.py +aria/cli/config/__init__.py +aria/cli/config/config.py +aria/cli/config/config_template.yaml +aria/cli/core/__init__.py +aria/cli/core/aria.py +aria/modeling/__init__.py +aria/modeling/constraints.py +aria/modeling/exceptions.py +aria/modeling/functions.py +aria/modeling/mixins.py +aria/modeling/models.py +aria/modeling/orchestration.py +aria/modeling/relationship.py +aria/modeling/service_changes.py +aria/modeling/service_common.py +aria/modeling/service_instance.py +aria/modeling/service_template.py +aria/modeling/types.py +aria/modeling/utils.py +aria/orchestrator/__init__.py +aria/orchestrator/decorators.py +aria/orchestrator/events.py +aria/orchestrator/exceptions.py +aria/orchestrator/plugin.py +aria/orchestrator/workflow_runner.py +aria/orchestrator/context/__init__.py +aria/orchestrator/context/common.py +aria/orchestrator/context/exceptions.py +aria/orchestrator/context/operation.py +aria/orchestrator/context/toolbelt.py +aria/orchestrator/context/workflow.py +aria/orchestrator/execution_plugin/__init__.py +aria/orchestrator/execution_plugin/common.py +aria/orchestrator/execution_plugin/constants.py +aria/orchestrator/execution_plugin/environment_globals.py +aria/orchestrator/execution_plugin/exceptions.py +aria/orchestrator/execution_plugin/instantiation.py +aria/orchestrator/execution_plugin/local.py +aria/orchestrator/execution_plugin/operations.py +aria/orchestrator/execution_plugin/ctx_proxy/__init__.py +aria/orchestrator/execution_plugin/ctx_proxy/client.py +aria/orchestrator/execution_plugin/ctx_proxy/server.py +aria/orchestrator/execution_plugin/ssh/__init__.py +aria/orchestrator/execution_plugin/ssh/operations.py +aria/orchestrator/execution_plugin/ssh/tunnel.py +aria/orchestrator/workflows/__init__.py +aria/orchestrator/workflows/events_logging.py +aria/orchestrator/workflows/exceptions.py +aria/orchestrator/workflows/api/__init__.py +aria/orchestrator/workflows/api/task.py +aria/orchestrator/workflows/api/task_graph.py +aria/orchestrator/workflows/builtin/__init__.py +aria/orchestrator/workflows/builtin/execute_operation.py +aria/orchestrator/workflows/builtin/heal.py +aria/orchestrator/workflows/builtin/install.py +aria/orchestrator/workflows/builtin/start.py +aria/orchestrator/workflows/builtin/stop.py +aria/orchestrator/workflows/builtin/uninstall.py +aria/orchestrator/workflows/builtin/workflows.py +aria/orchestrator/workflows/core/__init__.py +aria/orchestrator/workflows/core/engine.py +aria/orchestrator/workflows/core/events_handler.py +aria/orchestrator/workflows/core/graph_compiler.py +aria/orchestrator/workflows/executor/__init__.py +aria/orchestrator/workflows/executor/base.py +aria/orchestrator/workflows/executor/celery.py +aria/orchestrator/workflows/executor/dry.py +aria/orchestrator/workflows/executor/process.py +aria/orchestrator/workflows/executor/thread.py +aria/parser/__init__.py +aria/parser/exceptions.py +aria/parser/specification.py +aria/parser/consumption/__init__.py +aria/parser/consumption/consumer.py +aria/parser/consumption/context.py +aria/parser/consumption/exceptions.py +aria/parser/consumption/inputs.py +aria/parser/consumption/modeling.py +aria/parser/consumption/presentation.py +aria/parser/consumption/style.py +aria/parser/consumption/validation.py +aria/parser/loading/__init__.py +aria/parser/loading/context.py +aria/parser/loading/exceptions.py +aria/parser/loading/file.py +aria/parser/loading/literal.py +aria/parser/loading/loader.py +aria/parser/loading/location.py +aria/parser/loading/request.py +aria/parser/loading/source.py +aria/parser/loading/uri.py +aria/parser/modeling/__init__.py +aria/parser/modeling/context.py +aria/parser/presentation/__init__.py +aria/parser/presentation/context.py +aria/parser/presentation/exceptions.py +aria/parser/presentation/field_validators.py +aria/parser/presentation/fields.py +aria/parser/presentation/null.py +aria/parser/presentation/presentation.py +aria/parser/presentation/presenter.py +aria/parser/presentation/source.py +aria/parser/presentation/utils.py +aria/parser/reading/__init__.py +aria/parser/reading/context.py +aria/parser/reading/exceptions.py +aria/parser/reading/jinja.py +aria/parser/reading/json.py +aria/parser/reading/locator.py +aria/parser/reading/raw.py +aria/parser/reading/reader.py +aria/parser/reading/source.py +aria/parser/reading/yaml.py +aria/parser/validation/__init__.py +aria/parser/validation/context.py +aria/parser/validation/issue.py +aria/storage/__init__.py +aria/storage/api.py +aria/storage/collection_instrumentation.py +aria/storage/core.py +aria/storage/exceptions.py +aria/storage/filesystem_rapi.py +aria/storage/sql_mapi.py +aria/utils/__init__.py +aria/utils/archive.py +aria/utils/argparse.py +aria/utils/caching.py +aria/utils/collections.py +aria/utils/console.py +aria/utils/exceptions.py +aria/utils/file.py +aria/utils/formatting.py +aria/utils/http.py +aria/utils/imports.py +aria/utils/openclose.py +aria/utils/plugin.py +aria/utils/process.py +aria/utils/specification.py +aria/utils/threading.py +aria/utils/type.py +aria/utils/uris.py +aria/utils/uuid.py +aria/utils/validation.py +aria/utils/versions.py +docs/html/.buildinfo +docs/html/aria.cli.html +docs/html/aria.html +docs/html/aria.modeling.html +docs/html/aria.modeling.models.html +docs/html/aria.orchestrator.context.html +docs/html/aria.orchestrator.execution_plugin.ctx_proxy.html +docs/html/aria.orchestrator.execution_plugin.html +docs/html/aria.orchestrator.execution_plugin.ssh.html +docs/html/aria.orchestrator.html +docs/html/aria.orchestrator.workflows.api.html +docs/html/aria.orchestrator.workflows.builtin.html +docs/html/aria.orchestrator.workflows.executor.html +docs/html/aria.orchestrator.workflows.html +docs/html/aria.parser.consumption.html +docs/html/aria.parser.html +docs/html/aria.parser.loading.html +docs/html/aria.parser.modeling.html +docs/html/aria.parser.presentation.html +docs/html/aria.parser.reading.html +docs/html/aria.parser.validation.html +docs/html/aria.storage.html +docs/html/aria.utils.html +docs/html/aria_extension_tosca.simple_nfv_v1_0.html +docs/html/aria_extension_tosca.simple_v1_0.html +docs/html/aria_extension_tosca.simple_v1_0.modeling.html +docs/html/aria_extension_tosca.simple_v1_0.presentation.html +docs/html/cli.html +docs/html/genindex.html +docs/html/index.html +docs/html/objects.inv +docs/html/py-modindex.html +docs/html/rest.html +docs/html/search.html +docs/html/searchindex.js +docs/html/_sources/aria.cli.rst.txt +docs/html/_sources/aria.modeling.models.rst.txt +docs/html/_sources/aria.modeling.rst.txt +docs/html/_sources/aria.orchestrator.context.rst.txt +docs/html/_sources/aria.orchestrator.execution_plugin.ctx_proxy.rst.txt +docs/html/_sources/aria.orchestrator.execution_plugin.rst.txt +docs/html/_sources/aria.orchestrator.execution_plugin.ssh.rst.txt +docs/html/_sources/aria.orchestrator.rst.txt +docs/html/_sources/aria.orchestrator.workflows.api.rst.txt +docs/html/_sources/aria.orchestrator.workflows.builtin.rst.txt +docs/html/_sources/aria.orchestrator.workflows.executor.rst.txt +docs/html/_sources/aria.orchestrator.workflows.rst.txt +docs/html/_sources/aria.parser.consumption.rst.txt +docs/html/_sources/aria.parser.loading.rst.txt +docs/html/_sources/aria.parser.modeling.rst.txt +docs/html/_sources/aria.parser.presentation.rst.txt +docs/html/_sources/aria.parser.reading.rst.txt +docs/html/_sources/aria.parser.rst.txt +docs/html/_sources/aria.parser.validation.rst.txt +docs/html/_sources/aria.rst.txt +docs/html/_sources/aria.storage.rst.txt +docs/html/_sources/aria.utils.rst.txt +docs/html/_sources/aria_extension_tosca.simple_nfv_v1_0.rst.txt +docs/html/_sources/aria_extension_tosca.simple_v1_0.modeling.rst.txt +docs/html/_sources/aria_extension_tosca.simple_v1_0.presentation.rst.txt +docs/html/_sources/aria_extension_tosca.simple_v1_0.rst.txt +docs/html/_sources/cli.rst.txt +docs/html/_sources/index.rst.txt +docs/html/_sources/rest.rst.txt +docs/html/_static/ajax-loader.gif +docs/html/_static/basic.css +docs/html/_static/comment-bright.png +docs/html/_static/comment-close.png +docs/html/_static/comment.png +docs/html/_static/doctools.js +docs/html/_static/down-pressed.png +docs/html/_static/down.png +docs/html/_static/file.png +docs/html/_static/jquery-3.1.0.js +docs/html/_static/jquery.js +docs/html/_static/minus.png +docs/html/_static/plus.png +docs/html/_static/pygments.css +docs/html/_static/searchtools.js +docs/html/_static/underscore-1.3.1.js +docs/html/_static/underscore.js +docs/html/_static/up-pressed.png +docs/html/_static/up.png +docs/html/_static/websupport.js +docs/html/_static/css/badge_only.css +docs/html/_static/css/theme.css +docs/html/_static/fonts/Inconsolata-Bold.ttf +docs/html/_static/fonts/Inconsolata-Regular.ttf +docs/html/_static/fonts/Lato-Bold.ttf +docs/html/_static/fonts/Lato-Regular.ttf +docs/html/_static/fonts/RobotoSlab-Bold.ttf +docs/html/_static/fonts/RobotoSlab-Regular.ttf +docs/html/_static/fonts/fontawesome-webfont.eot +docs/html/_static/fonts/fontawesome-webfont.svg +docs/html/_static/fonts/fontawesome-webfont.ttf +docs/html/_static/fonts/fontawesome-webfont.woff +docs/html/_static/js/modernizr.min.js +docs/html/_static/js/theme.js +examples/hello-world/helloworld.yaml +examples/hello-world/index.html +examples/hello-world/images/aria-logo.png +examples/hello-world/scripts/configure.sh +examples/hello-world/scripts/start.sh +examples/hello-world/scripts/stop.sh +examples/tosca-simple-1.0/use-cases/non-normative-types.yaml +examples/tosca-simple-1.0/use-cases/block-storage-1/block-storage-1.yaml +examples/tosca-simple-1.0/use-cases/block-storage-1/inputs.yaml +examples/tosca-simple-1.0/use-cases/block-storage-2/block-storage-2.yaml +examples/tosca-simple-1.0/use-cases/block-storage-2/inputs.yaml +examples/tosca-simple-1.0/use-cases/block-storage-3/block-storage-3.yaml +examples/tosca-simple-1.0/use-cases/block-storage-3/inputs.yaml +examples/tosca-simple-1.0/use-cases/block-storage-4/block-storage-4.yaml +examples/tosca-simple-1.0/use-cases/block-storage-4/inputs.yaml +examples/tosca-simple-1.0/use-cases/block-storage-5/block-storage-5.yaml +examples/tosca-simple-1.0/use-cases/block-storage-5/inputs.yaml +examples/tosca-simple-1.0/use-cases/block-storage-6/block-storage-6.yaml +examples/tosca-simple-1.0/use-cases/block-storage-6/inputs.yaml +examples/tosca-simple-1.0/use-cases/compute-1/compute-1.yaml +examples/tosca-simple-1.0/use-cases/compute-1/inputs.yaml +examples/tosca-simple-1.0/use-cases/container-1/container-1.yaml +examples/tosca-simple-1.0/use-cases/multi-tier-1/inputs.yaml +examples/tosca-simple-1.0/use-cases/multi-tier-1/multi-tier-1.yaml +examples/tosca-simple-1.0/use-cases/multi-tier-1/custom_types/collectd.yaml +examples/tosca-simple-1.0/use-cases/multi-tier-1/custom_types/elasticsearch.yaml +examples/tosca-simple-1.0/use-cases/multi-tier-1/custom_types/kibana.yaml +examples/tosca-simple-1.0/use-cases/multi-tier-1/custom_types/logstash.yaml +examples/tosca-simple-1.0/use-cases/multi-tier-1/custom_types/rsyslog.yaml +examples/tosca-simple-1.0/use-cases/network-1/inputs.yaml +examples/tosca-simple-1.0/use-cases/network-1/network-1.yaml +examples/tosca-simple-1.0/use-cases/network-2/inputs.yaml +examples/tosca-simple-1.0/use-cases/network-2/network-2.yaml +examples/tosca-simple-1.0/use-cases/network-3/inputs.yaml +examples/tosca-simple-1.0/use-cases/network-3/network-3.yaml +examples/tosca-simple-1.0/use-cases/network-4/network-4.yaml +examples/tosca-simple-1.0/use-cases/object-storage-1/inputs.yaml +examples/tosca-simple-1.0/use-cases/object-storage-1/object-storage-1.yaml +examples/tosca-simple-1.0/use-cases/software-component-1/inputs.yaml +examples/tosca-simple-1.0/use-cases/software-component-1/software-component-1.yaml +examples/tosca-simple-1.0/use-cases/webserver-dbms-1/webserver-dbms-1.yaml +examples/tosca-simple-1.0/use-cases/webserver-dbms-2/webserver-dbms-2.yaml +examples/tosca-simple-1.0/use-cases/webserver-dbms-2/custom_types/paypalpizzastore_nodejs_app.yaml +extensions/aria_extension_tosca/__init__.py +extensions/aria_extension_tosca/profiles/aria-1.0/aria-1.0.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-1.0/artifacts.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-1.0/capabilities.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-1.0/data.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-1.0/groups.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-1.0/interfaces.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-1.0/nodes.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-1.0/policies.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-1.0/relationships.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-1.0/tosca-simple-1.0.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-nfv-1.0/artifacts.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-nfv-1.0/capabilities.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-nfv-1.0/data.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-nfv-1.0/nodes.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-nfv-1.0/relationships.yaml +extensions/aria_extension_tosca/profiles/tosca-simple-nfv-1.0/tosca-simple-nfv-1.0.yaml +extensions/aria_extension_tosca/simple_nfv_v1_0/__init__.py +extensions/aria_extension_tosca/simple_nfv_v1_0/presenter.py +extensions/aria_extension_tosca/simple_v1_0/__init__.py +extensions/aria_extension_tosca/simple_v1_0/assignments.py +extensions/aria_extension_tosca/simple_v1_0/data_types.py +extensions/aria_extension_tosca/simple_v1_0/definitions.py +extensions/aria_extension_tosca/simple_v1_0/filters.py +extensions/aria_extension_tosca/simple_v1_0/misc.py +extensions/aria_extension_tosca/simple_v1_0/presenter.py +extensions/aria_extension_tosca/simple_v1_0/templates.py +extensions/aria_extension_tosca/simple_v1_0/types.py +extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py +extensions/aria_extension_tosca/simple_v1_0/modeling/artifacts.py +extensions/aria_extension_tosca/simple_v1_0/modeling/capabilities.py +extensions/aria_extension_tosca/simple_v1_0/modeling/constraints.py +extensions/aria_extension_tosca/simple_v1_0/modeling/copy.py +extensions/aria_extension_tosca/simple_v1_0/modeling/data_types.py +extensions/aria_extension_tosca/simple_v1_0/modeling/functions.py +extensions/aria_extension_tosca/simple_v1_0/modeling/interfaces.py +extensions/aria_extension_tosca/simple_v1_0/modeling/parameters.py +extensions/aria_extension_tosca/simple_v1_0/modeling/policies.py +extensions/aria_extension_tosca/simple_v1_0/modeling/requirements.py +extensions/aria_extension_tosca/simple_v1_0/modeling/substitution_mappings.py +extensions/aria_extension_tosca/simple_v1_0/presentation/__init__.py +extensions/aria_extension_tosca/simple_v1_0/presentation/extensible.py +extensions/aria_extension_tosca/simple_v1_0/presentation/field_getters.py +extensions/aria_extension_tosca/simple_v1_0/presentation/field_validators.py +extensions/aria_extension_tosca/simple_v1_0/presentation/types.py \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/dependency_links.txt ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/dependency_links.txt b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/dependency_links.txt @@ -0,0 +1 @@ + http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/entry_points.txt ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/entry_points.txt b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/entry_points.txt new file mode 100644 index 0000000..392448e --- /dev/null +++ b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +aria = aria.cli.main:main + http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/not-zip-safe ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/not-zip-safe b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/not-zip-safe new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/not-zip-safe @@ -0,0 +1 @@ + http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/requires.txt ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/requires.txt b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/requires.txt new file mode 100644 index 0000000..8686349 --- /dev/null +++ b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/requires.txt @@ -0,0 +1,32 @@ +requests>=2.3.0, <2.14.0 +networkx>=1.9, <1.10 +retrying>=1.3.0, <1.4.0 +blinker>1.3, <1.5 +jsonpickle>0.9.0, <=0.9.4 +ruamel.yaml>=0.11.12, <0.12.0 +Jinja2>=2.8, <2.9 +shortuuid>=0.5, <0.6 +CacheControl[filecache]>=0.11.0, <0.13 +clint>=0.5.0, <0.6 +SQLAlchemy>=1.1.0, <1.2 +wagon==0.6.0 +bottle>=0.12.0, <0.13 +setuptools>=35.0.0, <36.0.0 +click>=6.0, < 7.0 +colorama>=0.3.7, <=0.3.9 +PrettyTable>=0.7,<0.8 +click_didyoumean==0.0.3 +backports.shutil_get_terminal_size==1.0.0 +logutils==0.3.4.1 +psutil>=5.2.2, < 6.0.0 + +[:python_version < '2.7'] +importlib +ordereddict +total-ordering + +[ssh] +Fabric>=1.13.0, <1.14 + +[ssh:sys_platform=="win32"] +pypiwin32==219 http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/top_level.txt ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/top_level.txt b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/top_level.txt new file mode 100644 index 0000000..58fb564 --- /dev/null +++ b/apache-ariatosca-0.1.1/apache_ariatosca.egg-info/top_level.txt @@ -0,0 +1,2 @@ +aria +aria_extension_tosca http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/ascii_art.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/ascii_art.py b/apache-ariatosca-0.1.1/aria/cli/ascii_art.py new file mode 100644 index 0000000..8a8b79f --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/ascii_art.py @@ -0,0 +1,24 @@ +# -*- coding: utf8 -*- +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + + +ARIA_ASCII_ART = r""" + ââââââ âââââââ âââ ââââââ + âââââââââââââââââââââââââââ + âââââââââââââââââââââââââââ + âââââââââââââââââââââââââââ + âââ ââââââ âââââââââ âââ + âââ ââââââ âââââââââ âââ""" http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/color.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/color.py b/apache-ariatosca-0.1.1/aria/cli/color.py new file mode 100644 index 0000000..03381ba --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/color.py @@ -0,0 +1,99 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +""" +Terminal colorization utilities. +""" + +from StringIO import StringIO +import re + +import colorama + +colorama.init() + + +class StringStylizer(object): + def __init__(self, str_, color_spec=None): + self._str = str_ + self._color_spec = color_spec + + def __repr__(self): + if self._color_spec: + return '{schema}{str}{reset}'.format( + schema=self._color_spec, str=str(self._str), reset=Colors.Style.RESET_ALL) + return self._str + + def __add__(self, other): + return str(self) + other + + def __radd__(self, other): + return other + str(self) + + def color(self, color_spec): + self._color_spec = color_spec + + def replace(self, old, new, **kwargs): + self._str = self._str.replace(str(old), str(new), **kwargs) + + def format(self, *args, **kwargs): + self._str = self._str.format(*args, **kwargs) + + def highlight(self, pattern, schema): + if pattern is None: + return + for match in set(re.findall(re.compile(pattern), self._str)): + self.replace(match, schema + match + Colors.Style.RESET_ALL + self._color_spec) + + +def _get_colors(color_type): + for name in dir(color_type): + if not name.startswith('_'): + yield (name.lower(), getattr(color_type, name)) + + +class Colors(object): + Fore = colorama.Fore + Back = colorama.Back + Style = colorama.Style + + _colors = { + 'fore': dict(_get_colors(Fore)), + 'back': dict(_get_colors(Back)), + 'style': dict(_get_colors(Style)) + } + + +class ColorSpec(object): + def __init__(self, fore=None, back=None, style=None): + """ + It is possible to provide fore, back and style arguments. each could be either + the color is lower case letter, or the actual color from Colorama. + """ + self._kwargs = dict(fore=fore, back=back, style=style) + self._str = StringIO() + for type_, colors in Colors._colors.items(): + value = self._kwargs.get(type_, None) + # the former case is if the value is a string, the latter is in case of an object. + self._str.write(colors.get(value) or value) + + def __str__(self): + return self._str.getvalue() + + def __add__(self, other): + return str(self) + str(other) + + def __radd__(self, other): + return str(other) + str(self) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/commands/executions.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/commands/executions.py b/apache-ariatosca-0.1.1/aria/cli/commands/executions.py new file mode 100644 index 0000000..ea70af5 --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/commands/executions.py @@ -0,0 +1,250 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +""" +CLI ``executions`` sub-commands. +""" + +import os + +from .. import helptexts +from .. import table +from .. import utils +from .. import logger as cli_logger +from .. import execution_logging +from ..core import aria +from ...modeling.models import Execution +from ...orchestrator.workflow_runner import WorkflowRunner +from ...orchestrator.workflows.executor.dry import DryExecutor +from ...utils import formatting +from ...utils import threading + +EXECUTION_COLUMNS = ('id', 'workflow_name', 'status', 'service_name', + 'created_at', 'error') + + [email protected](name='executions') [email protected]() +def executions(): + """ + Manage executions + """ + pass + + [email protected](name='show', + short_help='Show information for an execution') [email protected]('execution-id') [email protected]() [email protected]_model_storage [email protected]_logger +def show(execution_id, model_storage, logger): + """ + Show information for an execution + + EXECUTION_ID is the unique ID of the execution. + """ + logger.info('Showing execution {0}'.format(execution_id)) + execution = model_storage.execution.get(execution_id) + + table.print_data(EXECUTION_COLUMNS, execution, 'Execution:', col_max_width=50) + + # print execution parameters + logger.info('Execution Inputs:') + if execution.inputs: + #TODO check this section, havent tested it + execution_inputs = [ei.to_dict() for ei in execution.inputs] + for input_name, input_value in formatting.decode_dict( + execution_inputs).iteritems(): + logger.info('\t{0}: \t{1}'.format(input_name, input_value)) + else: + logger.info('\tNo inputs') + + [email protected](name='list', + short_help='List executions') [email protected]_name(required=False) [email protected]_by() [email protected] [email protected]() [email protected]_model_storage [email protected]_logger +def list(service_name, + sort_by, + descending, + model_storage, + logger): + """ + List executions + + If SERVICE_NAME is provided, list executions on that service. Otherwise, list executions on all + services. + """ + if service_name: + logger.info('Listing executions for service {0}...'.format( + service_name)) + service = model_storage.service.get_by_name(service_name) + filters = dict(service=service) + else: + logger.info('Listing all executions...') + filters = {} + + executions_list = model_storage.execution.list( + filters=filters, + sort=utils.storage_sort_param(sort_by, descending)).items + + table.print_data(EXECUTION_COLUMNS, executions_list, 'Executions:') + + [email protected](name='start', + short_help='Start a workflow on a service') [email protected]('workflow-name') [email protected]_name(required=True) [email protected](help=helptexts.EXECUTION_INPUTS) [email protected]_execution [email protected]_max_attempts() [email protected]_retry_interval() [email protected]_pattern() [email protected]() [email protected]_model_storage [email protected]_resource_storage [email protected]_plugin_manager [email protected]_logger +def start(workflow_name, + service_name, + inputs, + dry, + task_max_attempts, + task_retry_interval, + mark_pattern, + model_storage, + resource_storage, + plugin_manager, + logger): + """ + Start a workflow on a service + + SERVICE_NAME is the unique name of the service. + + WORKFLOW_NAME is the unique name of the workflow within the service (e.g. "uninstall"). + """ + service = model_storage.service.get_by_name(service_name) + executor = DryExecutor() if dry else None # use WorkflowRunner's default executor + + workflow_runner = \ + WorkflowRunner( + model_storage, resource_storage, plugin_manager, + service_id=service.id, workflow_name=workflow_name, inputs=inputs, executor=executor, + task_max_attempts=task_max_attempts, task_retry_interval=task_retry_interval + ) + logger.info('Starting {0}execution. Press Ctrl+C cancel'.format('dry ' if dry else '')) + + _run_execution(workflow_runner, logger, model_storage, dry, mark_pattern) + + [email protected](name='resume', + short_help='Resume a stopped execution') [email protected]('execution-id') [email protected](help=helptexts.EXECUTION_INPUTS) [email protected]_execution [email protected]_max_attempts() [email protected]_retry_interval() [email protected]_pattern() [email protected]() [email protected]_model_storage [email protected]_resource_storage [email protected]_plugin_manager [email protected]_logger +def resume(execution_id, + dry, + task_max_attempts, + task_retry_interval, + mark_pattern, + model_storage, + resource_storage, + plugin_manager, + logger): + """ + Resume a stopped execution + + EXECUTION_ID is the unique ID of the execution. + """ + executor = DryExecutor() if dry else None # use WorkflowRunner's default executor + + execution = model_storage.execution.get(execution_id) + if execution.status != execution.status.CANCELLED: + logger.info("Can't resume execution {execution.id} - " + "execution is in status {execution.status}. " + "Can only resume executions in status {valid_status}" + .format(execution=execution, valid_status=execution.status.CANCELLED)) + return + + workflow_runner = \ + WorkflowRunner( + model_storage, resource_storage, plugin_manager, + execution_id=execution_id, executor=executor, + task_max_attempts=task_max_attempts, task_retry_interval=task_retry_interval + ) + + logger.info('Resuming {0}execution. Press Ctrl+C cancel'.format('dry ' if dry else '')) + _run_execution(workflow_runner, logger, model_storage, dry, mark_pattern) + + +def _run_execution(workflow_runner, logger, model_storage, dry, mark_pattern): + execution_thread_name = '{0}_{1}'.format(workflow_runner.service.name, + workflow_runner.execution.workflow_name) + execution_thread = threading.ExceptionThread(target=workflow_runner.execute, + name=execution_thread_name) + + execution_thread.start() + + last_task_id = workflow_runner.execution.logs[-1].id if workflow_runner.execution.logs else 0 + log_iterator = cli_logger.ModelLogIterator(model_storage, + workflow_runner.execution_id, + offset=last_task_id) + try: + while execution_thread.is_alive(): + execution_logging.log_list(log_iterator, mark_pattern=mark_pattern) + execution_thread.join(1) + + except KeyboardInterrupt: + _cancel_execution(workflow_runner, execution_thread, logger, log_iterator) + + # It might be the case where some logs were written and the execution was terminated, thus we + # need to drain the remaining logs. + execution_logging.log_list(log_iterator, mark_pattern=mark_pattern) + + # raise any errors from the execution thread (note these are not workflow execution errors) + execution_thread.raise_error_if_exists() + + execution = workflow_runner.execution + logger.info('Execution has ended with "{0}" status'.format(execution.status)) + if execution.status == Execution.FAILED and execution.error: + logger.info('Execution error:{0}{1}'.format(os.linesep, execution.error)) + + if dry: + # remove traces of the dry execution (including tasks, logs, inputs..) + model_storage.execution.delete(execution) + + +def _cancel_execution(workflow_runner, execution_thread, logger, log_iterator): + logger.info('Cancelling execution. Press Ctrl+C again to force-cancel.') + workflow_runner.cancel() + while execution_thread.is_alive(): + try: + execution_logging.log_list(log_iterator) + execution_thread.join(1) + except KeyboardInterrupt: + pass http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/commands/logs.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/commands/logs.py b/apache-ariatosca-0.1.1/aria/cli/commands/logs.py new file mode 100644 index 0000000..b751b97 --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/commands/logs.py @@ -0,0 +1,72 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +""" +CLI ``logs`` sub-commands. +""" + +from .. import execution_logging +from ..logger import ModelLogIterator +from ..core import aria + + [email protected](name='logs') [email protected]() +def logs(): + """ + Manage logs of workflow executions + """ + pass + + [email protected](name='list', + short_help='List logs for an execution') [email protected]('execution-id') [email protected]() [email protected]_pattern() [email protected]_model_storage [email protected]_logger +def list(execution_id, mark_pattern, model_storage, logger): + """ + List logs for an execution + + EXECUTION_ID is the unique ID of the execution. + """ + logger.info('Listing logs for execution id {0}'.format(execution_id)) + log_iterator = ModelLogIterator(model_storage, execution_id) + + any_logs = execution_logging.log_list(log_iterator, mark_pattern=mark_pattern) + + if not any_logs: + logger.info('\tNo logs') + + [email protected](name='delete', + short_help='Delete logs of an execution') [email protected]('execution-id') [email protected]() [email protected]_model_storage [email protected]_logger +def delete(execution_id, model_storage, logger): + """ + Delete logs of an execution + + EXECUTION_ID is the unique ID of the execution. + """ + logger.info('Deleting logs for execution id {0}'.format(execution_id)) + logs_list = model_storage.log.list(filters=dict(execution_fk=execution_id)) + for log in logs_list: + model_storage.log.delete(log) + logger.info('Deleted logs for execution id {0}'.format(execution_id)) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/commands/node_templates.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/commands/node_templates.py b/apache-ariatosca-0.1.1/aria/cli/commands/node_templates.py new file mode 100644 index 0000000..ec160d2 --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/commands/node_templates.py @@ -0,0 +1,100 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +""" +CLI ``node-templates`` sub-commands. +""" + +from .. import table +from .. import utils +from ..core import aria + + +NODE_TEMPLATE_COLUMNS = ['id', 'name', 'description', 'service_template_name', 'type_name'] + + [email protected](name='node-templates') [email protected]() +def node_templates(): + """ + Manages stored service templates' node templates + """ + pass + + +@node_templates.command(name='show', + short_help='Show information for a stored node template') [email protected]('node-template-id') +# @aria.options.service_template_name(required=True) [email protected]() [email protected]_model_storage [email protected]_logger +def show(node_template_id, model_storage, logger): + """ + Show information for a stored node template + + NODE_TEMPLATE_ID is the unique node template ID. + """ + logger.info('Showing node template {0}'.format(node_template_id)) + node_template = model_storage.node_template.get(node_template_id) + + table.print_data(NODE_TEMPLATE_COLUMNS, node_template, 'Node template:', col_max_width=50) + + # print node template properties + logger.info('Node template properties:') + if node_template.properties: + logger.info(utils.get_parameter_templates_as_string(node_template.properties)) + else: + logger.info('\tNo properties') + + # print node IDs + nodes = node_template.nodes + logger.info('Nodes:') + if nodes: + for node in nodes: + logger.info('\t{0}'.format(node.name)) + else: + logger.info('\tNo nodes') + + +@node_templates.command(name='list', + short_help='List stored node templates') [email protected]_template_name() [email protected]_by('service_template_name') [email protected] [email protected]() [email protected]_model_storage [email protected]_logger +def list(service_template_name, sort_by, descending, model_storage, logger): + """ + List stored node templates + + If SERVICE_TEMPLATE_NAME is provided, list node templates for that stored service template. + Otherwise, list node templates for all service templates. + """ + if service_template_name: + logger.info('Listing node templates for service template {0}...'.format( + service_template_name)) + service_template = model_storage.service_template.get_by_name(service_template_name) + filters = dict(service_template=service_template) + else: + logger.info('Listing all node templates...') + filters = {} + + node_templates_list = model_storage.node_template.list( + filters=filters, + sort=utils.storage_sort_param(sort_by, descending)) + + table.print_data(NODE_TEMPLATE_COLUMNS, node_templates_list, 'Node templates:') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/commands/nodes.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/commands/nodes.py b/apache-ariatosca-0.1.1/aria/cli/commands/nodes.py new file mode 100644 index 0000000..30f1dd4 --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/commands/nodes.py @@ -0,0 +1,94 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +""" +CLI ``nodes`` sub-commands. +""" + +from .. import table +from .. import utils +from ..core import aria + + +NODE_COLUMNS = ['id', 'name', 'service_name', 'node_template_name', 'state'] + + [email protected](name='nodes') [email protected]() +def nodes(): + """ + Manage services' nodes + """ + pass + + [email protected](name='show', + short_help='Show information for a node') [email protected]('node_id') [email protected]() [email protected]_model_storage [email protected]_logger +def show(node_id, model_storage, logger): + """ + Show information for a node + + NODE_ID is the unique node ID. + """ + logger.info('Showing node {0}'.format(node_id)) + node = model_storage.node.get(node_id) + + table.print_data(NODE_COLUMNS, node, 'Node:', col_max_width=50) + + # print node attributes + logger.info('Node attributes:') + if node.attributes: + for param_name, param in node.attributes.iteritems(): + logger.info('\t{0}: {1}'.format(param_name, param.value)) + else: + logger.info('\tNo attributes') + + [email protected](name='list', + short_help='List node') [email protected]_name(required=False) [email protected]_by('service_name') [email protected] [email protected]() [email protected]_model_storage [email protected]_logger +def list(service_name, + sort_by, + descending, + model_storage, + logger): + """ + List nodes + + If SERVICE_NAME is provided, list nodes for that service. Otherwise, list nodes for all + services. + """ + if service_name: + logger.info('Listing nodes for service {0}...'.format(service_name)) + service = model_storage.service.get_by_name(service_name) + filters = dict(service=service) + else: + logger.info('Listing all nodes...') + filters = {} + + nodes_list = model_storage.node.list( + filters=filters, + sort=utils.storage_sort_param(sort_by, descending)) + + table.print_data(NODE_COLUMNS, nodes_list, 'Nodes:') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/commands/plugins.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/commands/plugins.py b/apache-ariatosca-0.1.1/aria/cli/commands/plugins.py new file mode 100644 index 0000000..b5d68a2 --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/commands/plugins.py @@ -0,0 +1,111 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +""" +CLI ``plugins`` sub-commands. +""" + +from .. import table +from .. import utils +from ..core import aria + + +PLUGIN_COLUMNS = ['id', 'package_name', 'package_version', 'supported_platform', + 'distribution', 'distribution_release', 'uploaded_at'] + + [email protected](name='plugins') [email protected]() +def plugins(): + """ + Manage plugins + """ + pass + + [email protected](name='validate', + short_help='Validate a plugin archive') [email protected]('plugin-path') [email protected]() [email protected]_plugin_manager [email protected]_logger +def validate(plugin_path, plugin_manager, logger): + """ + Validate a plugin archive + + A valid plugin is a wagon (`http://github.com/cloudify-cosmo/wagon`) in the ZIP format (suffix + may also be `.wgn`). + + PLUGIN_PATH is the path to the wagon archive. + """ + logger.info('Validating plugin {0}...'.format(plugin_path)) + plugin_manager.validate_plugin(plugin_path) + logger.info('Plugin validated successfully') + + [email protected](name='install', + short_help='Install a plugin') [email protected]('plugin-path') [email protected]() [email protected]_context [email protected]_plugin_manager [email protected]_logger +def install(ctx, plugin_path, plugin_manager, logger): + """ + Install a plugin + + A valid plugin is a wagon (`http://github.com/cloudify-cosmo/wagon`) in the ZIP format (suffix + may also be `.wgn`). + + PLUGIN_PATH is the path to the wagon archive. + """ + ctx.invoke(validate, plugin_path=plugin_path) + logger.info('Installing plugin {0}...'.format(plugin_path)) + plugin = plugin_manager.install(plugin_path) + logger.info("Plugin installed. The plugin's id is {0}".format(plugin.id)) + + [email protected](name='show', + short_help='Show information for an installed plugin') [email protected]('plugin-id') [email protected]() [email protected]_model_storage [email protected]_logger +def show(plugin_id, model_storage, logger): + """ + Show information for an installed plugin + + PLUGIN_ID is the unique installed plugin ID in this ARIA instance. + """ + logger.info('Showing plugin {0}...'.format(plugin_id)) + plugin = model_storage.plugin.get(plugin_id) + table.print_data(PLUGIN_COLUMNS, plugin, 'Plugin:') + + [email protected](name='list', + short_help='List all installed plugins') [email protected]_by('uploaded_at') [email protected] [email protected]() [email protected]_model_storage [email protected]_logger +def list(sort_by, descending, model_storage, logger): + """ + List all installed plugins + """ + logger.info('Listing all plugins...') + plugins_list = model_storage.plugin.list( + sort=utils.storage_sort_param(sort_by, descending)).items + table.print_data(PLUGIN_COLUMNS, plugins_list, 'Plugins:') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/commands/reset.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/commands/reset.py b/apache-ariatosca-0.1.1/aria/cli/commands/reset.py new file mode 100644 index 0000000..c82c707 --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/commands/reset.py @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +""" +CLI ``reset`` command. +""" + +from .. import helptexts +from ..core import aria +from ..env import env +from ..exceptions import AriaCliError + + [email protected](name='reset', + short_help="Reset ARIA working directory") [email protected](help=helptexts.FORCE_RESET) [email protected]_config [email protected]_logger [email protected]() +def reset(force, reset_config, logger): + """ + Reset ARIA working directory + + Deletes installed plugins, service templates, services, executions, and logs. The user + configuration will remain intact unless the `--reset_config` flag has been set as well, in + which case the entire ARIA working directory shall be removed. + """ + if not force: + raise AriaCliError("To reset the ARIA's working directory, you must also provide the force" + " flag ('-f'/'--force').") + + env.reset(reset_config=reset_config) + logger.info("ARIA's working directory has been reset") http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/commands/service_templates.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/commands/service_templates.py b/apache-ariatosca-0.1.1/aria/cli/commands/service_templates.py new file mode 100644 index 0000000..f567aa8 --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/commands/service_templates.py @@ -0,0 +1,245 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +""" +CLI ``service-templates`` sub-commands. +""" + +import os + +from .. import csar +from .. import service_template_utils +from .. import table +from .. import utils +from ..core import aria +from ...core import Core +from ...storage import exceptions as storage_exceptions +from ...parser import consumption +from ...utils import (formatting, collections, console) + + +DESCRIPTION_FIELD_LENGTH_LIMIT = 20 +SERVICE_TEMPLATE_COLUMNS = \ + ('id', 'name', 'description', 'main_file_name', 'created_at', 'updated_at') + + [email protected](name='service-templates') [email protected]() +def service_templates(): + """ + Manage service templates + """ + pass + + +@service_templates.command(name='show', + short_help='Show information for a stored service template') [email protected]('service-template-name') [email protected]() [email protected]_model_storage [email protected]_template_mode_full [email protected]_types [email protected]_json [email protected]_yaml [email protected]_logger +def show(service_template_name, model_storage, mode_full, mode_types, format_json, format_yaml, + logger): + """ + Show information for a stored service template + + SERVICE_TEMPLATE_NAME is the unique name of the stored service template. + """ + service_template = model_storage.service_template.get_by_name(service_template_name) + + if format_json or format_yaml: + mode_full = True + + if mode_full: + consumption.ConsumptionContext() + if format_json: + console.puts(formatting.json_dumps(collections.prune(service_template.as_raw))) + elif format_yaml: + console.puts(formatting.yaml_dumps(collections.prune(service_template.as_raw))) + else: + service_template.dump() + elif mode_types: + consumption.ConsumptionContext() + service_template.dump_types() + else: + logger.info('Showing service template {0}...'.format(service_template_name)) + service_template_dict = service_template.to_dict() + service_template_dict['#services'] = len(service_template.services) + columns = SERVICE_TEMPLATE_COLUMNS + ('#services',) + column_formatters = \ + dict(description=table.trim_formatter_generator(DESCRIPTION_FIELD_LENGTH_LIMIT)) + table.print_data(columns, service_template_dict, 'Service-template:', + column_formatters=column_formatters, col_max_width=50) + + if service_template_dict['description'] is not None: + logger.info('Description:') + logger.info('{0}{1}'.format(service_template_dict['description'].encode('UTF-8') or '', + os.linesep)) + + if service_template.services: + logger.info('Existing services:') + for service_name in service_template.services: + logger.info('\t{0}'.format(service_name)) + + +@service_templates.command(name='list', + short_help='List all stored service templates') [email protected]_by() [email protected] [email protected]() [email protected]_model_storage [email protected]_logger +def list(sort_by, descending, model_storage, logger): + """ + List all stored service templates + """ + + logger.info('Listing all service templates...') + service_templates_list = model_storage.service_template.list( + sort=utils.storage_sort_param(sort_by, descending)) + + column_formatters = \ + dict(description=table.trim_formatter_generator(DESCRIPTION_FIELD_LENGTH_LIMIT)) + table.print_data(SERVICE_TEMPLATE_COLUMNS, service_templates_list, 'Service templates:', + column_formatters=column_formatters) + + +@service_templates.command(name='store', + short_help='Parse and store a service template archive') [email protected]('service-template-path') [email protected]('service-template-name') [email protected]_template_filename [email protected]() [email protected]_model_storage [email protected]_resource_storage [email protected]_plugin_manager [email protected]_logger +def store(service_template_path, service_template_name, service_template_filename, + model_storage, resource_storage, plugin_manager, logger): + """ + Parse and store a service template archive + + SERVICE_TEMPLATE_PATH is the path to the service template archive. + + SERVICE_TEMPLATE_NAME is the unique name to give to the service template in storage. + """ + logger.info('Storing service template {0}...'.format(service_template_name)) + + service_template_path = service_template_utils.get(service_template_path, + service_template_filename) + core = Core(model_storage, resource_storage, plugin_manager) + try: + core.create_service_template(service_template_path, + os.path.dirname(service_template_path), + service_template_name) + except storage_exceptions.StorageError as e: + utils.check_overriding_storage_exceptions(e, 'service template', service_template_name) + raise + logger.info('Service template {0} stored'.format(service_template_name)) + + +@service_templates.command(name='delete', + short_help='Delete a stored service template') [email protected]('service-template-name') [email protected]() [email protected]_model_storage [email protected]_resource_storage [email protected]_plugin_manager [email protected]_logger +def delete(service_template_name, model_storage, resource_storage, plugin_manager, logger): + """ + Delete a stored service template + + SERVICE_TEMPLATE_NAME is the unique name of the stored service template. + """ + logger.info('Deleting service template {0}...'.format(service_template_name)) + service_template = model_storage.service_template.get_by_name(service_template_name) + core = Core(model_storage, resource_storage, plugin_manager) + core.delete_service_template(service_template.id) + logger.info('Service template {0} deleted'.format(service_template_name)) + + +@service_templates.command(name='inputs', + short_help='Show stored service template inputs') [email protected]('service-template-name') [email protected]() [email protected]_model_storage [email protected]_logger +def inputs(service_template_name, model_storage, logger): + """ + Show stored service template inputs + + SERVICE_TEMPLATE_NAME is the unique name of the stored service template. + """ + logger.info('Showing inputs for service template {0}...'.format(service_template_name)) + print_service_template_inputs(model_storage, service_template_name, logger) + + +@service_templates.command(name='validate', + short_help='Validate a service template archive') [email protected]('service-template') [email protected]_template_filename [email protected]() [email protected]_model_storage [email protected]_resource_storage [email protected]_plugin_manager [email protected]_logger +def validate(service_template, service_template_filename, + model_storage, resource_storage, plugin_manager, logger): + """ + Validate a service template archive + + SERVICE_TEMPLATE_PATH is the path to the service template archive. + """ + logger.info('Validating service template: {0}'.format(service_template)) + service_template_path = service_template_utils.get(service_template, service_template_filename) + core = Core(model_storage, resource_storage, plugin_manager) + core.validate_service_template(service_template_path) + logger.info('Service template validated successfully') + + +@service_templates.command(name='create-archive', + short_help='Create a CSAR archive from a service template source') [email protected]('service-template-path') [email protected]('destination') [email protected]() [email protected]_logger +def create_archive(service_template_path, destination, logger): + """ + Create a CSAR archive from a service template source + + SERVICE_TEMPLATE_PATH is the path to the service template source. + + DESTINATION is the path to the created CSAR archive. + """ + logger.info('Creating a CSAR archive') + if not destination.endswith(csar.CSAR_FILE_EXTENSION): + destination += csar.CSAR_FILE_EXTENSION + csar.write(service_template_path, destination, logger) + logger.info('CSAR archive created at {0}'.format(destination)) + + +def print_service_template_inputs(model_storage, service_template_name, logger): + service_template = model_storage.service_template.get_by_name(service_template_name) + + logger.info('Service template inputs:') + if service_template.inputs: + logger.info(utils.get_parameter_templates_as_string(service_template.inputs)) + else: + logger.info('\tNo inputs') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/commands/services.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/commands/services.py b/apache-ariatosca-0.1.1/aria/cli/commands/services.py new file mode 100644 index 0000000..a99f5b3 --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/commands/services.py @@ -0,0 +1,238 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +""" +CLI ``services`` sub-commands. +""" + +import os +from StringIO import StringIO + +from . import service_templates +from .. import helptexts +from .. import table +from .. import utils +from ..core import aria +from ...core import Core +from ...modeling import exceptions as modeling_exceptions +from ...storage import exceptions as storage_exceptions +from ...parser import consumption +from ...utils import (formatting, collections, console) + + +DESCRIPTION_FIELD_LENGTH_LIMIT = 20 +SERVICE_COLUMNS = ('id', 'name', 'description', 'service_template_name', 'created_at', 'updated_at') + + [email protected](name='services') [email protected]() +def services(): + """ + Manage services + """ + pass + + [email protected](name='show', + short_help='Show information for a service') [email protected]('service-name') [email protected]() [email protected]_mode_full [email protected]_graph [email protected]_json [email protected]_yaml [email protected]_model_storage [email protected]_logger +def show(service_name, model_storage, mode_full, mode_graph, format_json, format_yaml, logger): + """ + Show information for a service + + SERVICE_NAME is the unique name of the service. + """ + service = model_storage.service.get_by_name(service_name) + + if format_json or format_yaml: + mode_full = True + + if mode_full: + consumption.ConsumptionContext() + if format_json: + console.puts(formatting.json_dumps(collections.prune(service.as_raw))) + elif format_yaml: + console.puts(formatting.yaml_dumps(collections.prune(service.as_raw))) + else: + service.dump() + elif mode_graph: + consumption.ConsumptionContext() + service.dump_graph() + else: + logger.info('Showing service {0}...'.format(service_name)) + service_dict = service.to_dict() + columns = SERVICE_COLUMNS + column_formatters = \ + dict(description=table.trim_formatter_generator(DESCRIPTION_FIELD_LENGTH_LIMIT)) + table.print_data(columns, service_dict, 'Service:', + column_formatters=column_formatters, col_max_width=50) + + if service_dict['description'] is not None: + logger.info('Description:') + logger.info('{0}{1}'.format(service_dict['description'].encode('UTF-8') or '', + os.linesep)) + + [email protected](name='list', short_help='List services') [email protected]_template_name() [email protected]_by() [email protected] [email protected]() [email protected]_model_storage [email protected]_logger +def list(service_template_name, + sort_by, + descending, + model_storage, + logger): + """ + List services + + If `--service-template-name` is provided, list services based on that service template. + Otherwise, list all services. + """ + if service_template_name: + logger.info('Listing services for service template {0}...'.format( + service_template_name)) + service_template = model_storage.service_template.get_by_name(service_template_name) + filters = dict(service_template=service_template) + else: + logger.info('Listing all services...') + filters = {} + + services_list = model_storage.service.list( + sort=utils.storage_sort_param(sort_by=sort_by, descending=descending), + filters=filters) + table.print_data(SERVICE_COLUMNS, services_list, 'Services:') + + [email protected](name='create', + short_help='Create a service') [email protected]('service-name', required=False) [email protected]_template_name(required=True) [email protected](help=helptexts.SERVICE_INPUTS) [email protected]() [email protected]_model_storage [email protected]_resource_storage [email protected]_plugin_manager [email protected]_logger +def create(service_template_name, + service_name, + inputs, # pylint: disable=redefined-outer-name + model_storage, + resource_storage, + plugin_manager, + logger): + """ + Create a service + + SERVICE_NAME is the unique name to give to the service. + """ + logger.info('Creating new service from service template {0}...'.format( + service_template_name)) + core = Core(model_storage, resource_storage, plugin_manager) + service_template = model_storage.service_template.get_by_name(service_template_name) + + try: + service = core.create_service(service_template.id, inputs, service_name) + except storage_exceptions.StorageError as e: + utils.check_overriding_storage_exceptions(e, 'service', service_name) + raise + except modeling_exceptions.ParameterException: + service_templates.print_service_template_inputs(model_storage, service_template_name, + logger) + raise + logger.info("Service created. The service's name is {0}".format(service.name)) + + [email protected](name='delete', + short_help='Delete a service') [email protected]('service-name') [email protected](help=helptexts.IGNORE_AVAILABLE_NODES) [email protected]() [email protected]_model_storage [email protected]_resource_storage [email protected]_plugin_manager [email protected]_logger +def delete(service_name, force, model_storage, resource_storage, plugin_manager, logger): + """ + Delete a service + + SERVICE_NAME is the unique name of the service. + """ + logger.info('Deleting service {0}...'.format(service_name)) + service = model_storage.service.get_by_name(service_name) + core = Core(model_storage, resource_storage, plugin_manager) + core.delete_service(service.id, force=force) + logger.info('Service {0} deleted'.format(service_name)) + + [email protected](name='outputs', + short_help='Show service outputs') [email protected]('service-name') [email protected]() [email protected]_model_storage [email protected]_logger +def outputs(service_name, model_storage, logger): + """ + Show service outputs + + SERVICE_NAME is the unique name of the service. + """ + logger.info('Showing outputs for service {0}...'.format(service_name)) + service = model_storage.service.get_by_name(service_name) + + if service.outputs: + outputs_string = StringIO() + for output_name, output in service.outputs.iteritems(): + outputs_string.write(' - "{0}":{1}'.format(output_name, os.linesep)) + outputs_string.write(' Description: {0}{1}'.format(output.description, os.linesep)) + outputs_string.write(' Value: {0}{1}'.format(output.value, os.linesep)) + logger.info(outputs_string.getvalue()) + else: + logger.info('\tNo outputs') + + [email protected](name='inputs', + short_help='Show service inputs') [email protected]('service-name') [email protected]() [email protected]_model_storage [email protected]_logger +def inputs(service_name, model_storage, logger): + """ + Show service inputs + + SERVICE_NAME is the unique name of the service. + """ + logger.info('Showing inputs for service {0}...'.format(service_name)) + service = model_storage.service.get_by_name(service_name) + + if service.inputs: + inputs_string = StringIO() + for input_name, input_ in service.inputs.iteritems(): + inputs_string.write(' - "{0}":{1}'.format(input_name, os.linesep)) + inputs_string.write(' Description: {0}{1}'.format(input_.description, os.linesep)) + inputs_string.write(' Value: {0}{1}'.format(input_.value, os.linesep)) + logger.info(inputs_string.getvalue()) + else: + logger.info('\tNo inputs') http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/commands/workflows.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/commands/workflows.py b/apache-ariatosca-0.1.1/aria/cli/commands/workflows.py new file mode 100644 index 0000000..03cf00e --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/commands/workflows.py @@ -0,0 +1,111 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +""" +CLI ``worfklows`` sub-commands. +""" + +from .. import table +from ..core import aria +from ..exceptions import AriaCliError + +WORKFLOW_COLUMNS = ['name', 'service_template_name', 'service_name'] + + [email protected](name='workflows') +def workflows(): + """ + Manage service workflows + """ + pass + + [email protected](name='show', + short_help='Show information for a service workflow') [email protected]('workflow-name') [email protected]_name(required=True) [email protected]() [email protected]_model_storage [email protected]_logger +def show(workflow_name, service_name, model_storage, logger): + """ + Show information for a service workflow + + SERVICE_NAME is the unique name of the service. + + WORKFLOW_NAME is the unique name of the workflow within the service (e.g. "uninstall"). + """ + logger.info('Retrieving workflow {0} for service {1}'.format( + workflow_name, service_name)) + service = model_storage.service.get_by_name(service_name) + workflow = next((wf for wf in service.workflows.values() if + wf.name == workflow_name), None) + if not workflow: + raise AriaCliError( + 'Workflow {0} not found for service {1}'.format(workflow_name, service_name)) + + defaults = { + 'service_template_name': service.service_template_name, + 'service_name': service.name + } + table.print_data(WORKFLOW_COLUMNS, workflow, 'Workflows:', defaults=defaults) + + # print workflow inputs + required_inputs = dict() + optional_inputs = dict() + for input_name, input in workflow.inputs.iteritems(): + inputs_group = optional_inputs if input.value is not None else required_inputs + inputs_group[input_name] = input + + logger.info('Workflow Inputs:') + logger.info('\tMandatory Inputs:') + for input_name, input in required_inputs.iteritems(): + if input.description is not None: + logger.info('\t\t{0}\t({1})'.format(input_name, + input.description)) + else: + logger.info('\t\t{0}'.format(input_name)) + + logger.info('\tOptional Inputs:') + for input_name, input in optional_inputs.iteritems(): + if input.description is not None: + logger.info('\t\t{0}: \t{1}\t({2})'.format( + input_name, input.value, input.description)) + else: + logger.info('\t\t{0}: \t{1}'.format(input_name, + input.value)) + + [email protected](name='list', + short_help='List service workflows') [email protected]_name(required=True) [email protected]() [email protected]_model_storage [email protected]_logger +def list(service_name, model_storage, logger): + """ + List service workflows + + SERVICE_NAME is the unique name of the service. + """ + logger.info('Listing workflows for service {0}...'.format(service_name)) + service = model_storage.service.get_by_name(service_name) + workflows_list = sorted(service.workflows.values(), key=lambda w: w.name) + + defaults = { + 'service_template_name': service.service_template_name, + 'service_name': service.name + } + table.print_data(WORKFLOW_COLUMNS, workflows_list, 'Workflows:', defaults=defaults) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/config/config.py ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/config/config.py b/apache-ariatosca-0.1.1/aria/cli/config/config.py new file mode 100644 index 0000000..bbece80 --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/config/config.py @@ -0,0 +1,93 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You 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. + +""" +CLI configuration mechanism. +""" + +import os +import pkg_resources +from ruamel import yaml + +from jinja2.environment import Template + + +CONFIG_FILE_NAME = 'config.yaml' + + +class CliConfig(object): + + def __init__(self, config_path): + with open(config_path) as f: + self._config = yaml.safe_load(f.read()) + + @classmethod + def create_config(cls, workdir): + config_path = os.path.join(workdir, CONFIG_FILE_NAME) + if not os.path.isfile(config_path): + config_template = pkg_resources.resource_string( + __package__, + 'config_template.yaml') + + default_values = { + 'log_path': os.path.join(workdir, 'cli.log'), + 'enable_colors': True + } + + template = Template(config_template) + rendered = template.render(**default_values) + with open(config_path, 'w') as f: + f.write(rendered) + f.write(os.linesep) + + return cls(config_path) + + @property + def logging(self): + return self.Logging(self._config.get('logging')) + + class Logging(object): + + def __init__(self, logging): + self._logging = logging or {} + + @property + def filename(self): + return self._logging.get('filename') + + @property + def loggers(self): + return self._logging.get('loggers', {}) + + @property + def execution(self): + return self.Execution(self._logging.get('execution')) + + class Execution(object): + + def __init__(self, execution_logging): + self._execution_logging = execution_logging + + @property + def colors_enabled(self): + return self.colors.get('enabled', False) + + @property + def colors(self): + return self._execution_logging.get('colors', {}) + + @property + def formats(self): + return self._execution_logging.get('formats', {}) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca-website/blob/d593b4ae/apache-ariatosca-0.1.1/aria/cli/config/config_template.yaml ---------------------------------------------------------------------- diff --git a/apache-ariatosca-0.1.1/aria/cli/config/config_template.yaml b/apache-ariatosca-0.1.1/aria/cli/config/config_template.yaml new file mode 100644 index 0000000..94fcac3 --- /dev/null +++ b/apache-ariatosca-0.1.1/aria/cli/config/config_template.yaml @@ -0,0 +1,42 @@ + +logging: + + # path to a file where cli logs will be saved. + filename: {{ log_path }} + + # configuring level per logger + loggers: + + # main logger of the cli. provides basic descriptions for executed operations. + aria.cli.main: info + + execution: + formats: + # According to verbosity level 0 - no verbose. 3 - high verbose + 0: '{message}' + 1: '{timestamp:%H:%M:%S} | {level[0]} | {message}' + 2: '{timestamp:%H:%M:%S} | {level[0]} | {implementation} | {message}' + 3: '{timestamp:%H:%M:%S} | {level[0]} | {implementation} | {inputs} | {message}' + + colors: + enabled: true + + level: + default: {'fore': 'lightmagenta_ex'} + error: {'fore': 'red', 'style': 'bright'} + timestamp: + default: {'fore': 'lightmagenta_ex'} + error: {'fore': 'red', 'style': 'bright'} + message: + default: {'fore': 'lightblue_ex'} + error: {'fore': 'red', 'style': 'bright'} + implementation: + default: {'fore': 'lightblack_ex'} + error: {'fore': 'red', 'style': 'bright'} + inputs: + default: {'fore': 'blue'} + error: {'fore': 'red', 'style': 'bright'} + traceback: + default: {'fore': 'red'} + + marker: 'lightyellow_ex'
