| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#--------------------------------------------------------------------# |
|
2
|
|
|
|
|
|
|
# @class : Chef::Rest::Client::environment # |
|
3
|
|
|
|
|
|
|
# @author : Bhavin Patel # |
|
4
|
|
|
|
|
|
|
#--------------------------------------------------------------------# |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package Chef::REST::Client::environment; |
|
7
|
1
|
|
|
1
|
|
6
|
use parent qw { Chef::REST::Client::EndPoints }; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
7
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$Chef::REST::Client::environment::VERSION = 1.0; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
|
12
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
|
13
|
0
|
|
|
|
|
|
my $param = {@_}; |
|
14
|
|
|
|
|
|
|
|
|
15
|
0
|
|
|
|
|
|
my $self = $class->SUPER::new(@_); |
|
16
|
0
|
|
|
|
|
|
bless $self, $class; |
|
17
|
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
$self->name( |
|
19
|
|
|
|
|
|
|
$param->{'name' }); |
|
20
|
0
|
|
|
|
|
|
$self->url( |
|
21
|
|
|
|
|
|
|
$param->{'url' }); |
|
22
|
0
|
|
|
|
|
|
$self->description( |
|
23
|
|
|
|
|
|
|
$param->{'description' }); |
|
24
|
0
|
|
|
|
|
|
$self->override_attributes( |
|
25
|
|
|
|
|
|
|
$param->{'override_attributes'}); |
|
26
|
0
|
|
|
|
|
|
$self->default_attributes( |
|
27
|
|
|
|
|
|
|
$param->{'default_attributes' }); |
|
28
|
0
|
|
|
|
|
|
$self->cookbook_versions( |
|
29
|
|
|
|
|
|
|
$param->{'cookbook_versions' }); |
|
30
|
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
return $self; |
|
32
|
|
|
|
|
|
|
} |
|
33
|
|
|
|
|
|
|
|
|
34
|
0
|
0
|
|
0
|
1
|
|
sub override_attributes { $_[0]->{'override_attributes'} = $_[1] if defined $_[1]; return $_[0]->{'override_attributes'};} |
|
|
0
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
0
|
1
|
|
sub default_attributes { $_[0]->{'default_attributes' } = $_[1] if defined $_[1]; return $_[0]->{'default_attributes' };} |
|
|
0
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
|
37
|
0
|
0
|
|
0
|
1
|
|
sub url { $_[0]->{'url' } = $_[1] if defined $_[1]; return $_[0]->{'url' };} |
|
|
0
|
|
|
|
|
|
|
|
38
|
0
|
0
|
|
0
|
1
|
|
sub name { $_[0]->{'name' } = $_[1] if defined $_[1]; return $_[0]->{'name' };} |
|
|
0
|
|
|
|
|
|
|
|
39
|
0
|
0
|
|
0
|
1
|
|
sub description { $_[0]->{'description' } = $_[1] if defined $_[1]; return $_[0]->{'descripton' };} |
|
|
0
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# move to seperate class if possible |
|
42
|
0
|
0
|
|
0
|
1
|
|
sub cookbook_versions { $_[0]->{'cookbook_versions' } = $_[1] if defined $_[1]; return $_[0]->{'cookbook_versions' };} |
|
|
0
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=pod |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 NAME |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
Chef::REST::Client::environment |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 VERSION |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1.0 |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
use Chef::REST::Client::environment; |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
my $obj = new Chef::REST::Client::environment |
|
61
|
|
|
|
|
|
|
( 'name' => $name |
|
62
|
|
|
|
|
|
|
, 'url' => $url |
|
63
|
|
|
|
|
|
|
, 'description' => $description |
|
64
|
|
|
|
|
|
|
, 'override_attributes' => $override_attributes |
|
65
|
|
|
|
|
|
|
, 'default_attributes' => $default_attributes |
|
66
|
|
|
|
|
|
|
, 'cookbook_versions' => $cookbook_versions |
|
67
|
|
|
|
|
|
|
); |
|
68
|
|
|
|
|
|
|
$obj->key; |
|
69
|
|
|
|
|
|
|
$obj->value; |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Class representation of Chef Environment. |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 METHODS |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 Constructor |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
returns new object of class L with %params |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 name ( $name ) |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
get or set value for 'name' |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head2 url ( $url ) |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
get or set value for 'url' |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head2 description ( $description ) |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
get or set value for 'description' |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 override_attributes ( $override_attributes ) |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
get or set value for 'override_attributes' |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head2 default_attributes ( $default_attributes ) |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
get or set value for 'default_attributes' |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head2 cookbook_versions ( $cookbook_versions ) |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
get or set value for 'cookbook_versions' |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 KNOWN BUGS |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 SUPPORT |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
open a github ticket or email comments to Bhavin Patel |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
112
|
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This Software is free to use , licensed under : The Artisic License 2.0 (GPL Compatible) |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=cut |