line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Mattermost::V4::API::Resource::Logs; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
49
|
use Moo; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
41
|
|
6
|
7
|
|
|
7
|
|
2750
|
use Types::Standard 'Str'; |
|
7
|
|
|
|
|
25
|
|
|
7
|
|
|
|
|
52
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends 'WebService::Mattermost::V4::API::Resource'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has view_name => (is => 'ro', isa => Str, default => 'Log'); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub get { |
17
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
return $self->_get(); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub add_message { |
23
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
24
|
0
|
|
|
|
|
|
my $args = shift; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
return $self->_post({ |
27
|
|
|
|
|
|
|
parameters => $args, |
28
|
|
|
|
|
|
|
required => [ qw(level message) ], |
29
|
|
|
|
|
|
|
view => 'NewLogEntry', |
30
|
|
|
|
|
|
|
}); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=pod |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=encoding UTF-8 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
WebService::Mattermost::V4::API::Resource::Logs - Wrapped API methods for the logs API endpoints. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 VERSION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
version 0.26 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 DESCRIPTION |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 USAGE |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
use WebService::Mattermost; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my $mm = WebService::Mattermost->new({ |
58
|
|
|
|
|
|
|
authenticate => 1, |
59
|
|
|
|
|
|
|
username => 'me@somewhere.com', |
60
|
|
|
|
|
|
|
password => 'hunter2', |
61
|
|
|
|
|
|
|
base_url => 'https://my.mattermost.server.com/api/v4/', |
62
|
|
|
|
|
|
|
}); |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
my $resource = $mm->api->logs; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 METHODS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=over 4 |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=item C<get()> |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
L<Get logs|https://api.mattermost.com/#tag/system%2Fpaths%2F~1logs%2Fget> |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
my $response = $resource->get(); |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item C<add_message()> |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
L<Add log message|https://api.mattermost.com/#tag/system%2Fpaths%2F~1logs%2Fpost> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
my $response = $resource->add_message({ |
81
|
|
|
|
|
|
|
# Required parameters: |
82
|
|
|
|
|
|
|
level => 'ERROR', # or DEBUG |
83
|
|
|
|
|
|
|
message => '...', |
84
|
|
|
|
|
|
|
}); |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=back |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 AUTHOR |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Mike Jones <mike@netsplit.org.uk> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This software is Copyright (c) 2020 by Mike Jones. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This is free software, licensed under: |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
The MIT (X11) License |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=cut |
101
|
|
|
|
|
|
|
|