
#                                      Copyright 2024 WebPros International, LLC
#                                                           All rights reserved.
# copyright@cpanel.net                                         http://cpanel.net
# This code is subject to the cPanel license. Unauthorized copying is prohibited.

package Whostmgr::360Monitoring::Agent::Plugins::Powerdns;

use cPstrict;
use Moo;
use Types::Common qw(PositiveInt NonEmptyStr);
use Whostmgr::360Monitoring::Moo;
use Whostmgr::360Monitoring::Types qw(WPUrl);

extends 'Whostmgr::360Monitoring::Agent::Plugins';

conf_has 'statistics_url' => (
    isa     => WPUrl,
    default => 'http://localhost:8081/api/v1/servers/localhost/statistics',
);

conf_has 'api_key' => (
    isa => NonEmptyStr,
);

conf_has 'ca_file' => (
    isa => NonEmptyStr,
);

conf_has 'ca_path' => ( isa => NonEmptyStr );

conf_has 'timeout' => (
    isa     => PositiveInt,
    default => 10,
);

1;

__END__

=head1 NAME

Whostmgr::360Monitoring::Agent::Plugins::Powerdns - A class for the Powerdns plugin

=head1 DESCRIPTION

A child class of L<Whostmgr::360Monitoring::Agent::Plugins>. More information can be found at L<Agent360 Plugin Documentation|https://docs.360monitoring.com/docs/powerdns-plugin>. The upstream implementation can be found at the L<Agent360 Repository on Github|https://github.com/plesk/agent360/tree/master/agent360/plugins/powerdns.py>.

Usage for plugin configuration changes can be found in the L<Agent|Whostmgr::360Monitoring::Agent> class.

Usage for configuration options can be found in the L<Agent powerdns-plugin documentation|https://docs.360monitoring.com/docs/powerdns-plugin/#configure-the-plugin>.

=head1 ROLES

=over 15

=item L<Runnable|Whostmgr::360Monitoring::Agent::Plugins::Roles::Runnable>

=item L<Enableable|Whostmgr::360Monitoring::Agent::Plugins::Roles::Enableable>

=item L<Serializable|Whostmgr::360Monitoring::Agent::Plugins::Roles::Serializable>


=back

=head1 ATTRIBUTES

=over 15

=item statistics_url

The url to the statistics api.  Defaults to http://localhost:8081/api/v1/servers/localhost/statistics

=item api_key

The api key to use to reach the PowerDNS backend

=item ca_file

The optional ca file to load

=item ca_path

The optional ca path to load the ca_file from

=item timeout

The optional timeout for powerdns api requests.


=back

=head1 SEE ALSO

=over 8

=item L<Implementation of Plugin on Github|https://github.com/plesk/agent360/tree/master/agent360/plugins/powerdns.py>

=item L<Documentation on Agent360|https://docs.360monitoring.com/docs/powerdns-plugin>

=back
