libsolace package

Main Package

libsolace is a python library to manage the configuration of Solace messaging appliances. This project has a modular design which provides the basic features required to manage pairs of Solace Appliances.

Basics

Managed objects within Solace are managed through plugin.Plugin. Plugins are used to create SEMP requests, which can then be posted to the appliance through a SolaceAPI.SolaceAPI instance.

During the creation of SEMP requests, Plugins will enqueue the request in a instance of SolaceCommandQueue.SolaceCommandQueue which will also validate the request against the appropriate XSD for the version of SolOS-TR the appliance is running.

Example:

>>> import libsolace.settingsloader as settings
>>> from libsolace.SolaceAPI import SolaceAPI
>>> client = SolaceAPI("dev")
>>> list_requests = client.manage("NullPlugin", foo="bar", baz="jaz")
>>> type(list_requests)
<class 'libsolace.items.NullPlugin.NullPlugin'>

Installing

You need libyaml-devel or equivilant for your OS.

For debian means install:

  • libxslt1-dev
  • libxml2-dev
  • python-dev

and then run:

python setup.py install

Provisioning Quickstart

libsolace can be used as is for some basic provisioning which should be enough to get you started. In the main directory python-libsolace, create the following two YAML files.

libsolace.yaml

---
# the url you might want to serve the site config from if not using local files
CMDB_URL: "http://someurl/site.xml"
CMDB_FILE: "provision-example.yaml"
CMDB_USER: ""
CMDB_PASS: ""


# the readonly user to use for test mode
READ_ONLY_USER: readonly
READ_ONLY_PASS: readonly


# the naming standard to use, default is <env>_<name> if CMDB Client supports it.
NAMEHOOK: ZoinksNamingStandard


# list of all plugins to load
PLUGINS:
  - libsolace.items.SolaceACLProfile
  - libsolace.items.SolaceUser
  - libsolace.items.SolaceUsers
  - libsolace.items.SolaceVPN
  - libsolace.items.SolaceQueue
  - libsolace.plugins.NamingStandard
  - libsolace.plugins.ZoinksNamingStandard
  - libsolace.items.SolaceClientProfile
  - libsolace.plugins.Utilities
  - libsolace.plugins.InfluxDBClient
  - libsolace.plugins.YAMLClient


# the plugin name as registered in the registry we want to use for solace config
SOLACE_CMDB_PLUGIN: YAMLClient


# The plugin to use for Solace Queue management
SOLACE_QUEUE_PLUGIN: SolaceQueue
SOLACE_USER_PLUGIN: SolaceUser


# mapping of environment to solace appliances
SOLACE_CONF:
  dev:
   MGMT:
      - http://appliance.fqdn:8080/SEMP
   PASS: admin
   USER: admin

provision-example.yaml

VPNS:
  SolaceTest:
    -
      vpn_config:
        spool_size: 1024
      password: d0nt_u5e_th1s
      id: au_testvpn
      name: au_testvpn
    -
      owner: SolaceTest
      vpn_config:
        spool_size: 1024
      password: d0nt_u5e_th1s
      id: au_testvpn2
      name: au_testvpn2


QUEUES:
  au_testvpn:
    -
      name: testqueue1
      queue_config:
        exclusive: "true"
        queue_size: 4096
        retries: 0
        max_bind_count: 1000
        owner: au_testproductA
        consume: all


USERS:
  au_testvpn:
    -
      username: au_testproductA
      password: somepassword


  au_testvpn2:
    -
      username: au_testproductA
      password: somepassword

And then finally run wither of the following depending on if you have a cluster or standalone appliance.

Single appliance:

./bin/solace-provision.py -e dev --no-detect-status -p SolaceTest --soltr_version="soltr/7_1_1"

Cluster

./bin/solace-provision.py -e dev -p SolaceTest

Documentation

Documentation is sphinx based, so you need to install all the basics for sphinx including the rtd theme.

Doctest is run with make doctest

Documentation html is rendered with make html