zato-connection-registry: Load, Backup and Restore your Zato connection definitions

Zato

Zato is an open-source enterprise service bus solution for SOA.

It's built with Python2. And have amazing features if you need an ESB, in python ecosystem.

We have been experimenting with Zato, mainly, using it as an API gateway on our internal services. (REST APIs.) That process requires to define all our internal services. A simple connection definition holds these kind of data:

  • Service Name
  • Url/Path
  • Data Format (JSON, etc.)
  • Content Type
  • Security Definition (RBAC, Basic Auth, etc.)
  • ...


A simple pub-sub service definition on my local Zato setup

If you maintain lots of REST API service definitions and experiment Zato at the same time (spinning up new Zato instances for development, or having multiple Zato instances without sharing the database) then it may be a pain to migrate these services.

Of course, it's possible to do that migration with the internal Zato database. However, it's not much practical.

That brought the idea of having a backup/restore tool for Zato connection definitions.

zato-connection-registry

zato-connection-registry is a command line application/library to load, backup, restore REST connection definitions in Zato servers. (It can also serve as a python library.)


Pro tip: alias zct='zato_connection_registry'

This tool uses Zato's internal services to fetch and pull service definitions, and uses zato-client package.

Backup files are stored in the JSON format.

Note: Since zato-client package is a requirement for this tool, and python2 only, zato-connection-registry is also a python2 project.

Installation

$ pip install zato-connection-registry

Commands

  • Backup connection definitions
$ zato_connection_registry http://172.31.52.2:11223 pubapi:123 /tmp/foo.json
  • Restore connection definitions
$  zato_connection_registry restore http://172.31.52.2:11223 pubapi:123 /tmp/foo.json

Using zato-connection-registry as a library

After the installation, you can also use the package as a Python library:

from zato_connection_registry.registry import Registry

r = Registry(
    "http://localhost:11223",
    "pubapi",
    "123",
)

r.load_rest_channels()

print(r.rest_channels)

Limitations

  • Only REST channel definitions (including incoming and outcoing) are supported.

Running tests

python tests.py
...
----------------------------------------------------------------------
Ran 3 tests in 0.049s

OK

Commits

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
10 Comments