line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#--------------------------------------------------------------------# |
2
|
|
|
|
|
|
|
# @class : Chef::Rest::Client::databag # |
3
|
|
|
|
|
|
|
# @author : Bhavin Patel # |
4
|
|
|
|
|
|
|
#--------------------------------------------------------------------# |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Chef::REST::Client::data; |
7
|
1
|
|
|
1
|
|
986
|
use parent qw { Chef::REST::Client::EndPoints }; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
8
|
1
|
|
|
1
|
|
588
|
use Chef::REST::Client::databag; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
224
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$Chef::REST::Client::data::VERSION = 1.0; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub list |
13
|
|
|
|
|
|
|
{ |
14
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
15
|
0
|
|
|
|
|
|
my $databags = $self->___data___; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
foreach my $databag ( keys(%$databags) ) |
18
|
|
|
|
|
|
|
{ |
19
|
0
|
|
|
|
|
|
push @{'___data_bags_list___'} , |
|
0
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
new Chef::REST::Client::databag( |
21
|
|
|
|
|
|
|
'name' => $databag, |
22
|
|
|
|
|
|
|
'url' => $databags->{$databag} |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
} |
25
|
0
|
|
|
|
|
|
return @{'___data_bags_list___'}; |
|
0
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
sub details |
28
|
|
|
|
|
|
|
{ |
29
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
30
|
0
|
|
|
|
|
|
my $data = $self->___data___; |
31
|
|
|
|
|
|
|
|
32
|
0
|
0
|
|
|
|
|
return $self->raw() unless ref $data eq 'HASH'; |
33
|
|
|
|
|
|
|
|
34
|
0
|
|
|
|
|
|
return $data; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=pod |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 NAME |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Chef::REST::Client::data |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 VERSION |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1.0 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 SYNOPSIS |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
use Chef::REST::Client::data; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
$obj->data->list; |
54
|
|
|
|
|
|
|
$obj->data->details; |
55
|
|
|
|
|
|
|
$obj->data( 'abcusers' , 'webro' )->details; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 DESCRIPTION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Chef data class. used internally contains methods to fetch data from Chef server.This will return an array of L objects. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 METHODS |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 list |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
list all the data elements from Chef Server |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
$obj->data->list |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 details |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
fetch all the details about the data object saved in the Chef server. |
72
|
|
|
|
|
|
|
internally calls raw() method of L |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 KNOWN BUGS |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 SUPPORT |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
open a github ticket or email comments to Bhavin Patel |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
This Software is free to use , licensed under : The Artisic License 2.0 (GPL Compatible) |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |