{ "info": { "author": "Alexander Hermes", "author_email": "night_lynx@hotmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Programming Language :: Python :: 2.7" ], "description": "# libSolace\n[![Build Status](https://travis-ci.org/ExalDraen/python-libsolace.svg?branch=master)](https://travis-ci.org/ExalDraen/python-libsolace)\n\n**Table of Contents**\n\n- [libSolace](#libsolace)\n - [Overview](#overview)\n - [Installation](#installation)\n - [API Docs](#api-docs)\n - [XML Generator](#xml-generator)\n - [CMDB Configuration data and Naming Patterns](#cmdb-configuration-data-and-naming-patterns)\n - [Limitations](#limitations)\n- [Provisioning](#provisioning)\n - [Configuration](#configuration)\n- [Plugins](#plugins)\n- [bin](#bin)\n- [Classes](#classes)\n- [Site Management / Provisioning](#site-management--provisioning)\n - [-](#-)\n - [Integration with a Custom CMDB](#integration-with-a-custom-cmdb)\n - [Running the provision tasks](#running-the-provision-tasks)\n- [Testing](#testing)\n - [Single Plugin](#single-plugin)\n - [Single Test](#single-test)\n - [All with Coverage](#all-with-coverage)\n- [Docs](#docs)\n - [Doctests](#doctests)\n - [Html](#html)\n\n\n\n## Overview\n\nThis is a set of python helpers for managing and provisioning [Solace](https://solace.com/) Messaging Appliances and the VMR. The design is to be flexible\nand aimed at managing multiple clusters in multiple environments.\n\n## Installation\n\n1. Install the libraries required for `lxml` and `pyyaml`\n1. Install using `pip`:\n ```sh\n pip install libsolace\n ```\n\n## API Docs\n\n[API Docs](https://unixunion.github.io)\n\n\n### XML Generator\n\nThe core of this provisioning system is the SolaceXMLBuilder class which can generate XML through recursive instantiation of a dictionary like object. Example:\n\n```python\n >>> document = SolaceXMLBuilder(version=\"soltr/6_2\")\n >>> document.create.client_username.username = \"myUserName\"\n >>> document.create.client_username.vpn_name = \"dev_MyVPN\"\n >>> str(document)\n 'myUserNamedev_MyVPN'\n```\n\n\nPlugins create SEMP request objects, which then need to be sent via SolaceAPI.rpc to the appliances.\nPlugins are written to create single or batches of SEMP commands and return them once the XML is validated against the XSD.\n\n```python\n >>> from libsolace.SolaceAPI import SolaceAPI\n >>> connection = SolaceAPI(\"dev\")\n >>> # VMR: connection = SolaceAPI(\"dev\", detect_status=False, version=\"soltr/7_1_1\")\n >>> # create the command for creating a new user via the \"SolaceUser\" plugin\n >>> plugin_request = connection.manage(\"SolaceUser\").create_user(client_username=\"foo\", vpn_name=\"bar\")\n >>> plugin_request.xml\n 'foobar'\n >>> plugin_request.kwargs\n {'vpn_name': 'bar', 'primaryOnly': True, 'backupOnly': True, 'client_username': 'foo'}\n```\n\nThe SolaceXMLBuilder is typically used through the SolaceAPI, which will take care to detect the appliance OS version for you. e.g.\n\n```python\n >>> from libsolace.SolaceAPI import SolaceAPI\n >>> conn = SolaceAPI(\"dev\")\n >>> conn.manage(\"SolaceUser\").get(client_username=\"dev_testvpn\", vpn_name=\"dev_testvpn\")\n [{'HOST': 'http://solace1/SEMP', u'rpc-reply': {u'rpc': {u'show': {u'client-username': {u'client-usernames': {u'num-total-client-usernames': u'763', u'max-num-total-client-usernames': u'9002', u'num-dynamic-client-usernames': u'0', u'num-configured-client-usernames': u'763', u'client-username': {u'profile': u'glassfish', u'dynamically-configured': u'false', u'acl-profile': u'dev_testvpn', u'max-endpoints': u'16000', u'client-username': u'dev_testvpn', u'max-connections-service-smf': u'9000', u'enabled': u'true', u'message-vpn': u'dev_testvpn', u'password-configured': u'true', u'num-clients': u'0', u'max-connections-service-web': u'9000', u'num-endpoints': u'3', u'subscription-manager': u'false', u'authorization-group': None, u'max-connections': u'500', u'num-clients-service-web': u'0', u'guaranteed-endpoint-permission-override': u'false', u'num-clients-service-smf': u'0'}}}}}, u'execute-result': {u'@code': u'ok'}, u'@semp-version': u'soltr/7_1_1'}}, {'HOST': 'http://solace2/SEMP', u'rpc-reply': {u'rpc': {u'show': {u'client-username': {u'client-usernames': {u'num-total-client-usernames': u'755', u'max-num-total-client-usernames': u'9002', u'num-dynamic-client-usernames': u'0', u'num-configured-client-usernames': u'755', u'client-username': {u'profile': u'glassfish', u'dynamically-configured': u'false', u'acl-profile': u'dev_testvpn', u'max-endpoints': u'16000', u'client-username': u'dev_testvpn', u'max-connections-service-smf': u'9000', u'enabled': u'true', u'message-vpn': u'dev_testvpn', u'password-configured': u'true', u'num-clients': u'0', u'max-connections-service-web': u'9000', u'num-endpoints': u'4', u'subscription-manager': u'false', u'authorization-group': None, u'max-connections': u'500', u'num-clients-service-web': u'0', u'guaranteed-endpoint-permission-override': u'false', u'num-clients-service-smf': u'0'}}}}}, u'execute-result': {u'@code': u'ok'}, u'@semp-version': u'soltr/7_1_1'}}]\n```\n\nThe VMR requires initialization with the following:\n\n```python\n >>> from libsolace.SolaceAPI import SolaceAPI\n >>> conn = SolaceAPI(\"dev\", detect_status=False, version=\"soltr/7_1_1)\n >>> conn.manage(\"SolaceUser\").get(client_username=\"dev_testvpn\", vpn_name=\"dev_testvpn\")\n [{'HOST': 'http://solace3:8080/SEMP', u'rpc-reply': {u'rpc': {u'show': {u'client-username': {u'client-usernames': {u'num-total-client-usernames': u'10', u'max-num-total-client-usernames': u'1002', u'num-dynamic-client-usernames': u'0', u'num-configured-client-usernames': u'10'}}}}, u'execute-result': {u'@code': u'ok'}, u'@semp-version': u'soltr/7_1_1'}}, None]\n```\n\n\n### CMDB Configuration data and Naming Patterns\n\nIn my use case, each Solace Cluster could potentially host multiple 'environments', therefore ALL objects are created with\na environment specific name to allow multi-homing.\n\ne.g.:\n\n * dev_MyVPN\n * qa1_productA\n * dev_productA\n\nThis means that any cluster can host any number of environments combined without conflicting resources. The CMDBClient\ncontract states it must resolve the final item name by substituting the environment name into the string.\n\ne.g. '%s_myVpn' % env_name.\n\nThis can be achieved through a Naming plugin. see NamingStandard and\nZoinksNamingStandard\n\nSee CMDBClient for a CMDB plugin example.\n\n\n### Limitations\n\n* XML can only be validated if it is enqueued in a SolaceCommandQueue instance.\n* Appliance responses are difficult to validate since the \"slave\" appliance will almost always return errors when NOT \"active\", and already existing CI's will throw a error on create events and incorrect states. see\nDecorators for targeting specific appliances and states.\n* Since python dictionaries cannot contain `-` use `_`, the SolaceNode class will substitute a `-` for a `_` and\nvice-versa as needed on keyNames.\n\n# Provisioning\n\nlibsolace can provision Solace appliances from YAML files, or whichever CMDB you use if you implement a client for that.\n\nThe script ./bin/solace-provision.py is the entrypoint for provisioniong tasks.\n\nExamples\n```shell\n# single VMR \"au_dev3\"\n./bin/solace-provision.py -e au_dev3 --no-detect-status -p MySolaceEcosystem --soltr_version=\"soltr/7_1_1\"\n# 2 appliance cluster \"dev\"\n./bin/solace-provision.py -e dev -p MySolaceEcosystem\n\n```\n\n## Configuration\n\nlibsolace requires a `libsolace.yaml` file in order to know what environments exist and what appliances are part of those\nenvironments. A single appliance can be part of multiple environments.\n\nThe `libsolace.yaml` file is searched for in:\n\n* os.environ['LIBSOLACE_CONFIG']\n* 'libsolace.yaml'\n* '/etc/libsolace/libsolace.yaml'\n* '/opt/libsolace/libsolace.yaml'\n\nThe configuration loader is also responsible for loading all plugins as specified in the PLUGINS key.\n\nSee libsolace.yaml.template for more info.\n\n\n\n# Plugins\n\nlibsolace is pluggable, and you can register your own classes to customize the appliance management. You need to implement your own CMDBClient which should integrate with whatever configuration system you desire to populate solace.\n\n* See CMDBClient\n* See All Plugins\n* See Item Plugins\n\n# bin\n\nSee the bin for examples of various activities.\n\n# Classes\n\nrun `make html` to generate all sphinx docs.\nmake doctest -d to test docstrings\n\n# Site Management / Provisioning\n\nYou can manage a simple set of configuration items in multiple datacenters or environments utilizing the `solace-provision.py` bin,\nwhich can provision entire VPN's, Queues, Profiles and Users.\n\n```bash\n\u00a0./bin/solace-provision.py -e dev --no-detect-status -p MySolaceEcosystem --soltr_version=\"soltr/7_1_1\"\n```\n\n### YAMLClient\n\nThe YAML Client is the simplest way to spec out a environment. It is enabled by adding 'libsolace.plugins.YAMLClient' to\nthe PLUGINS list in libsolace.yaml, and settings 'SOLACE_CMDB_PLUGIN: YAMLClient'\n\n```yaml\n\n---\nVPNS:\n MySolaceEcosystem:\n -\n vpn_config:\n spool_size: 1024\n password: d0nt_u5e_th1s\n id: au_testvpn\n name: au_testvpn\n -\n vpn_config:\n spool_size: 1024\n password: d0nt_u5e_th1s\n id: au_testvpn2\n name: au_testvpn2\n\nQUEUES:\n au_testvpn:\n -\n name: testqueue1\n queue_config:\n exclusive: \"true\"\n queue_size: 4096\n retries: 0\n max_bind_count: 1000\n owner: au_testproductA\n consume: all\n\nUSERS:\n au_testvpn:\n -\n username: au_testproductA\n password: somepassword\n\n au_testvpn2:\n -\n username: au_testproductA\n password: somepassword\n```\n\n\n### Integration with a Custom CMDB\n\nYou should implement your own integration with whatever CMDB you use. See CMDBClient plugin *class* and associated\nlibpipeline.yaml properties for plugin structure and how to configure libsolace to use it.\n\nAny CMDB implementation must implement the methods as defined in the CMDBClient.py example.\n\n\n## Running the provision tasks\nsee ./bin/solace-provision.py --help\n\n# Testing\n\nDefine a \"dev\" environment in the config as in libsolace-tests.yaml. You can then run tests as follows:\n\n## Single Plugin\nnosetests -d tests.unittests.test_solace_user:TestSolaceUser --logging-level=INFO --nologcapture -v\n\n## Single Test\nnosetests -d tests.unittests.test_solace_user:TestSolaceUser.test_create_user --logging-level=INFO --nologcapture -v\n\n## All with Coverage\nLIBSOLACE_CONFIG=libsolace-tests.yaml nosetests --with-coverage --cover-package=libsolace\n\n# Docs\n\n## Doctests\nmake doctest\n\n## Html\nmake html\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ExalDraen/python-libsolace", "keywords": "solace", "license": "", "maintainer": "", "maintainer_email": "", "name": "libsolace", "package_url": "https://pypi.org/project/libsolace/", "platform": "", "project_url": "https://pypi.org/project/libsolace/", "project_urls": { "Homepage": "https://github.com/ExalDraen/python-libsolace" }, "release_url": "https://pypi.org/project/libsolace/0.3.0/", "requires_dist": [ "simplejson (<4.0.0,>=3.5.3)", "urllib3 (<2.0.0,>=1.9)", "lxml (<4.0.0,>=3.3.5)", "pyyaml (<4.0.0,>=3.11)" ], "requires_python": ">=2.7,<=3.0", "summary": "Solace Provisioning Helper using the Solace SEMP XML API", "version": "0.3.0" }, "last_serial": 4789821, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "13f89dddba0a13dc8afd394135843266", "sha256": "a4072b67ef216fa4c9f8375ed88bfb883db8dab947663bd1af4973e82b9e37a5" }, "downloads": -1, "filename": "libsolace-0.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "13f89dddba0a13dc8afd394135843266", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7,<=3.0", "size": 225398, "upload_time": "2018-10-26T07:24:25", "url": "https://files.pythonhosted.org/packages/eb/fe/9437da9b7087e7468cb42e7b82f7f8d881c89dec20c45f48b439c7dcf24d/libsolace-0.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "832b01af307677c0a1b1cfa3f8a226e4", "sha256": "c29d0ae7908482650a6a2a749c200adf2d281d1e83e92d2601a6619c0c32379a" }, "downloads": -1, "filename": "libsolace-0.2.1.tar.gz", "has_sig": false, "md5_digest": "832b01af307677c0a1b1cfa3f8a226e4", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,<=3.0", "size": 198597, "upload_time": "2018-10-26T07:24:28", "url": "https://files.pythonhosted.org/packages/f2/8d/31b72406bc90b44575b4cd60ce4346b30162332e2f1f2c61f4c35fc0ae43/libsolace-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "a269449268915c21ffb63a645077a6e5", "sha256": "8101b23e35b1ef18ecad4cba0524865c3bfd2a67321a6e1cd471fdf71bb16259" }, "downloads": -1, "filename": "libsolace-0.2.2-py2-none-any.whl", "has_sig": false, "md5_digest": "a269449268915c21ffb63a645077a6e5", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7,<=3.0", "size": 225471, "upload_time": "2018-11-01T08:22:11", "url": "https://files.pythonhosted.org/packages/f2/8b/1245c2fd6013046f05d96de419294934db489d54668d2e955ad208e084ad/libsolace-0.2.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ae631a0d1202cd77d7efc1e816ccdd78", "sha256": "e0b3ace31eb7b52af6231270c86fe78989df7ef2ef8bbb86c11c9ff540d068d2" }, "downloads": -1, "filename": "libsolace-0.2.2.tar.gz", "has_sig": false, "md5_digest": "ae631a0d1202cd77d7efc1e816ccdd78", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,<=3.0", "size": 198677, "upload_time": "2018-11-01T08:22:14", "url": "https://files.pythonhosted.org/packages/c6/1e/151aab83c7fb83ad2bed3d72c69d6efa1a28962a24ccc85df04f1252fcd0/libsolace-0.2.2.tar.gz" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "5ccde599b299c25ea73a289374a98ca9", "sha256": "568cd4d64cb2edb2e3941c2c54e679eab703c7811d42c2aa66a7671301185f5c" }, "downloads": -1, "filename": "libsolace-0.2.3-py2-none-any.whl", "has_sig": false, "md5_digest": "5ccde599b299c25ea73a289374a98ca9", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7,<=3.0", "size": 225504, "upload_time": "2018-12-17T03:37:54", "url": "https://files.pythonhosted.org/packages/58/da/f5a2e04e490b1b936298783ac6755e4124be6865de51ac87caaf86cdbb35/libsolace-0.2.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f9f909f4a80702176847830fd749a4f0", "sha256": "c402a6437d7ed5826daed0a6d62ba045103ce420b1e154272c89ec7644e486a1" }, "downloads": -1, "filename": "libsolace-0.2.3.tar.gz", "has_sig": false, "md5_digest": "f9f909f4a80702176847830fd749a4f0", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,<=3.0", "size": 197852, "upload_time": "2018-12-17T03:37:56", "url": "https://files.pythonhosted.org/packages/32/91/2294aff13ebebda655a9f38620db63861f1cdc6883a063a89e90c1f8c01d/libsolace-0.2.3.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "ba00343a2fca97a3b88b4f353de692f8", "sha256": "98c8eba408f0f8cd09989d4f1d1a2cef84a01f2fc2f0bffbd170109ce2142cec" }, "downloads": -1, "filename": "libsolace-0.3.0-py2-none-any.whl", "has_sig": false, "md5_digest": "ba00343a2fca97a3b88b4f353de692f8", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7,<=3.0", "size": 226167, "upload_time": "2019-02-07T06:39:29", "url": "https://files.pythonhosted.org/packages/e8/46/a6d26dad3f2a589f97ffdd17d259ef85854d1ceee43667ba10a69dc01063/libsolace-0.3.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6e6b10e6f033cf8146e01da8b62ddf27", "sha256": "56c19d8bfecd84ec2f2b94b5d79ed90a46425863fcd82a2c70155997e9f619d2" }, "downloads": -1, "filename": "libsolace-0.3.0.tar.gz", "has_sig": false, "md5_digest": "6e6b10e6f033cf8146e01da8b62ddf27", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,<=3.0", "size": 197876, "upload_time": "2019-02-07T06:39:32", "url": "https://files.pythonhosted.org/packages/39/ec/e06f664a7d86da96dca373eb290ba6a001c97fb1c06f53da184a163bbfb9/libsolace-0.3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ba00343a2fca97a3b88b4f353de692f8", "sha256": "98c8eba408f0f8cd09989d4f1d1a2cef84a01f2fc2f0bffbd170109ce2142cec" }, "downloads": -1, "filename": "libsolace-0.3.0-py2-none-any.whl", "has_sig": false, "md5_digest": "ba00343a2fca97a3b88b4f353de692f8", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": ">=2.7,<=3.0", "size": 226167, "upload_time": "2019-02-07T06:39:29", "url": "https://files.pythonhosted.org/packages/e8/46/a6d26dad3f2a589f97ffdd17d259ef85854d1ceee43667ba10a69dc01063/libsolace-0.3.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6e6b10e6f033cf8146e01da8b62ddf27", "sha256": "56c19d8bfecd84ec2f2b94b5d79ed90a46425863fcd82a2c70155997e9f619d2" }, "downloads": -1, "filename": "libsolace-0.3.0.tar.gz", "has_sig": false, "md5_digest": "6e6b10e6f033cf8146e01da8b62ddf27", "packagetype": "sdist", "python_version": "source", "requires_python": ">=2.7,<=3.0", "size": 197876, "upload_time": "2019-02-07T06:39:32", "url": "https://files.pythonhosted.org/packages/39/ec/e06f664a7d86da96dca373eb290ba6a001c97fb1c06f53da184a163bbfb9/libsolace-0.3.0.tar.gz" } ] }