Skip to content

Get remote JSON response and search for some specific results such as string, number.

Notifications You must be signed in to change notification settings

whoopsmonitor/whoopsmonitor-check-json-expect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

whoopsmonitor-check-json-expect

Get remote JSON response and search for some specific results such as string, number.

Environmental variables

  • WM_API_ENDPOINT API endpoint to call.
  • WM_EXPECT Comma separated list of items.

WM_EXPECT

It is separated into four parts separated with a slash.

  • key The name of the key to search in response.
  • rule
    • string
    • number, integer
    • boolean
  • operator
    • string
      • eq, = (exact match)
      • *= (partial match)
    • numbers
      • eq, = (exact match)
      • gt, > - greater than (numbers)
      • lt, < - lower than (numbers)
  • value Compared value.

Example

There is an example of the check at Whoops Monitor configuration tab or the .env file.

WM_API_ENDPOINT=https://localhost:1337
WM_EXPECT=data.db/boolean/=/true
WM_API_ENDPOINT=https://localhost:1337
WM_EXPECT=data.db/number/gt/100

Output

  • 0 - Data founded in the format as expected.
  • 2 - Data does not have a proper format.

Build

docker build -t whoopsmonitor-check-json-expect .

Run

docker run --rm --env-file .env whoopsmonitor-check-json-expect

About

Get remote JSON response and search for some specific results such as string, number.

Topics

Resources

Stars

Watchers

Forks

Packages