razor-client 1.8.1 → 1.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/NEWS.md +6 -0
- data/lib/razor/cli/query.rb +18 -1
- data/lib/razor/cli/version.rb +1 -1
- data/spec/cli/navigate_spec.rb +31 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/when_the_collections_endpoint_has_a_depth_parameter/should_be_set_to_1_when_the_endpoint_is_the_final_query.yml +77 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/when_the_collections_endpoint_has_a_depth_parameter/should_not_be_exposed_to_the_user.yml +40 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/when_the_collections_endpoint_has_a_depth_parameter/should_not_carry-over_to_later_requests_in_a_nested_query.yml +334 -0
- metadata +30 -43
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f4aba07bc09d83bcbce351964a713117efb1bca2
|
4
|
+
data.tar.gz: 1db80933d091c04c2048cbb8a543e919f9ced02c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5b9225d18b7414792a628ec7017bb62c9ef417369d92293b00627913a41a3760019ec4378dfeb2642fd45058733e9881a6d21db0736373929eb84bb0b51dd4d9
|
7
|
+
data.tar.gz: 710838e176dd8b9d8e58159e505df289071ce792d5e8bb64c311be3cb26d3ed1041a0ee15ecd1cb7700039f6415fec6d10055119702670c98b952efc4774dec4
|
data/NEWS.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Razor Client Release Notes
|
2
2
|
|
3
|
+
## 1.9.1 - 2018-06-07
|
4
|
+
|
5
|
+
* NEW: Use the server's `depth` parameter if it is supported. This will
|
6
|
+
dramatically decrease the number of API requests needed when listing
|
7
|
+
collections.
|
8
|
+
|
3
9
|
## 1.8.1 - 2018-04-23
|
4
10
|
|
5
11
|
* IMPROVEMENT: The default API URL now attempts to use TLS on localhost port
|
data/lib/razor/cli/query.rb
CHANGED
@@ -33,6 +33,12 @@ class Razor::CLI::Query
|
|
33
33
|
end
|
34
34
|
|
35
35
|
params.each do |param, args|
|
36
|
+
if param == 'depth'
|
37
|
+
# Set the depth parameter if the server offers it
|
38
|
+
@options[param] = 1
|
39
|
+
next
|
40
|
+
end
|
41
|
+
|
36
42
|
if args['type'] == 'boolean'
|
37
43
|
opts.on "--#{param}" do
|
38
44
|
@options[param] = true
|
@@ -51,12 +57,23 @@ class Razor::CLI::Query
|
|
51
57
|
while @segments.any?
|
52
58
|
nav = @segments.shift
|
53
59
|
@parse.stripped_args << nav
|
60
|
+
|
61
|
+
@options = {}
|
54
62
|
@segments = get_optparse(@doc, nav).order(@segments)
|
63
|
+
|
64
|
+
# Adding the depth parameter to an intermediate request is an
|
65
|
+
# inefficiency, so we should delete it.
|
66
|
+
@options.delete('depth') if @segments.any?
|
67
|
+
|
55
68
|
@doc = @navigate.move_to nav, @doc, @options
|
56
69
|
end
|
57
70
|
|
58
71
|
# Get the next level if it's a list of objects.
|
59
72
|
if @doc.is_a?(Hash) and @doc['items'].is_a?(Array)
|
73
|
+
# If our nav endpoint had a depth parameter, then we will already have
|
74
|
+
# the next level.
|
75
|
+
return @doc if @options['depth']
|
76
|
+
|
60
77
|
# Cache doc_resource since these queries are just for extra detail.
|
61
78
|
temp_doc_resource = @navigate.doc_resource
|
62
79
|
@doc['items'] = @doc['items'].map do |item|
|
@@ -66,4 +83,4 @@ class Razor::CLI::Query
|
|
66
83
|
end
|
67
84
|
@doc
|
68
85
|
end
|
69
|
-
end
|
86
|
+
end
|
data/lib/razor/cli/version.rb
CHANGED
@@ -18,7 +18,7 @@ module Razor
|
|
18
18
|
#
|
19
19
|
# The next line is the one that our packaging tools modify, so please make
|
20
20
|
# sure that any change to it is discussed and agreed first.
|
21
|
-
version = '1.
|
21
|
+
version = '1.9.1'
|
22
22
|
|
23
23
|
if version == "DEVELOPMENT"
|
24
24
|
root = File.expand_path("../../..", File.dirname(__FILE__))
|
data/spec/cli/navigate_spec.rb
CHANGED
@@ -274,6 +274,37 @@ describe Razor::CLI::Navigate do
|
|
274
274
|
end
|
275
275
|
end
|
276
276
|
|
277
|
+
context 'when the collections endpoint has a depth parameter', :vcr do
|
278
|
+
it "should not be exposed to the user" do
|
279
|
+
nav = Razor::CLI::Parse.new(['brokers', '--depth', '1']).navigate
|
280
|
+
expect {nav.get_document}.to raise_error(OptionParser::InvalidOption, 'invalid option: --depth')
|
281
|
+
end
|
282
|
+
|
283
|
+
it "should be set to 1 when the endpoint is the final query" do
|
284
|
+
nav = Razor::CLI::Parse.new(['nodes']).navigate
|
285
|
+
nav.get_document
|
286
|
+
expect(nav.doc_resource.url).to match(/nodes\?depth=1/)
|
287
|
+
end
|
288
|
+
|
289
|
+
it "should not carry-over to later requests in a nested query" do
|
290
|
+
broker_name = "test_broker"
|
291
|
+
Razor::CLI::Parse.new(
|
292
|
+
['create-broker', '--name', "#{broker_name}", '-c', 'server=puppet.example.org', '-c', 'environment=production', '--broker-type', 'puppet']
|
293
|
+
).navigate.get_document['name']
|
294
|
+
|
295
|
+
nav = Razor::CLI::Parse.new(['brokers', "#{broker_name}"]).navigate
|
296
|
+
nav.get_document
|
297
|
+
|
298
|
+
# TODO: Once the unit testing capabilities have improved
|
299
|
+
# (e.g. the Navigate class has the ability to cache visited URLS),
|
300
|
+
# we should also assert that the /collections/brokers endpoint
|
301
|
+
# was visited, and that the depth parameter was not used (since
|
302
|
+
# it is an intermediate request). We should also update the test
|
303
|
+
# description when we do this to note the new assertion.
|
304
|
+
expect(nav.doc_resource.url).not_to match(/depth/)
|
305
|
+
end
|
306
|
+
end
|
307
|
+
|
277
308
|
context "accept-language header", :vcr do
|
278
309
|
before :each do
|
279
310
|
GettextSetup.clear
|
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:8150/api
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.2 (linux x86_64) jruby/9.1.5.0 (2.3.1p0)
|
16
|
+
Accept-Language:
|
17
|
+
- en_US,en
|
18
|
+
Host:
|
19
|
+
- localhost:8150
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- Apache-Coyote/1.1
|
27
|
+
X-Content-Type-Options:
|
28
|
+
- nosniff
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
Content-Length:
|
32
|
+
- '7427'
|
33
|
+
Date:
|
34
|
+
- Fri, 20 Apr 2018 00:21:27 GMT
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"run-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/run-hook","id":"http://localhost:8150/api/commands/run-hook"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8150/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8150/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8150/api/commands/set-node-ipmi-credentials"},{"name":"update-broker-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-broker-configuration","id":"http://localhost:8150/api/commands/update-broker-configuration"},{"name":"update-hook-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-hook-configuration","id":"http://localhost:8150/api/commands/update-hook-configuration"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"name":"update-policy-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-broker","id":"http://localhost:8150/api/commands/update-policy-broker"},{"name":"update-policy-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-node-metadata","id":"http://localhost:8150/api/commands/update-policy-node-metadata"},{"name":"update-policy-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-repo","id":"http://localhost:8150/api/commands/update-policy-repo"},{"name":"update-policy-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-task","id":"http://localhost:8150/api/commands/update-policy-task"},{"name":"update-repo-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-repo-task","id":"http://localhost:8150/api/commands/update-repo-task"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8150/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8150/api/collections/brokers","params":{"depth":{"type":"number"}}},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8150/api/collections/repos","params":{"depth":{"type":"number"}}},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8150/api/collections/tags","params":{"depth":{"type":"number"}}},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8150/api/collections/policies","params":{"depth":{"type":"number"}}},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8150/api/collections/nodes","params":{"start":{"type":"number"},"limit":{"type":"number"},"depth":{"type":"number"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8150/api/collections/tasks","params":{"depth":{"type":"number"}}},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8150/api/collections/commands","params":{"depth":{"type":"number"}}},{"name":"events","rel":"http://api.puppetlabs.com/razor/v1/collections/events","id":"http://localhost:8150/api/collections/events","params":{"start":{"type":"number"},"limit":{"type":"number"},"depth":{"type":"number"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8150/api/collections/hooks","params":{"depth":{"type":"number"}}},{"name":"config","rel":"http://api.puppetlabs.com/razor/v1/collections/config","id":"http://localhost:8150/api/collections/config"}],"version":{"server":"v1.7.1-13-g69ef5ef"}}'
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 20 Apr 2018 00:21:27 GMT
|
40
|
+
- request:
|
41
|
+
method: get
|
42
|
+
uri: http://localhost:8150/api/collections/nodes?depth=1
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
45
|
+
string: ''
|
46
|
+
headers:
|
47
|
+
Accept:
|
48
|
+
- application/json
|
49
|
+
Accept-Encoding:
|
50
|
+
- gzip, deflate
|
51
|
+
User-Agent:
|
52
|
+
- rest-client/2.0.2 (linux x86_64) jruby/9.1.5.0 (2.3.1p0)
|
53
|
+
Accept-Language:
|
54
|
+
- en_US,en
|
55
|
+
Host:
|
56
|
+
- localhost:8150
|
57
|
+
response:
|
58
|
+
status:
|
59
|
+
code: 200
|
60
|
+
message: OK
|
61
|
+
headers:
|
62
|
+
Server:
|
63
|
+
- Apache-Coyote/1.1
|
64
|
+
X-Content-Type-Options:
|
65
|
+
- nosniff
|
66
|
+
Content-Type:
|
67
|
+
- application/json
|
68
|
+
Content-Length:
|
69
|
+
- '84'
|
70
|
+
Date:
|
71
|
+
- Fri, 20 Apr 2018 00:21:27 GMT
|
72
|
+
body:
|
73
|
+
encoding: UTF-8
|
74
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes","items":[],"total":0}'
|
75
|
+
http_version:
|
76
|
+
recorded_at: Fri, 20 Apr 2018 00:21:27 GMT
|
77
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:8150/api
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.2 (linux x86_64) jruby/9.1.5.0 (2.3.1p0)
|
16
|
+
Accept-Language:
|
17
|
+
- en_US,en
|
18
|
+
Host:
|
19
|
+
- localhost:8150
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- Apache-Coyote/1.1
|
27
|
+
X-Content-Type-Options:
|
28
|
+
- nosniff
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
Content-Length:
|
32
|
+
- '7427'
|
33
|
+
Date:
|
34
|
+
- Fri, 20 Apr 2018 00:21:17 GMT
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"run-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/run-hook","id":"http://localhost:8150/api/commands/run-hook"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8150/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8150/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8150/api/commands/set-node-ipmi-credentials"},{"name":"update-broker-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-broker-configuration","id":"http://localhost:8150/api/commands/update-broker-configuration"},{"name":"update-hook-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-hook-configuration","id":"http://localhost:8150/api/commands/update-hook-configuration"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"name":"update-policy-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-broker","id":"http://localhost:8150/api/commands/update-policy-broker"},{"name":"update-policy-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-node-metadata","id":"http://localhost:8150/api/commands/update-policy-node-metadata"},{"name":"update-policy-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-repo","id":"http://localhost:8150/api/commands/update-policy-repo"},{"name":"update-policy-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-task","id":"http://localhost:8150/api/commands/update-policy-task"},{"name":"update-repo-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-repo-task","id":"http://localhost:8150/api/commands/update-repo-task"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8150/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8150/api/collections/brokers","params":{"depth":{"type":"number"}}},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8150/api/collections/repos","params":{"depth":{"type":"number"}}},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8150/api/collections/tags","params":{"depth":{"type":"number"}}},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8150/api/collections/policies","params":{"depth":{"type":"number"}}},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8150/api/collections/nodes","params":{"start":{"type":"number"},"limit":{"type":"number"},"depth":{"type":"number"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8150/api/collections/tasks","params":{"depth":{"type":"number"}}},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8150/api/collections/commands","params":{"depth":{"type":"number"}}},{"name":"events","rel":"http://api.puppetlabs.com/razor/v1/collections/events","id":"http://localhost:8150/api/collections/events","params":{"start":{"type":"number"},"limit":{"type":"number"},"depth":{"type":"number"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8150/api/collections/hooks","params":{"depth":{"type":"number"}}},{"name":"config","rel":"http://api.puppetlabs.com/razor/v1/collections/config","id":"http://localhost:8150/api/collections/config"}],"version":{"server":"v1.7.1-13-g69ef5ef"}}'
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 20 Apr 2018 00:21:17 GMT
|
40
|
+
recorded_with: VCR 4.0.0
|
@@ -0,0 +1,334 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:8150/api
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- application/json
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- rest-client/2.0.2 (linux x86_64) jruby/9.1.5.0 (2.3.1p0)
|
16
|
+
Accept-Language:
|
17
|
+
- en_US,en
|
18
|
+
Host:
|
19
|
+
- localhost:8150
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Server:
|
26
|
+
- Apache-Coyote/1.1
|
27
|
+
X-Content-Type-Options:
|
28
|
+
- nosniff
|
29
|
+
Content-Type:
|
30
|
+
- application/json
|
31
|
+
Content-Length:
|
32
|
+
- '7427'
|
33
|
+
Date:
|
34
|
+
- Fri, 20 Apr 2018 00:21:37 GMT
|
35
|
+
body:
|
36
|
+
encoding: UTF-8
|
37
|
+
string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"run-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/run-hook","id":"http://localhost:8150/api/commands/run-hook"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8150/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8150/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8150/api/commands/set-node-ipmi-credentials"},{"name":"update-broker-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-broker-configuration","id":"http://localhost:8150/api/commands/update-broker-configuration"},{"name":"update-hook-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-hook-configuration","id":"http://localhost:8150/api/commands/update-hook-configuration"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"name":"update-policy-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-broker","id":"http://localhost:8150/api/commands/update-policy-broker"},{"name":"update-policy-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-node-metadata","id":"http://localhost:8150/api/commands/update-policy-node-metadata"},{"name":"update-policy-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-repo","id":"http://localhost:8150/api/commands/update-policy-repo"},{"name":"update-policy-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-task","id":"http://localhost:8150/api/commands/update-policy-task"},{"name":"update-repo-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-repo-task","id":"http://localhost:8150/api/commands/update-repo-task"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8150/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8150/api/collections/brokers","params":{"depth":{"type":"number"}}},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8150/api/collections/repos","params":{"depth":{"type":"number"}}},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8150/api/collections/tags","params":{"depth":{"type":"number"}}},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8150/api/collections/policies","params":{"depth":{"type":"number"}}},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8150/api/collections/nodes","params":{"start":{"type":"number"},"limit":{"type":"number"},"depth":{"type":"number"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8150/api/collections/tasks","params":{"depth":{"type":"number"}}},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8150/api/collections/commands","params":{"depth":{"type":"number"}}},{"name":"events","rel":"http://api.puppetlabs.com/razor/v1/collections/events","id":"http://localhost:8150/api/collections/events","params":{"start":{"type":"number"},"limit":{"type":"number"},"depth":{"type":"number"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8150/api/collections/hooks","params":{"depth":{"type":"number"}}},{"name":"config","rel":"http://api.puppetlabs.com/razor/v1/collections/config","id":"http://localhost:8150/api/collections/config"}],"version":{"server":"v1.7.1-13-g69ef5ef"}}'
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 20 Apr 2018 00:21:37 GMT
|
40
|
+
- request:
|
41
|
+
method: get
|
42
|
+
uri: http://localhost:8150/api/commands/create-broker
|
43
|
+
body:
|
44
|
+
encoding: US-ASCII
|
45
|
+
string: ''
|
46
|
+
headers:
|
47
|
+
Accept:
|
48
|
+
- application/json
|
49
|
+
Accept-Encoding:
|
50
|
+
- gzip, deflate
|
51
|
+
User-Agent:
|
52
|
+
- rest-client/2.0.2 (linux x86_64) jruby/9.1.5.0 (2.3.1p0)
|
53
|
+
Accept-Language:
|
54
|
+
- en_US,en
|
55
|
+
Host:
|
56
|
+
- localhost:8150
|
57
|
+
response:
|
58
|
+
status:
|
59
|
+
code: 200
|
60
|
+
message: OK
|
61
|
+
headers:
|
62
|
+
Server:
|
63
|
+
- Apache-Coyote/1.1
|
64
|
+
Etag:
|
65
|
+
- '"server-version-v1.7.1-13-g69ef5ef"'
|
66
|
+
X-Content-Type-Options:
|
67
|
+
- nosniff
|
68
|
+
Content-Type:
|
69
|
+
- application/json
|
70
|
+
Content-Length:
|
71
|
+
- '5560'
|
72
|
+
Date:
|
73
|
+
- Fri, 20 Apr 2018 00:21:37 GMT
|
74
|
+
body:
|
75
|
+
encoding: UTF-8
|
76
|
+
string: '{"name":"create-broker","help":{"summary":"Create a new broker configuration
|
77
|
+
for hand-off of installed nodes","description":"Create a new broker configuration. Brokers
|
78
|
+
are responsible for handing a node\noff to a config management system, such
|
79
|
+
as Puppet or Chef. In cases where you\nhave no configuration management system,
|
80
|
+
you can use the `noop` broker.","schema":"# Access Control\n\nThis command''s
|
81
|
+
access control pattern: `commands:create-broker:%{name}`\n\nWords surrounded
|
82
|
+
by `%{...}` are substitutions from the input data: typically\nthe name of
|
83
|
+
the object being modified, or some other critical detail, these\nallow roles
|
84
|
+
to be granted partial access to modify the system.\n\nFor more detail on how
|
85
|
+
the permission strings are structured and work, you can\nsee the [Shiro Permissions
|
86
|
+
documentation][shiro]. That pattern is expanded\nand then a permission check
|
87
|
+
applied to it, before the command is authorized.\n\nThese checks only apply
|
88
|
+
if security is enabled in the Razor configuration\nfile; on this server security
|
89
|
+
is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
|
90
|
+
Attributes\n\n * name\n - The name of the broker, as it will be referenced
|
91
|
+
within Razor.\n This is the name that you supply to, eg, `create-policy`
|
92
|
+
to specify\n which broker the node will be handed off via after installation.\n -
|
93
|
+
This attribute is required.\n - It must be of type string.\n - It must
|
94
|
+
be between 1 and 250 in length.\n - Its argument position is 0.\n\n * broker_type\n -
|
95
|
+
The broker type from which this broker is created. The available\n broker
|
96
|
+
types on your server are:\n - chef\n - legacy-puppet\n - noop\n -
|
97
|
+
puppet-pe\n - puppet\n - This attribute is required.\n - It must be
|
98
|
+
of type string.\n - It must match the name of an existing broker type.\n -
|
99
|
+
Its argument position is 1.\n\n * configuration\n - The configuration for
|
100
|
+
the broker. The acceptable values here are\n determined by the `broker_type`
|
101
|
+
selected. In general this has\n settings like which server to contact,
|
102
|
+
and other configuration\n related to handing on the newly installed system
|
103
|
+
to the final\n configuration management system.\n \n This attribute
|
104
|
+
can be abbreviated as `c` for convenience.\n - It must be of type object.\n","examples":{"api":"Creating
|
105
|
+
a simple Puppet broker:\n\n{\n \"name\": \"puppet\",\n \"configuration\":
|
106
|
+
{\n \"server\": \"puppet.example.org\",\n \"environment\": \"production\"\n },\n \"broker_type\":
|
107
|
+
\"puppet\"\n}","cli":"Creating a simple Puppet broker:\n\n razor create-broker
|
108
|
+
--name puppet -c server=puppet.example.org \\\n -c environment=production
|
109
|
+
--broker-type puppet\n\nWith positional arguments, this can be shortened::\n\n razor
|
110
|
+
create-broker puppet puppet -c server=puppet.example.org \\\n -c environment=production"},"full":"#
|
111
|
+
SYNOPSIS\nCreate a new broker configuration for hand-off of installed nodes\n\n#
|
112
|
+
DESCRIPTION\nCreate a new broker configuration. Brokers are responsible for
|
113
|
+
handing a node\noff to a config management system, such as Puppet or Chef. In
|
114
|
+
cases where you\nhave no configuration management system, you can use the
|
115
|
+
`noop` broker.\n# Access Control\n\nThis command''s access control pattern:
|
116
|
+
`commands:create-broker:%{name}`\n\nWords surrounded by `%{...}` are substitutions
|
117
|
+
from the input data: typically\nthe name of the object being modified, or
|
118
|
+
some other critical detail, these\nallow roles to be granted partial access
|
119
|
+
to modify the system.\n\nFor more detail on how the permission strings are
|
120
|
+
structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
121
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
122
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
123
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
124
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
125
|
+
The name of the broker, as it will be referenced within Razor.\n This
|
126
|
+
is the name that you supply to, eg, `create-policy` to specify\n which
|
127
|
+
broker the node will be handed off via after installation.\n - This attribute
|
128
|
+
is required.\n - It must be of type string.\n - It must be between 1 and
|
129
|
+
250 in length.\n - Its argument position is 0.\n\n * broker_type\n - The
|
130
|
+
broker type from which this broker is created. The available\n broker
|
131
|
+
types on your server are:\n - chef\n - legacy-puppet\n - noop\n -
|
132
|
+
puppet-pe\n - puppet\n - This attribute is required.\n - It must be
|
133
|
+
of type string.\n - It must match the name of an existing broker type.\n -
|
134
|
+
Its argument position is 1.\n\n * configuration\n - The configuration for
|
135
|
+
the broker. The acceptable values here are\n determined by the `broker_type`
|
136
|
+
selected. In general this has\n settings like which server to contact,
|
137
|
+
and other configuration\n related to handing on the newly installed system
|
138
|
+
to the final\n configuration management system.\n \n This attribute
|
139
|
+
can be abbreviated as `c` for convenience.\n - It must be of type object.\n\n#
|
140
|
+
EXAMPLES\n\n Creating a simple Puppet broker:\n \n {\n \"name\": \"puppet\",\n \"configuration\":
|
141
|
+
{\n \"server\": \"puppet.example.org\",\n \"environment\":
|
142
|
+
\"production\"\n },\n \"broker_type\": \"puppet\"\n }\n"},"schema":{"name":{"type":"string","position":0},"broker_type":{"type":"string","aliases":["broker-type"],"position":1},"configuration":{"type":"object","aliases":["c"]}}}'
|
143
|
+
http_version:
|
144
|
+
recorded_at: Fri, 20 Apr 2018 00:21:37 GMT
|
145
|
+
- request:
|
146
|
+
method: post
|
147
|
+
uri: http://localhost:8150/api/commands/create-broker
|
148
|
+
body:
|
149
|
+
encoding: UTF-8
|
150
|
+
string: '{"name":"test_broker","configuration":{"server":"puppet.example.org","environment":"production"},"broker_type":"puppet"}'
|
151
|
+
headers:
|
152
|
+
Accept:
|
153
|
+
- application/json
|
154
|
+
Accept-Encoding:
|
155
|
+
- gzip, deflate
|
156
|
+
User-Agent:
|
157
|
+
- rest-client/2.0.2 (linux x86_64) jruby/9.1.5.0 (2.3.1p0)
|
158
|
+
Content-Type:
|
159
|
+
- application/json
|
160
|
+
Accept-Language:
|
161
|
+
- en_US,en
|
162
|
+
Content-Length:
|
163
|
+
- '120'
|
164
|
+
Host:
|
165
|
+
- localhost:8150
|
166
|
+
response:
|
167
|
+
status:
|
168
|
+
code: 202
|
169
|
+
message: Accepted
|
170
|
+
headers:
|
171
|
+
Server:
|
172
|
+
- Apache-Coyote/1.1
|
173
|
+
X-Content-Type-Options:
|
174
|
+
- nosniff
|
175
|
+
Content-Type:
|
176
|
+
- application/json
|
177
|
+
Content-Length:
|
178
|
+
- '219'
|
179
|
+
Date:
|
180
|
+
- Fri, 20 Apr 2018 00:21:37 GMT
|
181
|
+
body:
|
182
|
+
encoding: UTF-8
|
183
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/brokers/member","id":"http://localhost:8150/api/collections/brokers/test_broker","name":"test_broker","command":"http://localhost:8150/api/collections/commands/1"}'
|
184
|
+
http_version:
|
185
|
+
recorded_at: Fri, 20 Apr 2018 00:21:37 GMT
|
186
|
+
- request:
|
187
|
+
method: get
|
188
|
+
uri: http://localhost:8150/api/collections/brokers/test_broker
|
189
|
+
body:
|
190
|
+
encoding: US-ASCII
|
191
|
+
string: ''
|
192
|
+
headers:
|
193
|
+
Accept:
|
194
|
+
- application/json
|
195
|
+
Accept-Encoding:
|
196
|
+
- gzip, deflate
|
197
|
+
User-Agent:
|
198
|
+
- rest-client/2.0.2 (linux x86_64) jruby/9.1.5.0 (2.3.1p0)
|
199
|
+
Accept-Language:
|
200
|
+
- en_US,en
|
201
|
+
Host:
|
202
|
+
- localhost:8150
|
203
|
+
response:
|
204
|
+
status:
|
205
|
+
code: 200
|
206
|
+
message: OK
|
207
|
+
headers:
|
208
|
+
Server:
|
209
|
+
- Apache-Coyote/1.1
|
210
|
+
X-Content-Type-Options:
|
211
|
+
- nosniff
|
212
|
+
Content-Type:
|
213
|
+
- application/json
|
214
|
+
Content-Length:
|
215
|
+
- '371'
|
216
|
+
Date:
|
217
|
+
- Fri, 20 Apr 2018 00:21:37 GMT
|
218
|
+
body:
|
219
|
+
encoding: UTF-8
|
220
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/brokers/member","id":"http://localhost:8150/api/collections/brokers/test_broker","name":"test_broker","configuration":{"server":"puppet.example.org","environment":"production"},"broker_type":"puppet","policies":{"id":"http://localhost:8150/api/collections/brokers/test_broker/policies","count":0,"name":"policies"}}'
|
221
|
+
http_version:
|
222
|
+
recorded_at: Fri, 20 Apr 2018 00:21:38 GMT
|
223
|
+
- request:
|
224
|
+
method: get
|
225
|
+
uri: http://localhost:8150/api
|
226
|
+
body:
|
227
|
+
encoding: US-ASCII
|
228
|
+
string: ''
|
229
|
+
headers:
|
230
|
+
Accept:
|
231
|
+
- application/json
|
232
|
+
Accept-Encoding:
|
233
|
+
- gzip, deflate
|
234
|
+
User-Agent:
|
235
|
+
- rest-client/2.0.2 (linux x86_64) jruby/9.1.5.0 (2.3.1p0)
|
236
|
+
Accept-Language:
|
237
|
+
- en_US,en
|
238
|
+
Host:
|
239
|
+
- localhost:8150
|
240
|
+
response:
|
241
|
+
status:
|
242
|
+
code: 200
|
243
|
+
message: OK
|
244
|
+
headers:
|
245
|
+
Server:
|
246
|
+
- Apache-Coyote/1.1
|
247
|
+
X-Content-Type-Options:
|
248
|
+
- nosniff
|
249
|
+
Content-Type:
|
250
|
+
- application/json
|
251
|
+
Content-Length:
|
252
|
+
- '7427'
|
253
|
+
Date:
|
254
|
+
- Fri, 20 Apr 2018 00:21:37 GMT
|
255
|
+
body:
|
256
|
+
encoding: UTF-8
|
257
|
+
string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"run-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/run-hook","id":"http://localhost:8150/api/commands/run-hook"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8150/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8150/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8150/api/commands/set-node-ipmi-credentials"},{"name":"update-broker-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-broker-configuration","id":"http://localhost:8150/api/commands/update-broker-configuration"},{"name":"update-hook-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-hook-configuration","id":"http://localhost:8150/api/commands/update-hook-configuration"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"name":"update-policy-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-broker","id":"http://localhost:8150/api/commands/update-policy-broker"},{"name":"update-policy-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-node-metadata","id":"http://localhost:8150/api/commands/update-policy-node-metadata"},{"name":"update-policy-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-repo","id":"http://localhost:8150/api/commands/update-policy-repo"},{"name":"update-policy-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-task","id":"http://localhost:8150/api/commands/update-policy-task"},{"name":"update-repo-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-repo-task","id":"http://localhost:8150/api/commands/update-repo-task"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8150/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8150/api/collections/brokers","params":{"depth":{"type":"number"}}},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8150/api/collections/repos","params":{"depth":{"type":"number"}}},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8150/api/collections/tags","params":{"depth":{"type":"number"}}},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8150/api/collections/policies","params":{"depth":{"type":"number"}}},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8150/api/collections/nodes","params":{"start":{"type":"number"},"limit":{"type":"number"},"depth":{"type":"number"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8150/api/collections/tasks","params":{"depth":{"type":"number"}}},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8150/api/collections/commands","params":{"depth":{"type":"number"}}},{"name":"events","rel":"http://api.puppetlabs.com/razor/v1/collections/events","id":"http://localhost:8150/api/collections/events","params":{"start":{"type":"number"},"limit":{"type":"number"},"depth":{"type":"number"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8150/api/collections/hooks","params":{"depth":{"type":"number"}}},{"name":"config","rel":"http://api.puppetlabs.com/razor/v1/collections/config","id":"http://localhost:8150/api/collections/config"}],"version":{"server":"v1.7.1-13-g69ef5ef"}}'
|
258
|
+
http_version:
|
259
|
+
recorded_at: Fri, 20 Apr 2018 00:21:38 GMT
|
260
|
+
- request:
|
261
|
+
method: get
|
262
|
+
uri: http://localhost:8150/api/collections/brokers
|
263
|
+
body:
|
264
|
+
encoding: US-ASCII
|
265
|
+
string: ''
|
266
|
+
headers:
|
267
|
+
Accept:
|
268
|
+
- application/json
|
269
|
+
Accept-Encoding:
|
270
|
+
- gzip, deflate
|
271
|
+
User-Agent:
|
272
|
+
- rest-client/2.0.2 (linux x86_64) jruby/9.1.5.0 (2.3.1p0)
|
273
|
+
Accept-Language:
|
274
|
+
- en_US,en
|
275
|
+
Host:
|
276
|
+
- localhost:8150
|
277
|
+
response:
|
278
|
+
status:
|
279
|
+
code: 200
|
280
|
+
message: OK
|
281
|
+
headers:
|
282
|
+
Server:
|
283
|
+
- Apache-Coyote/1.1
|
284
|
+
X-Content-Type-Options:
|
285
|
+
- nosniff
|
286
|
+
Content-Type:
|
287
|
+
- application/json
|
288
|
+
Content-Length:
|
289
|
+
- '244'
|
290
|
+
Date:
|
291
|
+
- Fri, 20 Apr 2018 00:21:37 GMT
|
292
|
+
body:
|
293
|
+
encoding: UTF-8
|
294
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/brokers","items":[{"spec":"http://api.puppetlabs.com/razor/v1/collections/brokers/member","id":"http://localhost:8150/api/collections/brokers/test_broker","name":"test_broker"}],"total":1}'
|
295
|
+
http_version:
|
296
|
+
recorded_at: Fri, 20 Apr 2018 00:21:38 GMT
|
297
|
+
- request:
|
298
|
+
method: get
|
299
|
+
uri: http://localhost:8150/api/collections/brokers/test_broker
|
300
|
+
body:
|
301
|
+
encoding: US-ASCII
|
302
|
+
string: ''
|
303
|
+
headers:
|
304
|
+
Accept:
|
305
|
+
- application/json
|
306
|
+
Accept-Encoding:
|
307
|
+
- gzip, deflate
|
308
|
+
User-Agent:
|
309
|
+
- rest-client/2.0.2 (linux x86_64) jruby/9.1.5.0 (2.3.1p0)
|
310
|
+
Accept-Language:
|
311
|
+
- en_US,en
|
312
|
+
Host:
|
313
|
+
- localhost:8150
|
314
|
+
response:
|
315
|
+
status:
|
316
|
+
code: 200
|
317
|
+
message: OK
|
318
|
+
headers:
|
319
|
+
Server:
|
320
|
+
- Apache-Coyote/1.1
|
321
|
+
X-Content-Type-Options:
|
322
|
+
- nosniff
|
323
|
+
Content-Type:
|
324
|
+
- application/json
|
325
|
+
Content-Length:
|
326
|
+
- '371'
|
327
|
+
Date:
|
328
|
+
- Fri, 20 Apr 2018 00:21:37 GMT
|
329
|
+
body:
|
330
|
+
encoding: UTF-8
|
331
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/brokers/member","id":"http://localhost:8150/api/collections/brokers/test_broker","name":"test_broker","configuration":{"server":"puppet.example.org","environment":"production"},"broker_type":"puppet","policies":{"id":"http://localhost:8150/api/collections/brokers/test_broker/policies","count":0,"name":"policies"}}'
|
332
|
+
http_version:
|
333
|
+
recorded_at: Fri, 20 Apr 2018 00:21:38 GMT
|
334
|
+
recorded_with: VCR 4.0.0
|
metadata
CHANGED
@@ -1,118 +1,104 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: razor-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.9.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Puppet Labs
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2018-
|
11
|
+
date: 2018-06-07 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: mime-types
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - <
|
17
|
+
- - "<"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '2.0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - <
|
24
|
+
- - "<"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '2.0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: multi_json
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rest-client
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - <
|
45
|
+
- - "<"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '1.7'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - <
|
52
|
+
- - "<"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '1.7'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: command_line_reporter
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">"
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '3.0'
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">"
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '3.0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: gettext-setup
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :runtime
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
|
-
description:
|
95
|
-
bare-metal
|
96
|
-
|
97
|
-
and virtual systems. It''s aimed at solving the problem of how to bring new
|
98
|
-
|
83
|
+
description: |
|
84
|
+
Razor is an advanced provisioning application which can deploy both bare-metal
|
85
|
+
and virtual systems. It's aimed at solving the problem of how to bring new
|
99
86
|
metal into a state where your existing DevOps/configuration management
|
100
|
-
|
101
87
|
workflows can take it over.
|
102
88
|
|
103
|
-
|
104
89
|
This provides the client application gem, used to provide CLI access and control
|
105
|
-
|
106
90
|
to users of razor-server.
|
107
|
-
|
108
|
-
'
|
109
91
|
email: info@puppetlabs.com
|
110
92
|
executables:
|
111
93
|
- razor
|
112
94
|
extensions: []
|
113
95
|
extra_rdoc_files: []
|
114
96
|
files:
|
97
|
+
- LICENSE
|
98
|
+
- NEWS.md
|
99
|
+
- README.md
|
115
100
|
- bin/razor
|
101
|
+
- lib/razor.rb
|
116
102
|
- lib/razor/cli.rb
|
117
103
|
- lib/razor/cli/command.rb
|
118
104
|
- lib/razor/cli/document.rb
|
@@ -125,12 +111,8 @@ files:
|
|
125
111
|
- lib/razor/cli/version.rb
|
126
112
|
- lib/razor/cli/views.rb
|
127
113
|
- lib/razor/cli/views.yaml
|
128
|
-
- lib/razor.rb
|
129
114
|
- locales/config.yaml
|
130
115
|
- locales/razor-client.pot
|
131
|
-
- NEWS.md
|
132
|
-
- README.md
|
133
|
-
- LICENSE
|
134
116
|
- spec/cli/command_spec.rb
|
135
117
|
- spec/cli/document_spec.rb
|
136
118
|
- spec/cli/format_spec.rb
|
@@ -152,6 +134,9 @@ files:
|
|
152
134
|
- spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_help_command_.yml
|
153
135
|
- spec/fixtures/vcr/Razor_CLI_Navigate/positional_arguments/should_allow_the_use_of_positional_arguments.yml
|
154
136
|
- spec/fixtures/vcr/Razor_CLI_Navigate/positional_arguments/should_fail_with_too_many_positional_arguments.yml
|
137
|
+
- spec/fixtures/vcr/Razor_CLI_Navigate/when_the_collections_endpoint_has_a_depth_parameter/should_be_set_to_1_when_the_endpoint_is_the_final_query.yml
|
138
|
+
- spec/fixtures/vcr/Razor_CLI_Navigate/when_the_collections_endpoint_has_a_depth_parameter/should_not_be_exposed_to_the_user.yml
|
139
|
+
- spec/fixtures/vcr/Razor_CLI_Navigate/when_the_collections_endpoint_has_a_depth_parameter/should_not_carry-over_to_later_requests_in_a_nested_query.yml
|
155
140
|
- spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_preserve_that_across_navigation.yml
|
156
141
|
- spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_supply_that_to_the_API_service.yml
|
157
142
|
- spec/fixtures/vcr/Razor_CLI_Navigate/with_invalid_parameter/should_fail_with_bad_JSON.yml
|
@@ -178,27 +163,26 @@ files:
|
|
178
163
|
- spec/version_spec.rb
|
179
164
|
homepage: http://puppetlabs.com/puppet/puppet-enterprise
|
180
165
|
licenses: []
|
166
|
+
metadata: {}
|
181
167
|
post_install_message:
|
182
168
|
rdoc_options: []
|
183
169
|
require_paths:
|
184
170
|
- lib
|
185
171
|
required_ruby_version: !ruby/object:Gem::Requirement
|
186
|
-
none: false
|
187
172
|
requirements:
|
188
|
-
- -
|
173
|
+
- - ">="
|
189
174
|
- !ruby/object:Gem::Version
|
190
175
|
version: 1.9.3
|
191
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
192
|
-
none: false
|
193
177
|
requirements:
|
194
|
-
- -
|
178
|
+
- - ">="
|
195
179
|
- !ruby/object:Gem::Version
|
196
180
|
version: '0'
|
197
181
|
requirements: []
|
198
182
|
rubyforge_project:
|
199
|
-
rubygems_version:
|
183
|
+
rubygems_version: 2.5.2.1
|
200
184
|
signing_key:
|
201
|
-
specification_version:
|
185
|
+
specification_version: 4
|
202
186
|
summary: Razor is an advanced provisioning application
|
203
187
|
test_files:
|
204
188
|
- spec/cli/command_spec.rb
|
@@ -222,6 +206,9 @@ test_files:
|
|
222
206
|
- spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_help_command_.yml
|
223
207
|
- spec/fixtures/vcr/Razor_CLI_Navigate/positional_arguments/should_allow_the_use_of_positional_arguments.yml
|
224
208
|
- spec/fixtures/vcr/Razor_CLI_Navigate/positional_arguments/should_fail_with_too_many_positional_arguments.yml
|
209
|
+
- spec/fixtures/vcr/Razor_CLI_Navigate/when_the_collections_endpoint_has_a_depth_parameter/should_be_set_to_1_when_the_endpoint_is_the_final_query.yml
|
210
|
+
- spec/fixtures/vcr/Razor_CLI_Navigate/when_the_collections_endpoint_has_a_depth_parameter/should_not_be_exposed_to_the_user.yml
|
211
|
+
- spec/fixtures/vcr/Razor_CLI_Navigate/when_the_collections_endpoint_has_a_depth_parameter/should_not_carry-over_to_later_requests_in_a_nested_query.yml
|
225
212
|
- spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_preserve_that_across_navigation.yml
|
226
213
|
- spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_supply_that_to_the_API_service.yml
|
227
214
|
- spec/fixtures/vcr/Razor_CLI_Navigate/with_invalid_parameter/should_fail_with_bad_JSON.yml
|