my $client = API::Client->new({service => "dist"});
my $data = $client->server_info({hostname => "foo.bar.com"});
# this maps out to https://someserver.com/dist/server_info POSTing {"hostname":"foo.bar.com"}
####
package DistService;
use API::Base;
sub server_info__meta {
return {
desc => 'Returns information about a server',
args => {
server_id => {desc => 'The Id of this server', required => 1},
},
resp => {success => 1},
};
}
sub server_info {
my ($self, $args) = @_;
my %data;
...
return \%data;
}
##
##
[rhandom@somehost ~/%] ds server_info hostname foo.bar.com
Arguments:
+----------+-------------+
| hostname | foo.bar.com |
+----------+-------------+
Data:
+---------------+---------------------+
| access_tag | MDEV |
| added_by_uid | 33 |
| date_added | 2013-09-27 09:17:47 |
| description | - |
| hostname | foo.bar.com |
| ip | 0.0.6.11 |
| server_id | 26208 |
+---------------+---------------------+
##
##
0.0.20.86 - - [27/Sep/2013:08:12:50 -0600] "POST /dist/server_info HTTP/1.0" 200 292 "-" "-"
0.0.66.29 - - [27/Sep/2013:08:12:50 -0600] "POST /dist/unmanaged_add HTTP/1.0" 200 21 "-" "-"
0.0.80.14 - - [27/Sep/2013:08:12:50 -0600] "POST /dist/undone_list HTTP/1.0" 200 218214 "-" "-"
0.0.69.86 - - [27/Sep/2013:08:12:50 -0600] "POST /dist/unmanaged_add HTTP/1.0" 200 21 "-" "-"
0.0.54.28 - - [27/Sep/2013:08:12:50 -0600] "POST /dist/unmanaged_add HTTP/1.0" 200 21 "-" "-"
0.0.80.16 - - [27/Sep/2013:08:12:50 -0600] "POST /dist/undone_list HTTP/1.0" 200 302337 "-" "-"
0.0.48.23 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/unmanaged_add HTTP/1.0" 200 21 "-" "-"
0.0.19.71 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/server_info HTTP/1.0" 200 290 "-" "-"
0.0.80.17 - - [27/Sep/2013:08:12:50 -0600] "POST /dist/undone_list HTTP/1.0" 200 146432 "-" "-"
0.0.50.12 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/server_info HTTP/1.0" 200 294 "-" "-"
0.0.27.29 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/server_info HTTP/1.0" 200 293 "-" "-"
0.0.19.22 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/server_info_files HTTP/1.0" 200 30321 "-" "-"
0.0.58.10 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/unmanaged_add HTTP/1.0" 200 21 "-" "-"
0.0.19.22 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/unmanaged_add HTTP/1.0" 200 21 "-" "-"
0.0.63.83 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/unmanaged_add HTTP/1.0" 200 21 "-" "-"
0.0.86.42 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/server_info HTTP/1.0" 200 273 "-" "-"
0.0.24.47 - - [27/Sep/2013:08:12:52 -0600] "POST /dist/server_info HTTP/1.0" 200 292 "-" "-"
0.0.44.15 - - [27/Sep/2013:08:12:52 -0600] "POST /dist/server_info HTTP/1.0" 200 294 "-" "-"
0.0.33.11 - - [27/Sep/2013:08:12:52 -0600] "POST /dist/server_info HTTP/1.0" 200 293 "-" "-"
0.0.15.80 - - [27/Sep/2013:08:12:52 -0600] "POST /dist/server_info HTTP/1.0" 200 290 "-" "-"
##
##
0.0.20.86 - - [27/Sep/2013:08:12:50 -0600] "GET /dist/server/32 HTTP/1.0" 200 292 "-" "-"
0.0.66.29 - - [27/Sep/2013:08:12:50 -0600] "POST /dist/unmanaged/33 HTTP/1.0" 200 21 "-" "-"
0.0.80.14 - - [27/Sep/2013:08:12:50 -0600] "GET /dist/undone HTTP/1.0" 200 218214 "-" "-"
0.0.69.86 - - [27/Sep/2013:08:12:50 -0600] "POST /dist/unmanaged/32 HTTP/1.0" 200 21 "-" "-"
0.0.54.28 - - [27/Sep/2013:08:12:50 -0600] "POST /dist/unmanaged/32 HTTP/1.0" 200 21 "-" "-"
0.0.80.16 - - [27/Sep/2013:08:12:50 -0600] "GET /dist/undone HTTP/1.0" 200 302337 "-" "-"
0.0.48.23 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/unmanaged/23 HTTP/1.0" 200 21 "-" "-"
0.0.19.71 - - [27/Sep/2013:08:12:51 -0600] "GET /dist/server/36 HTTP/1.0" 200 290 "-" "-"
0.0.80.17 - - [27/Sep/2013:08:12:50 -0600] "GET /dist/undone HTTP/1.0" 200 146432 "-" "-"
0.0.50.12 - - [27/Sep/2013:08:12:51 -0600] "GET /dist/server/31 HTTP/1.0" 200 294 "-" "-"
0.0.27.29 - - [27/Sep/2013:08:12:51 -0600] "GET /dist/server/38 HTTP/1.0" 200 293 "-" "-"
0.0.19.22 - - [27/Sep/2013:08:12:51 -0600] "GET /dist/server/32_files HTTP/1.0" 200 30321 "-" "-"
0.0.58.10 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/unmanaged/23 HTTP/1.0" 200 21 "-" "-"
0.0.19.22 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/unmanaged/25 HTTP/1.0" 200 21 "-" "-"
0.0.63.83 - - [27/Sep/2013:08:12:51 -0600] "POST /dist/unmanaged/26 HTTP/1.0" 200 21 "-" "-"
0.0.86.42 - - [27/Sep/2013:08:12:51 -0600] "GET /dist/server/38 HTTP/1.0" 200 273 "-" "-"
0.0.24.47 - - [27/Sep/2013:08:12:52 -0600] "GET /dist/server/33 HTTP/1.0" 200 292 "-" "-"
0.0.44.15 - - [27/Sep/2013:08:12:52 -0600] "GET /dist/server/34 HTTP/1.0" 200 294 "-" "-"
0.0.33.11 - - [27/Sep/2013:08:12:52 -0600] "GET /dist/server/38 HTTP/1.0" 200 293 "-" "-"
0.0.15.80 - - [27/Sep/2013:08:12:52 -0600] "GET /dist/server/33 HTTP/1.0" 200 290 "-" "-"