line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::Icecast2::Admin; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Net::Icecast2::Admin::VERSION = '0.005'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
# ABSTRACT: Icecast2 Server Admin API |
6
|
2
|
|
|
2
|
|
32268
|
use Moo; |
|
2
|
|
|
|
|
18277
|
|
|
2
|
|
|
|
|
17
|
|
7
|
|
|
|
|
|
|
extends 'Net::Icecast2'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Net::Icecast2::Admin - Icecast2 Server Admin API |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Net::Icecast2::Admin; |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $icecast_admin = Net::Icecast2::Admin->new( |
18
|
|
|
|
|
|
|
host => 192.168.1.10, |
19
|
|
|
|
|
|
|
port => 8008, |
20
|
|
|
|
|
|
|
protocol => 'https', |
21
|
|
|
|
|
|
|
login => 'source', |
22
|
|
|
|
|
|
|
password => 'hackme', |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
$icecast_admin->stats; |
26
|
|
|
|
|
|
|
$icecast_admin->list_mount; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 DESCRIPTION |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Make request for Icecast2 Server Admin API |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=head2 host |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
Description : Icecast2 Server hostname |
37
|
|
|
|
|
|
|
Default : localhost |
38
|
|
|
|
|
|
|
Required : 0 |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 port |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Description : Icecast2 Server port |
45
|
|
|
|
|
|
|
Default : 8000 |
46
|
|
|
|
|
|
|
Required : 0 |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 protocol |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Description : Icecast2 Server protocol ( scheme ) |
53
|
|
|
|
|
|
|
Default : http |
54
|
|
|
|
|
|
|
Required : 0 |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 login |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Description : Icecast2 Server Admin login |
61
|
|
|
|
|
|
|
Required : 1 |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=cut |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 password |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Description : Icecast2 Server Admin password |
68
|
|
|
|
|
|
|
Required : 1 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=cut |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 METHODS |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 stats |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Usage : $icecast_admin->stats |
77
|
|
|
|
|
|
|
Description : This admin function provides the ability to query the internal |
78
|
|
|
|
|
|
|
statistics kept by the icecast server. Almost all information |
79
|
|
|
|
|
|
|
about the internal workings of the server such as the |
80
|
|
|
|
|
|
|
mountpoints connected, how many client requests have been |
81
|
|
|
|
|
|
|
served, how many listeners for each mountpoint, etc, are |
82
|
|
|
|
|
|
|
available via this admin function. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |
85
|
|
|
|
|
|
|
sub stats { |
86
|
0
|
|
|
0
|
|
|
my $self = shift; |
87
|
|
|
|
|
|
|
|
88
|
0
|
|
|
|
|
|
$self->request( '/stats' ); |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 list_mounts |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Usage : $icecast_admin->list_mounts |
94
|
|
|
|
|
|
|
Description : This admin function provides the ability to view all the |
95
|
|
|
|
|
|
|
currently connected mountpoints. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |
98
|
|
|
|
|
|
|
sub list_mounts { |
99
|
0
|
|
|
0
|
|
|
my $self = shift; |
100
|
|
|
|
|
|
|
|
101
|
0
|
|
|
|
|
|
$self->request( '/listmounts' )->{source}; |
102
|
|
|
|
|
|
|
} |
103
|
|
|
|
|
|
|
|
104
|
2
|
|
|
2
|
|
2123
|
no Moo; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
105
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
106
|
|
|
|
|
|
|
1; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 SEE ALSO |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Icecast2 server: http://www.icecast.org |
111
|
|
|
|
|
|
|
Icecast2 API Docs: http://www.icecast.org/docs/icecast-trunk/icecast2_admin.html |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
Related modules L L |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 AUTHOR |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Pavel R3VoLuT1OneR Zhytomirsky |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
This software is copyright (c) 2012 by Pavel R3VoLuT1OneR Zhytomirsky. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
124
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=cut |
127
|
|
|
|
|
|
|
|