Python+GraphQL microservice to check ports availability in a host.
git clone [email protected]:davidecaruso/wazowski.git
cd wazowski && cp .env.example .env && vi .envdocker-compose up --build -dpip3 install --no-cache-dir -r requirements.txt
python3 main.pyMany of the following GraphQL queries accept these parameters:
start: is the starting port value of the range. Default value is 1024end: is the ending port value of the range. Default value is 65535host: is the host where the search will be performed. Default value is "127.0.0.1"
POST /graphql
query Query {
check(port: 3000, host: "127.0.0.1")
}200
{
"data": {
"check": true
}
}POST /graphql
query Query {
list(start: 3000, end: 3010, host: "127.0.0.1")
}200
{
"data": {
"list": [
3000,
3002,
3010
]
}
}POST /graphql
query Query {
next(port: 3007, start: 3000, end: 3010, host: "127.0.0.1")
}200
{
"data": {
"next": 3008
}
}POST /graphql
query Query {
previous(port: 3007, start: 3000, end: 3010, host: "127.0.0.1")
}200
{
"data": {
"previous": 3006
}
}POST /graphql
query Query {
random(start: 3000, end: 4000, host: "127.0.0.1")
}200
{
"data": {
"random": 3265
}
}Licensed under MIT.
