Original install method (e.g. download page, yum, from source, etc.):
Docker
Describe the bug:
paramsfield stated to be a string, but API accepts as string as well as json object.
response of PUT / POST (create / update) monitor API return params as json object only, not a string.
GET request doesn't return params, username, password, proxy_headers, check.response.body.positive
GET, PUT and POST requests doesn't return retest_on_failure field
max_redirects for http monitor described as number, but API returns it as a string. You could also see that doc shows it as string
"max_redirects": "0",
GET API doesn't return inline_script and synthetics_args.
The difference in ssl, check and response fields is so that it is impossible to make back and forth mapping (aka not isomorphic, which is required for terraform resource, e.g.).
Steps to reproduce:
I was able to reproduce it in this unit test
Steps:
create elasticsearch and kibana, e.g. in docker
create private location in fleet, e.g. via API
call monitor create API and provide params as string / as json object -> see response has params as json object
call monitor GET api -> see response doesn't have params field
call update api -> see response has params as json object
Expected behavior:
GET Monitor API returns params as JSON object, as well as the following fields: username, password, proxy_headers, check.response.body.positive
GET, PUT and POST requests return retest_on_failure field
There is documentation, e.g. OpenAPI spec and text documentation for response field params
Overall idea - could we try to keep two invariants?
Request and Response schema is identical, or isomorphic?
The test to verify it: create a request, send it to API and compare result with the request.
Attach couple of examples for http and tcp monitors:
*.get.json - response from GET request
*.post.request.json - body sent to create a monitor
Kibana version: 8.14.3
Elasticsearch version: 8.14.3
Server OS version: Tested with docker,
docker.elastic.co/elasticsearch/elasticsearch:8.14.3
/docker.elastic.co/kibana/kibana:8.14.3
Here is docker compose example
Browser version: N/A
Browser OS version: N/A
Original install method (e.g. download page, yum, from source, etc.): Docker
Describe the bug:
params
field stated to be a string, but API accepts as string as well as json object.params
as json object only, not a string.params
,username
,password
,proxy_headers
,check.response.body.positive
GET
,PUT
andPOST
requests doesn't returnretest_on_failure
fieldmax_redirects
for http monitor described as number, but API returns it as a string. You could also see that doc shows it as stringinline_script
andsynthetics_args
.The difference in
ssl
,check
andresponse
fields is so that it is impossible to make back and forth mapping (aka not isomorphic, which is required for terraform resource, e.g.).Steps to reproduce: I was able to reproduce it in this unit test
Steps:
string
/ as json object -> see response hasparams
as json objectparams
fieldparams
as json objectExpected behavior:
params
as JSON object, as well as the following fields:username
,password
,proxy_headers
,check.response.body.positive
GET
,PUT
andPOST
requests returnretest_on_failure
fieldparams
Overall idea - could we try to keep two invariants?
Attach couple of examples for
http
andtcp
monitors:*.get.json
- response from GET request*.post.request.json
- body sent to create a monitor*.post.response.json
- response from POST (similar to PUT response) http.get.json http.post.request.json http.post.response.json tcp.get.json tcp.post.request.json tcp.post.response.json