Eureka Templating Library
Project description
About
eureka_template - library to generate files from eureka information
This library helps you generate files based on jinja2 templates based on information retrieved from Eureka
Installation
eureka_template can be installed using the pip distribution system for python by issuing:
$ pip install eureka_template
Alternatively, you can run use setup.py to install by cloning this repository and issuing:
# python setup.py install
Examples
Create a file named template.conf.tmpl:
[
{% for app in apps %}
{
"name": "{{ app.name }}",
"instances": [
{% for instance in app.instances %}
{
"hostName": "{{ instance.hostname }}",
"port": {{ instance.port }}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}{% if not loop.last %},{% endif %}
{% endfor %}
]
Then execute:
eureka-template -e http://eureka.example.com/eureka/v2/ \
-t template.conf.tmpl \
-o /dev/stdout
You’ll see your template filled with data on the screen.
It will keep running and polling eureka and will generate a new template any time there’s a change.
You can specify a command to execute whenever the template is generated by using the -c flag
eureka-template -e http://eureka.example.com/eureka/v2/ \
-t template.conf.tmpl \
-o /dev/stdout
-c "echo hi"
You can also run it and exit immediately:
eureka-template -e http://eureka.example.com/eureka/v2/ \
-t template.conf.tmpl \
-o /dev/stdout \
-c "echo hi" \
--once
Licensing
eureka_template is licensed under the Apache License 2.0. See LICENSE for the eureka_template full license text.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for eureka_template-0.0.5.dev0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7437f047ed536b36d2efa3c5cfc74902b180584d1688dc63d03b70a81ec38f8 |
|
MD5 | e15ffab722956444817e69ad40eacae0 |
|
BLAKE2b-256 | 4850fd1c9453a66e5dc2a2eec294949836ea104cd31eb653651e9d6397074991 |