mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-13 22:50:25 +00:00
Misc work-in-progress updates to pt-agent, Agent and Config resources. Config will change again. Make Client::put() return Location header like POST.
This commit is contained in:
@@ -22,10 +22,10 @@ package Percona::WebAPI::Resource::Agent;
|
||||
|
||||
use Lmo;
|
||||
|
||||
has 'id' => (
|
||||
is => 'ro',
|
||||
has 'uuid' => (
|
||||
is => 'r0',
|
||||
isa => 'Str',
|
||||
required => 1,
|
||||
required => 0,
|
||||
);
|
||||
|
||||
has 'hostname' => (
|
||||
@@ -34,6 +34,12 @@ has 'hostname' => (
|
||||
required => 1,
|
||||
);
|
||||
|
||||
has 'alias' => (
|
||||
is => 'ro',
|
||||
isa => 'Str',
|
||||
required => 0,
|
||||
);
|
||||
|
||||
has 'versions' => (
|
||||
is => 'ro',
|
||||
isa => 'Maybe[HashRef]',
|
||||
@@ -47,6 +53,11 @@ has 'links' => (
|
||||
default => sub { return {} },
|
||||
);
|
||||
|
||||
sub name {
|
||||
my ($self) = @_;
|
||||
return $self->alias || $self->hostname || $self->uuid || 'Unknown';
|
||||
}
|
||||
|
||||
no Lmo;
|
||||
1;
|
||||
}
|
||||
|
@@ -22,8 +22,8 @@ package Percona::WebAPI::Resource::Config;
|
||||
|
||||
use Lmo;
|
||||
|
||||
has 'id' => (
|
||||
is => 'r0',
|
||||
has 'config_id' => (
|
||||
is => 'ro',
|
||||
isa => 'Int',
|
||||
required => 1,
|
||||
);
|
||||
|
Reference in New Issue
Block a user