chef-api 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -2
- data/CHANGELOG.md +17 -0
- data/README.md +42 -0
- data/chef-api.gemspec +1 -1
- data/lib/chef-api/configurable.rb +3 -2
- data/lib/chef-api/connection.rb +77 -47
- data/lib/chef-api/defaults.rb +28 -8
- data/lib/chef-api/errors.rb +32 -3
- data/lib/chef-api/resource.rb +1 -0
- data/lib/chef-api/resources/base.rb +30 -21
- data/lib/chef-api/resources/client.rb +6 -8
- data/lib/chef-api/resources/collection_proxy.rb +19 -2
- data/lib/chef-api/resources/data_bag.rb +1 -1
- data/lib/chef-api/resources/organization.rb +22 -0
- data/lib/chef-api/resources/user.rb +72 -1
- data/lib/chef-api/schema.rb +59 -21
- data/lib/chef-api/version.rb +1 -1
- data/lib/chef-api.rb +26 -5
- data/spec/integration/resources/client_spec.rb +54 -0
- data/spec/integration/resources/user_spec.rb +8 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/support/chef_server.rb +1 -0
- data/spec/unit/errors_spec.rb +294 -0
- data/spec/unit/resources/client_spec.rb +0 -16
- data/spec/unit/resources/connection_spec.rb +51 -0
- data/templates/errors/abstract_method.erb +5 -0
- data/templates/errors/cannot_regenerate_key.erb +1 -0
- data/templates/errors/chef_api_error.erb +1 -0
- data/templates/errors/file_not_found.erb +1 -0
- data/templates/errors/http_bad_request.erb +3 -0
- data/templates/errors/http_forbidden_request.erb +3 -0
- data/templates/errors/http_gateway_timeout.erb +3 -0
- data/templates/errors/http_method_not_allowed.erb +3 -0
- data/templates/errors/http_not_acceptable.erb +3 -0
- data/templates/errors/http_not_found.erb +3 -0
- data/templates/errors/http_server_unavailable.erb +1 -0
- data/templates/errors/http_unauthorized_request.erb +3 -0
- data/templates/errors/insufficient_file_permissions.erb +1 -0
- data/templates/errors/invalid_resource.erb +1 -0
- data/templates/errors/invalid_validator.erb +1 -0
- data/templates/errors/missing_url_parameter.erb +1 -0
- data/templates/errors/not_a_directory.erb +1 -0
- data/templates/errors/resource_already_exists.erb +1 -0
- data/templates/errors/resource_not_found.erb +1 -0
- data/templates/errors/resource_not_mutable.erb +1 -0
- data/templates/errors/unknown_attribute.erb +1 -0
- metadata +43 -17
- data/lib/chef-api/logger.rb +0 -160
- data/lib/chef-api/proxy.rb +0 -72
- data/locales/en.yml +0 -89
@@ -0,0 +1,294 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module ChefAPI::Error
|
4
|
+
describe ChefAPIError do
|
5
|
+
let(:instance) { described_class.new }
|
6
|
+
|
7
|
+
it 'raises an exception with the correct message' do
|
8
|
+
expect { raise instance }.to raise_error { |error|
|
9
|
+
expect(error).to be_a(described_class)
|
10
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
11
|
+
Oh no! Something really bad happened. I am not sure what actually happened because this is the catch-all error, but you should most definitely report an issue on GitHub at https://github.com/sethvargo/chef-api.
|
12
|
+
EOH
|
13
|
+
}
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
describe AbstractMethod do
|
18
|
+
let(:instance) { described_class.new(method: 'Resource#load') }
|
19
|
+
|
20
|
+
it 'raises an exception with the correct message' do
|
21
|
+
expect { raise instance }.to raise_error { |error|
|
22
|
+
expect(error).to be_a(described_class)
|
23
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
24
|
+
'Resource#load' is an abstract method. You must override this method in your subclass with the proper implementation and logic. For more information, please see the inline documentation for Resource#load. If you are not a developer, this is most likely a bug in the ChefAPI gem. Please file a bug report at:
|
25
|
+
|
26
|
+
https://github.com/sethvargo/chef-api/issues/new
|
27
|
+
|
28
|
+
and include the command(s) or code you ran to arrive at this error.
|
29
|
+
EOH
|
30
|
+
}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe CannotRegenerateKey do
|
35
|
+
let(:instance) { described_class.new }
|
36
|
+
|
37
|
+
it 'raises an exception with the correct message' do
|
38
|
+
expect { raise instance }.to raise_error { |error|
|
39
|
+
expect(error).to be_a(described_class)
|
40
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
41
|
+
You attempted to regenerate the private key for a Client or User that does not yet exist on the remote Chef Server. You can only regenerate the key for an object that is persisted. Try saving this record this object before regenerating the key.
|
42
|
+
EOH
|
43
|
+
}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
describe FileNotFound do
|
48
|
+
let(:instance) { described_class.new(path: '/path/to/file.rb') }
|
49
|
+
|
50
|
+
it 'raises an exception with the correct message' do
|
51
|
+
expect { raise instance }.to raise_error { |error|
|
52
|
+
expect(error).to be_a(described_class)
|
53
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
54
|
+
I could not find a file at '/path/to/file.rb'. Please make sure you have typed the path correctly and that the resource exists at the given path.
|
55
|
+
EOH
|
56
|
+
}
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe HTTPBadRequest do
|
61
|
+
let(:instance) { described_class.new(message: 'Something happened...') }
|
62
|
+
|
63
|
+
it 'raises an exception with the correct message' do
|
64
|
+
expect { raise instance }.to raise_error { |error|
|
65
|
+
expect(error).to be_a(described_class)
|
66
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
67
|
+
The Chef Server did not understand the request because it was malformed.
|
68
|
+
|
69
|
+
Something happened...
|
70
|
+
EOH
|
71
|
+
}
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
describe HTTPForbiddenRequest do
|
76
|
+
let(:instance) { described_class.new(message: 'Something happened...') }
|
77
|
+
|
78
|
+
it 'raises an exception with the correct message' do
|
79
|
+
expect { raise instance }.to raise_error { |error|
|
80
|
+
expect(error).to be_a(described_class)
|
81
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
82
|
+
The Chef Server actively refused to fulfill the request.
|
83
|
+
|
84
|
+
Something happened...
|
85
|
+
EOH
|
86
|
+
}
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe HTTPGatewayTimeout do
|
91
|
+
let(:instance) { described_class.new(message: 'Something happened...') }
|
92
|
+
|
93
|
+
it 'raises an exception with the correct message' do
|
94
|
+
expect { raise instance }.to raise_error { |error|
|
95
|
+
expect(error).to be_a(described_class)
|
96
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
97
|
+
The Chef Server did not respond in an adequate amount of time.
|
98
|
+
|
99
|
+
Something happened...
|
100
|
+
EOH
|
101
|
+
}
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
describe HTTPMethodNotAllowed do
|
106
|
+
let(:instance) { described_class.new(message: 'Something happened...') }
|
107
|
+
|
108
|
+
it 'raises an exception with the correct message' do
|
109
|
+
expect { raise instance }.to raise_error { |error|
|
110
|
+
expect(error).to be_a(described_class)
|
111
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
112
|
+
That HTTP method is not allowed on this URL.
|
113
|
+
|
114
|
+
Something happened...
|
115
|
+
EOH
|
116
|
+
}
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
describe HTTPNotAcceptable do
|
121
|
+
let(:instance) { described_class.new(message: 'Something happened...') }
|
122
|
+
|
123
|
+
it 'raises an exception with the correct message' do
|
124
|
+
expect { raise instance }.to raise_error { |error|
|
125
|
+
expect(error).to be_a(described_class)
|
126
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
127
|
+
The Chef Server identified this request as unacceptable. This usually means you have not specified the correct Accept or Content-Type headers on the request.
|
128
|
+
|
129
|
+
Something happened...
|
130
|
+
EOH
|
131
|
+
}
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
describe HTTPNotFound do
|
136
|
+
let(:instance) { described_class.new(message: 'Something happened...') }
|
137
|
+
|
138
|
+
it 'raises an exception with the correct message' do
|
139
|
+
expect { raise instance }.to raise_error { |error|
|
140
|
+
expect(error).to be_a(described_class)
|
141
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
142
|
+
The requested URL does not exist on the Chef Server.
|
143
|
+
|
144
|
+
Something happened...
|
145
|
+
EOH
|
146
|
+
}
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
describe HTTPServerUnavailable do
|
151
|
+
let(:instance) { described_class.new }
|
152
|
+
|
153
|
+
it 'raises an exception with the correct message' do
|
154
|
+
expect { raise instance }.to raise_error { |error|
|
155
|
+
expect(error).to be_a(described_class)
|
156
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
157
|
+
The Chef Server is currently unavailable or is not currently accepting client connections. Please ensure the server is accessible via ping or telnet on your local network. If this error persists, please contact your network administrator.
|
158
|
+
EOH
|
159
|
+
}
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
describe HTTPUnauthorizedRequest do
|
164
|
+
let(:instance) { described_class.new(message: 'Something happened...') }
|
165
|
+
|
166
|
+
it 'raises an exception with the correct message' do
|
167
|
+
expect { raise instance }.to raise_error { |error|
|
168
|
+
expect(error).to be_a(described_class)
|
169
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
170
|
+
The Chef Server requires authorization. Please ensure you have specified the correct client name and private key. If this error continues, please verify the given client has the proper permissions on the Chef Server.
|
171
|
+
|
172
|
+
Something happened...
|
173
|
+
EOH
|
174
|
+
}
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
describe InsufficientFilePermissions do
|
179
|
+
let(:instance) { described_class.new(path: '/path/to/file.rb') }
|
180
|
+
|
181
|
+
it 'raises an exception with the correct message' do
|
182
|
+
expect { raise instance }.to raise_error { |error|
|
183
|
+
expect(error).to be_a(described_class)
|
184
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
185
|
+
I cannot read the file at '/path/to/file.rb' because the permissions on the file do not permit it. Please ensure the file has the correct permissions and that this Ruby process is running as a user with access to that path.
|
186
|
+
EOH
|
187
|
+
}
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
describe InvalidResource do
|
192
|
+
let(:instance) { described_class.new(errors: 'Missing a thing!') }
|
193
|
+
|
194
|
+
it 'raises an exception with the correct message' do
|
195
|
+
expect { raise instance }.to raise_error { |error|
|
196
|
+
expect(error).to be_a(described_class)
|
197
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
198
|
+
There were errors saving your resource: Missing a thing!
|
199
|
+
EOH
|
200
|
+
}
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
describe InvalidValidator do
|
205
|
+
let(:instance) { described_class.new(key: 'bacon') }
|
206
|
+
|
207
|
+
it 'raises an exception with the correct message' do
|
208
|
+
expect { raise instance }.to raise_error { |error|
|
209
|
+
expect(error).to be_a(described_class)
|
210
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
211
|
+
'bacon' is not a valid validator. Please make sure it is spelled correctly and that the constant is properly defined. If you are using a custom validator, please ensure the validator extends ChefAPI::Validator::Base and is a subclass of ChefAPI::Validator.
|
212
|
+
EOH
|
213
|
+
}
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
describe MissingURLParameter do
|
218
|
+
let(:instance) { described_class.new(param: 'user') }
|
219
|
+
|
220
|
+
it 'raises an exception with the correct message' do
|
221
|
+
expect { raise instance }.to raise_error { |error|
|
222
|
+
expect(error).to be_a(described_class)
|
223
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
224
|
+
The required URL parameter 'user' was not present. Please specify the parameter as an option, like Resource.new(id, user: 'value').
|
225
|
+
EOH
|
226
|
+
}
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
describe NotADirectory do
|
231
|
+
let(:instance) { described_class.new(path: '/path/to/directory') }
|
232
|
+
|
233
|
+
it 'raises an exception with the correct message' do
|
234
|
+
expect { raise instance }.to raise_error { |error|
|
235
|
+
expect(error).to be_a(described_class)
|
236
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
237
|
+
The given path '/path/to/directory' is not a directory. Please make sure you have passed the path to a directory on disk.
|
238
|
+
EOH
|
239
|
+
}
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
describe ResourceAlreadyExists do
|
244
|
+
let(:instance) { described_class.new(type: 'client', id: 'bacon') }
|
245
|
+
|
246
|
+
it 'raises an exception with the correct message' do
|
247
|
+
expect { raise instance }.to raise_error { |error|
|
248
|
+
expect(error).to be_a(described_class)
|
249
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
250
|
+
The client 'bacon' already exists on the Chef Server. Each client must have a unique identifier and the Chef Server indicated this client already exists. If you are trying to update the client, consider using the 'update' method instead.
|
251
|
+
EOH
|
252
|
+
}
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
describe ResourceNotFound do
|
257
|
+
let(:instance) { described_class.new(type: 'client', id: 'bacon') }
|
258
|
+
|
259
|
+
it 'raises an exception with the correct message' do
|
260
|
+
expect { raise instance }.to raise_error { |error|
|
261
|
+
expect(error).to be_a(described_class)
|
262
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
263
|
+
There is no client with an id of 'bacon' on the Chef Server. If you are updating the client, please make sure the client exists and has the correct Chef identifier (primary key).
|
264
|
+
EOH
|
265
|
+
}
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
describe ResourceNotMutable do
|
270
|
+
let(:instance) { described_class.new(type: 'client', id: 'bacon') }
|
271
|
+
|
272
|
+
it 'raises an exception with the correct message' do
|
273
|
+
expect { raise instance }.to raise_error { |error|
|
274
|
+
expect(error).to be_a(described_class)
|
275
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
276
|
+
The client 'bacon' is not mutable. It may be locked by the remote Chef Server, or the Chef Server may not permit modifying the resource.
|
277
|
+
EOH
|
278
|
+
}
|
279
|
+
end
|
280
|
+
end
|
281
|
+
|
282
|
+
describe UnknownAttribute do
|
283
|
+
let(:instance) { described_class.new(attribute: 'name') }
|
284
|
+
|
285
|
+
it 'raises an exception with the correct message' do
|
286
|
+
expect { raise instance }.to raise_error { |error|
|
287
|
+
expect(error).to be_a(described_class)
|
288
|
+
expect(error.message).to eq <<-EOH.gsub(/^ {10}/, '')
|
289
|
+
'name' is not a valid attribute!
|
290
|
+
EOH
|
291
|
+
}
|
292
|
+
end
|
293
|
+
end
|
294
|
+
end
|
@@ -2,22 +2,6 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module ChefAPI
|
4
4
|
describe Resource::Client do
|
5
|
-
describe '.from_file' do
|
6
|
-
it 'raises a permission error when Ruby cannot read the file' do
|
7
|
-
File.stub(:read).and_raise(Errno::EACCES)
|
8
|
-
expect {
|
9
|
-
described_class.from_file('client.pem')
|
10
|
-
}.to raise_error(Error::InsufficientFilePermissions)
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'raises an error when the file does not exist' do
|
14
|
-
File.stub(:read).and_raise(Errno::ENOENT)
|
15
|
-
expect {
|
16
|
-
described_class.from_file('client.pem')
|
17
|
-
}.to raise_error(Error::FileNotFound)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
5
|
describe '.initialize' do
|
22
6
|
it 'converts an x509 certificate to a public key' do
|
23
7
|
certificate = <<-EOH.gsub(/^ {10}/, '')
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module ChefAPI
|
4
|
+
describe Connection do
|
5
|
+
shared_examples 'a proxy for' do |resource, klass|
|
6
|
+
context "##{resource}" do
|
7
|
+
it 'sets Thread.current to self' do
|
8
|
+
subject.send(resource)
|
9
|
+
expect(Thread.current['chefapi.connection']).to be(subject)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "returns an instance of #{klass}" do
|
13
|
+
# Fuck you Ruby 1.9.3
|
14
|
+
expected = klass.split('::').inject(ChefAPI) { |c, i| c.const_get(i) }
|
15
|
+
|
16
|
+
expect(subject.send(resource)).to be(expected)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
it_behaves_like 'a proxy for', :clients, 'Resource::Client'
|
22
|
+
it_behaves_like 'a proxy for', :data_bags, 'Resource::DataBag'
|
23
|
+
it_behaves_like 'a proxy for', :environments, 'Resource::Environment'
|
24
|
+
it_behaves_like 'a proxy for', :nodes, 'Resource::Node'
|
25
|
+
it_behaves_like 'a proxy for', :principals, 'Resource::Principal'
|
26
|
+
it_behaves_like 'a proxy for', :roles, 'Resource::Role'
|
27
|
+
it_behaves_like 'a proxy for', :users, 'Resource::User'
|
28
|
+
|
29
|
+
context '#initialize' do
|
30
|
+
context 'when options are given' do
|
31
|
+
let(:endpoint) { 'http://endpoint.gov' }
|
32
|
+
|
33
|
+
it 'sets the option' do
|
34
|
+
instance = described_class.new(endpoint: endpoint)
|
35
|
+
expect(instance.endpoint).to eq(endpoint)
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'uses the default options' do
|
39
|
+
instance = described_class.new
|
40
|
+
expect(instance.endpoint).to eq(ChefAPI.endpoint)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'when a block is given' do
|
45
|
+
it 'yields self' do
|
46
|
+
expect { |b| described_class.new(&b) }.to yield_with_args(described_class)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
'<%= @method %>' is an abstract method. You must override this method in your subclass with the proper implementation and logic. For more information, please see the inline documentation for <%= @method %>. If you are not a developer, this is most likely a bug in the ChefAPI gem. Please file a bug report at:
|
2
|
+
|
3
|
+
https://github.com/sethvargo/chef-api/issues/new
|
4
|
+
|
5
|
+
and include the command(s) or code you ran to arrive at this error.
|
@@ -0,0 +1 @@
|
|
1
|
+
You attempted to regenerate the private key for a Client or User that does not yet exist on the remote Chef Server. You can only regenerate the key for an object that is persisted. Try saving this record this object before regenerating the key.
|
@@ -0,0 +1 @@
|
|
1
|
+
Oh no! Something really bad happened. I am not sure what actually happened because this is the catch-all error, but you should most definitely report an issue on GitHub at https://github.com/sethvargo/chef-api.
|
@@ -0,0 +1 @@
|
|
1
|
+
I could not find a file at '<%= @path %>'. Please make sure you have typed the path correctly and that the resource exists at the given path.
|
@@ -0,0 +1 @@
|
|
1
|
+
The Chef Server is currently unavailable or is not currently accepting client connections. Please ensure the server is accessible via ping or telnet on your local network. If this error persists, please contact your network administrator.
|
@@ -0,0 +1 @@
|
|
1
|
+
I cannot read the file at '<%= @path %>' because the permissions on the file do not permit it. Please ensure the file has the correct permissions and that this Ruby process is running as a user with access to that path.
|
@@ -0,0 +1 @@
|
|
1
|
+
There were errors saving your resource: <%= @errors %>
|
@@ -0,0 +1 @@
|
|
1
|
+
'<%= @key %>' is not a valid validator. Please make sure it is spelled correctly and that the constant is properly defined. If you are using a custom validator, please ensure the validator extends ChefAPI::Validator::Base and is a subclass of ChefAPI::Validator.
|
@@ -0,0 +1 @@
|
|
1
|
+
The required URL parameter '<%= @param %>' was not present. Please specify the parameter as an option, like Resource.new(id, <%= @param %>: 'value').
|
@@ -0,0 +1 @@
|
|
1
|
+
The given path '<%= @path %>' is not a directory. Please make sure you have passed the path to a directory on disk.
|
@@ -0,0 +1 @@
|
|
1
|
+
The <%= @type %> '<%= @id %>' already exists on the Chef Server. Each <%= @type %> must have a unique identifier and the Chef Server indicated this <%= @type %> already exists. If you are trying to update the <%= @type %>, consider using the 'update' method instead.
|
@@ -0,0 +1 @@
|
|
1
|
+
There is no <%= @type %> with an id of '<%= @id %>' on the Chef Server. If you are updating the <%= @type %>, please make sure the <%= @type %> exists and has the correct Chef identifier (primary key).
|
@@ -0,0 +1 @@
|
|
1
|
+
The <%= @type %> '<%= @id %>' is not mutable. It may be locked by the remote Chef Server, or the Chef Server may not permit modifying the resource.
|
@@ -0,0 +1 @@
|
|
1
|
+
'<%= @attribute %>' is not a valid attribute!
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seth Vargo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: logify
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mixlib-authentication
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '1.3'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.3'
|
41
41
|
description: A tiny Chef API client with minimal dependencies
|
@@ -45,8 +45,9 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- .gitignore
|
49
|
-
- .travis.yml
|
48
|
+
- ".gitignore"
|
49
|
+
- ".travis.yml"
|
50
|
+
- CHANGELOG.md
|
50
51
|
- Gemfile
|
51
52
|
- LICENSE
|
52
53
|
- README.md
|
@@ -59,8 +60,6 @@ files:
|
|
59
60
|
- lib/chef-api/defaults.rb
|
60
61
|
- lib/chef-api/error_collection.rb
|
61
62
|
- lib/chef-api/errors.rb
|
62
|
-
- lib/chef-api/logger.rb
|
63
|
-
- lib/chef-api/proxy.rb
|
64
63
|
- lib/chef-api/resource.rb
|
65
64
|
- lib/chef-api/resources/base.rb
|
66
65
|
- lib/chef-api/resources/client.rb
|
@@ -71,6 +70,7 @@ files:
|
|
71
70
|
- lib/chef-api/resources/data_bag_item.rb
|
72
71
|
- lib/chef-api/resources/environment.rb
|
73
72
|
- lib/chef-api/resources/node.rb
|
73
|
+
- lib/chef-api/resources/organization.rb
|
74
74
|
- lib/chef-api/resources/principal.rb
|
75
75
|
- lib/chef-api/resources/role.rb
|
76
76
|
- lib/chef-api/resources/user.rb
|
@@ -81,16 +81,39 @@ files:
|
|
81
81
|
- lib/chef-api/validators/required.rb
|
82
82
|
- lib/chef-api/validators/type.rb
|
83
83
|
- lib/chef-api/version.rb
|
84
|
-
- locales/en.yml
|
85
84
|
- spec/integration/resources/client_spec.rb
|
86
85
|
- spec/integration/resources/environment_spec.rb
|
87
86
|
- spec/integration/resources/node_spec.rb
|
88
87
|
- spec/integration/resources/role_spec.rb
|
88
|
+
- spec/integration/resources/user_spec.rb
|
89
89
|
- spec/spec_helper.rb
|
90
90
|
- spec/support/chef_server.rb
|
91
91
|
- spec/support/shared/chef_api_resource.rb
|
92
|
+
- spec/unit/errors_spec.rb
|
92
93
|
- spec/unit/resources/base_spec.rb
|
93
94
|
- spec/unit/resources/client_spec.rb
|
95
|
+
- spec/unit/resources/connection_spec.rb
|
96
|
+
- templates/errors/abstract_method.erb
|
97
|
+
- templates/errors/cannot_regenerate_key.erb
|
98
|
+
- templates/errors/chef_api_error.erb
|
99
|
+
- templates/errors/file_not_found.erb
|
100
|
+
- templates/errors/http_bad_request.erb
|
101
|
+
- templates/errors/http_forbidden_request.erb
|
102
|
+
- templates/errors/http_gateway_timeout.erb
|
103
|
+
- templates/errors/http_method_not_allowed.erb
|
104
|
+
- templates/errors/http_not_acceptable.erb
|
105
|
+
- templates/errors/http_not_found.erb
|
106
|
+
- templates/errors/http_server_unavailable.erb
|
107
|
+
- templates/errors/http_unauthorized_request.erb
|
108
|
+
- templates/errors/insufficient_file_permissions.erb
|
109
|
+
- templates/errors/invalid_resource.erb
|
110
|
+
- templates/errors/invalid_validator.erb
|
111
|
+
- templates/errors/missing_url_parameter.erb
|
112
|
+
- templates/errors/not_a_directory.erb
|
113
|
+
- templates/errors/resource_already_exists.erb
|
114
|
+
- templates/errors/resource_not_found.erb
|
115
|
+
- templates/errors/resource_not_mutable.erb
|
116
|
+
- templates/errors/unknown_attribute.erb
|
94
117
|
homepage: https://github.com/sethvargo/chef-api
|
95
118
|
licenses:
|
96
119
|
- Apache 2.0
|
@@ -101,17 +124,17 @@ require_paths:
|
|
101
124
|
- lib
|
102
125
|
required_ruby_version: !ruby/object:Gem::Requirement
|
103
126
|
requirements:
|
104
|
-
- -
|
127
|
+
- - ">="
|
105
128
|
- !ruby/object:Gem::Version
|
106
129
|
version: '1.9'
|
107
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
108
131
|
requirements:
|
109
|
-
- -
|
132
|
+
- - ">="
|
110
133
|
- !ruby/object:Gem::Version
|
111
134
|
version: '0'
|
112
135
|
requirements: []
|
113
136
|
rubyforge_project:
|
114
|
-
rubygems_version: 2.2.
|
137
|
+
rubygems_version: 2.2.2
|
115
138
|
signing_key:
|
116
139
|
specification_version: 4
|
117
140
|
summary: A Chef API client in Ruby
|
@@ -120,9 +143,12 @@ test_files:
|
|
120
143
|
- spec/integration/resources/environment_spec.rb
|
121
144
|
- spec/integration/resources/node_spec.rb
|
122
145
|
- spec/integration/resources/role_spec.rb
|
146
|
+
- spec/integration/resources/user_spec.rb
|
123
147
|
- spec/spec_helper.rb
|
124
148
|
- spec/support/chef_server.rb
|
125
149
|
- spec/support/shared/chef_api_resource.rb
|
150
|
+
- spec/unit/errors_spec.rb
|
126
151
|
- spec/unit/resources/base_spec.rb
|
127
152
|
- spec/unit/resources/client_spec.rb
|
153
|
+
- spec/unit/resources/connection_spec.rb
|
128
154
|
has_rdoc:
|