Class ContentMatcher (2.21.0)

ContentMatcher(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Optional. Used to perform content matching. This allows matching based on substrings and regular expressions, together with their negations. Only the first 4 MB of an HTTP or HTTPS check's response (and the first 1 MB of a TCP check's response) are examined for purposes of content matching.

.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes

Name Description
content str
String, regex or JSON content to match. Maximum 1024 bytes. An empty content string indicates no content matching is to be performed.
matcher google.cloud.monitoring_v3.types.UptimeCheckConfig.ContentMatcher.ContentMatcherOption
The type of content matcher that will be applied to the server output, compared to the content string when the check is run.
json_path_matcher google.cloud.monitoring_v3.types.UptimeCheckConfig.ContentMatcher.JsonPathMatcher
Matcher information for MATCHES_JSON_PATH and NOT_MATCHES_JSON_PATH This field is a member of oneof_ additional_matcher_info.

Classes

ContentMatcherOption

ContentMatcherOption(value)

Options to perform content matching.

Values: CONTENT_MATCHER_OPTION_UNSPECIFIED (0): No content matcher type specified (maintained for backward compatibility, but deprecated for future use). Treated as CONTAINS_STRING. CONTAINS_STRING (1): Selects substring matching. The match succeeds if the output contains the content string. This is the default value for checks without a matcher option, or where the value of matcher is CONTENT_MATCHER_OPTION_UNSPECIFIED. NOT_CONTAINS_STRING (2): Selects negation of substring matching. The match succeeds if the output does NOT contain the content string. MATCHES_REGEX (3): Selects regular-expression matching. The match succeeds if the output matches the regular expression specified in the content string. Regex matching is only supported for HTTP/HTTPS checks. NOT_MATCHES_REGEX (4): Selects negation of regular-expression matching. The match succeeds if the output does NOT match the regular expression specified in the content string. Regex matching is only supported for HTTP/HTTPS checks. MATCHES_JSON_PATH (5): Selects JSONPath matching. See JsonPathMatcher for details on when the match succeeds. JSONPath matching is only supported for HTTP/HTTPS checks. NOT_MATCHES_JSON_PATH (6): Selects JSONPath matching. See JsonPathMatcher for details on when the match succeeds. Succeeds when output does NOT match as specified. JSONPath is only supported for HTTP/HTTPS checks.

JsonPathMatcher

JsonPathMatcher(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Information needed to perform a JSONPath content match. Used for ContentMatcherOption::MATCHES_JSON_PATH and ContentMatcherOption::NOT_MATCHES_JSON_PATH.