mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
Add headers to Lmo and WebAPI modules, and put the modules in pt-agent.
This commit is contained in:
1469
bin/pt-agent
1469
bin/pt-agent
File diff suppressed because it is too large
Load Diff
35
lib/Lmo.pm
35
lib/Lmo.pm
@@ -17,15 +17,26 @@
|
||||
# ###########################################################################
|
||||
# Lmo package
|
||||
# ###########################################################################
|
||||
{
|
||||
# Package: Lmo
|
||||
# Lmo provides a miniature object system in the style of Moose and Moo.
|
||||
# Forked from 0.30 of Mo.
|
||||
|
||||
BEGIN {
|
||||
$INC{"Lmo.pm"} = __FILE__;
|
||||
# Lmo provides a little meta object system like Moose and Moo.
|
||||
# This code was derived from Mo 0.30.
|
||||
package Lmo;
|
||||
|
||||
our $VERSION = '0.01';
|
||||
|
||||
use strict;
|
||||
use warnings qw( FATAL all );
|
||||
|
||||
use Carp ();
|
||||
use Scalar::Util qw(blessed);
|
||||
|
||||
eval {
|
||||
require Lmo::Meta;
|
||||
require Lmo::Object;
|
||||
require Lmo::Types;
|
||||
};
|
||||
|
||||
{
|
||||
# Gets the glob from a given string.
|
||||
no strict 'refs';
|
||||
@@ -43,16 +54,6 @@ our $VERSION = '0.01';
|
||||
}
|
||||
}
|
||||
|
||||
use strict;
|
||||
use warnings qw( FATAL all );
|
||||
|
||||
use Carp ();
|
||||
use Scalar::Util qw(looks_like_number blessed);
|
||||
|
||||
use Lmo::Meta;
|
||||
use Lmo::Object;
|
||||
use Lmo::Types;
|
||||
|
||||
my %export_for;
|
||||
sub import {
|
||||
# Set warnings and strict for the caller.
|
||||
@@ -224,8 +225,6 @@ sub has {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
# handles handles
|
||||
sub _has_handles {
|
||||
my ($caller, $attribute, $args) = @_;
|
||||
@@ -348,8 +347,8 @@ BEGIN {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Lmo package
|
||||
# ###########################################################################
|
||||
|
@@ -1,24 +1,42 @@
|
||||
use strict;
|
||||
use warnings qw( FATAL all );
|
||||
|
||||
use Carp ();
|
||||
use Scalar::Util qw(looks_like_number blessed);
|
||||
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# Lmo::Meta package
|
||||
# ###########################################################################
|
||||
{
|
||||
package Lmo::Meta;
|
||||
my %metadata_for;
|
||||
# Package: Lmo::Meta
|
||||
# Meta data implementation for Lmo. Forked from 0.30 of Mo.
|
||||
package Lmo::Meta;
|
||||
|
||||
sub new {
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
|
||||
my %metadata_for;
|
||||
|
||||
sub new {
|
||||
shift;
|
||||
return Lmo::Meta::Class->new(@_);
|
||||
}
|
||||
}
|
||||
|
||||
sub metadata_for {
|
||||
sub metadata_for {
|
||||
my $self = shift;
|
||||
my ($class) = @_;
|
||||
|
||||
return $metadata_for{$class} ||= {};
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
@@ -55,3 +73,7 @@ use Scalar::Util qw(looks_like_number blessed);
|
||||
}
|
||||
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Lmo::Meta package
|
||||
# ###########################################################################
|
||||
|
@@ -1,4 +1,24 @@
|
||||
# Mo::Object is the parent of every Mo-derived object. Here's where new
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# Lmo::Object package
|
||||
# ###########################################################################
|
||||
{
|
||||
# Lmo::Object is the parent of every Mo-derived object. Here's where new
|
||||
# and BUILDARGS gets inherited from.
|
||||
package Lmo::Object;
|
||||
|
||||
@@ -6,9 +26,11 @@ use strict;
|
||||
use warnings qw( FATAL all );
|
||||
|
||||
use Carp ();
|
||||
use Scalar::Util qw(looks_like_number blessed);
|
||||
use Scalar::Util qw(blessed);
|
||||
|
||||
use Lmo::Meta;
|
||||
eval {
|
||||
require Lmo::Meta;
|
||||
};
|
||||
|
||||
{
|
||||
# Gets the glob from a given string.
|
||||
@@ -100,5 +122,8 @@ sub meta {
|
||||
return Lmo::Meta->new(class => $class);
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Lmo::Object package
|
||||
# ###########################################################################
|
||||
|
@@ -1,3 +1,26 @@
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# Lmo::Types package
|
||||
# ###########################################################################
|
||||
{
|
||||
# Package: Lmo::Types
|
||||
# Basic types for isa. If you want a new type, either add it here,
|
||||
# or give isa a coderef.
|
||||
package Lmo::Types;
|
||||
|
||||
use strict;
|
||||
@@ -6,9 +29,6 @@ use warnings qw( FATAL all );
|
||||
use Carp ();
|
||||
use Scalar::Util qw(looks_like_number blessed);
|
||||
|
||||
# Basic types for isa. If you want a new type, either add it here,
|
||||
# or give isa a coderef.
|
||||
|
||||
our %TYPES = (
|
||||
Bool => sub { !$_[0] || (defined $_[0] && looks_like_number($_[0]) && $_[0] == 1) },
|
||||
Num => sub { defined $_[0] && looks_like_number($_[0]) },
|
||||
@@ -96,3 +116,7 @@ sub _nested_constraints {
|
||||
}
|
||||
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Lmo::Types package
|
||||
# ###########################################################################
|
||||
|
@@ -19,8 +19,14 @@
|
||||
# ###########################################################################
|
||||
{
|
||||
package Percona::Toolkit;
|
||||
|
||||
our $VERSION = '3.0.0';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
|
||||
use Carp qw(carp cluck);
|
||||
use Data::Dumper qw();
|
||||
$Data::Dumper::Indent = 1;
|
||||
|
@@ -1,13 +1,40 @@
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# Percona::WebAPI::Client package
|
||||
# ###########################################################################
|
||||
{
|
||||
package Percona::WebAPI::Client;
|
||||
|
||||
our $VERSION = '0.01';
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
|
||||
use LWP;
|
||||
use JSON;
|
||||
use Scalar::Util qw(blessed);
|
||||
use English qw(-no_match_vars);
|
||||
|
||||
use Lmo;
|
||||
use Percona::Toolkit;
|
||||
use Percona::WebAPI::Exception::Request;
|
||||
|
||||
has 'api_key' => (
|
||||
is => 'ro',
|
||||
@@ -298,4 +325,9 @@ sub update_links {
|
||||
return;
|
||||
}
|
||||
|
||||
no Lmo;
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Percona::WebAPI::Client package
|
||||
# ###########################################################################
|
||||
|
@@ -1,6 +1,26 @@
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# Percona::WebAPI::Exception::Request package
|
||||
# ###########################################################################
|
||||
{
|
||||
package Percona::WebAPI::Exception::Request;
|
||||
|
||||
use Mo;
|
||||
use Lmo;
|
||||
use overload '""' => \&as_string;
|
||||
|
||||
has 'method' => (
|
||||
@@ -41,4 +61,9 @@ sub as_string {
|
||||
$error, $self->status, $self->method, $self->url, $self->content || '';
|
||||
}
|
||||
|
||||
no Lmo;
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Percona::WebAPI::Exception::Request package
|
||||
# ###########################################################################
|
||||
|
@@ -1,6 +1,26 @@
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# Percona::WebAPI::Representation::HashRef package
|
||||
# ###########################################################################
|
||||
{
|
||||
package Percona::WebAPI::Representation::HashRef;
|
||||
|
||||
use Moose::Role;
|
||||
use Lmo::Role;
|
||||
|
||||
sub as_hashref {
|
||||
my ($self) = @_;
|
||||
@@ -16,3 +36,7 @@ sub as_hashref {
|
||||
}
|
||||
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Percona::WebAPI::Representation::HashRef package
|
||||
# ###########################################################################
|
||||
|
@@ -1,6 +1,26 @@
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# Percona::WebAPI::Representation::JSON package
|
||||
# ###########################################################################
|
||||
{
|
||||
package Percona::WebAPI::Representation::JSON;
|
||||
|
||||
use Moose::Role;
|
||||
use Lmo::Role;
|
||||
use JSON;
|
||||
|
||||
sub as_json {
|
||||
@@ -17,3 +37,7 @@ sub as_json {
|
||||
}
|
||||
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Percona::WebAPI::Representation::JSON package
|
||||
# ###########################################################################
|
||||
|
@@ -1,9 +1,26 @@
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# Percona::WebAPI::Resource::Agent package
|
||||
# ###########################################################################
|
||||
{
|
||||
package Percona::WebAPI::Resource::Agent;
|
||||
|
||||
use Mo;
|
||||
|
||||
with 'Percona::WebAPI::Representation::JSON';
|
||||
with 'Percona::WebAPI::Representation::HashRef';
|
||||
use Lmo;
|
||||
|
||||
has 'id' => (
|
||||
is => 'ro',
|
||||
@@ -24,4 +41,9 @@ has 'versions' => (
|
||||
default => undef,
|
||||
);
|
||||
|
||||
no Lmo;
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Percona::WebAPI::Resource::Agent package
|
||||
# ###########################################################################
|
||||
|
@@ -1,9 +1,26 @@
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# Percona::WebAPI::Resource::Config package
|
||||
# ###########################################################################
|
||||
{
|
||||
package Percona::WebAPI::Resource::Config;
|
||||
|
||||
use Mo;
|
||||
|
||||
with 'Percona::WebAPI::Representation::JSON';
|
||||
with 'Percona::WebAPI::Representation::HashRef';
|
||||
use Lmo;
|
||||
|
||||
has 'options' => (
|
||||
is => 'ro',
|
||||
@@ -11,4 +28,9 @@ has 'options' => (
|
||||
required => 1,
|
||||
);
|
||||
|
||||
no Lmo;
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Percona::WebAPI::Resource::Config package
|
||||
# ###########################################################################
|
||||
|
@@ -1,9 +1,26 @@
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# Percona::WebAPI::Resource::Run package
|
||||
# ###########################################################################
|
||||
{
|
||||
package Percona::WebAPI::Resource::Run;
|
||||
|
||||
use Mo;
|
||||
|
||||
with 'Percona::WebAPI::Representation::JSON';
|
||||
with 'Percona::WebAPI::Representation::HashRef';
|
||||
use Lmo;
|
||||
|
||||
has 'number' => (
|
||||
is => 'ro',
|
||||
@@ -29,4 +46,9 @@ has 'output' => (
|
||||
required => 1,
|
||||
);
|
||||
|
||||
no Lmo;
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Percona::WebAPI::Resource::Run package
|
||||
# ###########################################################################
|
||||
|
@@ -1,9 +1,26 @@
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
# MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it under
|
||||
# the terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, version 2; OR the Perl Artistic License. On UNIX and similar
|
||||
# systems, you can issue `man perlgpl' or `man perlartistic' to read these
|
||||
# licenses.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||
# Place, Suite 330, Boston, MA 02111-1307 USA.
|
||||
# ###########################################################################
|
||||
# Percona::WebAPI::Resource::Service package
|
||||
# ###########################################################################
|
||||
{
|
||||
package Percona::WebAPI::Resource::Service;
|
||||
|
||||
use Mo;
|
||||
|
||||
with 'Percona::WebAPI::Representation::JSON';
|
||||
with 'Percona::WebAPI::Representation::HashRef';
|
||||
use Lmo;
|
||||
|
||||
has 'name' => (
|
||||
is => 'ro',
|
||||
@@ -23,4 +40,9 @@ has 'run' => (
|
||||
required => 1,
|
||||
);
|
||||
|
||||
no Lmo;
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
# End Percona::WebAPI::Resource::Service package
|
||||
# ###########################################################################
|
||||
|
@@ -1,4 +1,4 @@
|
||||
# This program is copyright 2012 Percona Inc.
|
||||
# This program is copyright 2012-2013 Percona Inc.
|
||||
# Feedback and improvements are welcome.
|
||||
#
|
||||
# THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
|
@@ -22,7 +22,7 @@
|
||||
# VersionParser parses a MySQL version string.
|
||||
package VersionParser;
|
||||
|
||||
use Mo;
|
||||
use Lmo;
|
||||
use Scalar::Util qw(blessed);
|
||||
use English qw(-no_match_vars);
|
||||
use constant PTDEBUG => $ENV{PTDEBUG} || 0;
|
||||
@@ -37,8 +37,6 @@ use overload (
|
||||
|
||||
use Carp ();
|
||||
|
||||
our $VERSION = 0.01;
|
||||
|
||||
has major => (
|
||||
is => 'ro',
|
||||
isa => 'Int',
|
||||
@@ -213,7 +211,7 @@ sub _d {
|
||||
print STDERR "# $package:$line $PID ", join(' ', @_), "\n";
|
||||
}
|
||||
|
||||
no Mo;
|
||||
no Lmo;
|
||||
1;
|
||||
}
|
||||
# ###########################################################################
|
||||
|
Reference in New Issue
Block a user