razor-client 1.7.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/NEWS.md +12 -0
  2. data/bin/razor +19 -23
  3. data/lib/razor/cli/command.rb +3 -3
  4. data/lib/razor/cli/navigate.rb +55 -1
  5. data/lib/razor/cli/parse.rb +15 -11
  6. data/lib/razor/cli/version.rb +1 -1
  7. data/spec/cli/command_spec.rb +10 -1
  8. data/spec/cli/navigate_spec.rb +52 -4
  9. data/spec/cli/parse_spec.rb +1 -2
  10. data/spec/fixtures/sample_api +1 -0
  11. data/spec/fixtures/vcr/Razor_CLI_Navigate/accept-language_header/should_allow_other_accept-language_headers.yml +10 -8
  12. data/spec/fixtures/vcr/Razor_CLI_Navigate/accept-language_header/should_set_the_accept-language_header.yml +10 -8
  13. data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_in_string.yml +110 -91
  14. data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_single-dash_with_single_character_flag.yml +71 -51
  15. data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_spaces.yml +328 -271
  16. data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_not_allow_double-dash_with_single_character_flag.yml +52 -40
  17. data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_not_allow_single-dash_with_multiple_character_flag.yml +49 -37
  18. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_--help_command_.yml +53 -135
  19. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_-h_command_.yml +53 -135
  20. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_--help_.yml +53 -135
  21. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_-h_.yml +53 -135
  22. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_help_.yml +53 -135
  23. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_help_command_.yml +53 -135
  24. data/spec/fixtures/vcr/Razor_CLI_Navigate/positional_arguments/should_allow_the_use_of_positional_arguments.yml +229 -163
  25. data/spec/fixtures/vcr/Razor_CLI_Navigate/positional_arguments/should_fail_with_too_many_positional_arguments.yml +49 -37
  26. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_preserve_that_across_navigation.yml +25 -13
  27. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_supply_that_to_the_API_service.yml +14 -8
  28. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_invalid_parameter/should_fail_with_bad_JSON.yml +52 -40
  29. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_invalid_parameter/should_fail_with_malformed_argument.yml +105 -90
  30. 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 +549 -446
  31. 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 +549 -446
  32. 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 +549 -446
  33. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_construct_a_json_object.yml +71 -51
  34. 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 +144 -100
  35. 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 +52 -40
  36. 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 +52 -40
  37. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_no_parameters/should_fail_with_bad_JSON.yml +54 -43
  38. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_limit.yml +25 -13
  39. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_start.yml +25 -13
  40. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_not_fail_when_query_returns_details_for_one_item.yml +78 -44
  41. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_store_query_without_query_parameters.yml +130 -74
  42. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_throw_an_error_if_the_query_parameter_is_not_in_the_API.yml +14 -8
  43. 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 +66 -38
  44. data/spec/fixtures/vcr/Razor_CLI_Parse/_new/_help/should_print_a_list_of_known_endpoints.yml +12 -8
  45. data/spec/spec_helper.rb +4 -1
  46. data/spec/testing.md +25 -1
  47. metadata +73 -71
@@ -12,7 +12,11 @@ http_interactions:
12
12
  Accept-Encoding:
13
13
  - gzip, deflate
14
14
  User-Agent:
15
- - Ruby
15
+ - rest-client/2.0.2 (darwin x86_64) jruby/9.1.5.0 (2.3.1p0)
16
+ Accept-Language:
17
+ - en_US,en
18
+ Host:
19
+ - localhost:8150
16
20
  response:
17
21
  status:
18
22
  code: 200
@@ -23,109 +27,16 @@ http_interactions:
23
27
  X-Content-Type-Options:
24
28
  - nosniff
25
29
  Content-Type:
26
- - application/json;charset=utf-8
27
- Content-Length:
28
- - '5650'
29
- Date:
30
- - Mon, 09 Mar 2015 19:54:29 GMT
31
- body:
32
- encoding: US-ASCII
33
- string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"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
- http_version:
35
- recorded_at: Mon, 09 Mar 2015 19:54:29 GMT
36
- - request:
37
- method: get
38
- uri: http://localhost:8150/api/commands/update-tag-rule
39
- body:
40
- encoding: US-ASCII
41
- string: ''
42
- headers:
43
- Accept:
44
30
  - 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.16.1-18-gd3acc7a-dirty"'
58
- X-Content-Type-Options:
59
- - nosniff
60
- Content-Type:
61
- - application/json;charset=utf-8
62
31
  Content-Length:
63
- - '4691'
32
+ - '7110'
64
33
  Date:
65
- - Mon, 09 Mar 2015 19:54:29 GMT
34
+ - Mon, 23 Apr 2018 19:48:28 GMT
66
35
  body:
67
- encoding: US-ASCII
68
- string: '{"name":"update-tag-rule","help":{"summary":"Update the matching rule
69
- for an existing tag","description":"This will change the rule of the given
70
- tag to the new rule. The tag will be\nreevaluated against all nodes and each
71
- node''s tag attribute will be updated to\nreflect whether the tag now matches
72
- or not, i.e., the tag will be added\nto/removed from each node''s tag as appropriate.\n\nIf
73
- the tag is used by any policies, the update will only be performed if the\noptional
74
- parameter `force` is set to `true`. Otherwise, it will fail.","schema":"#
75
- Access Control\n\nThis command''s access control pattern: `commands:update-tag-rule:%{name}`\n\nWords
76
- surrounded by `%{...}` are substitutions from the input data: typically\nthe
77
- name of the object being modified, or some other critical detail, these\nallow
78
- roles to be granted partial access to modify the system.\n\nFor more detail
79
- on how the permission strings are structured and work, you can\nsee the [Shiro
80
- Permissions documentation][shiro]. That pattern is expanded\nand then a permission
81
- check applied to it, before the command is authorized.\n\nThese checks only
82
- apply if security is enabled in the Razor configuration\nfile; on this server
83
- security is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
84
- Attributes\n\n * name\n - The tag for which to change the rule.\n - This
85
- attribute is required.\n - It must be of type string.\n - It must match
86
- the name of an existing tag.\n\n * rule\n - The new rule to apply to the
87
- tag.\n - This attribute is required.\n - It must be of type array.\n\n
88
- * force\n - By default this command will fail if the tag is in use by an
89
- existing\n policy. This flag allows you to override that, and force the
90
- change to\n apply despite the tag being in use.\n \n This will
91
- not change policy binding of nodes, which may lead to some\n counter-intuitive
92
- results such as a node that does *not* match policy\n tags being bound
93
- to the policy.\n - It must be of type boolean.\n","examples":{"api":"An
94
- example of updating a tag rule, and forcing reevaluation:\n\n{\n \"name\":
95
- \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
96
- true\n}","cli":"An example of updating a tag rule, and forcing reevaluation:\n\nrazor
97
- update-tag-rule --name small --force \\\n --rule ''[\"<=\", [\"fact\",
98
- \"processorcount\"], \"2\"]''"},"full":"# SYNOPSIS\nUpdate the matching rule
99
- for an existing tag\n\n# DESCRIPTION\nThis will change the rule of the given
100
- tag to the new rule. The tag will be\nreevaluated against all nodes and each
101
- node''s tag attribute will be updated to\nreflect whether the tag now matches
102
- or not, i.e., the tag will be added\nto/removed from each node''s tag as appropriate.\n\nIf
103
- the tag is used by any policies, the update will only be performed if the\noptional
104
- parameter `force` is set to `true`. Otherwise, it will fail.\n# Access Control\n\nThis
105
- command''s access control pattern: `commands:update-tag-rule:%{name}`\n\nWords
106
- surrounded by `%{...}` are substitutions from the input data: typically\nthe
107
- name of the object being modified, or some other critical detail, these\nallow
108
- roles to be granted partial access to modify the system.\n\nFor more detail
109
- on how the permission strings are structured and work, you can\nsee the [Shiro
110
- Permissions documentation][shiro]. That pattern is expanded\nand then a permission
111
- check applied to it, before the command is authorized.\n\nThese checks only
112
- apply if security is enabled in the Razor configuration\nfile; on this server
113
- security is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
114
- Attributes\n\n * name\n - The tag for which to change the rule.\n - This
115
- attribute is required.\n - It must be of type string.\n - It must match
116
- the name of an existing tag.\n\n * rule\n - The new rule to apply to the
117
- tag.\n - This attribute is required.\n - It must be of type array.\n\n
118
- * force\n - By default this command will fail if the tag is in use by an
119
- existing\n policy. This flag allows you to override that, and force the
120
- change to\n apply despite the tag being in use.\n \n This will
121
- not change policy binding of nodes, which may lead to some\n counter-intuitive
122
- results such as a node that does *not* match policy\n tags being bound
123
- to the policy.\n - It must be of type boolean.\n\n# EXAMPLES\n\n An example
124
- of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
125
- \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
126
- true\n }\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
36
+ encoding: UTF-8
37
+ string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"run-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/run-hook","id":"http://localhost:8150/api/commands/run-hook"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8150/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8150/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8150/api/commands/set-node-ipmi-credentials"},{"name":"update-broker-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-broker-configuration","id":"http://localhost:8150/api/commands/update-broker-configuration"},{"name":"update-hook-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-hook-configuration","id":"http://localhost:8150/api/commands/update-hook-configuration"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"name":"update-policy-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-broker","id":"http://localhost:8150/api/commands/update-policy-broker"},{"name":"update-policy-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-node-metadata","id":"http://localhost:8150/api/commands/update-policy-node-metadata"},{"name":"update-policy-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-repo","id":"http://localhost:8150/api/commands/update-policy-repo"},{"name":"update-policy-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-task","id":"http://localhost:8150/api/commands/update-policy-task"},{"name":"update-repo-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-repo-task","id":"http://localhost:8150/api/commands/update-repo-task"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8150/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8150/api/collections/brokers"},{"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"},{"name":"config","rel":"http://api.puppetlabs.com/razor/v1/collections/config","id":"http://localhost:8150/api/collections/config"}],"version":{"server":"v1.8.0-dirty"}}'
127
38
  http_version:
128
- recorded_at: Mon, 09 Mar 2015 19:54:29 GMT
39
+ recorded_at: Mon, 23 Apr 2018 19:48:28 GMT
129
40
  - request:
130
41
  method: get
131
42
  uri: http://localhost:8150/api/commands/update-tag-rule
@@ -138,7 +49,11 @@ http_interactions:
138
49
  Accept-Encoding:
139
50
  - gzip, deflate
140
51
  User-Agent:
141
- - Ruby
52
+ - rest-client/2.0.2 (darwin x86_64) jruby/9.1.5.0 (2.3.1p0)
53
+ Accept-Language:
54
+ - en_US,en
55
+ Host:
56
+ - localhost:8150
142
57
  response:
143
58
  status:
144
59
  code: 200
@@ -147,17 +62,17 @@ http_interactions:
147
62
  Server:
148
63
  - Apache-Coyote/1.1
149
64
  Etag:
150
- - '"server-version-v0.16.1-18-gd3acc7a-dirty"'
65
+ - '"server-version-v1.8.0-dirty"'
151
66
  X-Content-Type-Options:
152
67
  - nosniff
153
68
  Content-Type:
154
- - application/json;charset=utf-8
69
+ - application/json
155
70
  Content-Length:
156
- - '4691'
71
+ - '5021'
157
72
  Date:
158
- - Mon, 09 Mar 2015 19:54:29 GMT
73
+ - Mon, 23 Apr 2018 19:48:28 GMT
159
74
  body:
160
- encoding: US-ASCII
75
+ encoding: UTF-8
161
76
  string: '{"name":"update-tag-rule","help":{"summary":"Update the matching rule
162
77
  for an existing tag","description":"This will change the rule of the given
163
78
  tag to the new rule. The tag will be\nreevaluated against all nodes and each
@@ -176,23 +91,26 @@ http_interactions:
176
91
  security is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
177
92
  Attributes\n\n * name\n - The tag for which to change the rule.\n - This
178
93
  attribute is required.\n - It must be of type string.\n - It must match
179
- the name of an existing tag.\n\n * rule\n - The new rule to apply to the
180
- tag.\n - This attribute is required.\n - It must be of type array.\n\n
181
- * force\n - By default this command will fail if the tag is in use by an
182
- existing\n policy. This flag allows you to override that, and force the
183
- change to\n apply despite the tag being in use.\n \n This will
184
- not change policy binding of nodes, which may lead to some\n counter-intuitive
185
- results such as a node that does *not* match policy\n tags being bound
186
- to the policy.\n - It must be of type boolean.\n","examples":{"api":"An
187
- example of updating a tag rule, and forcing reevaluation:\n\n{\n \"name\":
188
- \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
189
- true\n}","cli":"An example of updating a tag rule, and forcing reevaluation:\n\nrazor
190
- update-tag-rule --name small --force \\\n --rule ''[\"<=\", [\"fact\",
191
- \"processorcount\"], \"2\"]''"},"full":"# SYNOPSIS\nUpdate the matching rule
192
- for an existing tag\n\n# DESCRIPTION\nThis will change the rule of the given
193
- tag to the new rule. The tag will be\nreevaluated against all nodes and each
194
- node''s tag attribute will be updated to\nreflect whether the tag now matches
195
- or not, i.e., the tag will be added\nto/removed from each node''s tag as appropriate.\n\nIf
94
+ the name of an existing tag.\n - Its argument position is 0.\n\n * rule\n -
95
+ The new rule to apply to the tag.\n - This attribute is required.\n -
96
+ It must be of type array.\n - Its argument position is 1.\n\n * force\n -
97
+ By default this command will fail if the tag is in use by an existing\n policy. This
98
+ flag allows you to override that, and force the change to\n apply despite
99
+ the tag being in use.\n \n This will not change policy binding of
100
+ nodes, which may lead to some\n counter-intuitive results such as a node
101
+ that does *not* match policy\n tags being bound to the policy.\n - It
102
+ must be of type boolean.\n","examples":{"api":"An example of updating a tag
103
+ rule, and forcing reevaluation:\n\n{\n \"name\": \"small\",\n \"rule\":
104
+ [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\": true\n}","cli":"An
105
+ example of updating a tag rule, and forcing reevaluation:\n\n razor update-tag-rule
106
+ --name small --force \\\n --rule ''[\"<=\", [\"fact\", \"processorcount\"],
107
+ \"2\"]''\n\nWith positional arguments, this can be shortened:\n\n razor
108
+ update-tag-rule small ''[[\"<=\", [\"fact\", \"processorcount\"], \"2\"]]''
109
+ \\\n --force"},"full":"# SYNOPSIS\nUpdate the matching rule for an
110
+ existing tag\n\n# DESCRIPTION\nThis will change the rule of the given tag
111
+ to the new rule. The tag will be\nreevaluated against all nodes and each node''s
112
+ tag attribute will be updated to\nreflect whether the tag now matches or not,
113
+ i.e., the tag will be added\nto/removed from each node''s tag as appropriate.\n\nIf
196
114
  the tag is used by any policies, the update will only be performed if the\noptional
197
115
  parameter `force` is set to `true`. Otherwise, it will fail.\n# Access Control\n\nThis
198
116
  command''s access control pattern: `commands:update-tag-rule:%{name}`\n\nWords
@@ -206,17 +124,17 @@ http_interactions:
206
124
  security is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
207
125
  Attributes\n\n * name\n - The tag for which to change the rule.\n - This
208
126
  attribute is required.\n - It must be of type string.\n - It must match
209
- the name of an existing tag.\n\n * rule\n - The new rule to apply to the
210
- tag.\n - This attribute is required.\n - It must be of type array.\n\n
211
- * force\n - By default this command will fail if the tag is in use by an
212
- existing\n policy. This flag allows you to override that, and force the
213
- change to\n apply despite the tag being in use.\n \n This will
214
- not change policy binding of nodes, which may lead to some\n counter-intuitive
215
- results such as a node that does *not* match policy\n tags being bound
216
- to the policy.\n - It must be of type boolean.\n\n# EXAMPLES\n\n An example
217
- of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
218
- \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
219
- true\n }\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
127
+ the name of an existing tag.\n - Its argument position is 0.\n\n * rule\n -
128
+ The new rule to apply to the tag.\n - This attribute is required.\n -
129
+ It must be of type array.\n - Its argument position is 1.\n\n * force\n -
130
+ By default this command will fail if the tag is in use by an existing\n policy. This
131
+ flag allows you to override that, and force the change to\n apply despite
132
+ the tag being in use.\n \n This will not change policy binding of
133
+ nodes, which may lead to some\n counter-intuitive results such as a node
134
+ that does *not* match policy\n tags being bound to the policy.\n - It
135
+ must be of type boolean.\n\n# EXAMPLES\n\n An example of updating a tag rule,
136
+ and forcing reevaluation:\n \n {\n \"name\": \"small\",\n \"rule\":
137
+ [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\": true\n }\n"},"schema":{"name":{"type":"string","position":0},"rule":{"type":"array","position":1},"force":{"type":"boolean"}}}'
220
138
  http_version:
221
- recorded_at: Mon, 09 Mar 2015 19:54:29 GMT
222
- recorded_with: VCR 2.5.0
139
+ recorded_at: Mon, 23 Apr 2018 19:48:28 GMT
140
+ recorded_with: VCR 4.0.0
@@ -12,7 +12,11 @@ http_interactions:
12
12
  Accept-Encoding:
13
13
  - gzip, deflate
14
14
  User-Agent:
15
- - Ruby
15
+ - rest-client/2.0.2 (darwin x86_64) jruby/9.1.5.0 (2.3.1p0)
16
+ Accept-Language:
17
+ - en_US,en
18
+ Host:
19
+ - localhost:8150
16
20
  response:
17
21
  status:
18
22
  code: 200
@@ -23,109 +27,16 @@ http_interactions:
23
27
  X-Content-Type-Options:
24
28
  - nosniff
25
29
  Content-Type:
26
- - application/json;charset=utf-8
27
- Content-Length:
28
- - '5650'
29
- Date:
30
- - Mon, 09 Mar 2015 19:54:12 GMT
31
- body:
32
- encoding: US-ASCII
33
- string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"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
- http_version:
35
- recorded_at: Mon, 09 Mar 2015 19:54:12 GMT
36
- - request:
37
- method: get
38
- uri: http://localhost:8150/api/commands/update-tag-rule
39
- body:
40
- encoding: US-ASCII
41
- string: ''
42
- headers:
43
- Accept:
44
30
  - 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.16.1-18-gd3acc7a-dirty"'
58
- X-Content-Type-Options:
59
- - nosniff
60
- Content-Type:
61
- - application/json;charset=utf-8
62
31
  Content-Length:
63
- - '4691'
32
+ - '7110'
64
33
  Date:
65
- - Mon, 09 Mar 2015 19:54:12 GMT
34
+ - Mon, 23 Apr 2018 19:48:08 GMT
66
35
  body:
67
- encoding: US-ASCII
68
- string: '{"name":"update-tag-rule","help":{"summary":"Update the matching rule
69
- for an existing tag","description":"This will change the rule of the given
70
- tag to the new rule. The tag will be\nreevaluated against all nodes and each
71
- node''s tag attribute will be updated to\nreflect whether the tag now matches
72
- or not, i.e., the tag will be added\nto/removed from each node''s tag as appropriate.\n\nIf
73
- the tag is used by any policies, the update will only be performed if the\noptional
74
- parameter `force` is set to `true`. Otherwise, it will fail.","schema":"#
75
- Access Control\n\nThis command''s access control pattern: `commands:update-tag-rule:%{name}`\n\nWords
76
- surrounded by `%{...}` are substitutions from the input data: typically\nthe
77
- name of the object being modified, or some other critical detail, these\nallow
78
- roles to be granted partial access to modify the system.\n\nFor more detail
79
- on how the permission strings are structured and work, you can\nsee the [Shiro
80
- Permissions documentation][shiro]. That pattern is expanded\nand then a permission
81
- check applied to it, before the command is authorized.\n\nThese checks only
82
- apply if security is enabled in the Razor configuration\nfile; on this server
83
- security is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
84
- Attributes\n\n * name\n - The tag for which to change the rule.\n - This
85
- attribute is required.\n - It must be of type string.\n - It must match
86
- the name of an existing tag.\n\n * rule\n - The new rule to apply to the
87
- tag.\n - This attribute is required.\n - It must be of type array.\n\n
88
- * force\n - By default this command will fail if the tag is in use by an
89
- existing\n policy. This flag allows you to override that, and force the
90
- change to\n apply despite the tag being in use.\n \n This will
91
- not change policy binding of nodes, which may lead to some\n counter-intuitive
92
- results such as a node that does *not* match policy\n tags being bound
93
- to the policy.\n - It must be of type boolean.\n","examples":{"api":"An
94
- example of updating a tag rule, and forcing reevaluation:\n\n{\n \"name\":
95
- \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
96
- true\n}","cli":"An example of updating a tag rule, and forcing reevaluation:\n\nrazor
97
- update-tag-rule --name small --force \\\n --rule ''[\"<=\", [\"fact\",
98
- \"processorcount\"], \"2\"]''"},"full":"# SYNOPSIS\nUpdate the matching rule
99
- for an existing tag\n\n# DESCRIPTION\nThis will change the rule of the given
100
- tag to the new rule. The tag will be\nreevaluated against all nodes and each
101
- node''s tag attribute will be updated to\nreflect whether the tag now matches
102
- or not, i.e., the tag will be added\nto/removed from each node''s tag as appropriate.\n\nIf
103
- the tag is used by any policies, the update will only be performed if the\noptional
104
- parameter `force` is set to `true`. Otherwise, it will fail.\n# Access Control\n\nThis
105
- command''s access control pattern: `commands:update-tag-rule:%{name}`\n\nWords
106
- surrounded by `%{...}` are substitutions from the input data: typically\nthe
107
- name of the object being modified, or some other critical detail, these\nallow
108
- roles to be granted partial access to modify the system.\n\nFor more detail
109
- on how the permission strings are structured and work, you can\nsee the [Shiro
110
- Permissions documentation][shiro]. That pattern is expanded\nand then a permission
111
- check applied to it, before the command is authorized.\n\nThese checks only
112
- apply if security is enabled in the Razor configuration\nfile; on this server
113
- security is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
114
- Attributes\n\n * name\n - The tag for which to change the rule.\n - This
115
- attribute is required.\n - It must be of type string.\n - It must match
116
- the name of an existing tag.\n\n * rule\n - The new rule to apply to the
117
- tag.\n - This attribute is required.\n - It must be of type array.\n\n
118
- * force\n - By default this command will fail if the tag is in use by an
119
- existing\n policy. This flag allows you to override that, and force the
120
- change to\n apply despite the tag being in use.\n \n This will
121
- not change policy binding of nodes, which may lead to some\n counter-intuitive
122
- results such as a node that does *not* match policy\n tags being bound
123
- to the policy.\n - It must be of type boolean.\n\n# EXAMPLES\n\n An example
124
- of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
125
- \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
126
- true\n }\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
36
+ encoding: UTF-8
37
+ string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"run-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/run-hook","id":"http://localhost:8150/api/commands/run-hook"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8150/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8150/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8150/api/commands/set-node-ipmi-credentials"},{"name":"update-broker-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-broker-configuration","id":"http://localhost:8150/api/commands/update-broker-configuration"},{"name":"update-hook-configuration","rel":"http://api.puppetlabs.com/razor/v1/commands/update-hook-configuration","id":"http://localhost:8150/api/commands/update-hook-configuration"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"name":"update-policy-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-broker","id":"http://localhost:8150/api/commands/update-policy-broker"},{"name":"update-policy-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-node-metadata","id":"http://localhost:8150/api/commands/update-policy-node-metadata"},{"name":"update-policy-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-repo","id":"http://localhost:8150/api/commands/update-policy-repo"},{"name":"update-policy-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-policy-task","id":"http://localhost:8150/api/commands/update-policy-task"},{"name":"update-repo-task","rel":"http://api.puppetlabs.com/razor/v1/commands/update-repo-task","id":"http://localhost:8150/api/commands/update-repo-task"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8150/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8150/api/collections/brokers"},{"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"},{"name":"config","rel":"http://api.puppetlabs.com/razor/v1/collections/config","id":"http://localhost:8150/api/collections/config"}],"version":{"server":"v1.8.0-dirty"}}'
127
38
  http_version:
128
- recorded_at: Mon, 09 Mar 2015 19:54:12 GMT
39
+ recorded_at: Mon, 23 Apr 2018 19:48:08 GMT
129
40
  - request:
130
41
  method: get
131
42
  uri: http://localhost:8150/api/commands/update-tag-rule
@@ -138,7 +49,11 @@ http_interactions:
138
49
  Accept-Encoding:
139
50
  - gzip, deflate
140
51
  User-Agent:
141
- - Ruby
52
+ - rest-client/2.0.2 (darwin x86_64) jruby/9.1.5.0 (2.3.1p0)
53
+ Accept-Language:
54
+ - en_US,en
55
+ Host:
56
+ - localhost:8150
142
57
  response:
143
58
  status:
144
59
  code: 200
@@ -147,17 +62,17 @@ http_interactions:
147
62
  Server:
148
63
  - Apache-Coyote/1.1
149
64
  Etag:
150
- - '"server-version-v0.16.1-18-gd3acc7a-dirty"'
65
+ - '"server-version-v1.8.0-dirty"'
151
66
  X-Content-Type-Options:
152
67
  - nosniff
153
68
  Content-Type:
154
- - application/json;charset=utf-8
69
+ - application/json
155
70
  Content-Length:
156
- - '4691'
71
+ - '5021'
157
72
  Date:
158
- - Mon, 09 Mar 2015 19:54:12 GMT
73
+ - Mon, 23 Apr 2018 19:48:08 GMT
159
74
  body:
160
- encoding: US-ASCII
75
+ encoding: UTF-8
161
76
  string: '{"name":"update-tag-rule","help":{"summary":"Update the matching rule
162
77
  for an existing tag","description":"This will change the rule of the given
163
78
  tag to the new rule. The tag will be\nreevaluated against all nodes and each
@@ -176,23 +91,26 @@ http_interactions:
176
91
  security is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
177
92
  Attributes\n\n * name\n - The tag for which to change the rule.\n - This
178
93
  attribute is required.\n - It must be of type string.\n - It must match
179
- the name of an existing tag.\n\n * rule\n - The new rule to apply to the
180
- tag.\n - This attribute is required.\n - It must be of type array.\n\n
181
- * force\n - By default this command will fail if the tag is in use by an
182
- existing\n policy. This flag allows you to override that, and force the
183
- change to\n apply despite the tag being in use.\n \n This will
184
- not change policy binding of nodes, which may lead to some\n counter-intuitive
185
- results such as a node that does *not* match policy\n tags being bound
186
- to the policy.\n - It must be of type boolean.\n","examples":{"api":"An
187
- example of updating a tag rule, and forcing reevaluation:\n\n{\n \"name\":
188
- \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
189
- true\n}","cli":"An example of updating a tag rule, and forcing reevaluation:\n\nrazor
190
- update-tag-rule --name small --force \\\n --rule ''[\"<=\", [\"fact\",
191
- \"processorcount\"], \"2\"]''"},"full":"# SYNOPSIS\nUpdate the matching rule
192
- for an existing tag\n\n# DESCRIPTION\nThis will change the rule of the given
193
- tag to the new rule. The tag will be\nreevaluated against all nodes and each
194
- node''s tag attribute will be updated to\nreflect whether the tag now matches
195
- or not, i.e., the tag will be added\nto/removed from each node''s tag as appropriate.\n\nIf
94
+ the name of an existing tag.\n - Its argument position is 0.\n\n * rule\n -
95
+ The new rule to apply to the tag.\n - This attribute is required.\n -
96
+ It must be of type array.\n - Its argument position is 1.\n\n * force\n -
97
+ By default this command will fail if the tag is in use by an existing\n policy. This
98
+ flag allows you to override that, and force the change to\n apply despite
99
+ the tag being in use.\n \n This will not change policy binding of
100
+ nodes, which may lead to some\n counter-intuitive results such as a node
101
+ that does *not* match policy\n tags being bound to the policy.\n - It
102
+ must be of type boolean.\n","examples":{"api":"An example of updating a tag
103
+ rule, and forcing reevaluation:\n\n{\n \"name\": \"small\",\n \"rule\":
104
+ [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\": true\n}","cli":"An
105
+ example of updating a tag rule, and forcing reevaluation:\n\n razor update-tag-rule
106
+ --name small --force \\\n --rule ''[\"<=\", [\"fact\", \"processorcount\"],
107
+ \"2\"]''\n\nWith positional arguments, this can be shortened:\n\n razor
108
+ update-tag-rule small ''[[\"<=\", [\"fact\", \"processorcount\"], \"2\"]]''
109
+ \\\n --force"},"full":"# SYNOPSIS\nUpdate the matching rule for an
110
+ existing tag\n\n# DESCRIPTION\nThis will change the rule of the given tag
111
+ to the new rule. The tag will be\nreevaluated against all nodes and each node''s
112
+ tag attribute will be updated to\nreflect whether the tag now matches or not,
113
+ i.e., the tag will be added\nto/removed from each node''s tag as appropriate.\n\nIf
196
114
  the tag is used by any policies, the update will only be performed if the\noptional
197
115
  parameter `force` is set to `true`. Otherwise, it will fail.\n# Access Control\n\nThis
198
116
  command''s access control pattern: `commands:update-tag-rule:%{name}`\n\nWords
@@ -206,17 +124,17 @@ http_interactions:
206
124
  security is currently disabled.\n\n[shiro]: http://shiro.apache.org/permissions.html\n\n#
207
125
  Attributes\n\n * name\n - The tag for which to change the rule.\n - This
208
126
  attribute is required.\n - It must be of type string.\n - It must match
209
- the name of an existing tag.\n\n * rule\n - The new rule to apply to the
210
- tag.\n - This attribute is required.\n - It must be of type array.\n\n
211
- * force\n - By default this command will fail if the tag is in use by an
212
- existing\n policy. This flag allows you to override that, and force the
213
- change to\n apply despite the tag being in use.\n \n This will
214
- not change policy binding of nodes, which may lead to some\n counter-intuitive
215
- results such as a node that does *not* match policy\n tags being bound
216
- to the policy.\n - It must be of type boolean.\n\n# EXAMPLES\n\n An example
217
- of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
218
- \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
219
- true\n }\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
127
+ the name of an existing tag.\n - Its argument position is 0.\n\n * rule\n -
128
+ The new rule to apply to the tag.\n - This attribute is required.\n -
129
+ It must be of type array.\n - Its argument position is 1.\n\n * force\n -
130
+ By default this command will fail if the tag is in use by an existing\n policy. This
131
+ flag allows you to override that, and force the change to\n apply despite
132
+ the tag being in use.\n \n This will not change policy binding of
133
+ nodes, which may lead to some\n counter-intuitive results such as a node
134
+ that does *not* match policy\n tags being bound to the policy.\n - It
135
+ must be of type boolean.\n\n# EXAMPLES\n\n An example of updating a tag rule,
136
+ and forcing reevaluation:\n \n {\n \"name\": \"small\",\n \"rule\":
137
+ [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\": true\n }\n"},"schema":{"name":{"type":"string","position":0},"rule":{"type":"array","position":1},"force":{"type":"boolean"}}}'
220
138
  http_version:
221
- recorded_at: Mon, 09 Mar 2015 19:54:12 GMT
222
- recorded_with: VCR 2.5.0
139
+ recorded_at: Mon, 23 Apr 2018 19:48:08 GMT
140
+ recorded_with: VCR 4.0.0