razor-client 0.15.1 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +7 -0
  2. data/NEWS.md +22 -0
  3. data/bin/razor +24 -0
  4. data/lib/razor/cli/command.rb +139 -0
  5. data/lib/razor/cli/document.rb +8 -4
  6. data/lib/razor/cli/format.rb +46 -22
  7. data/lib/razor/cli/navigate.rb +27 -149
  8. data/lib/razor/cli/parse.rb +21 -5
  9. data/lib/razor/cli/query.rb +68 -0
  10. data/lib/razor/cli/table_format.rb +41 -0
  11. data/lib/razor/cli/transforms.rb +18 -0
  12. data/lib/razor/cli/version.rb +1 -1
  13. data/lib/razor/cli/views.yaml +38 -0
  14. data/lib/razor/cli.rb +5 -2
  15. data/spec/cli/format_spec.rb +95 -5
  16. data/spec/cli/navigate_spec.rb +49 -5
  17. data/spec/cli/parse_spec.rb +21 -0
  18. data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_in_string.yml +322 -0
  19. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_--api_command_--help_.yml +110 -0
  20. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_--api_command_help_.yml +110 -0
  21. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_--api_help_command_.yml +110 -0
  22. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_--help_--api_command_.yml +110 -0
  23. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_-a_-h_command_.yml +110 -0
  24. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_API_command_help_for_razor_-a_command_-h_.yml +110 -0
  25. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_construct_a_json_object.yml +181 -49
  26. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_construct_a_json_object_with_unicode.yml +121 -46
  27. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_fail_with_mixed_types_array_then_hash_.yml +68 -65
  28. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_fail_with_mixed_types_hash_then_array_.yml +177 -45
  29. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_limit.yml +69 -0
  30. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_start.yml +69 -0
  31. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_not_fail_when_query_returns_details_for_one_item.yml +421 -0
  32. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_store_query_without_query_parameters.yml +773 -0
  33. 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
  34. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_throw_an_error_if_the_query_parameter_is_not_in_the_API_from_a_single_item.yml +388 -0
  35. metadata +94 -82
@@ -0,0 +1,110 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:8080/api
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '4975'
29
+ Date:
30
+ - Mon, 25 Aug 2014 20:56:56 GMT
31
+ body:
32
+ encoding: US-ASCII
33
+ string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8080/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8080/api/commands/create-broker"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8080/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8080/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8080/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8080/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8080/api/commands/delete-broker"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8080/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8080/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8080/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8080/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8080/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8080/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8080/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8080/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8080/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8080/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8080/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8080/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8080/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8080/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8080/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8080/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8080/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8080/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8080/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8080/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8080/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8080/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8080/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8080/api/collections/nodes"},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8080/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8080/api/collections/commands"}],"version":{"server":"v0.15.0-32-g1a997ad"}}'
34
+ http_version:
35
+ recorded_at: Mon, 25 Aug 2014 20:56:56 GMT
36
+ - request:
37
+ method: get
38
+ uri: http://localhost:8080/api/commands/update-tag-rule
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ Accept:
44
+ - application/json
45
+ Accept-Encoding:
46
+ - gzip, deflate
47
+ User-Agent:
48
+ - Ruby
49
+ response:
50
+ status:
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ Server:
55
+ - Apache-Coyote/1.1
56
+ Etag:
57
+ - '"server-version-v0.15.0-32-g1a997ad"'
58
+ X-Content-Type-Options:
59
+ - nosniff
60
+ Content-Type:
61
+ - application/json;charset=utf-8
62
+ Content-Length:
63
+ - '3255'
64
+ Date:
65
+ - Mon, 25 Aug 2014 20:56:56 GMT
66
+ 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":"\n#
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 --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#<Razor::Validation::HashSchema:0x110c667>\n#
105
+ EXAMPLES\n\n An example of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
106
+ \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
107
+ true\n }\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
108
+ http_version:
109
+ recorded_at: Mon, 25 Aug 2014 20:56:56 GMT
110
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,110 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:8080/api
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '4975'
29
+ Date:
30
+ - Mon, 25 Aug 2014 20:56:50 GMT
31
+ body:
32
+ encoding: US-ASCII
33
+ string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8080/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8080/api/commands/create-broker"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8080/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8080/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8080/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8080/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8080/api/commands/delete-broker"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8080/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8080/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8080/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8080/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8080/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8080/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8080/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8080/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8080/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8080/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8080/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8080/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8080/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8080/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8080/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8080/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8080/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8080/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8080/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8080/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8080/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8080/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8080/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8080/api/collections/nodes"},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8080/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8080/api/collections/commands"}],"version":{"server":"v0.15.0-32-g1a997ad"}}'
34
+ http_version:
35
+ recorded_at: Mon, 25 Aug 2014 20:56:50 GMT
36
+ - request:
37
+ method: get
38
+ uri: http://localhost:8080/api/commands/update-tag-rule
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ Accept:
44
+ - application/json
45
+ Accept-Encoding:
46
+ - gzip, deflate
47
+ User-Agent:
48
+ - Ruby
49
+ response:
50
+ status:
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ Server:
55
+ - Apache-Coyote/1.1
56
+ Etag:
57
+ - '"server-version-v0.15.0-32-g1a997ad"'
58
+ X-Content-Type-Options:
59
+ - nosniff
60
+ Content-Type:
61
+ - application/json;charset=utf-8
62
+ Content-Length:
63
+ - '3255'
64
+ Date:
65
+ - Mon, 25 Aug 2014 20:56:50 GMT
66
+ 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":"\n#
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 --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#<Razor::Validation::HashSchema:0x110c667>\n#
105
+ EXAMPLES\n\n An example of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
106
+ \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
107
+ true\n }\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
108
+ http_version:
109
+ recorded_at: Mon, 25 Aug 2014 20:56:50 GMT
110
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,110 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:8080/api
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '4975'
29
+ Date:
30
+ - Mon, 25 Aug 2014 20:56:37 GMT
31
+ body:
32
+ encoding: US-ASCII
33
+ string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8080/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8080/api/commands/create-broker"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8080/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8080/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8080/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8080/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8080/api/commands/delete-broker"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8080/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8080/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8080/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8080/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8080/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8080/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8080/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8080/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8080/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8080/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8080/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8080/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8080/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8080/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8080/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8080/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8080/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8080/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8080/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8080/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8080/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8080/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8080/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8080/api/collections/nodes"},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8080/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8080/api/collections/commands"}],"version":{"server":"v0.15.0-32-g1a997ad"}}'
34
+ http_version:
35
+ recorded_at: Mon, 25 Aug 2014 20:56:37 GMT
36
+ - request:
37
+ method: get
38
+ uri: http://localhost:8080/api/commands/update-tag-rule
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ Accept:
44
+ - application/json
45
+ Accept-Encoding:
46
+ - gzip, deflate
47
+ User-Agent:
48
+ - Ruby
49
+ response:
50
+ status:
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ Server:
55
+ - Apache-Coyote/1.1
56
+ Etag:
57
+ - '"server-version-v0.15.0-32-g1a997ad"'
58
+ X-Content-Type-Options:
59
+ - nosniff
60
+ Content-Type:
61
+ - application/json;charset=utf-8
62
+ Content-Length:
63
+ - '3255'
64
+ Date:
65
+ - Mon, 25 Aug 2014 20:56:37 GMT
66
+ 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":"\n#
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 --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#<Razor::Validation::HashSchema:0x110c667>\n#
105
+ EXAMPLES\n\n An example of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
106
+ \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
107
+ true\n }\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
108
+ http_version:
109
+ recorded_at: Mon, 25 Aug 2014 20:56:37 GMT
110
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,110 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:8080/api
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '4975'
29
+ Date:
30
+ - Mon, 25 Aug 2014 20:56:43 GMT
31
+ body:
32
+ encoding: US-ASCII
33
+ string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8080/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8080/api/commands/create-broker"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8080/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8080/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8080/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8080/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8080/api/commands/delete-broker"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8080/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8080/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8080/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8080/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8080/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8080/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8080/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8080/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8080/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8080/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8080/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8080/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8080/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8080/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8080/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8080/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8080/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8080/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8080/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8080/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8080/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8080/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8080/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8080/api/collections/nodes"},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8080/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8080/api/collections/commands"}],"version":{"server":"v0.15.0-32-g1a997ad"}}'
34
+ http_version:
35
+ recorded_at: Mon, 25 Aug 2014 20:56:43 GMT
36
+ - request:
37
+ method: get
38
+ uri: http://localhost:8080/api/commands/update-tag-rule
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ Accept:
44
+ - application/json
45
+ Accept-Encoding:
46
+ - gzip, deflate
47
+ User-Agent:
48
+ - Ruby
49
+ response:
50
+ status:
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ Server:
55
+ - Apache-Coyote/1.1
56
+ Etag:
57
+ - '"server-version-v0.15.0-32-g1a997ad"'
58
+ X-Content-Type-Options:
59
+ - nosniff
60
+ Content-Type:
61
+ - application/json;charset=utf-8
62
+ Content-Length:
63
+ - '3255'
64
+ Date:
65
+ - Mon, 25 Aug 2014 20:56:43 GMT
66
+ 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":"\n#
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 --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#<Razor::Validation::HashSchema:0x110c667>\n#
105
+ EXAMPLES\n\n An example of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
106
+ \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
107
+ true\n }\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
108
+ http_version:
109
+ recorded_at: Mon, 25 Aug 2014 20:56:43 GMT
110
+ recorded_with: VCR 2.9.2
@@ -0,0 +1,110 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:8080/api
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json
12
+ Accept-Encoding:
13
+ - gzip, deflate
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ X-Content-Type-Options:
24
+ - nosniff
25
+ Content-Type:
26
+ - application/json;charset=utf-8
27
+ Content-Length:
28
+ - '4975'
29
+ Date:
30
+ - Mon, 25 Aug 2014 20:56:31 GMT
31
+ body:
32
+ encoding: US-ASCII
33
+ string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8080/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8080/api/commands/create-broker"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8080/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8080/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8080/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8080/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8080/api/commands/delete-broker"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8080/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8080/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8080/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8080/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8080/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8080/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8080/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8080/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8080/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8080/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8080/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8080/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8080/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8080/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8080/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8080/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8080/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8080/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8080/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8080/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8080/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8080/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8080/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8080/api/collections/nodes"},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8080/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8080/api/collections/commands"}],"version":{"server":"v0.15.0-32-g1a997ad"}}'
34
+ http_version:
35
+ recorded_at: Mon, 25 Aug 2014 20:56:31 GMT
36
+ - request:
37
+ method: get
38
+ uri: http://localhost:8080/api/commands/update-tag-rule
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ Accept:
44
+ - application/json
45
+ Accept-Encoding:
46
+ - gzip, deflate
47
+ User-Agent:
48
+ - Ruby
49
+ response:
50
+ status:
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ Server:
55
+ - Apache-Coyote/1.1
56
+ Etag:
57
+ - '"server-version-v0.15.0-32-g1a997ad"'
58
+ X-Content-Type-Options:
59
+ - nosniff
60
+ Content-Type:
61
+ - application/json;charset=utf-8
62
+ Content-Length:
63
+ - '3255'
64
+ Date:
65
+ - Mon, 25 Aug 2014 20:56:31 GMT
66
+ 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":"\n#
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 --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#<Razor::Validation::HashSchema:0x110c667>\n#
105
+ EXAMPLES\n\n An example of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
106
+ \"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
107
+ true\n }\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
108
+ http_version:
109
+ recorded_at: Mon, 25 Aug 2014 20:56:31 GMT
110
+ recorded_with: VCR 2.9.2