Validators Config


| Language: |

cloudprober.validators.Validator #


name: <string>

[http_validator <cloudprober.validators.http.Validator> | integrity_validator <cloudprober.validators.integrity.Validator> | 
 json_validator <cloudprober.validators.json.Validator> | regex <string>]: <oneof>

cloudprober.validators.http.Validator #


# Comma-separated list of success status codes and code ranges. # Example: success_stauts_codes: 200-299,301,302
success_status_codes: <string>
# Comma-separated list of failure status codes and code ranges. If HTTP # status code matches failure_status_codes, validator fails.
failure_status_codes: <string>
# Header based validations. # TODO(manugarg): Add support for specifying multiple success and failure # headers. # # Success Header: # If specified, HTTP response headers should match the success_header for # validation to succeed. Example: # success_header: { # name: "Strict-Transport-Security" # value_regex: "max-age=31536000" # }
success_header: <cloudprober.validators.http.Validator.Header>
# Failure Header: # If HTTP response headers match failure_header, validation fails.
failure_header: <cloudprober.validators.http.Validator.Header>
# Last Modified Difference: # If specified, HTTP response's Last-Modified header is checked to be # within the specified time difference from the current time. Example: # max_last_modified_diff_sec: 3600 # This will check that the Last-Modified header is within the last hour.
max_last_modified_diff_sec: <uint64>

cloudprober.validators.http.Validator.Header #


# Header name to look for
name: <string>
# Header value to match. If omited - check for header existence
value_regex: <string>

cloudprober.validators.integrity.Validator #


# Validate the data integrity of the response using a pattern that is # repeated throughout the length of the response, with last len(response) % # len(pattern) bytes being zero bytes. # # For example if response length is 100 bytes and pattern length is 8 bytes, # first 96 bytes of the response should be pattern repeated 12 times, and # last 4 bytes should be set to zero byte ('\0')
[pattern_string <string> | pattern_num_bytes <int32>]: <oneof>

cloudprober.validators.json.Validator #


# If jq filter is specified, validator passes only if applying jq_filter to # the probe output, e.g. HTTP API response, results in 'true' boolean. # See the following test file for some examples: # https://github.com/cloudprober/cloudprober/blob/master/validators/json/json_test.go
jq_filter: <string>