pe-razor-client 0.15.2.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +27 -0
- data/bin/razor +27 -2
- data/lib/razor/cli.rb +11 -2
- data/lib/razor/cli/command.rb +150 -0
- data/lib/razor/cli/document.rb +8 -4
- data/lib/razor/cli/format.rb +46 -22
- data/lib/razor/cli/navigate.rb +28 -156
- data/lib/razor/cli/parse.rb +49 -7
- data/lib/razor/cli/query.rb +69 -0
- data/lib/razor/cli/table_format.rb +41 -0
- data/lib/razor/cli/transforms.rb +25 -0
- data/lib/razor/cli/version.rb +1 -1
- data/lib/razor/cli/views.yaml +53 -2
- data/spec/cli/command_spec.rb +66 -0
- data/spec/cli/format_spec.rb +95 -5
- data/spec/cli/navigate_spec.rb +50 -6
- data/spec/cli/parse_spec.rb +42 -2
- data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_in_string.yml +233 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_spaces.yml +281 -548
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_--help_command_.yml +160 -37
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_-h_command_.yml +160 -37
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_--help_.yml +160 -37
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_-h_.yml +160 -37
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_help_.yml +160 -37
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_help_command_.yml +160 -37
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_preserve_that_across_navigation.yml +10 -10
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_supply_that_to_the_API_service.yml +5 -5
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_invalid_parameter/should_fail_with_bad_JSON.yml +71 -166
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_invalid_parameter/should_fail_with_malformed_argument.yml +109 -59
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_array/should_merge_an_array_into_an_existing_array.yml +527 -1360
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_array/should_merge_the_arguments_as_an_array.yml +528 -1361
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_array/should_merge_the_arguments_into_an_existing_array.yml +528 -1361
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_construct_a_json_object.yml +80 -111
- 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 +137 -123
- 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 +71 -166
- 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 +71 -102
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_no_parameters/should_fail_with_bad_JSON.yml +98 -5
- 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 +313 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_store_query_without_query_parameters.yml +557 -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 +280 -0
- data/spec/fixtures/vcr/Razor_CLI_Parse/_new/_help/should_print_a_list_of_known_endpoints.yml +5 -5
- data/spec/spec_helper.rb +8 -4
- metadata +26 -7
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://localhost:
|
5
|
+
uri: http://localhost:8150/api
|
6
6
|
body:
|
7
7
|
encoding: US-ASCII
|
8
8
|
string: ''
|
@@ -25,17 +25,17 @@ http_interactions:
|
|
25
25
|
Content-Type:
|
26
26
|
- application/json;charset=utf-8
|
27
27
|
Content-Length:
|
28
|
-
- '
|
28
|
+
- '5650'
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Mon, 09 Mar 2015 19:53:39 GMT
|
31
31
|
body:
|
32
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:
|
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":"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-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"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":"v0.16.1-18-gd3acc7a-dirty"}}'
|
34
34
|
http_version:
|
35
|
-
recorded_at:
|
35
|
+
recorded_at: Mon, 09 Mar 2015 19:53:39 GMT
|
36
36
|
- request:
|
37
37
|
method: get
|
38
|
-
uri: http://localhost:
|
38
|
+
uri: http://localhost:8150/api/commands/create-broker
|
39
39
|
body:
|
40
40
|
encoding: US-ASCII
|
41
41
|
string: ''
|
@@ -54,119 +54,88 @@ http_interactions:
|
|
54
54
|
Server:
|
55
55
|
- Apache-Coyote/1.1
|
56
56
|
Etag:
|
57
|
-
- '"server-version-v0.
|
57
|
+
- '"server-version-v0.16.1-18-gd3acc7a-dirty"'
|
58
58
|
X-Content-Type-Options:
|
59
59
|
- nosniff
|
60
60
|
Content-Type:
|
61
61
|
- application/json;charset=utf-8
|
62
62
|
Content-Length:
|
63
|
-
- '
|
63
|
+
- '5184'
|
64
64
|
Date:
|
65
|
-
-
|
65
|
+
- Mon, 09 Mar 2015 19:53:39 GMT
|
66
66
|
body:
|
67
67
|
encoding: US-ASCII
|
68
|
-
string: '{"name":"create-broker","help":{"
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
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
82
|
Attributes\n\n * name\n - The name of the broker, as it will be referenced
|
83
|
-
within Razor.\n
|
84
|
-
to specify\n
|
85
|
-
This attribute is required
|
86
|
-
be between 1 and 250 in length.\n\n *
|
87
|
-
this broker is created
|
88
|
-
are:\n
|
89
|
-
attribute is required
|
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
90
|
the name of an existing broker type.\n\n * configuration\n - The configuration
|
91
|
-
for the broker. The acceptable values here are\n
|
92
|
-
selected. In general this has\n
|
93
|
-
and other configuration\n
|
94
|
-
to the final\n
|
95
|
-
|
96
|
-
\
|
97
|
-
\"
|
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"]}}}'
|
98
131
|
http_version:
|
99
|
-
recorded_at:
|
100
|
-
- request:
|
101
|
-
method: get
|
102
|
-
uri: http://localhost:8080/api/commands/create-broker
|
103
|
-
body:
|
104
|
-
encoding: US-ASCII
|
105
|
-
string: ''
|
106
|
-
headers:
|
107
|
-
Accept:
|
108
|
-
- application/json
|
109
|
-
Accept-Encoding:
|
110
|
-
- gzip, deflate
|
111
|
-
User-Agent:
|
112
|
-
- Ruby
|
113
|
-
response:
|
114
|
-
status:
|
115
|
-
code: 200
|
116
|
-
message: OK
|
117
|
-
headers:
|
118
|
-
Server:
|
119
|
-
- Apache-Coyote/1.1
|
120
|
-
Etag:
|
121
|
-
- '"server-version-v0.14.1-113-g8b33d83-dirty"'
|
122
|
-
X-Content-Type-Options:
|
123
|
-
- nosniff
|
124
|
-
Content-Type:
|
125
|
-
- application/json;charset=utf-8
|
126
|
-
Content-Length:
|
127
|
-
- '2496'
|
128
|
-
Date:
|
129
|
-
- Fri, 16 May 2014 22:18:28 GMT
|
130
|
-
body:
|
131
|
-
encoding: US-ASCII
|
132
|
-
string: '{"name":"create-broker","help":{"full":"# SYNOPSIS\nCreate a new broker
|
133
|
-
configuration for hand-off of installed nodes\n\n# DESCRIPTION\nCreate a new
|
134
|
-
broker configuration. Brokers are responsible for handing a node\noff to
|
135
|
-
a config management system, such as Puppet or Chef. In cases where you\nhave
|
136
|
-
no configuration management system, you can use the `noop` broker.\n\n\n#
|
137
|
-
Access Control\n\nThis command''s access control pattern: `commands:create-broker:%{name}`\n\nWords
|
138
|
-
surrounded by `%{...}` are substitutions from the input data: typically\nthe
|
139
|
-
name of the object being modified, or some other critical detail, these\nallow
|
140
|
-
roles to be granted partial access to modify the system.\n\nFor more detail
|
141
|
-
on how the permission strings are structured and work, you can\nsee the [Shiro
|
142
|
-
Permissions documentation][shiro]. That pattern is expanded\nand then a permission
|
143
|
-
check applied to it, before the command is authorized.\n\nThese checks only
|
144
|
-
apply if security is enabled in the Razor configuration\nfile; on this server
|
145
|
-
security is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
|
146
|
-
Attributes\n\n * name\n - The name of the broker, as it will be referenced
|
147
|
-
within Razor.\n This is the name that you supply to, eg, `create-policy`
|
148
|
-
to specify\n which broker the node will be handed off via after installation.\n -
|
149
|
-
This attribute is required\n - It must be of type string.\n - It must
|
150
|
-
be between 1 and 250 in length.\n\n * broker-type\n - The broker type that
|
151
|
-
this broker is created from. The available\n broker types on your server
|
152
|
-
are:\n - chef\n - noop\n - puppet-pe\n - puppet\n - This
|
153
|
-
attribute is required\n - It must be of type string.\n - It must match
|
154
|
-
the name of an existing broker type.\n\n * configuration\n - The configuration
|
155
|
-
for the broker. The acceptable values here are\n determined by the `broker-type`
|
156
|
-
selected. In general this has\n settings like which server to contact,
|
157
|
-
and other configuration\n related to handing on the newly installed system
|
158
|
-
to the final\n configuration management system.\n - It must be of type
|
159
|
-
object.\n \n \n\n\n\n# EXAMPLES\n Creating a simple Puppet broker:\n \n {\n \"name\":
|
160
|
-
\"puppet\",\n \"configuration\": {\n \"server\": \"puppet.example.org\",\n \"environment\":
|
161
|
-
\"production\"\n },\n \"broker-type\": \"puppet\"\n }\n\n"},"schema":{"name":{"type":"string"},"broker-type":{"type":"string"},"configuration":{"type":"object"}}}'
|
162
|
-
http_version:
|
163
|
-
recorded_at: Fri, 16 May 2014 22:18:28 GMT
|
132
|
+
recorded_at: Mon, 09 Mar 2015 19:53:39 GMT
|
164
133
|
- request:
|
165
134
|
method: post
|
166
|
-
uri: http://localhost:
|
135
|
+
uri: http://localhost:8150/api/commands/create-broker
|
167
136
|
body:
|
168
137
|
encoding: UTF-8
|
169
|
-
string: '{"name":"broker1","
|
138
|
+
string: '{"name":"broker1","broker_type":"puppet","configuration":{"server":"puppet.example.org","environment":"production"}}'
|
170
139
|
headers:
|
171
140
|
Accept:
|
172
141
|
- application/json
|
@@ -192,15 +161,15 @@ http_interactions:
|
|
192
161
|
Content-Length:
|
193
162
|
- '211'
|
194
163
|
Date:
|
195
|
-
-
|
164
|
+
- Mon, 09 Mar 2015 19:53:39 GMT
|
196
165
|
body:
|
197
166
|
encoding: US-ASCII
|
198
|
-
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/brokers/member","id":"http://localhost:
|
167
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/brokers/member","id":"http://localhost:8150/api/collections/brokers/broker1","name":"broker1","command":"http://localhost:8150/api/collections/commands/1"}'
|
199
168
|
http_version:
|
200
|
-
recorded_at:
|
169
|
+
recorded_at: Mon, 09 Mar 2015 19:53:39 GMT
|
201
170
|
- request:
|
202
171
|
method: get
|
203
|
-
uri: http://localhost:
|
172
|
+
uri: http://localhost:8150/api/collections/brokers/broker1
|
204
173
|
body:
|
205
174
|
encoding: US-ASCII
|
206
175
|
string: ''
|
@@ -225,10 +194,10 @@ http_interactions:
|
|
225
194
|
Content-Length:
|
226
195
|
- '359'
|
227
196
|
Date:
|
228
|
-
-
|
197
|
+
- Mon, 09 Mar 2015 19:53:39 GMT
|
229
198
|
body:
|
230
199
|
encoding: US-ASCII
|
231
|
-
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/brokers/member","id":"http://localhost:
|
200
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/brokers/member","id":"http://localhost:8150/api/collections/brokers/broker1","name":"broker1","configuration":{"server":"puppet.example.org","environment":"production"},"broker_type":"puppet","policies":{"id":"http://localhost:8150/api/collections/brokers/broker1/policies","count":0,"name":"policies"}}'
|
232
201
|
http_version:
|
233
|
-
recorded_at:
|
202
|
+
recorded_at: Mon, 09 Mar 2015 19:53:39 GMT
|
234
203
|
recorded_with: VCR 2.5.0
|
@@ -2,9 +2,9 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: get
|
5
|
-
uri: http://localhost:
|
5
|
+
uri: http://localhost:8150/api
|
6
6
|
body:
|
7
|
-
encoding:
|
7
|
+
encoding: US-ASCII
|
8
8
|
string: ''
|
9
9
|
headers:
|
10
10
|
Accept:
|
@@ -25,19 +25,19 @@ http_interactions:
|
|
25
25
|
Content-Type:
|
26
26
|
- application/json;charset=utf-8
|
27
27
|
Content-Length:
|
28
|
-
- '
|
28
|
+
- '5650'
|
29
29
|
Date:
|
30
|
-
-
|
30
|
+
- Mon, 09 Mar 2015 19:53:44 GMT
|
31
31
|
body:
|
32
|
-
encoding:
|
33
|
-
string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:
|
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":"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-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"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":"v0.16.1-18-gd3acc7a-dirty"}}'
|
34
34
|
http_version:
|
35
|
-
recorded_at:
|
35
|
+
recorded_at: Mon, 09 Mar 2015 19:53:44 GMT
|
36
36
|
- request:
|
37
37
|
method: get
|
38
|
-
uri: http://localhost:
|
38
|
+
uri: http://localhost:8150/api/commands/register-node
|
39
39
|
body:
|
40
|
-
encoding:
|
40
|
+
encoding: US-ASCII
|
41
41
|
string: ''
|
42
42
|
headers:
|
43
43
|
Accept:
|
@@ -54,29 +54,29 @@ http_interactions:
|
|
54
54
|
Server:
|
55
55
|
- Apache-Coyote/1.1
|
56
56
|
Etag:
|
57
|
-
- '"server-version-v0.
|
57
|
+
- '"server-version-v0.16.1-18-gd3acc7a-dirty"'
|
58
58
|
X-Content-Type-Options:
|
59
59
|
- nosniff
|
60
60
|
Content-Type:
|
61
61
|
- application/json;charset=utf-8
|
62
62
|
Content-Length:
|
63
|
-
- '
|
63
|
+
- '6207'
|
64
64
|
Date:
|
65
|
-
-
|
65
|
+
- Mon, 09 Mar 2015 19:53:44 GMT
|
66
66
|
body:
|
67
|
-
encoding:
|
68
|
-
string: '{"name":"register-node","help":{"
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
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
80
|
pattern: `commands:register-node`\n\nFor more detail on how the permission
|
81
81
|
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
82
82
|
pattern is expanded\nand then a permission check applied to it, before the
|
@@ -85,57 +85,27 @@ http_interactions:
|
|
85
85
|
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * installed\n -
|
86
86
|
Should the node be considered ''installed'' already? Installed nodes are\n not
|
87
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 *
|
88
|
+
is required.\n - It must be of type boolean.\n\n * hw_info\n - The hardware
|
89
89
|
information for the node. This is used to match the node on first\n boot
|
90
90
|
with the record in the database. The order of MAC address assignment in\n this
|
91
91
|
data is not significant, as a node with reordered MAC addresses will be\n treated
|
92
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
|
93
|
+
object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
|
94
94
|
serial\n - The DMI serial number of the node\n - It must be of type
|
95
95
|
string.\n \n * asset\n - The DMI asset tag of the node\n -
|
96
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
|
98
|
-
boot it, and note that it already has an OS\
|
99
|
-
subject to policy-based reinstallation:\n
|
100
|
-
|
101
|
-
\"
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
encoding: UTF-8
|
110
|
-
string: ''
|
111
|
-
headers:
|
112
|
-
Accept:
|
113
|
-
- application/json
|
114
|
-
Accept-Encoding:
|
115
|
-
- gzip, deflate
|
116
|
-
User-Agent:
|
117
|
-
- Ruby
|
118
|
-
response:
|
119
|
-
status:
|
120
|
-
code: 200
|
121
|
-
message: OK
|
122
|
-
headers:
|
123
|
-
Server:
|
124
|
-
- Apache-Coyote/1.1
|
125
|
-
Etag:
|
126
|
-
- '"server-version-v0.15.0-3-gb0cbb3f-dirty"'
|
127
|
-
X-Content-Type-Options:
|
128
|
-
- nosniff
|
129
|
-
Content-Type:
|
130
|
-
- application/json;charset=utf-8
|
131
|
-
Content-Length:
|
132
|
-
- '2936'
|
133
|
-
Date:
|
134
|
-
- Tue, 03 Jun 2014 23:18:44 GMT
|
135
|
-
body:
|
136
|
-
encoding: UTF-8
|
137
|
-
string: '{"name":"register-node","help":{"full":"# SYNOPSIS\nRegister a node
|
138
|
-
with Razor before it is discovered\n\n# DESCRIPTION\nIn order to make brownfield
|
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
|
139
109
|
deployments of Razor easier we allow users to\nregister nodes explicitly. This
|
140
110
|
command allows you to perform the same\nregistration that would happen when
|
141
111
|
a new node checked in, ahead of time.\n\nIn order for this to be effective
|
@@ -145,21 +115,21 @@ http_interactions:
|
|
145
115
|
the node installed field will be updated to\nmatch the value in this command.\n\nThe
|
146
116
|
final state is that a node with the supplied hardware information, and the\ndesired
|
147
117
|
installed state, will be present in the database, regardless of it\nexisting
|
148
|
-
before hand or not.\n
|
149
|
-
|
150
|
-
|
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
|
151
121
|
pattern is expanded\nand then a permission check applied to it, before the
|
152
122
|
command is authorized.\n\nThese checks only apply if security is enabled in
|
153
123
|
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
154
124
|
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * installed\n -
|
155
125
|
Should the node be considered ''installed'' already? Installed nodes are\n not
|
156
126
|
eligible for policy matching, and will simply boot locally.\n - This attribute
|
157
|
-
is required.\n - It must be of type boolean.\n\n *
|
127
|
+
is required.\n - It must be of type boolean.\n\n * hw_info\n - The hardware
|
158
128
|
information for the node. This is used to match the node on first\n boot
|
159
129
|
with the record in the database. The order of MAC address assignment in\n this
|
160
130
|
data is not significant, as a node with reordered MAC addresses will be\n treated
|
161
131
|
as the same node.\n - This attribute is required.\n - It must be of type
|
162
|
-
object.\n - It must be between 1 and Infinity in length.\n
|
132
|
+
object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
|
163
133
|
serial\n - The DMI serial number of the node\n - It must be of type
|
164
134
|
string.\n \n * asset\n - The DMI asset tag of the node\n -
|
165
135
|
It must be of type string.\n \n * uuid\n - The DMI UUID of the node\n -
|
@@ -168,15 +138,15 @@ http_interactions:
|
|
168
138
|
subject to policy-based reinstallation:\n \n {\n \"hw_info\":
|
169
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\":
|
170
140
|
\"xxxxxxxxxxx\",\n \"asset\": \"Asset-1234567890\",\n \"uuid\": \"Not
|
171
|
-
Settable\"\n },\n \"installed\": true\n }\n"},"schema":{"installed":{"type":"boolean"},"
|
141
|
+
Settable\"\n },\n \"installed\": true\n }\n"},"schema":{"installed":{"type":"boolean"},"hw_info":{"type":"object","aliases":["hw-info"]}}}'
|
172
142
|
http_version:
|
173
|
-
recorded_at:
|
143
|
+
recorded_at: Mon, 09 Mar 2015 19:53:44 GMT
|
174
144
|
- request:
|
175
145
|
method: post
|
176
|
-
uri: http://localhost:
|
146
|
+
uri: http://localhost:8150/api/commands/register-node
|
177
147
|
body:
|
178
148
|
encoding: UTF-8
|
179
|
-
string: '{"installed":true,"
|
149
|
+
string: '{"installed":true,"hw_info":{"net0":"abcdef"}}'
|
180
150
|
headers:
|
181
151
|
Accept:
|
182
152
|
- application/json
|
@@ -202,17 +172,17 @@ http_interactions:
|
|
202
172
|
Content-Length:
|
203
173
|
- '203'
|
204
174
|
Date:
|
205
|
-
-
|
175
|
+
- Mon, 09 Mar 2015 19:53:44 GMT
|
206
176
|
body:
|
207
|
-
encoding:
|
208
|
-
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:
|
177
|
+
encoding: US-ASCII
|
178
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8150/api/collections/nodes/node1","name":"node1","command":"http://localhost:8150/api/collections/commands/1"}'
|
209
179
|
http_version:
|
210
|
-
recorded_at:
|
180
|
+
recorded_at: Mon, 09 Mar 2015 19:53:44 GMT
|
211
181
|
- request:
|
212
182
|
method: get
|
213
|
-
uri: http://localhost:
|
183
|
+
uri: http://localhost:8150/api/collections/nodes/node1
|
214
184
|
body:
|
215
|
-
encoding:
|
185
|
+
encoding: US-ASCII
|
216
186
|
string: ''
|
217
187
|
headers:
|
218
188
|
Accept:
|
@@ -233,19 +203,19 @@ http_interactions:
|
|
233
203
|
Content-Type:
|
234
204
|
- application/json;charset=utf-8
|
235
205
|
Content-Length:
|
236
|
-
- '
|
206
|
+
- '398'
|
237
207
|
Date:
|
238
|
-
-
|
208
|
+
- Mon, 09 Mar 2015 19:53:44 GMT
|
239
209
|
body:
|
240
|
-
encoding:
|
241
|
-
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:
|
210
|
+
encoding: US-ASCII
|
211
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8150/api/collections/nodes/node1","name":"node1","hw_info":{"mac":["abcdef"]},"log":{"id":"http://localhost:8150/api/collections/nodes/node1/log","name":"log","params":{"limit":{"type":"number"},"start":{"type":"number"}}},"tags":[],"state":{"installed":"true","installed_at":"2015-03-09T14:53:44-05:00"}}'
|
242
212
|
http_version:
|
243
|
-
recorded_at:
|
213
|
+
recorded_at: Mon, 09 Mar 2015 19:53:44 GMT
|
244
214
|
- request:
|
245
215
|
method: get
|
246
|
-
uri: http://localhost:
|
216
|
+
uri: http://localhost:8150/api
|
247
217
|
body:
|
248
|
-
encoding:
|
218
|
+
encoding: US-ASCII
|
249
219
|
string: ''
|
250
220
|
headers:
|
251
221
|
Accept:
|
@@ -266,19 +236,19 @@ http_interactions:
|
|
266
236
|
Content-Type:
|
267
237
|
- application/json;charset=utf-8
|
268
238
|
Content-Length:
|
269
|
-
- '
|
239
|
+
- '5650'
|
270
240
|
Date:
|
271
|
-
-
|
241
|
+
- Mon, 09 Mar 2015 19:53:44 GMT
|
272
242
|
body:
|
273
|
-
encoding:
|
274
|
-
string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:
|
243
|
+
encoding: US-ASCII
|
244
|
+
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":"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-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"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":"v0.16.1-18-gd3acc7a-dirty"}}'
|
275
245
|
http_version:
|
276
|
-
recorded_at:
|
246
|
+
recorded_at: Mon, 09 Mar 2015 19:53:44 GMT
|
277
247
|
- request:
|
278
248
|
method: get
|
279
|
-
uri: http://localhost:
|
249
|
+
uri: http://localhost:8150/api/commands/modify-node-metadata
|
280
250
|
body:
|
281
|
-
encoding:
|
251
|
+
encoding: US-ASCII
|
282
252
|
string: ''
|
283
253
|
headers:
|
284
254
|
Accept:
|
@@ -295,24 +265,58 @@ http_interactions:
|
|
295
265
|
Server:
|
296
266
|
- Apache-Coyote/1.1
|
297
267
|
Etag:
|
298
|
-
- '"server-version-v0.
|
268
|
+
- '"server-version-v0.16.1-18-gd3acc7a-dirty"'
|
299
269
|
X-Content-Type-Options:
|
300
270
|
- nosniff
|
301
271
|
Content-Type:
|
302
272
|
- application/json;charset=utf-8
|
303
273
|
Content-Length:
|
304
|
-
- '
|
274
|
+
- '5386'
|
305
275
|
Date:
|
306
|
-
-
|
276
|
+
- Mon, 09 Mar 2015 19:53:44 GMT
|
307
277
|
body:
|
308
|
-
encoding:
|
309
|
-
string: '{"name":"modify-node-metadata","help":{"
|
310
|
-
|
311
|
-
|
312
|
-
|
278
|
+
encoding: US-ASCII
|
279
|
+
string: '{"name":"modify-node-metadata","help":{"summary":"Perform various editing
|
280
|
+
operations on node metadata","description":"Node metadata can be added, changed,
|
281
|
+
or removed with this command; it contains\na limited editing language to make
|
282
|
+
changes to the existing metadata in an\natomic fashion.\n\nIt can also clear
|
283
|
+
all metadata from a node, although that operation is\nexclusive to all other
|
284
|
+
editing operations, and cannot be performed atomically\nwith them.","schema":"#
|
285
|
+
Access Control\n\nThis command''s access control pattern: `commands:modify-node-metadata:%{node}`\n\nWords
|
286
|
+
surrounded by `%{...}` are substitutions from the input data: typically\nthe
|
287
|
+
name of the object being modified, or some other critical detail, these\nallow
|
288
|
+
roles to be granted partial access to modify the system.\n\nFor more detail
|
289
|
+
on how the permission strings are structured and work, you can\nsee the [Shiro
|
290
|
+
Permissions documentation][shiro]. That pattern is expanded\nand then a permission
|
291
|
+
check applied to it, before the command is authorized.\n\nThese checks only
|
292
|
+
apply if security is enabled in the Razor configuration\nfile; on this server
|
293
|
+
security is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
|
294
|
+
Attributes\n\n * node\n - The name of the node for which to modify metadata.\n -
|
295
|
+
This attribute is required.\n - It must be of type string.\n - It must
|
296
|
+
match the name of an existing node.\n\n * update\n - The metadata to update\n -
|
297
|
+
It must be of type object.\n\n * remove\n - The metadata to remove\n -
|
298
|
+
It must be of type array.\n\n * clear\n - Remove all metadata from the node. Cannot
|
299
|
+
be used together with\n either ''update'' or ''remove''.\n - It must
|
300
|
+
be of type boolean.\n - If present, update, remove must not be present.\n\n
|
301
|
+
* no_replace\n - If true, the `update` operation will cause this command
|
302
|
+
to fail if the\n metadata key is already present on the node. No effect
|
303
|
+
on `remove` or\n clear.\n - It must be of type boolean.\n","examples":{"api":"Editing
|
304
|
+
node metadata, by adding and removing some keys, but refusing to\nmodify an
|
305
|
+
existing value already present on a node:\n\n {\n \"node\": \"node1\",\n \"update\":
|
306
|
+
{\n \"key1\": \"value1\",\n \"key2\": \"value2\"\n }\n \"remove\":
|
307
|
+
[\"key3\", \"key4\"],\n \"no_replace\": true\n }\n\nRemoving all
|
308
|
+
node metadata:\n\n {\"node\": \"node1\", \"clear\": true}","cli":"Editing
|
309
|
+
node metadata, by adding and removing some keys, but refusing to\nmodify an
|
310
|
+
existing value already present on a node:\n\n razor modify-node-metadata
|
311
|
+
--node node1 --update key1=value1 \\\n --update key2=value2 --remove
|
312
|
+
key3 --remove key4 --no-replace\n\nRemoving all node metadata:\n\n razor
|
313
|
+
modify-node-metadata --node node1 --clear"},"full":"# SYNOPSIS\nPerform various
|
314
|
+
editing operations on node metadata\n\n# DESCRIPTION\nNode metadata can be
|
315
|
+
added, changed, or removed with this command; it contains\na limited editing
|
316
|
+
language to make changes to the existing metadata in an\natomic fashion.\n\nIt
|
313
317
|
can also clear all metadata from a node, although that operation is\nexclusive
|
314
318
|
to all other editing operations, and cannot be performed atomically\nwith
|
315
|
-
them.\n
|
319
|
+
them.\n# Access Control\n\nThis command''s access control pattern: `commands:modify-node-metadata:%{node}`\n\nWords
|
316
320
|
surrounded by `%{...}` are substitutions from the input data: typically\nthe
|
317
321
|
name of the object being modified, or some other critical detail, these\nallow
|
318
322
|
roles to be granted partial access to modify the system.\n\nFor more detail
|
@@ -328,20 +332,20 @@ http_interactions:
|
|
328
332
|
It must be of type array.\n\n * clear\n - Remove all metadata from the node. Cannot
|
329
333
|
be used together with\n either ''update'' or ''remove''.\n - It must
|
330
334
|
be of type boolean.\n - If present, update, remove must not be present.\n\n
|
331
|
-
*
|
335
|
+
* no_replace\n - If true, the `update` operation will cause this command
|
332
336
|
to fail if the\n metadata key is already present on the node. No effect
|
333
337
|
on `remove` or\n clear.\n - It must be of type boolean.\n\n# EXAMPLES\n\n Editing
|
334
338
|
node metadata, by adding and removing some keys, but refusing to\n modify
|
335
339
|
an existing value already present on a node:\n \n {\n \"node\":
|
336
340
|
\"node1\",\n \"update\": {\n \"key1\": \"value1\",\n \"key2\":
|
337
|
-
\"value2\"\n }\n \"remove\": [\"key3\", \"key4\"],\n \"
|
341
|
+
\"value2\"\n }\n \"remove\": [\"key3\", \"key4\"],\n \"no_replace\":
|
338
342
|
true\n }\n \n Removing all node metadata:\n \n {\"node\": \"node1\",
|
339
|
-
\"clear\": true}\n"},"schema":{"node":{"type":"string"},"update":{"type":"object"},"remove":{"type":"array"},"clear":{"type":"boolean"},"
|
343
|
+
\"clear\": true}\n"},"schema":{"node":{"type":"string"},"update":{"type":"object"},"remove":{"type":"array"},"clear":{"type":"boolean"},"no_replace":{"type":"boolean","aliases":["no-replace"]}}}'
|
340
344
|
http_version:
|
341
|
-
recorded_at:
|
345
|
+
recorded_at: Mon, 09 Mar 2015 19:53:44 GMT
|
342
346
|
- request:
|
343
347
|
method: post
|
344
|
-
uri: http://localhost:
|
348
|
+
uri: http://localhost:8150/api/commands/modify-node-metadata
|
345
349
|
body:
|
346
350
|
encoding: UTF-8
|
347
351
|
string: '{"node":"node1","update":{"keyᓱ123":"valueᓱ1"}}'
|
@@ -370,17 +374,17 @@ http_interactions:
|
|
370
374
|
Content-Length:
|
371
375
|
- '203'
|
372
376
|
Date:
|
373
|
-
-
|
377
|
+
- Mon, 09 Mar 2015 19:53:44 GMT
|
374
378
|
body:
|
375
|
-
encoding:
|
376
|
-
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:
|
379
|
+
encoding: US-ASCII
|
380
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8150/api/collections/nodes/node1","name":"node1","command":"http://localhost:8150/api/collections/commands/2"}'
|
377
381
|
http_version:
|
378
|
-
recorded_at:
|
382
|
+
recorded_at: Mon, 09 Mar 2015 19:53:45 GMT
|
379
383
|
- request:
|
380
384
|
method: get
|
381
|
-
uri: http://localhost:
|
385
|
+
uri: http://localhost:8150/api/collections/nodes/node1
|
382
386
|
body:
|
383
|
-
encoding:
|
387
|
+
encoding: US-ASCII
|
384
388
|
string: ''
|
385
389
|
headers:
|
386
390
|
Accept:
|
@@ -401,12 +405,22 @@ http_interactions:
|
|
401
405
|
Content-Type:
|
402
406
|
- application/json;charset=utf-8
|
403
407
|
Content-Length:
|
404
|
-
- '
|
408
|
+
- '435'
|
405
409
|
Date:
|
406
|
-
-
|
410
|
+
- Mon, 09 Mar 2015 19:53:44 GMT
|
407
411
|
body:
|
408
|
-
encoding:
|
409
|
-
string:
|
412
|
+
encoding: ASCII-8BIT
|
413
|
+
string: !binary |-
|
414
|
+
eyJzcGVjIjoiaHR0cDovL2FwaS5wdXBwZXRsYWJzLmNvbS9yYXpvci92MS9j
|
415
|
+
b2xsZWN0aW9ucy9ub2Rlcy9tZW1iZXIiLCJpZCI6Imh0dHA6Ly9sb2NhbGhv
|
416
|
+
c3Q6ODE1MC9hcGkvY29sbGVjdGlvbnMvbm9kZXMvbm9kZTEiLCJuYW1lIjoi
|
417
|
+
bm9kZTEiLCJod19pbmZvIjp7Im1hYyI6WyJhYmNkZWYiXX0sImxvZyI6eyJp
|
418
|
+
ZCI6Imh0dHA6Ly9sb2NhbGhvc3Q6ODE1MC9hcGkvY29sbGVjdGlvbnMvbm9k
|
419
|
+
ZXMvbm9kZTEvbG9nIiwibmFtZSI6ImxvZyIsInBhcmFtcyI6eyJsaW1pdCI6
|
420
|
+
eyJ0eXBlIjoibnVtYmVyIn0sInN0YXJ0Ijp7InR5cGUiOiJudW1iZXIifX19
|
421
|
+
LCJ0YWdzIjpbXSwibWV0YWRhdGEiOnsia2V54ZOxMTIzIjoidmFsdWXhk7Ex
|
422
|
+
In0sInN0YXRlIjp7Imluc3RhbGxlZCI6InRydWUiLCJpbnN0YWxsZWRfYXQi
|
423
|
+
OiIyMDE1LTAzLTA5VDE0OjUzOjQ0LTA1OjAwIn19
|
410
424
|
http_version:
|
411
|
-
recorded_at:
|
425
|
+
recorded_at: Mon, 09 Mar 2015 19:53:45 GMT
|
412
426
|
recorded_with: VCR 2.5.0
|