Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d30f1fc

Browse files
authored
Update README.md
1 parent f6f07c4 commit d30f1fc

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

‎README.md

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# Python Client for Spring Boot Admin
1+
# Python/Flask Web Service Component connecting to Spring Boot Admin
22

3-
[Spring Boot Admin](https://github.com/codecentric/spring-boot-admin "Spring Boot Admin GitHub repository") is a great tool written to show an admin interface for [Spring Boot<sup>®</sup>](http://projects.spring.io/spring-boot/ "Official Spring-Boot website") applications. However, in a world driven by microservices, other programming languages might also be used to develop components. This project provides a simple executable template of a Python Flask application registering itself as a component to a Spring Boot Admin server. Thereafter, it's monitored by the Spring Boot Admin server (alive status) that also provides access to the shared meta information. Your advantage: Spring Boot and Python applications are monitored using the same tool.
3+
[Spring Boot Admin](https://github.com/codecentric/spring-boot-admin "Spring Boot Admin GitHub repository") is a great tool implemented to provide an admin interface for [Spring Boot<sup>®</sup>](http://projects.spring.io/spring-boot/ "Official Spring-Boot website") applications. However, in a world driven by microservices, other programming languages than Java might also be used to develop components.
4+
5+
This project provides a simple executable template of a Python Flask application, registering itself as a component to a Spring Boot Admin server. Thereafter, it's monitored by the Spring Boot Admin server (alive status) that also provides access to the shared meta information. Your advantage: Spring Boot and Python applications are monitored using the same tool.
46

57

68
![Python v3.6](https://img.shields.io/badge/python-v3.6-brightgreen) ![Flask v1](https://img.shields.io/badge/flask-v1-brightgreen) [![License](http://img.shields.io/:license-mit-blue.svg?style=flat-square)](http://badges.mit-license.org)
@@ -11,17 +13,18 @@
1113
### Prepare the Project
1214

1315
```sh
14-
git clone https://github.com/anbo-de/PythonClientForSpringBootAdmin.git
15-
cd PythonClientForSpringBootAdmin
16+
git clone git@github.com:WSE-research/Spring-Boot-Admin-Python-component.git
17+
cd Spring-Boot-Admin-Python-component
1618
pip install -r requirements.txt
17-
1819
```
1920

20-
### Setup your Service
21+
### Set up your Service
2122

2223
Copy the template configuration file [app.conf](./app.conf) to create a custom configuration file (e.g., `cp app.conf app.local.conf`).
2324

24-
Edit your custom configuration file (e.g., `app.local.conf`) and define your environment values. Thereafter, the file might look like this:
25+
Edit your custom configuration file (e.g., `app.local.conf`) and define your environment values.
26+
Thereafter, the file might look like this:
27+
2528
```ini
2629
[ServiceConfiguration]
2730
springbootadminserverurl = http://localhost:8080/
@@ -36,20 +39,24 @@ servicedescription = my component is doing some magic
3639
### Run the Service
3740

3841
A typical start of the service using the previously defined custom configuration `app.local.conf` might be done via:
42+
3943
```sh
4044
python3 app.py -c app.local.conf
4145
```
42-
Now, check your Spring Boot Admin server UI. There should be a component visible having the name you had defined in your configuration file.
4346

47+
Now, check your Spring Boot Admin server UI.
48+
There should be a component visible having the same name as you had defined in your configuration file.
4449

45-
### Test the Service
46-
47-
The service template already provides some endpoints. For example, a GET endpoint is available at the route `/`.
48-
If you have defined you run your service at `http://127.0.0.1` (servicehost) and port `5000` (serviceport), then you can open http://127.0.0.1:5000/ using your browser. The response will be `Hello, World!` as defined in [myservice.py](./myservice.py).
4950

50-
Additionally, a basic HTML file is provided using the data defined in the configuration file. Following the previously mentioned examplary configuration it would be available at: http://127.0.0.1:5000/about
51+
### Test the Service
5152

53+
The service template already provides some endpoints.
54+
For example, a GET endpoint is available at the route `/`.
55+
If you have defined you run your service at `http://127.0.0.1` (servicehost) and port `5000` (serviceport), then you can open http://127.0.0.1:5000/ using your web browser.
56+
The response will be `Hello, World!` as defined in [myservice.py](./myservice.py).
5257

58+
Additionally, a basic HTML file is provided using the data defined in the configuration file.
59+
Following the previously mentioned exemplary configuration, it would be available at: http://127.0.0.1:5000/about
5360

5461
## Customize your Service
5562

@@ -69,20 +76,22 @@ The following files are contained in the project.
6976
└── templates
7077
└── about.html
7178
```
79+
7280
Typically, only the file `myservice.py` will be customized.
7381

7482
### Implement your own Service Functionality
7583

76-
Implementing a customized service is possible using the Flask functionality. See the [Flash documentation](https://palletsprojects.com/p/flask/) for details.
84+
Implementing a customized service is possible using the Flask functionality.
85+
See the [Flask documentation](https://palletsprojects.com/p/flask/) for details.
7786

7887

7988

8089
## Features
8190

8291
The template service provides the following functionality:
8392
* calls the Spring Boot Admin server iteratively (by default: every 10 seconds)
84-
* some meta data is send to the server, too
85-
* provides a health interface availabe at `/health` which will be called by Spring Boot Admin server (callback)
93+
* some metadata is sent to the server, too
94+
* provides a health interface available at `/health` which will be called by Spring Boot Admin server (callback)
8695
* the endpoint is used by the Spring Boot Admin server to check if the component is still available
8796
* provides an HTML page (available at `/about`) containing information about the component (see [templates/about.html](templates/about.html))
8897
* the presented data is taking from the (custom) config file

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /