pe-razor-client 1.1.0 → 1.2.0

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.
@@ -128,6 +128,31 @@ describe Razor::CLI::Navigate do
128
128
  it "should allow '=' in string" do
129
129
  Razor::CLI::Parse.new(['create-repo', '--name=\'with=equals\'', '--url', 'http://url.com/some.iso', '--task', 'noop']).navigate.get_document['name'].should =~ /with=equals/
130
130
  end
131
+
132
+ it "should not allow double-dash with single character flag" do
133
+ nav = Razor::CLI::Parse.new(['create-broker', '--name=some-broker', '--broker-type', 'puppet-pe', '--c', 'server=abc.com']).navigate
134
+ expect{nav.get_document}.to raise_error(ArgumentError, 'Unexpected argument --c (did you mean -c?)')
135
+ end
136
+ it "should not allow single-dash with multiple character flag" do
137
+ nav = Razor::CLI::Parse.new(['create-broker', '--name=some-broker', '-broker-type', 'puppet-pe']).navigate
138
+ expect{nav.get_document}.to raise_error(ArgumentError, 'Unexpected argument -broker-type (did you mean --broker-type?)')
139
+ end
140
+ it "should allow single-dash with single character flag" do
141
+ Razor::CLI::Parse.new(['create-broker', '--name=some-broker', '--broker-type', 'puppet-pe', '-c', 'server=abc.com']).navigate.get_document['configuration']['server'].should == 'abc.com'
142
+ end
143
+ end
144
+
145
+ context "positional arguments", :vcr do
146
+ it "should allow the use of positional arguments" do
147
+ Razor::CLI::Parse.new(['create-broker', 'some noop broker', 'noop']).navigate.get_document['name'].should == 'some noop broker'
148
+ Razor::CLI::Parse.new(['create-broker', 'some other broker', '--broker-type', 'noop']).navigate.get_document['name'].should == 'some other broker'
149
+ Razor::CLI::Parse.new(['delete-broker', 'some noop broker']).navigate.get_document['result'].should == 'broker some noop broker destroyed'
150
+ Razor::CLI::Parse.new(['delete-broker', 'some other broker']).navigate.get_document['result'].should == 'broker some other broker destroyed'
151
+ end
152
+ it "should fail with too many positional arguments" do
153
+ nav = Razor::CLI::Parse.new(['create-broker', 'some noop broker', 'noop', 'extra']).navigate
154
+ expect{nav.get_document}.to raise_error(ArgumentError, 'Unexpected argument extra')
155
+ end
131
156
  end
132
157
 
133
158
  context "for command help", :vcr do
@@ -57,6 +57,11 @@ describe Razor::CLI::Parse do
57
57
  parse('-u',url).verify_ssl?.should == true
58
58
  end
59
59
 
60
+ it "should respect insecure requests" do
61
+ url = 'http://razor.example.com:2150/path/to/api'
62
+ parse('-u',url,'-k').verify_ssl?.should be false
63
+ end
64
+
60
65
  it "should terminate with an error if an invalid URL is provided" do
61
66
  expect{parse('-u','not valid url')}.to raise_error(Razor::CLI::InvalidURIError)
62
67
  end
@@ -86,6 +91,12 @@ describe Razor::CLI::Parse do
86
91
  it {parse("--version").show_version?.should be true}
87
92
  end
88
93
 
94
+ context "with '--version' and no reachable server" do
95
+ subject { parse("--version", '-u', 'https://localhost:9999999/api').version.first }
96
+ it { should =~ /Razor Server version: \(unknown\)/ }
97
+ it { should =~ /Razor Client version: #{Razor::CLI::VERSION}/ }
98
+ end
99
+
89
100
  context "with ENV RAZOR_API set" do
90
101
  it "should use the given URL" do
91
102
  url = 'http://razor.example.com:2150/env/path/to/api'
@@ -0,0 +1,203 @@
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
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '6471'
29
+ Date:
30
+ - Tue, 06 Oct 2015 23:42:04 GMT
31
+ body:
32
+ encoding: US-ASCII
33
+ 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-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"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8150/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8150/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8150/api/collections/policies"},{"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"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8150/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8150/api/collections/commands"},{"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"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8150/api/collections/hooks"}],"version":{"server":"v1.0.1-39-g2052ab6-dirty"}}'
34
+ http_version:
35
+ recorded_at: Tue, 06 Oct 2015 23:42:04 GMT
36
+ - request:
37
+ method: get
38
+ uri: http://localhost:8150/api/commands/create-broker
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ Accept:
44
+ - application/json
45
+ Accept-Encoding:
46
+ - gzip, deflate
47
+ User-Agent:
48
+ - Ruby
49
+ response:
50
+ status:
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ Server:
55
+ - Apache-Coyote/1.1
56
+ Etag:
57
+ - '"server-version-v1.0.1-39-g2052ab6-dirty"'
58
+ X-Content-Type-Options:
59
+ - nosniff
60
+ Content-Type:
61
+ - application/json;charset=utf-8
62
+ Content-Length:
63
+ - '5184'
64
+ Date:
65
+ - Tue, 06 Oct 2015 23:42:04 GMT
66
+ body:
67
+ encoding: US-ASCII
68
+ string: '{"name":"create-broker","help":{"summary":"Create a new broker configuration
69
+ for hand-off of installed nodes","description":"Create a new broker configuration. Brokers
70
+ are responsible for handing a node\noff to a config management system, such
71
+ as Puppet or Chef. In cases where you\nhave no configuration management system,
72
+ you can use the `noop` broker.","schema":"# Access Control\n\nThis command''s
73
+ access control pattern: `commands:create-broker:%{name}`\n\nWords surrounded
74
+ by `%{...}` are substitutions from the input data: typically\nthe name of
75
+ the object being modified, or some other critical detail, these\nallow roles
76
+ to be granted partial access to modify the system.\n\nFor more detail on how
77
+ the permission strings are structured and work, you can\nsee the [Shiro Permissions
78
+ documentation][shiro]. That pattern is expanded\nand then a permission check
79
+ applied to it, before the command is authorized.\n\nThese checks only apply
80
+ if security is enabled in the Razor configuration\nfile; on this server security
81
+ is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
82
+ Attributes\n\n * name\n - The name of the broker, as it will be referenced
83
+ within Razor.\n This is the name that you supply to, eg, `create-policy`
84
+ to specify\n which broker the node will be handed off via after installation.\n -
85
+ This attribute is required.\n - It must be of type string.\n - It must
86
+ be between 1 and 250 in length.\n\n * broker_type\n - The broker type from
87
+ which this broker is created. The available\n broker types on your server
88
+ are:\n - chef\n - noop\n - puppet-pe\n - puppet\n - This
89
+ attribute is required.\n - It must be of type string.\n - It must match
90
+ the name of an existing broker type.\n\n * configuration\n - The configuration
91
+ for the broker. The acceptable values here are\n determined by the `broker_type`
92
+ selected. In general this has\n settings like which server to contact,
93
+ and other configuration\n related to handing on the newly installed system
94
+ to the final\n configuration management system.\n \n This attribute
95
+ can be abbreviated as `c` for convenience.\n - It must be of type object.\n","examples":{"api":"Creating
96
+ a simple Puppet broker:\n\n{\n \"name\": \"puppet\",\n \"configuration\":
97
+ {\n \"server\": \"puppet.example.org\",\n \"environment\": \"production\"\n },\n \"broker_type\":
98
+ \"puppet\"\n}","cli":"Creating a simple Puppet broker:\n\nrazor create-broker
99
+ --name puppet -c server=puppet.example.org \\\n -c environment=production
100
+ --broker-type puppet"},"full":"# SYNOPSIS\nCreate a new broker configuration
101
+ for hand-off of installed nodes\n\n# DESCRIPTION\nCreate a new broker configuration. Brokers
102
+ are responsible for handing a node\noff to a config management system, such
103
+ as Puppet or Chef. In cases where you\nhave no configuration management system,
104
+ you can use the `noop` broker.\n# Access Control\n\nThis command''s access
105
+ control pattern: `commands:create-broker:%{name}`\n\nWords surrounded by `%{...}`
106
+ are substitutions from the input data: typically\nthe name of the object being
107
+ modified, or some other critical detail, these\nallow roles to be granted
108
+ partial access to modify the system.\n\nFor more detail on how the permission
109
+ strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
110
+ pattern is expanded\nand then a permission check applied to it, before the
111
+ command is authorized.\n\nThese checks only apply if security is enabled in
112
+ the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
113
+ http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
114
+ The name of the broker, as it will be referenced within Razor.\n This
115
+ is the name that you supply to, eg, `create-policy` to specify\n which
116
+ broker the node will be handed off via after installation.\n - This attribute
117
+ is required.\n - It must be of type string.\n - It must be between 1 and
118
+ 250 in length.\n\n * broker_type\n - The broker type from which this broker
119
+ is created. The available\n broker types on your server are:\n -
120
+ chef\n - noop\n - puppet-pe\n - puppet\n - This attribute is
121
+ required.\n - It must be of type string.\n - It must match the name of
122
+ an existing broker type.\n\n * configuration\n - The configuration for the
123
+ broker. The acceptable values here are\n determined by the `broker_type`
124
+ selected. In general this has\n settings like which server to contact,
125
+ and other configuration\n related to handing on the newly installed system
126
+ to the final\n configuration management system.\n \n This attribute
127
+ can be abbreviated as `c` for convenience.\n - It must be of type object.\n\n#
128
+ EXAMPLES\n\n Creating a simple Puppet broker:\n \n {\n \"name\": \"puppet\",\n \"configuration\":
129
+ {\n \"server\": \"puppet.example.org\",\n \"environment\":
130
+ \"production\"\n },\n \"broker_type\": \"puppet\"\n }\n"},"schema":{"name":{"type":"string"},"broker_type":{"type":"string","aliases":["broker-type"]},"configuration":{"type":"object","aliases":["c"]}}}'
131
+ http_version:
132
+ recorded_at: Tue, 06 Oct 2015 23:42:04 GMT
133
+ - request:
134
+ method: post
135
+ uri: http://localhost:8150/api/commands/create-broker
136
+ body:
137
+ encoding: UTF-8
138
+ string: '{"name":"some-broker","broker_type":"puppet-pe","configuration":{"server":"abc.com"}}'
139
+ headers:
140
+ Accept:
141
+ - application/json
142
+ Accept-Encoding:
143
+ - gzip, deflate
144
+ Content-Type:
145
+ - application/json
146
+ Content-Length:
147
+ - '85'
148
+ User-Agent:
149
+ - Ruby
150
+ response:
151
+ status:
152
+ code: 202
153
+ message: Accepted
154
+ headers:
155
+ Server:
156
+ - Apache-Coyote/1.1
157
+ X-Content-Type-Options:
158
+ - nosniff
159
+ Content-Type:
160
+ - application/json;charset=utf-8
161
+ Content-Length:
162
+ - '219'
163
+ Date:
164
+ - Tue, 06 Oct 2015 23:42:04 GMT
165
+ body:
166
+ encoding: US-ASCII
167
+ string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/brokers/member","id":"http://localhost:8150/api/collections/brokers/some-broker","name":"some-broker","command":"http://localhost:8150/api/collections/commands/1"}'
168
+ http_version:
169
+ recorded_at: Tue, 06 Oct 2015 23:42:05 GMT
170
+ - request:
171
+ method: get
172
+ uri: http://localhost:8150/api/collections/brokers/some-broker
173
+ body:
174
+ encoding: US-ASCII
175
+ string: ''
176
+ headers:
177
+ Accept:
178
+ - application/json
179
+ Accept-Encoding:
180
+ - gzip, deflate
181
+ User-Agent:
182
+ - Ruby
183
+ response:
184
+ status:
185
+ code: 200
186
+ message: OK
187
+ headers:
188
+ Server:
189
+ - Apache-Coyote/1.1
190
+ X-Content-Type-Options:
191
+ - nosniff
192
+ Content-Type:
193
+ - application/json;charset=utf-8
194
+ Content-Length:
195
+ - '336'
196
+ Date:
197
+ - Tue, 06 Oct 2015 23:42:04 GMT
198
+ body:
199
+ encoding: US-ASCII
200
+ string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/brokers/member","id":"http://localhost:8150/api/collections/brokers/some-broker","name":"some-broker","configuration":{"server":"abc.com"},"broker_type":"puppet-pe","policies":{"id":"http://localhost:8150/api/collections/brokers/some-broker/policies","count":0,"name":"policies"}}'
201
+ http_version:
202
+ recorded_at: Tue, 06 Oct 2015 23:42:05 GMT
203
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,133 @@
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
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '6471'
29
+ Date:
30
+ - Tue, 06 Oct 2015 23:41:59 GMT
31
+ body:
32
+ encoding: US-ASCII
33
+ 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-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"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8150/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8150/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8150/api/collections/policies"},{"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"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8150/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8150/api/collections/commands"},{"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"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8150/api/collections/hooks"}],"version":{"server":"v1.0.1-39-g2052ab6-dirty"}}'
34
+ http_version:
35
+ recorded_at: Tue, 06 Oct 2015 23:41:59 GMT
36
+ - request:
37
+ method: get
38
+ uri: http://localhost:8150/api/commands/create-broker
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ Accept:
44
+ - application/json
45
+ Accept-Encoding:
46
+ - gzip, deflate
47
+ User-Agent:
48
+ - Ruby
49
+ response:
50
+ status:
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ Server:
55
+ - Apache-Coyote/1.1
56
+ Etag:
57
+ - '"server-version-v1.0.1-39-g2052ab6-dirty"'
58
+ X-Content-Type-Options:
59
+ - nosniff
60
+ Content-Type:
61
+ - application/json;charset=utf-8
62
+ Content-Length:
63
+ - '5184'
64
+ Date:
65
+ - Tue, 06 Oct 2015 23:41:59 GMT
66
+ body:
67
+ encoding: US-ASCII
68
+ string: '{"name":"create-broker","help":{"summary":"Create a new broker configuration
69
+ for hand-off of installed nodes","description":"Create a new broker configuration. Brokers
70
+ are responsible for handing a node\noff to a config management system, such
71
+ as Puppet or Chef. In cases where you\nhave no configuration management system,
72
+ you can use the `noop` broker.","schema":"# Access Control\n\nThis command''s
73
+ access control pattern: `commands:create-broker:%{name}`\n\nWords surrounded
74
+ by `%{...}` are substitutions from the input data: typically\nthe name of
75
+ the object being modified, or some other critical detail, these\nallow roles
76
+ to be granted partial access to modify the system.\n\nFor more detail on how
77
+ the permission strings are structured and work, you can\nsee the [Shiro Permissions
78
+ documentation][shiro]. That pattern is expanded\nand then a permission check
79
+ applied to it, before the command is authorized.\n\nThese checks only apply
80
+ if security is enabled in the Razor configuration\nfile; on this server security
81
+ is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
82
+ Attributes\n\n * name\n - The name of the broker, as it will be referenced
83
+ within Razor.\n This is the name that you supply to, eg, `create-policy`
84
+ to specify\n which broker the node will be handed off via after installation.\n -
85
+ This attribute is required.\n - It must be of type string.\n - It must
86
+ be between 1 and 250 in length.\n\n * broker_type\n - The broker type from
87
+ which this broker is created. The available\n broker types on your server
88
+ are:\n - chef\n - noop\n - puppet-pe\n - puppet\n - This
89
+ attribute is required.\n - It must be of type string.\n - It must match
90
+ the name of an existing broker type.\n\n * configuration\n - The configuration
91
+ for the broker. The acceptable values here are\n determined by the `broker_type`
92
+ selected. In general this has\n settings like which server to contact,
93
+ and other configuration\n related to handing on the newly installed system
94
+ to the final\n configuration management system.\n \n This attribute
95
+ can be abbreviated as `c` for convenience.\n - It must be of type object.\n","examples":{"api":"Creating
96
+ a simple Puppet broker:\n\n{\n \"name\": \"puppet\",\n \"configuration\":
97
+ {\n \"server\": \"puppet.example.org\",\n \"environment\": \"production\"\n },\n \"broker_type\":
98
+ \"puppet\"\n}","cli":"Creating a simple Puppet broker:\n\nrazor create-broker
99
+ --name puppet -c server=puppet.example.org \\\n -c environment=production
100
+ --broker-type puppet"},"full":"# SYNOPSIS\nCreate a new broker configuration
101
+ for hand-off of installed nodes\n\n# DESCRIPTION\nCreate a new broker configuration. Brokers
102
+ are responsible for handing a node\noff to a config management system, such
103
+ as Puppet or Chef. In cases where you\nhave no configuration management system,
104
+ you can use the `noop` broker.\n# Access Control\n\nThis command''s access
105
+ control pattern: `commands:create-broker:%{name}`\n\nWords surrounded by `%{...}`
106
+ are substitutions from the input data: typically\nthe name of the object being
107
+ modified, or some other critical detail, these\nallow roles to be granted
108
+ partial access to modify the system.\n\nFor more detail on how the permission
109
+ strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
110
+ pattern is expanded\nand then a permission check applied to it, before the
111
+ command is authorized.\n\nThese checks only apply if security is enabled in
112
+ the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
113
+ http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
114
+ The name of the broker, as it will be referenced within Razor.\n This
115
+ is the name that you supply to, eg, `create-policy` to specify\n which
116
+ broker the node will be handed off via after installation.\n - This attribute
117
+ is required.\n - It must be of type string.\n - It must be between 1 and
118
+ 250 in length.\n\n * broker_type\n - The broker type from which this broker
119
+ is created. The available\n broker types on your server are:\n -
120
+ chef\n - noop\n - puppet-pe\n - puppet\n - This attribute is
121
+ required.\n - It must be of type string.\n - It must match the name of
122
+ an existing broker type.\n\n * configuration\n - The configuration for the
123
+ broker. The acceptable values here are\n determined by the `broker_type`
124
+ selected. In general this has\n settings like which server to contact,
125
+ and other configuration\n related to handing on the newly installed system
126
+ to the final\n configuration management system.\n \n This attribute
127
+ can be abbreviated as `c` for convenience.\n - It must be of type object.\n\n#
128
+ EXAMPLES\n\n Creating a simple Puppet broker:\n \n {\n \"name\": \"puppet\",\n \"configuration\":
129
+ {\n \"server\": \"puppet.example.org\",\n \"environment\":
130
+ \"production\"\n },\n \"broker_type\": \"puppet\"\n }\n"},"schema":{"name":{"type":"string"},"broker_type":{"type":"string","aliases":["broker-type"]},"configuration":{"type":"object","aliases":["c"]}}}'
131
+ http_version:
132
+ recorded_at: Tue, 06 Oct 2015 23:41:59 GMT
133
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,133 @@
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
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ Content-Type:
26
+ - application/json
27
+ Content-Length:
28
+ - '6470'
29
+ Date:
30
+ - Wed, 09 Dec 2015 01:27:48 GMT
31
+ body:
32
+ encoding: US-ASCII
33
+ 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-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"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8150/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8150/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8150/api/collections/policies"},{"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"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8150/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8150/api/collections/commands"},{"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"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8150/api/collections/hooks"}],"version":{"server":"v1.1.0-4-gbc32aac-dirty"}}'
34
+ http_version:
35
+ recorded_at: Wed, 09 Dec 2015 01:27:48 GMT
36
+ - request:
37
+ method: get
38
+ uri: http://localhost:8150/api/commands/create-broker
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ Accept:
44
+ - application/json
45
+ Accept-Encoding:
46
+ - gzip, deflate
47
+ User-Agent:
48
+ - Ruby
49
+ response:
50
+ status:
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ Server:
55
+ - Apache-Coyote/1.1
56
+ Etag:
57
+ - '"server-version-v1.1.0-4-gbc32aac-dirty"'
58
+ X-Content-Type-Options:
59
+ - nosniff
60
+ Content-Type:
61
+ - application/json
62
+ Content-Length:
63
+ - '5210'
64
+ Date:
65
+ - Wed, 09 Dec 2015 01:27:48 GMT
66
+ body:
67
+ encoding: US-ASCII
68
+ string: '{"name":"create-broker","help":{"summary":"Create a new broker configuration
69
+ for hand-off of installed nodes","description":"Create a new broker configuration. Brokers
70
+ are responsible for handing a node\noff to a config management system, such
71
+ as Puppet or Chef. In cases where you\nhave no configuration management system,
72
+ you can use the `noop` broker.","schema":"# Access Control\n\nThis command''s
73
+ access control pattern: `commands:create-broker:%{name}`\n\nWords surrounded
74
+ by `%{...}` are substitutions from the input data: typically\nthe name of
75
+ the object being modified, or some other critical detail, these\nallow roles
76
+ to be granted partial access to modify the system.\n\nFor more detail on how
77
+ the permission strings are structured and work, you can\nsee the [Shiro Permissions
78
+ documentation][shiro]. That pattern is expanded\nand then a permission check
79
+ applied to it, before the command is authorized.\n\nThese checks only apply
80
+ if security is enabled in the Razor configuration\nfile; on this server security
81
+ is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
82
+ Attributes\n\n * name\n - The name of the broker, as it will be referenced
83
+ within Razor.\n This is the name that you supply to, eg, `create-policy`
84
+ to specify\n which broker the node will be handed off via after installation.\n -
85
+ This attribute is required.\n - It must be of type string.\n - It must
86
+ be between 1 and 250 in length.\n\n * broker_type\n - The broker type from
87
+ which this broker is created. The available\n broker types on your server
88
+ are:\n - chef\n - noop\n - puppet-pe\n - puppet\n - This
89
+ attribute is required.\n - It must be of type string.\n - It must match
90
+ the name of an existing broker type.\n\n * configuration\n - The configuration
91
+ for the broker. The acceptable values here are\n determined by the `broker_type`
92
+ selected. In general this has\n settings like which server to contact,
93
+ and other configuration\n related to handing on the newly installed system
94
+ to the final\n configuration management system.\n \n This attribute
95
+ can be abbreviated as `c` for convenience.\n - It must be of type object.\n","examples":{"api":"Creating
96
+ a simple Puppet broker:\n\n{\n \"name\": \"puppet\",\n \"configuration\":
97
+ {\n \"server\": \"puppet.example.org\",\n \"environment\": \"production\"\n },\n \"broker_type\":
98
+ \"puppet\"\n}","cli":"Creating a simple Puppet broker:\n\nrazor create-broker
99
+ --name puppet -c server=puppet.example.org \\\n -c environment=production
100
+ --broker-type puppet"},"full":"# SYNOPSIS\nCreate a new broker configuration
101
+ for hand-off of installed nodes\n\n# DESCRIPTION\nCreate a new broker configuration. Brokers
102
+ are responsible for handing a node\noff to a config management system, such
103
+ as Puppet or Chef. In cases where you\nhave no configuration management system,
104
+ you can use the `noop` broker.\n# Access Control\n\nThis command''s access
105
+ control pattern: `commands:create-broker:%{name}`\n\nWords surrounded by `%{...}`
106
+ are substitutions from the input data: typically\nthe name of the object being
107
+ modified, or some other critical detail, these\nallow roles to be granted
108
+ partial access to modify the system.\n\nFor more detail on how the permission
109
+ strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
110
+ pattern is expanded\nand then a permission check applied to it, before the
111
+ command is authorized.\n\nThese checks only apply if security is enabled in
112
+ the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
113
+ http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
114
+ The name of the broker, as it will be referenced within Razor.\n This
115
+ is the name that you supply to, eg, `create-policy` to specify\n which
116
+ broker the node will be handed off via after installation.\n - This attribute
117
+ is required.\n - It must be of type string.\n - It must be between 1 and
118
+ 250 in length.\n\n * broker_type\n - The broker type from which this broker
119
+ is created. The available\n broker types on your server are:\n -
120
+ chef\n - noop\n - puppet-pe\n - puppet\n - This attribute is
121
+ required.\n - It must be of type string.\n - It must match the name of
122
+ an existing broker type.\n\n * configuration\n - The configuration for the
123
+ broker. The acceptable values here are\n determined by the `broker_type`
124
+ selected. In general this has\n settings like which server to contact,
125
+ and other configuration\n related to handing on the newly installed system
126
+ to the final\n configuration management system.\n \n This attribute
127
+ can be abbreviated as `c` for convenience.\n - It must be of type object.\n\n#
128
+ EXAMPLES\n\n Creating a simple Puppet broker:\n \n {\n \"name\": \"puppet\",\n \"configuration\":
129
+ {\n \"server\": \"puppet.example.org\",\n \"environment\":
130
+ \"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"]}}}'
131
+ http_version:
132
+ recorded_at: Wed, 09 Dec 2015 01:27:48 GMT
133
+ recorded_with: VCR 2.5.0