#!/use/bin/perl
package RVL::CPAPI::Plesk::SiteAlias;
##LICENSE##
use strict;
use warnings;
use Carp;
use base 'RVL::CPAPI::Plesk::Component';
#TODO
sub create {
my ( $self, %params ) = @_;
my $bulk_send = delete $params{bulk_send};
$self->check_required_params(\%params, [qw(site-id name)]);
return $bulk_send ? \%params :
$self->plesk->send('site-alias', 'create', \%params);
}
sub get {
my ($self, %filter) = @_;
my $bulk_send = delete $filter{bulk_send};
my $data = {
filter => @_ > 2 ? \%filter : '',
};
return $bulk_send ? $data :
$self->plesk->send('site-alias', 'get', $data);
}
sub set {
my ( $self, %params ) = @_;
my $bulk_send = delete $params{bulk_send};
return $bulk_send ? \%params :
$self->plesk->send('site-alias', 'set', \%params);
}
sub del {
my ($self, %filter) = @_;
my $bulk_send = delete $filter{bulk_send};
my $data = {
filter => @_ > 2 ? \%filter : ''
};
return $bulk_send ? $data :
$self->plesk->send('site-alias', 'del', $data);
}
1;
__END__
=head1 NAME
RVL::CPAPI::Plesk::SiteAlias - Managing site aliases.
=head1 SYNOPSIS
$api = RVL::CPAPI::Plesk->new(...);
$response = $api->site_alias->get(..);
=head1 DESCRIPTION
Module manage sites (domains).
=head1 METHODS
=over 3
=item create(%params)
=item get(%params)
=item set(%params)
=item del(%params)
=back
=head1 AUTHOR
Ivan Sokolov <lt>ivsokolov@cpan.org<gt>
=cut
Copyright 2K16 - 2K18 Indonesian Hacker Rulez