NAME

HealthCheck::WebRequests - Make HTTP/HTTPS requests to web servers to check connectivity

VERSION

version v1.4.4

SYNOPSIS

use HealthCheck::WebRequests;

my $healthcheck = HealthCheck::WebRequests->new(
    checks => [
        {
            id    => 'foo',
            tags  => ['foo'],
            label => 'foo',
            url   => 'https://foo.example',
            # Any other valid args for HealthCheck::Diagnostic::WebRequest
        },
        HealthCheck::Diagnostic::WebRequest->new(...), # the top-level shared args do not apply to HealthCheck::Diagnostic::WebRequest instances
    ],
    # These args apply to all hashrefs in checks
    tags      => ['default_tag'],
    label     => 'default_label',
);

my $healthcheck2 = HealthCheck::WebRequests->new(
    checks => [
        {
            url   => 'https://foo.example',
            # tags        = ['default_tag']
            # label       = 'default_label'
            # status_code = '200'
        },
        {
            url   => 'https://bar.example',
            # tags        = ['default_tag']
            # label       = 'default_label'
            # status_code = '200'
        },
        HealthCheck::Diagnostic::WebRequest->new(...), # the top-level shared args do not apply to HealthCheck::Diagnostic::WebRequest instances
    ],
    # These args apply to all hashrefs in checks
    tags        => ['default_tag'],
    label       => 'default_label',
    status_code => '200',
);

DESCRIPTION

A HealthCheck that groups multiple HealthCheck::Diagnostic::WebRequest.

ATTRIBUTES

checks

An arrayref of hashrefs, where each hashref should contain valid arguments to instantiate a HealthCheck::Diagnostic::WebRequest object. Alternatively, HealthCheck::Diagnostic::WebRequest objects or subclasses can be directly provided instead of hashrefs.

SHARED ATTRIBUTES

These attributes, if supplied, are used to override the defaults for each hashref in the checks. These will not apply to any HealthCheck::Diagnostic::WebRequest objects in checks.

See the documentation in HealthCheck::Diagnostic::WebRequest for more details on them.

status_code
response_time_threshold
content_regex
no_follow_redirects
ua
options

DEPENDENCIES

HealthCheck HealthCheck::Diagnostic::WebRequest LWP::UserAgent

CONFIGURATION AND ENVIRONMENT

None

AUTHOR

Grant Street Group <developers@grantstreet.com>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018 - 2024 by Grant Street Group.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)