Comments (4)
Hi @LukasKnuth, thanks for raising this.
Yes, you can use the /system/status
healthcheck endpoint which returns HTTP 200
when the server is up.
For additional binaries inside the container, here's an example of a custom Docker image https://github.com/outofcoffee/imposter/blob/main/examples/docker/Dockerfile
☝️ This example extends from the Java base image so has its various userspace tools available (and more you can install with the package manager).
from imposter.
For this part of your question:
Would you be open to adding a CLI option to the server to check if its up and ready?
You should be able to use this command with the CLI:
imposter list --exit-code-health
You can also use the short form of the
--exit-code-health
argument,-x
More info here.
This sets the exit code based on mock health.
Example
$ imposter list -x ; echo $?
| ID | NAME | PORT | HEALTH |
|----|------|------|--------|
1
☝️ Returns code 1 as no mocks running.
$ imposter list -x ; echo $?
| ID | NAME | PORT | HEALTH |
|--------------|--------------|------|---------|
| d5755b211011 | /brave_mayer | 8080 | healthy |
0
☝️ Returns code 0 as a healthy mock running.
from imposter.
Nice, thanks for getting back to me. I wasn't aware that this existed already, thats great!
from imposter.
I tested it with my setup now and for me, this doesn't seem to work as expected:
$ docker exec e2e-apiv1-1 imposter list -x
| ID | NAME | PORT | HEALTH |
|----|------|------|---------|
| 1 | java | 0 | unknown |
$ echo $?
1
I use the openapi
plugin for this. Everything in the mock works as expected, just the list returns the unknown
health status. Do I need to add any additional information to the configuration for imposter ls
to pick it up and/or it's health?
from imposter.
Related Issues (20)
- --recursive-config-scan fails all mocks when one config.yaml is wrong
- imposter --dry-run
- docs: improve description of steps HOT 1
- build: remove deprecated nashorn-standalone-plugin JAR HOT 1
- issue in case of multiple matching HOT 8
- soap imposter-all issue with returning file as response HOT 1
- Docker + S3 HOT 3
- Support for GRPC mocking HOT 2
- Http 500 error when navigating to Swagger UI HOT 6
- [Improvement] Add support to configure through a remote API
- Can I add basepath for _spec endpoint? HOT 2
- A way to instruct a specific OAI example response HOT 2
- Port test-containers example to module catalogue
- Issue with Swagger UI and combined.json in Imposter AWS Lambda Deployment
- Incorrect order for Server Path and OpenAPI config path
- Using Expression.regexify in content responses HOT 2
- Request to make Context.Request.toString() produce json HOT 1
- Add support for faker regexify and similar functions
- Let a percentage of requests fail HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imposter.