Class: Google::Cloud::Monitoring::V3::UptimeCheckConfig::ContentMatcher

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/monitoring/v3/uptime.rb

Overview

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.

Defined Under Namespace

Modules: ContentMatcherOption Classes: JsonPathMatcher

Instance Attribute Summary collapse

Instance Attribute Details

#content::String

Returns String, regex or JSON content to match. Maximum 1024 bytes. An empty content string indicates no content matching is to be performed.

Returns:

  • (::String)

    String, regex or JSON content to match. Maximum 1024 bytes. An empty content string indicates no content matching is to be performed.



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'proto_docs/google/monitoring/v3/uptime.rb', line 413

class ContentMatcher
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Information needed to perform a JSONPath content match.
  # Used for `ContentMatcherOption::MATCHES_JSON_PATH` and
  # `ContentMatcherOption::NOT_MATCHES_JSON_PATH`.
  # @!attribute [rw] json_path
  #   @return [::String]
  #     JSONPath within the response output pointing to the expected
  #     `ContentMatcher::content` to match against.
  # @!attribute [rw] json_matcher
  #   @return [::Google::Cloud::Monitoring::V3::UptimeCheckConfig::ContentMatcher::JsonPathMatcher::JsonPathMatcherOption]
  #     The type of JSONPath match that will be applied to the JSON output
  #     (`ContentMatcher.content`)
  class JsonPathMatcher
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Options to perform JSONPath content matching.
    module JsonPathMatcherOption
      # No JSONPath matcher type specified (not valid).
      JSON_PATH_MATCHER_OPTION_UNSPECIFIED = 0

      # Selects 'exact string' matching. The match succeeds if the content at
      # the `json_path` within the output is exactly the same as the
      # `content` string.
      EXACT_MATCH = 1

      # Selects regular-expression matching. The match succeeds if the
      # content at the `json_path` within the output matches the regular
      # expression specified in the `content` string.
      REGEX_MATCH = 2
    end
  end

  # Options to perform content matching.
  module ContentMatcherOption
    # No content matcher type specified (maintained for backward
    # compatibility, but deprecated for future use).
    # Treated as `CONTAINS_STRING`.
    CONTENT_MATCHER_OPTION_UNSPECIFIED = 0

    # 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`.
    CONTAINS_STRING = 1

    # Selects negation of substring matching. The match succeeds if the
    # output does _NOT_ contain the `content` string.
    NOT_CONTAINS_STRING = 2

    # 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.
    MATCHES_REGEX = 3

    # 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.
    NOT_MATCHES_REGEX = 4

    # Selects JSONPath matching. See `JsonPathMatcher` for details on when
    # the match succeeds. JSONPath matching is only supported for HTTP/HTTPS
    # checks.
    MATCHES_JSON_PATH = 5

    # 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.
    NOT_MATCHES_JSON_PATH = 6
  end
end

#json_path_matcher::Google::Cloud::Monitoring::V3::UptimeCheckConfig::ContentMatcher::JsonPathMatcher

Returns Matcher information for MATCHES_JSON_PATH and NOT_MATCHES_JSON_PATH.

Returns:



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'proto_docs/google/monitoring/v3/uptime.rb', line 413

class ContentMatcher
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Information needed to perform a JSONPath content match.
  # Used for `ContentMatcherOption::MATCHES_JSON_PATH` and
  # `ContentMatcherOption::NOT_MATCHES_JSON_PATH`.
  # @!attribute [rw] json_path
  #   @return [::String]
  #     JSONPath within the response output pointing to the expected
  #     `ContentMatcher::content` to match against.
  # @!attribute [rw] json_matcher
  #   @return [::Google::Cloud::Monitoring::V3::UptimeCheckConfig::ContentMatcher::JsonPathMatcher::JsonPathMatcherOption]
  #     The type of JSONPath match that will be applied to the JSON output
  #     (`ContentMatcher.content`)
  class JsonPathMatcher
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Options to perform JSONPath content matching.
    module JsonPathMatcherOption
      # No JSONPath matcher type specified (not valid).
      JSON_PATH_MATCHER_OPTION_UNSPECIFIED = 0

      # Selects 'exact string' matching. The match succeeds if the content at
      # the `json_path` within the output is exactly the same as the
      # `content` string.
      EXACT_MATCH = 1

      # Selects regular-expression matching. The match succeeds if the
      # content at the `json_path` within the output matches the regular
      # expression specified in the `content` string.
      REGEX_MATCH = 2
    end
  end

  # Options to perform content matching.
  module ContentMatcherOption
    # No content matcher type specified (maintained for backward
    # compatibility, but deprecated for future use).
    # Treated as `CONTAINS_STRING`.
    CONTENT_MATCHER_OPTION_UNSPECIFIED = 0

    # 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`.
    CONTAINS_STRING = 1

    # Selects negation of substring matching. The match succeeds if the
    # output does _NOT_ contain the `content` string.
    NOT_CONTAINS_STRING = 2

    # 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.
    MATCHES_REGEX = 3

    # 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.
    NOT_MATCHES_REGEX = 4

    # Selects JSONPath matching. See `JsonPathMatcher` for details on when
    # the match succeeds. JSONPath matching is only supported for HTTP/HTTPS
    # checks.
    MATCHES_JSON_PATH = 5

    # 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.
    NOT_MATCHES_JSON_PATH = 6
  end
end

#matcher::Google::Cloud::Monitoring::V3::UptimeCheckConfig::ContentMatcher::ContentMatcherOption

Returns The type of content matcher that will be applied to the server output, compared to the content string when the check is run.

Returns:



413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
# File 'proto_docs/google/monitoring/v3/uptime.rb', line 413

class ContentMatcher
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Information needed to perform a JSONPath content match.
  # Used for `ContentMatcherOption::MATCHES_JSON_PATH` and
  # `ContentMatcherOption::NOT_MATCHES_JSON_PATH`.
  # @!attribute [rw] json_path
  #   @return [::String]
  #     JSONPath within the response output pointing to the expected
  #     `ContentMatcher::content` to match against.
  # @!attribute [rw] json_matcher
  #   @return [::Google::Cloud::Monitoring::V3::UptimeCheckConfig::ContentMatcher::JsonPathMatcher::JsonPathMatcherOption]
  #     The type of JSONPath match that will be applied to the JSON output
  #     (`ContentMatcher.content`)
  class JsonPathMatcher
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Options to perform JSONPath content matching.
    module JsonPathMatcherOption
      # No JSONPath matcher type specified (not valid).
      JSON_PATH_MATCHER_OPTION_UNSPECIFIED = 0

      # Selects 'exact string' matching. The match succeeds if the content at
      # the `json_path` within the output is exactly the same as the
      # `content` string.
      EXACT_MATCH = 1

      # Selects regular-expression matching. The match succeeds if the
      # content at the `json_path` within the output matches the regular
      # expression specified in the `content` string.
      REGEX_MATCH = 2
    end
  end

  # Options to perform content matching.
  module ContentMatcherOption
    # No content matcher type specified (maintained for backward
    # compatibility, but deprecated for future use).
    # Treated as `CONTAINS_STRING`.
    CONTENT_MATCHER_OPTION_UNSPECIFIED = 0

    # 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`.
    CONTAINS_STRING = 1

    # Selects negation of substring matching. The match succeeds if the
    # output does _NOT_ contain the `content` string.
    NOT_CONTAINS_STRING = 2

    # 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.
    MATCHES_REGEX = 3

    # 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.
    NOT_MATCHES_REGEX = 4

    # Selects JSONPath matching. See `JsonPathMatcher` for details on when
    # the match succeeds. JSONPath matching is only supported for HTTP/HTTPS
    # checks.
    MATCHES_JSON_PATH = 5

    # 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.
    NOT_MATCHES_JSON_PATH = 6
  end
end