line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#--------------------------------------------------------------------# |
2
|
|
|
|
|
|
|
# @class : Chef::Rest::Client::nodes # |
3
|
|
|
|
|
|
|
# @author : Bhavin Patel # |
4
|
|
|
|
|
|
|
#--------------------------------------------------------------------# |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Chef::REST::Client::nodes; |
7
|
1
|
|
|
1
|
|
950
|
use parent qw { Chef::REST::Client::EndPoints }; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
6
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
54
|
use Chef::REST::Client::node; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
225
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$Chef::REST::Client::nodes::VERSION = 1.0; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub list |
14
|
|
|
|
|
|
|
{ |
15
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
16
|
0
|
|
|
|
|
|
my $list_of_nodes = $self->___data___; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
foreach my $n ( keys(%$list_of_nodes) ){ |
19
|
0
|
|
|
|
|
|
my $node = new Chef::REST::Client::node( |
20
|
|
|
|
|
|
|
'name' => $n, |
21
|
|
|
|
|
|
|
'url' => $list_of_nodes->{$n} |
22
|
|
|
|
|
|
|
); |
23
|
0
|
|
|
|
|
|
push @{'___nodes_list___'} , $node; |
|
0
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
} |
25
|
0
|
|
|
|
|
|
return @{'___nodes_list___'}; |
|
0
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub details |
29
|
|
|
|
|
|
|
{ |
30
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
31
|
0
|
|
|
|
|
|
my $data = $self->___data___; |
32
|
|
|
|
|
|
|
|
33
|
0
|
0
|
|
|
|
|
return $self->raw() unless ref $data eq 'HASH'; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# return $data; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
return new Chef::REST::Client::node( |
38
|
|
|
|
|
|
|
'name' => $data->{'name'}, |
39
|
|
|
|
|
|
|
'environment' => $data->{'chef_environment'}, |
40
|
|
|
|
|
|
|
'automatic' => $data->{'automatic'}, |
41
|
|
|
|
|
|
|
'override' => $data->{'override' }, |
42
|
|
|
|
|
|
|
'default' => $data->{'default' }, |
43
|
|
|
|
|
|
|
'run_list' => $data->{'run_list' } |
44
|
|
|
|
|
|
|
); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=pod |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 NAME |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Chef::REST::Client::nodes |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 VERSION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1.0 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 SYNOPSIS |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
use Chef::REST::Client::nodes; |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
$obj->nodes->list; |
66
|
|
|
|
|
|
|
$obj->nodes('server1')->details; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 DESCRIPTION |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Class that represents collection of nodes |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 METHODS |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head2 list |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
return list of nodess, array of L objects. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 details ( $details ) |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
retun detail about a perticular node. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 KNOWN BUGS |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 SUPPORT |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
open a github ticket or email comments to Bhavin Patel |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
This Software is free to use , licensed under : The Artisic License 2.0 (GPL Compatible) |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |