razor-client 0.15.1 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/NEWS.md +22 -0
- data/bin/razor +24 -0
- data/lib/razor/cli/command.rb +139 -0
- data/lib/razor/cli/document.rb +8 -4
- data/lib/razor/cli/format.rb +46 -22
- data/lib/razor/cli/navigate.rb +27 -149
- data/lib/razor/cli/parse.rb +21 -5
- data/lib/razor/cli/query.rb +68 -0
- data/lib/razor/cli/table_format.rb +41 -0
- data/lib/razor/cli/transforms.rb +18 -0
- data/lib/razor/cli/version.rb +1 -1
- data/lib/razor/cli/views.yaml +38 -0
- data/lib/razor/cli.rb +5 -2
- data/spec/cli/format_spec.rb +95 -5
- data/spec/cli/navigate_spec.rb +49 -5
- data/spec/cli/parse_spec.rb +21 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_in_string.yml +322 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_--api_command_--help_.yml +110 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_--api_command_help_.yml +110 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_--api_help_command_.yml +110 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_--help_--api_command_.yml +110 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_-a_-h_command_.yml +110 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_-a_command_-h_.yml +110 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_construct_a_json_object.yml +181 -49
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_construct_a_json_object_with_unicode.yml +121 -46
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_fail_with_mixed_types_array_then_hash_.yml +68 -65
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_fail_with_mixed_types_hash_then_array_.yml +177 -45
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_limit.yml +69 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_start.yml +69 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_not_fail_when_query_returns_details_for_one_item.yml +421 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_store_query_without_query_parameters.yml +773 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_throw_an_error_if_the_query_parameter_is_not_in_the_API.yml +36 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_throw_an_error_if_the_query_parameter_is_not_in_the_API_from_a_single_item.yml +388 -0
- metadata +94 -82
@@ -0,0 +1,773 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://localhost:8080/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
|
+
- '5644'
|
29
|
+
Date:
|
30
|
+
- Tue, 18 Nov 2014 07:10:19 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:8080/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8080/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8080/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8080/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8080/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8080/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8080/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8080/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8080/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8080/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8080/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8080/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8080/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8080/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8080/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8080/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:8080/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8080/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8080/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8080/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8080/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8080/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8080/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8080/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:8080/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:8080/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8080/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8080/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8080/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8080/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8080/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8080/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8080/api/collections/nodes","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8080/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8080/api/collections/commands"},{"name":"events","rel":"http://api.puppetlabs.com/razor/v1/collections/events","id":"http://localhost:8080/api/collections/events","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8080/api/collections/hooks"}],"version":{"server":"v0.15.0-67-gcc2509f"}}'
|
34
|
+
http_version:
|
35
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
36
|
+
- request:
|
37
|
+
method: get
|
38
|
+
uri: http://localhost:8080/api/commands/register-node
|
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-v0.15.0-67-gcc2509f"'
|
58
|
+
X-Content-Type-Options:
|
59
|
+
- nosniff
|
60
|
+
Content-Type:
|
61
|
+
- application/json;charset=utf-8
|
62
|
+
Content-Length:
|
63
|
+
- '6185'
|
64
|
+
Date:
|
65
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
66
|
+
body:
|
67
|
+
encoding: US-ASCII
|
68
|
+
string: '{"name":"register-node","help":{"summary":"Register a node with Razor
|
69
|
+
before it is discovered","description":"In order to make brownfield deployments
|
70
|
+
of Razor easier we allow users to\nregister nodes explicitly. This command
|
71
|
+
allows you to perform the same\nregistration that would happen when a new
|
72
|
+
node checked in, ahead of time.\n\nIn order for this to be effective the hw_info
|
73
|
+
must contain enough information\nthat the node can successfully be matched
|
74
|
+
during the iPXE boot phase.\n\nIf the node matches an existing node, in keeping
|
75
|
+
with the overall policy of\ncommands declaring desired state, the node installed
|
76
|
+
field will be updated to\nmatch the value in this command.\n\nThe final state
|
77
|
+
is that a node with the supplied hardware information, and the\ndesired installed
|
78
|
+
state, will be present in the database, regardless of it\nexisting before
|
79
|
+
hand or not.","schema":"# Access Control\n\nThis command''s access control
|
80
|
+
pattern: `commands:register-node`\n\nFor more detail on how the permission
|
81
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
82
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
83
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
84
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
85
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * installed\n -
|
86
|
+
Should the node be considered ''installed'' already? Installed nodes are\n not
|
87
|
+
eligible for policy matching, and will simply boot locally.\n - This attribute
|
88
|
+
is required.\n - It must be of type boolean.\n\n * hw-info\n - The hardware
|
89
|
+
information for the node. This is used to match the node on first\n boot
|
90
|
+
with the record in the database. The order of MAC address assignment in\n this
|
91
|
+
data is not significant, as a node with reordered MAC addresses will be\n treated
|
92
|
+
as the same node.\n - This attribute is required.\n - It must be of type
|
93
|
+
object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
|
94
|
+
serial\n - The DMI serial number of the node\n - It must be of type
|
95
|
+
string.\n \n * asset\n - The DMI asset tag of the node\n -
|
96
|
+
It must be of type string.\n \n * uuid\n - The DMI UUID of the node\n -
|
97
|
+
It must be of type string.\n","examples":{"api":"Register a machine before
|
98
|
+
you boot it, and note that it already has an OS\ninstalled, so should not
|
99
|
+
be subject to policy-based reinstallation:\n\n {\n \"hw-info\": {\n \"net0\": \"78:31:c1:be:c8:00\",\n \"net1\": \"72:00:01:f2:13:f0\",\n \"net2\": \"72:00:01:f2:13:f1\",\n \"serial\":
|
100
|
+
\"xxxxxxxxxxx\",\n \"asset\": \"Asset-1234567890\",\n \"uuid\": \"Not
|
101
|
+
Settable\"\n },\n \"installed\": true\n }","cli":"Register a
|
102
|
+
machine before you boot it, and note that it already has an OS\ninstalled,
|
103
|
+
so should not be subject to policy-based reinstallation:\n\n razor register-node
|
104
|
+
--hw-info net0=78:31:c1:be:c8:00 \\\n --hw-info net1=72:00:01:f2:13:f0
|
105
|
+
\\\n --hw-info net2=72:00:01:f2:13:f1 \\\n --hw-info serial=xxxxxxxxxxx
|
106
|
+
\\\n --hw-info asset=Asset-1234567890 \\\n --hw-info uuid=\"Not
|
107
|
+
Settable\" \\\n --installed"},"full":"# SYNOPSIS\nRegister a node with
|
108
|
+
Razor before it is discovered\n\n# DESCRIPTION\nIn order to make brownfield
|
109
|
+
deployments of Razor easier we allow users to\nregister nodes explicitly. This
|
110
|
+
command allows you to perform the same\nregistration that would happen when
|
111
|
+
a new node checked in, ahead of time.\n\nIn order for this to be effective
|
112
|
+
the hw_info must contain enough information\nthat the node can successfully
|
113
|
+
be matched during the iPXE boot phase.\n\nIf the node matches an existing
|
114
|
+
node, in keeping with the overall policy of\ncommands declaring desired state,
|
115
|
+
the node installed field will be updated to\nmatch the value in this command.\n\nThe
|
116
|
+
final state is that a node with the supplied hardware information, and the\ndesired
|
117
|
+
installed state, will be present in the database, regardless of it\nexisting
|
118
|
+
before hand or not.\n# Access Control\n\nThis command''s access control pattern:
|
119
|
+
`commands:register-node`\n\nFor more detail on how the permission strings
|
120
|
+
are 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 * installed\n -
|
125
|
+
Should the node be considered ''installed'' already? Installed nodes are\n not
|
126
|
+
eligible for policy matching, and will simply boot locally.\n - This attribute
|
127
|
+
is required.\n - It must be of type boolean.\n\n * hw-info\n - The hardware
|
128
|
+
information for the node. This is used to match the node on first\n boot
|
129
|
+
with the record in the database. The order of MAC address assignment in\n this
|
130
|
+
data is not significant, as a node with reordered MAC addresses will be\n treated
|
131
|
+
as the same node.\n - This attribute is required.\n - It must be of type
|
132
|
+
object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
|
133
|
+
serial\n - The DMI serial number of the node\n - It must be of type
|
134
|
+
string.\n \n * asset\n - The DMI asset tag of the node\n -
|
135
|
+
It must be of type string.\n \n * uuid\n - The DMI UUID of the node\n -
|
136
|
+
It must be of type string.\n\n# EXAMPLES\n\n Register a machine before you
|
137
|
+
boot it, and note that it already has an OS\n installed, so should not be
|
138
|
+
subject to policy-based reinstallation:\n \n {\n \"hw-info\":
|
139
|
+
{\n \"net0\": \"78:31:c1:be:c8:00\",\n \"net1\": \"72:00:01:f2:13:f0\",\n \"net2\": \"72:00:01:f2:13:f1\",\n \"serial\":
|
140
|
+
\"xxxxxxxxxxx\",\n \"asset\": \"Asset-1234567890\",\n \"uuid\": \"Not
|
141
|
+
Settable\"\n },\n \"installed\": true\n }\n"},"schema":{"installed":{"type":"boolean"},"hw-info":{"type":"object"}}}'
|
142
|
+
http_version:
|
143
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
144
|
+
- request:
|
145
|
+
method: get
|
146
|
+
uri: http://localhost:8080/api/commands/register-node
|
147
|
+
body:
|
148
|
+
encoding: US-ASCII
|
149
|
+
string: ''
|
150
|
+
headers:
|
151
|
+
Accept:
|
152
|
+
- application/json
|
153
|
+
Accept-Encoding:
|
154
|
+
- gzip, deflate
|
155
|
+
User-Agent:
|
156
|
+
- Ruby
|
157
|
+
response:
|
158
|
+
status:
|
159
|
+
code: 200
|
160
|
+
message: OK
|
161
|
+
headers:
|
162
|
+
Server:
|
163
|
+
- Apache-Coyote/1.1
|
164
|
+
Etag:
|
165
|
+
- '"server-version-v0.15.0-67-gcc2509f"'
|
166
|
+
X-Content-Type-Options:
|
167
|
+
- nosniff
|
168
|
+
Content-Type:
|
169
|
+
- application/json;charset=utf-8
|
170
|
+
Content-Length:
|
171
|
+
- '6185'
|
172
|
+
Date:
|
173
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
174
|
+
body:
|
175
|
+
encoding: US-ASCII
|
176
|
+
string: '{"name":"register-node","help":{"summary":"Register a node with Razor
|
177
|
+
before it is discovered","description":"In order to make brownfield deployments
|
178
|
+
of Razor easier we allow users to\nregister nodes explicitly. This command
|
179
|
+
allows you to perform the same\nregistration that would happen when a new
|
180
|
+
node checked in, ahead of time.\n\nIn order for this to be effective the hw_info
|
181
|
+
must contain enough information\nthat the node can successfully be matched
|
182
|
+
during the iPXE boot phase.\n\nIf the node matches an existing node, in keeping
|
183
|
+
with the overall policy of\ncommands declaring desired state, the node installed
|
184
|
+
field will be updated to\nmatch the value in this command.\n\nThe final state
|
185
|
+
is that a node with the supplied hardware information, and the\ndesired installed
|
186
|
+
state, will be present in the database, regardless of it\nexisting before
|
187
|
+
hand or not.","schema":"# Access Control\n\nThis command''s access control
|
188
|
+
pattern: `commands:register-node`\n\nFor more detail on how the permission
|
189
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
190
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
191
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
192
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
193
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * installed\n -
|
194
|
+
Should the node be considered ''installed'' already? Installed nodes are\n not
|
195
|
+
eligible for policy matching, and will simply boot locally.\n - This attribute
|
196
|
+
is required.\n - It must be of type boolean.\n\n * hw-info\n - The hardware
|
197
|
+
information for the node. This is used to match the node on first\n boot
|
198
|
+
with the record in the database. The order of MAC address assignment in\n this
|
199
|
+
data is not significant, as a node with reordered MAC addresses will be\n treated
|
200
|
+
as the same node.\n - This attribute is required.\n - It must be of type
|
201
|
+
object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
|
202
|
+
serial\n - The DMI serial number of the node\n - It must be of type
|
203
|
+
string.\n \n * asset\n - The DMI asset tag of the node\n -
|
204
|
+
It must be of type string.\n \n * uuid\n - The DMI UUID of the node\n -
|
205
|
+
It must be of type string.\n","examples":{"api":"Register a machine before
|
206
|
+
you boot it, and note that it already has an OS\ninstalled, so should not
|
207
|
+
be subject to policy-based reinstallation:\n\n {\n \"hw-info\": {\n \"net0\": \"78:31:c1:be:c8:00\",\n \"net1\": \"72:00:01:f2:13:f0\",\n \"net2\": \"72:00:01:f2:13:f1\",\n \"serial\":
|
208
|
+
\"xxxxxxxxxxx\",\n \"asset\": \"Asset-1234567890\",\n \"uuid\": \"Not
|
209
|
+
Settable\"\n },\n \"installed\": true\n }","cli":"Register a
|
210
|
+
machine before you boot it, and note that it already has an OS\ninstalled,
|
211
|
+
so should not be subject to policy-based reinstallation:\n\n razor register-node
|
212
|
+
--hw-info net0=78:31:c1:be:c8:00 \\\n --hw-info net1=72:00:01:f2:13:f0
|
213
|
+
\\\n --hw-info net2=72:00:01:f2:13:f1 \\\n --hw-info serial=xxxxxxxxxxx
|
214
|
+
\\\n --hw-info asset=Asset-1234567890 \\\n --hw-info uuid=\"Not
|
215
|
+
Settable\" \\\n --installed"},"full":"# SYNOPSIS\nRegister a node with
|
216
|
+
Razor before it is discovered\n\n# DESCRIPTION\nIn order to make brownfield
|
217
|
+
deployments of Razor easier we allow users to\nregister nodes explicitly. This
|
218
|
+
command allows you to perform the same\nregistration that would happen when
|
219
|
+
a new node checked in, ahead of time.\n\nIn order for this to be effective
|
220
|
+
the hw_info must contain enough information\nthat the node can successfully
|
221
|
+
be matched during the iPXE boot phase.\n\nIf the node matches an existing
|
222
|
+
node, in keeping with the overall policy of\ncommands declaring desired state,
|
223
|
+
the node installed field will be updated to\nmatch the value in this command.\n\nThe
|
224
|
+
final state is that a node with the supplied hardware information, and the\ndesired
|
225
|
+
installed state, will be present in the database, regardless of it\nexisting
|
226
|
+
before hand or not.\n# Access Control\n\nThis command''s access control pattern:
|
227
|
+
`commands:register-node`\n\nFor more detail on how the permission strings
|
228
|
+
are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
229
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
230
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
231
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
232
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * installed\n -
|
233
|
+
Should the node be considered ''installed'' already? Installed nodes are\n not
|
234
|
+
eligible for policy matching, and will simply boot locally.\n - This attribute
|
235
|
+
is required.\n - It must be of type boolean.\n\n * hw-info\n - The hardware
|
236
|
+
information for the node. This is used to match the node on first\n boot
|
237
|
+
with the record in the database. The order of MAC address assignment in\n this
|
238
|
+
data is not significant, as a node with reordered MAC addresses will be\n treated
|
239
|
+
as the same node.\n - This attribute is required.\n - It must be of type
|
240
|
+
object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
|
241
|
+
serial\n - The DMI serial number of the node\n - It must be of type
|
242
|
+
string.\n \n * asset\n - The DMI asset tag of the node\n -
|
243
|
+
It must be of type string.\n \n * uuid\n - The DMI UUID of the node\n -
|
244
|
+
It must be of type string.\n\n# EXAMPLES\n\n Register a machine before you
|
245
|
+
boot it, and note that it already has an OS\n installed, so should not be
|
246
|
+
subject to policy-based reinstallation:\n \n {\n \"hw-info\":
|
247
|
+
{\n \"net0\": \"78:31:c1:be:c8:00\",\n \"net1\": \"72:00:01:f2:13:f0\",\n \"net2\": \"72:00:01:f2:13:f1\",\n \"serial\":
|
248
|
+
\"xxxxxxxxxxx\",\n \"asset\": \"Asset-1234567890\",\n \"uuid\": \"Not
|
249
|
+
Settable\"\n },\n \"installed\": true\n }\n"},"schema":{"installed":{"type":"boolean"},"hw-info":{"type":"object"}}}'
|
250
|
+
http_version:
|
251
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
252
|
+
- request:
|
253
|
+
method: post
|
254
|
+
uri: http://localhost:8080/api/commands/register-node
|
255
|
+
body:
|
256
|
+
encoding: UTF-8
|
257
|
+
string: '{"installed":true,"hw-info":{"net0":"78:31:c1:be:c8:00"}}'
|
258
|
+
headers:
|
259
|
+
Accept:
|
260
|
+
- application/json
|
261
|
+
Accept-Encoding:
|
262
|
+
- gzip, deflate
|
263
|
+
Content-Type:
|
264
|
+
- application/json
|
265
|
+
Content-Length:
|
266
|
+
- '57'
|
267
|
+
User-Agent:
|
268
|
+
- Ruby
|
269
|
+
response:
|
270
|
+
status:
|
271
|
+
code: 202
|
272
|
+
message: Accepted
|
273
|
+
headers:
|
274
|
+
Server:
|
275
|
+
- Apache-Coyote/1.1
|
276
|
+
X-Content-Type-Options:
|
277
|
+
- nosniff
|
278
|
+
Content-Type:
|
279
|
+
- application/json;charset=utf-8
|
280
|
+
Content-Length:
|
281
|
+
- '214'
|
282
|
+
Date:
|
283
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
284
|
+
body:
|
285
|
+
encoding: US-ASCII
|
286
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8080/api/collections/nodes/node15939","name":"node15939","command":"http://localhost:8080/api/collections/commands/5929"}'
|
287
|
+
http_version:
|
288
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
289
|
+
- request:
|
290
|
+
method: get
|
291
|
+
uri: http://localhost:8080/api/collections/nodes/node15939
|
292
|
+
body:
|
293
|
+
encoding: US-ASCII
|
294
|
+
string: ''
|
295
|
+
headers:
|
296
|
+
Accept:
|
297
|
+
- application/json
|
298
|
+
Accept-Encoding:
|
299
|
+
- gzip, deflate
|
300
|
+
User-Agent:
|
301
|
+
- Ruby
|
302
|
+
response:
|
303
|
+
status:
|
304
|
+
code: 200
|
305
|
+
message: OK
|
306
|
+
headers:
|
307
|
+
Server:
|
308
|
+
- Apache-Coyote/1.1
|
309
|
+
X-Content-Type-Options:
|
310
|
+
- nosniff
|
311
|
+
Content-Type:
|
312
|
+
- application/json;charset=utf-8
|
313
|
+
Content-Length:
|
314
|
+
- '421'
|
315
|
+
Date:
|
316
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
317
|
+
body:
|
318
|
+
encoding: US-ASCII
|
319
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8080/api/collections/nodes/node15939","name":"node15939","hw_info":{"mac":["78:31:c1:be:c8:00"]},"log":{"id":"http://localhost:8080/api/collections/nodes/node15939/log","name":"log","params":{"limit":{"type":"number"},"start":{"type":"number"}}},"tags":[],"state":{"installed":"true","installed_at":"2014-11-18T01:10:20-06:00"}}'
|
320
|
+
http_version:
|
321
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
322
|
+
- request:
|
323
|
+
method: get
|
324
|
+
uri: http://localhost:8080/api
|
325
|
+
body:
|
326
|
+
encoding: US-ASCII
|
327
|
+
string: ''
|
328
|
+
headers:
|
329
|
+
Accept:
|
330
|
+
- application/json
|
331
|
+
Accept-Encoding:
|
332
|
+
- gzip, deflate
|
333
|
+
User-Agent:
|
334
|
+
- Ruby
|
335
|
+
response:
|
336
|
+
status:
|
337
|
+
code: 200
|
338
|
+
message: OK
|
339
|
+
headers:
|
340
|
+
Server:
|
341
|
+
- Apache-Coyote/1.1
|
342
|
+
X-Content-Type-Options:
|
343
|
+
- nosniff
|
344
|
+
Content-Type:
|
345
|
+
- application/json;charset=utf-8
|
346
|
+
Content-Length:
|
347
|
+
- '5644'
|
348
|
+
Date:
|
349
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
350
|
+
body:
|
351
|
+
encoding: US-ASCII
|
352
|
+
string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8080/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8080/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8080/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8080/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8080/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8080/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8080/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8080/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8080/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8080/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8080/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8080/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8080/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8080/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8080/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8080/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:8080/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8080/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8080/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8080/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8080/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8080/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8080/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8080/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:8080/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:8080/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8080/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8080/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8080/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8080/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8080/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8080/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8080/api/collections/nodes","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8080/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8080/api/collections/commands"},{"name":"events","rel":"http://api.puppetlabs.com/razor/v1/collections/events","id":"http://localhost:8080/api/collections/events","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8080/api/collections/hooks"}],"version":{"server":"v0.15.0-67-gcc2509f"}}'
|
353
|
+
http_version:
|
354
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
355
|
+
- request:
|
356
|
+
method: get
|
357
|
+
uri: http://localhost:8080/api/commands/register-node
|
358
|
+
body:
|
359
|
+
encoding: US-ASCII
|
360
|
+
string: ''
|
361
|
+
headers:
|
362
|
+
Accept:
|
363
|
+
- application/json
|
364
|
+
Accept-Encoding:
|
365
|
+
- gzip, deflate
|
366
|
+
User-Agent:
|
367
|
+
- Ruby
|
368
|
+
response:
|
369
|
+
status:
|
370
|
+
code: 200
|
371
|
+
message: OK
|
372
|
+
headers:
|
373
|
+
Server:
|
374
|
+
- Apache-Coyote/1.1
|
375
|
+
Etag:
|
376
|
+
- '"server-version-v0.15.0-67-gcc2509f"'
|
377
|
+
X-Content-Type-Options:
|
378
|
+
- nosniff
|
379
|
+
Content-Type:
|
380
|
+
- application/json;charset=utf-8
|
381
|
+
Content-Length:
|
382
|
+
- '6185'
|
383
|
+
Date:
|
384
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
385
|
+
body:
|
386
|
+
encoding: US-ASCII
|
387
|
+
string: '{"name":"register-node","help":{"summary":"Register a node with Razor
|
388
|
+
before it is discovered","description":"In order to make brownfield deployments
|
389
|
+
of Razor easier we allow users to\nregister nodes explicitly. This command
|
390
|
+
allows you to perform the same\nregistration that would happen when a new
|
391
|
+
node checked in, ahead of time.\n\nIn order for this to be effective the hw_info
|
392
|
+
must contain enough information\nthat the node can successfully be matched
|
393
|
+
during the iPXE boot phase.\n\nIf the node matches an existing node, in keeping
|
394
|
+
with the overall policy of\ncommands declaring desired state, the node installed
|
395
|
+
field will be updated to\nmatch the value in this command.\n\nThe final state
|
396
|
+
is that a node with the supplied hardware information, and the\ndesired installed
|
397
|
+
state, will be present in the database, regardless of it\nexisting before
|
398
|
+
hand or not.","schema":"# Access Control\n\nThis command''s access control
|
399
|
+
pattern: `commands:register-node`\n\nFor more detail on how the permission
|
400
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
401
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
402
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
403
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
404
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * installed\n -
|
405
|
+
Should the node be considered ''installed'' already? Installed nodes are\n not
|
406
|
+
eligible for policy matching, and will simply boot locally.\n - This attribute
|
407
|
+
is required.\n - It must be of type boolean.\n\n * hw-info\n - The hardware
|
408
|
+
information for the node. This is used to match the node on first\n boot
|
409
|
+
with the record in the database. The order of MAC address assignment in\n this
|
410
|
+
data is not significant, as a node with reordered MAC addresses will be\n treated
|
411
|
+
as the same node.\n - This attribute is required.\n - It must be of type
|
412
|
+
object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
|
413
|
+
serial\n - The DMI serial number of the node\n - It must be of type
|
414
|
+
string.\n \n * asset\n - The DMI asset tag of the node\n -
|
415
|
+
It must be of type string.\n \n * uuid\n - The DMI UUID of the node\n -
|
416
|
+
It must be of type string.\n","examples":{"api":"Register a machine before
|
417
|
+
you boot it, and note that it already has an OS\ninstalled, so should not
|
418
|
+
be subject to policy-based reinstallation:\n\n {\n \"hw-info\": {\n \"net0\": \"78:31:c1:be:c8:00\",\n \"net1\": \"72:00:01:f2:13:f0\",\n \"net2\": \"72:00:01:f2:13:f1\",\n \"serial\":
|
419
|
+
\"xxxxxxxxxxx\",\n \"asset\": \"Asset-1234567890\",\n \"uuid\": \"Not
|
420
|
+
Settable\"\n },\n \"installed\": true\n }","cli":"Register a
|
421
|
+
machine before you boot it, and note that it already has an OS\ninstalled,
|
422
|
+
so should not be subject to policy-based reinstallation:\n\n razor register-node
|
423
|
+
--hw-info net0=78:31:c1:be:c8:00 \\\n --hw-info net1=72:00:01:f2:13:f0
|
424
|
+
\\\n --hw-info net2=72:00:01:f2:13:f1 \\\n --hw-info serial=xxxxxxxxxxx
|
425
|
+
\\\n --hw-info asset=Asset-1234567890 \\\n --hw-info uuid=\"Not
|
426
|
+
Settable\" \\\n --installed"},"full":"# SYNOPSIS\nRegister a node with
|
427
|
+
Razor before it is discovered\n\n# DESCRIPTION\nIn order to make brownfield
|
428
|
+
deployments of Razor easier we allow users to\nregister nodes explicitly. This
|
429
|
+
command allows you to perform the same\nregistration that would happen when
|
430
|
+
a new node checked in, ahead of time.\n\nIn order for this to be effective
|
431
|
+
the hw_info must contain enough information\nthat the node can successfully
|
432
|
+
be matched during the iPXE boot phase.\n\nIf the node matches an existing
|
433
|
+
node, in keeping with the overall policy of\ncommands declaring desired state,
|
434
|
+
the node installed field will be updated to\nmatch the value in this command.\n\nThe
|
435
|
+
final state is that a node with the supplied hardware information, and the\ndesired
|
436
|
+
installed state, will be present in the database, regardless of it\nexisting
|
437
|
+
before hand or not.\n# Access Control\n\nThis command''s access control pattern:
|
438
|
+
`commands:register-node`\n\nFor more detail on how the permission strings
|
439
|
+
are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
440
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
441
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
442
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
443
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * installed\n -
|
444
|
+
Should the node be considered ''installed'' already? Installed nodes are\n not
|
445
|
+
eligible for policy matching, and will simply boot locally.\n - This attribute
|
446
|
+
is required.\n - It must be of type boolean.\n\n * hw-info\n - The hardware
|
447
|
+
information for the node. This is used to match the node on first\n boot
|
448
|
+
with the record in the database. The order of MAC address assignment in\n this
|
449
|
+
data is not significant, as a node with reordered MAC addresses will be\n treated
|
450
|
+
as the same node.\n - This attribute is required.\n - It must be of type
|
451
|
+
object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
|
452
|
+
serial\n - The DMI serial number of the node\n - It must be of type
|
453
|
+
string.\n \n * asset\n - The DMI asset tag of the node\n -
|
454
|
+
It must be of type string.\n \n * uuid\n - The DMI UUID of the node\n -
|
455
|
+
It must be of type string.\n\n# EXAMPLES\n\n Register a machine before you
|
456
|
+
boot it, and note that it already has an OS\n installed, so should not be
|
457
|
+
subject to policy-based reinstallation:\n \n {\n \"hw-info\":
|
458
|
+
{\n \"net0\": \"78:31:c1:be:c8:00\",\n \"net1\": \"72:00:01:f2:13:f0\",\n \"net2\": \"72:00:01:f2:13:f1\",\n \"serial\":
|
459
|
+
\"xxxxxxxxxxx\",\n \"asset\": \"Asset-1234567890\",\n \"uuid\": \"Not
|
460
|
+
Settable\"\n },\n \"installed\": true\n }\n"},"schema":{"installed":{"type":"boolean"},"hw-info":{"type":"object"}}}'
|
461
|
+
http_version:
|
462
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
463
|
+
- request:
|
464
|
+
method: get
|
465
|
+
uri: http://localhost:8080/api/commands/register-node
|
466
|
+
body:
|
467
|
+
encoding: US-ASCII
|
468
|
+
string: ''
|
469
|
+
headers:
|
470
|
+
Accept:
|
471
|
+
- application/json
|
472
|
+
Accept-Encoding:
|
473
|
+
- gzip, deflate
|
474
|
+
User-Agent:
|
475
|
+
- Ruby
|
476
|
+
response:
|
477
|
+
status:
|
478
|
+
code: 200
|
479
|
+
message: OK
|
480
|
+
headers:
|
481
|
+
Server:
|
482
|
+
- Apache-Coyote/1.1
|
483
|
+
Etag:
|
484
|
+
- '"server-version-v0.15.0-67-gcc2509f"'
|
485
|
+
X-Content-Type-Options:
|
486
|
+
- nosniff
|
487
|
+
Content-Type:
|
488
|
+
- application/json;charset=utf-8
|
489
|
+
Content-Length:
|
490
|
+
- '6185'
|
491
|
+
Date:
|
492
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
493
|
+
body:
|
494
|
+
encoding: US-ASCII
|
495
|
+
string: '{"name":"register-node","help":{"summary":"Register a node with Razor
|
496
|
+
before it is discovered","description":"In order to make brownfield deployments
|
497
|
+
of Razor easier we allow users to\nregister nodes explicitly. This command
|
498
|
+
allows you to perform the same\nregistration that would happen when a new
|
499
|
+
node checked in, ahead of time.\n\nIn order for this to be effective the hw_info
|
500
|
+
must contain enough information\nthat the node can successfully be matched
|
501
|
+
during the iPXE boot phase.\n\nIf the node matches an existing node, in keeping
|
502
|
+
with the overall policy of\ncommands declaring desired state, the node installed
|
503
|
+
field will be updated to\nmatch the value in this command.\n\nThe final state
|
504
|
+
is that a node with the supplied hardware information, and the\ndesired installed
|
505
|
+
state, will be present in the database, regardless of it\nexisting before
|
506
|
+
hand or not.","schema":"# Access Control\n\nThis command''s access control
|
507
|
+
pattern: `commands:register-node`\n\nFor more detail on how the permission
|
508
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
509
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
510
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
511
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
512
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * installed\n -
|
513
|
+
Should the node be considered ''installed'' already? Installed nodes are\n not
|
514
|
+
eligible for policy matching, and will simply boot locally.\n - This attribute
|
515
|
+
is required.\n - It must be of type boolean.\n\n * hw-info\n - The hardware
|
516
|
+
information for the node. This is used to match the node on first\n boot
|
517
|
+
with the record in the database. The order of MAC address assignment in\n this
|
518
|
+
data is not significant, as a node with reordered MAC addresses will be\n treated
|
519
|
+
as the same node.\n - This attribute is required.\n - It must be of type
|
520
|
+
object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
|
521
|
+
serial\n - The DMI serial number of the node\n - It must be of type
|
522
|
+
string.\n \n * asset\n - The DMI asset tag of the node\n -
|
523
|
+
It must be of type string.\n \n * uuid\n - The DMI UUID of the node\n -
|
524
|
+
It must be of type string.\n","examples":{"api":"Register a machine before
|
525
|
+
you boot it, and note that it already has an OS\ninstalled, so should not
|
526
|
+
be subject to policy-based reinstallation:\n\n {\n \"hw-info\": {\n \"net0\": \"78:31:c1:be:c8:00\",\n \"net1\": \"72:00:01:f2:13:f0\",\n \"net2\": \"72:00:01:f2:13:f1\",\n \"serial\":
|
527
|
+
\"xxxxxxxxxxx\",\n \"asset\": \"Asset-1234567890\",\n \"uuid\": \"Not
|
528
|
+
Settable\"\n },\n \"installed\": true\n }","cli":"Register a
|
529
|
+
machine before you boot it, and note that it already has an OS\ninstalled,
|
530
|
+
so should not be subject to policy-based reinstallation:\n\n razor register-node
|
531
|
+
--hw-info net0=78:31:c1:be:c8:00 \\\n --hw-info net1=72:00:01:f2:13:f0
|
532
|
+
\\\n --hw-info net2=72:00:01:f2:13:f1 \\\n --hw-info serial=xxxxxxxxxxx
|
533
|
+
\\\n --hw-info asset=Asset-1234567890 \\\n --hw-info uuid=\"Not
|
534
|
+
Settable\" \\\n --installed"},"full":"# SYNOPSIS\nRegister a node with
|
535
|
+
Razor before it is discovered\n\n# DESCRIPTION\nIn order to make brownfield
|
536
|
+
deployments of Razor easier we allow users to\nregister nodes explicitly. This
|
537
|
+
command allows you to perform the same\nregistration that would happen when
|
538
|
+
a new node checked in, ahead of time.\n\nIn order for this to be effective
|
539
|
+
the hw_info must contain enough information\nthat the node can successfully
|
540
|
+
be matched during the iPXE boot phase.\n\nIf the node matches an existing
|
541
|
+
node, in keeping with the overall policy of\ncommands declaring desired state,
|
542
|
+
the node installed field will be updated to\nmatch the value in this command.\n\nThe
|
543
|
+
final state is that a node with the supplied hardware information, and the\ndesired
|
544
|
+
installed state, will be present in the database, regardless of it\nexisting
|
545
|
+
before hand or not.\n# Access Control\n\nThis command''s access control pattern:
|
546
|
+
`commands:register-node`\n\nFor more detail on how the permission strings
|
547
|
+
are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
548
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
549
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
550
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
551
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * installed\n -
|
552
|
+
Should the node be considered ''installed'' already? Installed nodes are\n not
|
553
|
+
eligible for policy matching, and will simply boot locally.\n - This attribute
|
554
|
+
is required.\n - It must be of type boolean.\n\n * hw-info\n - The hardware
|
555
|
+
information for the node. This is used to match the node on first\n boot
|
556
|
+
with the record in the database. The order of MAC address assignment in\n this
|
557
|
+
data is not significant, as a node with reordered MAC addresses will be\n treated
|
558
|
+
as the same node.\n - This attribute is required.\n - It must be of type
|
559
|
+
object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
|
560
|
+
serial\n - The DMI serial number of the node\n - It must be of type
|
561
|
+
string.\n \n * asset\n - The DMI asset tag of the node\n -
|
562
|
+
It must be of type string.\n \n * uuid\n - The DMI UUID of the node\n -
|
563
|
+
It must be of type string.\n\n# EXAMPLES\n\n Register a machine before you
|
564
|
+
boot it, and note that it already has an OS\n installed, so should not be
|
565
|
+
subject to policy-based reinstallation:\n \n {\n \"hw-info\":
|
566
|
+
{\n \"net0\": \"78:31:c1:be:c8:00\",\n \"net1\": \"72:00:01:f2:13:f0\",\n \"net2\": \"72:00:01:f2:13:f1\",\n \"serial\":
|
567
|
+
\"xxxxxxxxxxx\",\n \"asset\": \"Asset-1234567890\",\n \"uuid\": \"Not
|
568
|
+
Settable\"\n },\n \"installed\": true\n }\n"},"schema":{"installed":{"type":"boolean"},"hw-info":{"type":"object"}}}'
|
569
|
+
http_version:
|
570
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
571
|
+
- request:
|
572
|
+
method: post
|
573
|
+
uri: http://localhost:8080/api/commands/register-node
|
574
|
+
body:
|
575
|
+
encoding: UTF-8
|
576
|
+
string: '{"installed":true,"hw-info":{"net0":"78:31:c1:be:c8:01"}}'
|
577
|
+
headers:
|
578
|
+
Accept:
|
579
|
+
- application/json
|
580
|
+
Accept-Encoding:
|
581
|
+
- gzip, deflate
|
582
|
+
Content-Type:
|
583
|
+
- application/json
|
584
|
+
Content-Length:
|
585
|
+
- '57'
|
586
|
+
User-Agent:
|
587
|
+
- Ruby
|
588
|
+
response:
|
589
|
+
status:
|
590
|
+
code: 202
|
591
|
+
message: Accepted
|
592
|
+
headers:
|
593
|
+
Server:
|
594
|
+
- Apache-Coyote/1.1
|
595
|
+
X-Content-Type-Options:
|
596
|
+
- nosniff
|
597
|
+
Content-Type:
|
598
|
+
- application/json;charset=utf-8
|
599
|
+
Content-Length:
|
600
|
+
- '214'
|
601
|
+
Date:
|
602
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
603
|
+
body:
|
604
|
+
encoding: US-ASCII
|
605
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8080/api/collections/nodes/node15940","name":"node15940","command":"http://localhost:8080/api/collections/commands/5930"}'
|
606
|
+
http_version:
|
607
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
608
|
+
- request:
|
609
|
+
method: get
|
610
|
+
uri: http://localhost:8080/api/collections/nodes/node15940
|
611
|
+
body:
|
612
|
+
encoding: US-ASCII
|
613
|
+
string: ''
|
614
|
+
headers:
|
615
|
+
Accept:
|
616
|
+
- application/json
|
617
|
+
Accept-Encoding:
|
618
|
+
- gzip, deflate
|
619
|
+
User-Agent:
|
620
|
+
- Ruby
|
621
|
+
response:
|
622
|
+
status:
|
623
|
+
code: 200
|
624
|
+
message: OK
|
625
|
+
headers:
|
626
|
+
Server:
|
627
|
+
- Apache-Coyote/1.1
|
628
|
+
X-Content-Type-Options:
|
629
|
+
- nosniff
|
630
|
+
Content-Type:
|
631
|
+
- application/json;charset=utf-8
|
632
|
+
Content-Length:
|
633
|
+
- '421'
|
634
|
+
Date:
|
635
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
636
|
+
body:
|
637
|
+
encoding: US-ASCII
|
638
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8080/api/collections/nodes/node15940","name":"node15940","hw_info":{"mac":["78:31:c1:be:c8:01"]},"log":{"id":"http://localhost:8080/api/collections/nodes/node15940/log","name":"log","params":{"limit":{"type":"number"},"start":{"type":"number"}}},"tags":[],"state":{"installed":"true","installed_at":"2014-11-18T01:10:20-06:00"}}'
|
639
|
+
http_version:
|
640
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
641
|
+
- request:
|
642
|
+
method: get
|
643
|
+
uri: http://fred:dead@localhost:8080/api
|
644
|
+
body:
|
645
|
+
encoding: US-ASCII
|
646
|
+
string: ''
|
647
|
+
headers:
|
648
|
+
Accept:
|
649
|
+
- application/json
|
650
|
+
Accept-Encoding:
|
651
|
+
- gzip, deflate
|
652
|
+
User-Agent:
|
653
|
+
- Ruby
|
654
|
+
response:
|
655
|
+
status:
|
656
|
+
code: 200
|
657
|
+
message: OK
|
658
|
+
headers:
|
659
|
+
Server:
|
660
|
+
- Apache-Coyote/1.1
|
661
|
+
X-Content-Type-Options:
|
662
|
+
- nosniff
|
663
|
+
Content-Type:
|
664
|
+
- application/json;charset=utf-8
|
665
|
+
Content-Length:
|
666
|
+
- '5644'
|
667
|
+
Date:
|
668
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
669
|
+
body:
|
670
|
+
encoding: US-ASCII
|
671
|
+
string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8080/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8080/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8080/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8080/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8080/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8080/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8080/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8080/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8080/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8080/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8080/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8080/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8080/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8080/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8080/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8080/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:8080/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8080/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8080/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8080/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8080/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8080/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8080/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8080/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:8080/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:8080/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8080/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8080/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8080/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8080/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8080/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8080/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8080/api/collections/nodes","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8080/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8080/api/collections/commands"},{"name":"events","rel":"http://api.puppetlabs.com/razor/v1/collections/events","id":"http://localhost:8080/api/collections/events","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8080/api/collections/hooks"}],"version":{"server":"v0.15.0-67-gcc2509f"}}'
|
672
|
+
http_version:
|
673
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
674
|
+
- request:
|
675
|
+
method: get
|
676
|
+
uri: http://fred:dead@localhost:8080/api/collections/nodes
|
677
|
+
body:
|
678
|
+
encoding: US-ASCII
|
679
|
+
string: ''
|
680
|
+
headers:
|
681
|
+
Accept:
|
682
|
+
- application/json
|
683
|
+
Accept-Encoding:
|
684
|
+
- gzip, deflate
|
685
|
+
User-Agent:
|
686
|
+
- Ruby
|
687
|
+
response:
|
688
|
+
status:
|
689
|
+
code: 200
|
690
|
+
message: OK
|
691
|
+
headers:
|
692
|
+
Server:
|
693
|
+
- Apache-Coyote/1.1
|
694
|
+
X-Content-Type-Options:
|
695
|
+
- nosniff
|
696
|
+
Content-Type:
|
697
|
+
- application/json;charset=utf-8
|
698
|
+
Content-Length:
|
699
|
+
- '385'
|
700
|
+
Date:
|
701
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
702
|
+
body:
|
703
|
+
encoding: US-ASCII
|
704
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes","items":[{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8080/api/collections/nodes/node15939","name":"node15939"},{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8080/api/collections/nodes/node15940","name":"node15940"}],"total":2}'
|
705
|
+
http_version:
|
706
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
707
|
+
- request:
|
708
|
+
method: get
|
709
|
+
uri: http://fred:dead@localhost:8080/api/collections/nodes/node15939
|
710
|
+
body:
|
711
|
+
encoding: US-ASCII
|
712
|
+
string: ''
|
713
|
+
headers:
|
714
|
+
Accept:
|
715
|
+
- application/json
|
716
|
+
Accept-Encoding:
|
717
|
+
- gzip, deflate
|
718
|
+
User-Agent:
|
719
|
+
- Ruby
|
720
|
+
response:
|
721
|
+
status:
|
722
|
+
code: 200
|
723
|
+
message: OK
|
724
|
+
headers:
|
725
|
+
Server:
|
726
|
+
- Apache-Coyote/1.1
|
727
|
+
X-Content-Type-Options:
|
728
|
+
- nosniff
|
729
|
+
Content-Type:
|
730
|
+
- application/json;charset=utf-8
|
731
|
+
Content-Length:
|
732
|
+
- '421'
|
733
|
+
Date:
|
734
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
735
|
+
body:
|
736
|
+
encoding: US-ASCII
|
737
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8080/api/collections/nodes/node15939","name":"node15939","hw_info":{"mac":["78:31:c1:be:c8:00"]},"log":{"id":"http://localhost:8080/api/collections/nodes/node15939/log","name":"log","params":{"limit":{"type":"number"},"start":{"type":"number"}}},"tags":[],"state":{"installed":"true","installed_at":"2014-11-18T01:10:20-06:00"}}'
|
738
|
+
http_version:
|
739
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
740
|
+
- request:
|
741
|
+
method: get
|
742
|
+
uri: http://fred:dead@localhost:8080/api/collections/nodes/node15939/log?limit=1
|
743
|
+
body:
|
744
|
+
encoding: US-ASCII
|
745
|
+
string: ''
|
746
|
+
headers:
|
747
|
+
Accept:
|
748
|
+
- application/json
|
749
|
+
Accept-Encoding:
|
750
|
+
- gzip, deflate
|
751
|
+
User-Agent:
|
752
|
+
- Ruby
|
753
|
+
response:
|
754
|
+
status:
|
755
|
+
code: 200
|
756
|
+
message: OK
|
757
|
+
headers:
|
758
|
+
Server:
|
759
|
+
- Apache-Coyote/1.1
|
760
|
+
X-Content-Type-Options:
|
761
|
+
- nosniff
|
762
|
+
Content-Type:
|
763
|
+
- application/json;charset=utf-8
|
764
|
+
Content-Length:
|
765
|
+
- '78'
|
766
|
+
Date:
|
767
|
+
- Tue, 18 Nov 2014 07:10:19 GMT
|
768
|
+
body:
|
769
|
+
encoding: US-ASCII
|
770
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/log","items":[]}'
|
771
|
+
http_version:
|
772
|
+
recorded_at: Tue, 18 Nov 2014 07:10:20 GMT
|
773
|
+
recorded_with: VCR 2.5.0
|