WATSOAP (What's The Status Of API) is a API health-checking monitoring tool
The purpose of this tool is to automatically monitor the health of APIs. Monitoring the health of APIs manually is a time-consuming and painful task. Watsoap is an open-source tool that returns the operational status of API endpoints and connection times on a regular basis. It is a free, simple tool that saves you time and money.
- Collects the current health status of configured APIs.
- Generates the health status reports in a variety of file formats.
- Install git, If it is already installed, ignore it.
- Install Python, If it is already installed, ignore it.
- If Poetry is not already installed on your local machine, proceed as follows.
$ python -m pip install --upgrade pip
$ pip install poetry
- Clone this repository to your local machine.
$ git https://github.com/nawinto99/watsoap.git
- Change the working directory as follows.
$ cd watsoap
- Run following command which will install the necessary dependencies.
$ poetry install
- Rename the .env.dummy file in the config folder to .env.
- config.yml: This file contains information about the application configuration.
- .env: This file contains the Tokens, API keys, usernames and passwords, and other sensitive information.
- requests.yml : This file contains a list of requests, and the request's name should be unique in the list.
- requests_data.yml : This file contains the data required to initiate each request. Create one dictionary object for each request, and the name should exactly match the name mentioned in step one.
- The names of the keys must be distinct.
- It is recommended to use capital letters and underscores for separate words.
- The following keys should be updated
- HEALTH_REPORT_LOCATION: The location where the health status reports will be stored.
- HEALTH_REPORT_TYPE: Health status report format. Select one of the following options.
- CSV
- JSON
LOG_FILE_LOCATION: ~/logs/watsoap/
HEALTH_REPORT_LOCATION: ~/logs/watsoap/
HEALTH_REPORT_TYPE: CSV
- Create the list and map key name as endpoints .
- The name of the request should be unique in the list.
- It is recommended to use capital letters and underscores for separate words.
endpoints:
- MOCKBIN
- JSON_PLACE_HOLDER
- The names of the environmental variables must be distinct.
- It is recommended to use capital letters and underscores for separate words.
DOMAIN=example.org
ADMIN_EMAIL=admin@${DOMAIN}
BASIC_AUTH_GENERIC= { "user_name":"dummy_user", "password":"dummypassword"}
MOCKBIN= { "user_name":"sample", "password":"sample"}
- Create one dictionary object for each request, and the map key name should exactly match with the request name.
- For each dictionary object create following keys
- base_url[MANDATORY]: Complete API URL Path.
- method[MANDATORY]: The HTTP request method to perform the desired action on a given resource. HTTP request methods
- headers[OPTIONAL]: Custom HTTP headers.
- payload[OPTIONAL] Request payload.
- params[OPTIONAL]: Request query strings.
- auth_type[MANDATORY]: To access the resources, choose one of the following authentication types. - NO-AUTH - BASIC - API-KEY
- auth_env_name[OPTIONAL]: The name of the authentication environment variable should exactly match the name of the environment variable created in the.env file.
GENERIC:
doc: >
This is the generic section where requests fetch the common data for all APIs.
payload: |
{
"body": "bar",
"userId": 1
}
headers: |
{
"Content-Length": "253",
"Content-Type": "application/json",
"x-pretty-print": "2"
}
MOCKBIN:
base_url: "http://mockbin.com/request"
method: "POST"
headers: "GENERIC"
payload: |
{
"foo": "bar"
}
params: |
{
"foo":["bar","baz"]
}
auth_type: "BASIC"
auth_env_name: "MOCKBIN"
$ chmod +x run.sh
$ ./run.sh