Fakewebapi simulare a Fleet API endpoint for testing the checkin#14945
Merged
ph merged 2 commits intoelastic:fleetfrom Dec 5, 2019
ph:agent/fakewebapi
Merged
Fakewebapi simulare a Fleet API endpoint for testing the checkin#14945ph merged 2 commits intoelastic:fleetfrom ph:agent/fakewebapi
ph merged 2 commits intoelastic:fleetfrom
ph:agent/fakewebapi
Conversation
This PR creates a crude fake webserver to allow a beat agent to enroll and receives action from a remote host.
michalpristas
approved these changes
Dec 5, 2019
| @@ -0,0 +1,5 @@ | |||
| #!/bin/sh | |||
| APIKEY=${1:-"abc123"} | |||
| AGENTID=${2:-"agent007"} | |||
Contributor
Author
There was a problem hiding this comment.
shameless influence from a trailer.
| } | ||
|
|
||
| func handlerCheckin(w http.ResponseWriter, r *http.Request) { | ||
| mutex.Lock() |
Contributor
There was a problem hiding this comment.
what this lock locks?
you are responding with same response always, what about preparing mashalled response upfront
Contributor
Author
There was a problem hiding this comment.
Well, I wanted to make it more freeform, you can actually push a new configuration using the handlerAction
14 tasks
leweafan
pushed a commit
to leweafan/beats
that referenced
this pull request
Apr 28, 2023
…stic#14945) * Fakewebapi simulare a Fleet API endpoint for testing the checkin This PR creates a crude fake webserver to allow a beat agent to enroll and receives action from a remote host.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR creates a crude fake webserver to allow a beat agent to enroll
and receives action from a remote host.
@michalpristas This is really a quick and dirty webserver just to simulate a subset of the Fleet API, There are currently no validation for the action that are acked.