pe-razor-client 0.14.0 → 0.15.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +25 -0
- data/bin/razor +9 -4
- data/lib/razor/cli.rb +10 -0
- data/lib/razor/cli/document.rb +59 -0
- data/lib/razor/cli/format.rb +81 -20
- data/lib/razor/cli/navigate.rb +121 -27
- data/lib/razor/cli/parse.rb +83 -10
- data/lib/razor/cli/transforms.rb +42 -0
- data/lib/razor/cli/version.rb +46 -0
- data/lib/razor/cli/views.rb +25 -0
- data/lib/razor/cli/views.yaml +196 -0
- data/spec/cli/format_spec.rb +99 -0
- data/spec/cli/navigate_spec.rb +111 -2
- data/spec/cli/parse_spec.rb +20 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_spaces.yml +966 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_--help_command_.yml +99 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_-h_command_.yml +99 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_--help_.yml +99 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_-h_.yml +99 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_help_.yml +99 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_help_command_.yml +99 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_preserve_that_across_navigation.yml +9 -42
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_supply_that_to_the_API_service.yml +5 -5
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_invalid_parameter/should_fail_with_bad_JSON.yml +228 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_invalid_parameter/should_fail_with_malformed_argument.yml +120 -0
- 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 +2006 -0
- 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 +2006 -0
- 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 +2006 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_construct_a_json_object.yml +234 -0
- 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 +412 -0
- 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 +228 -0
- 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 +164 -0
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_no_parameters/should_fail_with_bad_JSON.yml +36 -0
- data/spec/fixtures/vcr/Razor_CLI_Parse/_new/_help/should_print_a_list_of_known_endpoints.yml +5 -5
- data/spec/spec_helper.rb +12 -1
- data/spec/testing.md +16 -0
- data/spec/version_spec.rb +8 -0
- metadata +67 -60
- data/.gitignore +0 -7
- data/.yardopts +0 -2
- data/Gemfile +0 -35
- data/Gemfile.lock +0 -53
- data/Rakefile +0 -37
- data/lib/razor/cli/navigate.yaml +0 -28
- data/pe-razor-client.gemspec +0 -32
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_a_single_item_path/.yml +0 -69
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_an_invalid_path/.yml +0 -36
- data/spec/fixtures/vcr/Razor_CLI_Navigate/with_no_path/.yml +0 -36
- data/spec/fixtures/vcr/Razor_CLI_Parse/_new/_help/.yml +0 -36
@@ -0,0 +1,99 @@
|
|
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
|
+
- '4982'
|
29
|
+
Date:
|
30
|
+
- Fri, 16 May 2014 21:36: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.14.1-113-g8b33d83-dirty"}}'
|
34
|
+
http_version:
|
35
|
+
recorded_at: Fri, 16 May 2014 21:36: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.14.1-113-g8b33d83-dirty"'
|
58
|
+
X-Content-Type-Options:
|
59
|
+
- nosniff
|
60
|
+
Content-Type:
|
61
|
+
- application/json;charset=utf-8
|
62
|
+
Content-Length:
|
63
|
+
- '2307'
|
64
|
+
Date:
|
65
|
+
- Fri, 16 May 2014 21:36:31 GMT
|
66
|
+
body:
|
67
|
+
encoding: US-ASCII
|
68
|
+
string: '{"name":"update-tag-rule","help":{"full":"# SYNOPSIS\nUpdate the matching
|
69
|
+
rule for an existing tag\n\n# DESCRIPTION\nThis will change the rule of the
|
70
|
+
given tag to the new rule. The tag will be\nreevaluated against all nodes
|
71
|
+
and each node''s tag attribute will be updated to\nreflect whether the tag
|
72
|
+
now matches or not, i.e., the tag will be added\nto/removed from each node''s
|
73
|
+
tag as appropriate.\n\nIf the tag is used by any policies, the update will
|
74
|
+
only be performed if the\noptional parameter `force` is set to `true`. Otherwise,
|
75
|
+
it will fail.\n\n\n# Access Control\n\nThis command''s access control pattern:
|
76
|
+
`commands:update-tag-rule:%{name}`\n\nWords surrounded by `%{...}` are substitutions
|
77
|
+
from the input data: typically\nthe name of the object being modified, or
|
78
|
+
some other critical detail, these\nallow roles to be granted partial access
|
79
|
+
to modify the system.\n\nFor more detail on how the permission strings are
|
80
|
+
structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
81
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
82
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
83
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
84
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
85
|
+
The tag to change the rule of\n - This attribute is required\n - It must
|
86
|
+
be of type string.\n - It must match the name of an existing tag.\n\n *
|
87
|
+
rule\n - The new rule to apply to the tag\n - This attribute is required\n -
|
88
|
+
It must be of type array.\n\n * force\n - By default this command will fail
|
89
|
+
if the tag is in use by an existing\n policy. This flag allows you to override
|
90
|
+
that, and force the change to\n apply despite the tag being in use.\n \n This
|
91
|
+
will 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 to
|
93
|
+
the policy.\n - It must be of type boolean.\n\n\n\n# EXAMPLES\n An example
|
94
|
+
of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
|
95
|
+
\"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
|
96
|
+
true\n }\n\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
|
97
|
+
http_version:
|
98
|
+
recorded_at: Fri, 16 May 2014 21:36:31 GMT
|
99
|
+
recorded_with: VCR 2.5.0
|
@@ -0,0 +1,99 @@
|
|
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
|
+
- '4982'
|
29
|
+
Date:
|
30
|
+
- Fri, 16 May 2014 21:36:36 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.14.1-113-g8b33d83-dirty"}}'
|
34
|
+
http_version:
|
35
|
+
recorded_at: Fri, 16 May 2014 21:36:36 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.14.1-113-g8b33d83-dirty"'
|
58
|
+
X-Content-Type-Options:
|
59
|
+
- nosniff
|
60
|
+
Content-Type:
|
61
|
+
- application/json;charset=utf-8
|
62
|
+
Content-Length:
|
63
|
+
- '2307'
|
64
|
+
Date:
|
65
|
+
- Fri, 16 May 2014 21:36:36 GMT
|
66
|
+
body:
|
67
|
+
encoding: US-ASCII
|
68
|
+
string: '{"name":"update-tag-rule","help":{"full":"# SYNOPSIS\nUpdate the matching
|
69
|
+
rule for an existing tag\n\n# DESCRIPTION\nThis will change the rule of the
|
70
|
+
given tag to the new rule. The tag will be\nreevaluated against all nodes
|
71
|
+
and each node''s tag attribute will be updated to\nreflect whether the tag
|
72
|
+
now matches or not, i.e., the tag will be added\nto/removed from each node''s
|
73
|
+
tag as appropriate.\n\nIf the tag is used by any policies, the update will
|
74
|
+
only be performed if the\noptional parameter `force` is set to `true`. Otherwise,
|
75
|
+
it will fail.\n\n\n# Access Control\n\nThis command''s access control pattern:
|
76
|
+
`commands:update-tag-rule:%{name}`\n\nWords surrounded by `%{...}` are substitutions
|
77
|
+
from the input data: typically\nthe name of the object being modified, or
|
78
|
+
some other critical detail, these\nallow roles to be granted partial access
|
79
|
+
to modify the system.\n\nFor more detail on how the permission strings are
|
80
|
+
structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
81
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
82
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
83
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
84
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
85
|
+
The tag to change the rule of\n - This attribute is required\n - It must
|
86
|
+
be of type string.\n - It must match the name of an existing tag.\n\n *
|
87
|
+
rule\n - The new rule to apply to the tag\n - This attribute is required\n -
|
88
|
+
It must be of type array.\n\n * force\n - By default this command will fail
|
89
|
+
if the tag is in use by an existing\n policy. This flag allows you to override
|
90
|
+
that, and force the change to\n apply despite the tag being in use.\n \n This
|
91
|
+
will 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 to
|
93
|
+
the policy.\n - It must be of type boolean.\n\n\n\n# EXAMPLES\n An example
|
94
|
+
of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
|
95
|
+
\"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
|
96
|
+
true\n }\n\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
|
97
|
+
http_version:
|
98
|
+
recorded_at: Fri, 16 May 2014 21:36:36 GMT
|
99
|
+
recorded_with: VCR 2.5.0
|
@@ -0,0 +1,99 @@
|
|
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
|
+
- '4982'
|
29
|
+
Date:
|
30
|
+
- Fri, 16 May 2014 21:36:21 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.14.1-113-g8b33d83-dirty"}}'
|
34
|
+
http_version:
|
35
|
+
recorded_at: Fri, 16 May 2014 21:36:21 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.14.1-113-g8b33d83-dirty"'
|
58
|
+
X-Content-Type-Options:
|
59
|
+
- nosniff
|
60
|
+
Content-Type:
|
61
|
+
- application/json;charset=utf-8
|
62
|
+
Content-Length:
|
63
|
+
- '2307'
|
64
|
+
Date:
|
65
|
+
- Fri, 16 May 2014 21:36:21 GMT
|
66
|
+
body:
|
67
|
+
encoding: US-ASCII
|
68
|
+
string: '{"name":"update-tag-rule","help":{"full":"# SYNOPSIS\nUpdate the matching
|
69
|
+
rule for an existing tag\n\n# DESCRIPTION\nThis will change the rule of the
|
70
|
+
given tag to the new rule. The tag will be\nreevaluated against all nodes
|
71
|
+
and each node''s tag attribute will be updated to\nreflect whether the tag
|
72
|
+
now matches or not, i.e., the tag will be added\nto/removed from each node''s
|
73
|
+
tag as appropriate.\n\nIf the tag is used by any policies, the update will
|
74
|
+
only be performed if the\noptional parameter `force` is set to `true`. Otherwise,
|
75
|
+
it will fail.\n\n\n# Access Control\n\nThis command''s access control pattern:
|
76
|
+
`commands:update-tag-rule:%{name}`\n\nWords surrounded by `%{...}` are substitutions
|
77
|
+
from the input data: typically\nthe name of the object being modified, or
|
78
|
+
some other critical detail, these\nallow roles to be granted partial access
|
79
|
+
to modify the system.\n\nFor more detail on how the permission strings are
|
80
|
+
structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
81
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
82
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
83
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
84
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
85
|
+
The tag to change the rule of\n - This attribute is required\n - It must
|
86
|
+
be of type string.\n - It must match the name of an existing tag.\n\n *
|
87
|
+
rule\n - The new rule to apply to the tag\n - This attribute is required\n -
|
88
|
+
It must be of type array.\n\n * force\n - By default this command will fail
|
89
|
+
if the tag is in use by an existing\n policy. This flag allows you to override
|
90
|
+
that, and force the change to\n apply despite the tag being in use.\n \n This
|
91
|
+
will 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 to
|
93
|
+
the policy.\n - It must be of type boolean.\n\n\n\n# EXAMPLES\n An example
|
94
|
+
of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
|
95
|
+
\"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
|
96
|
+
true\n }\n\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
|
97
|
+
http_version:
|
98
|
+
recorded_at: Fri, 16 May 2014 21:36:21 GMT
|
99
|
+
recorded_with: VCR 2.5.0
|
@@ -0,0 +1,99 @@
|
|
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
|
+
- '4982'
|
29
|
+
Date:
|
30
|
+
- Fri, 16 May 2014 21:36:26 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.14.1-113-g8b33d83-dirty"}}'
|
34
|
+
http_version:
|
35
|
+
recorded_at: Fri, 16 May 2014 21:36:26 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.14.1-113-g8b33d83-dirty"'
|
58
|
+
X-Content-Type-Options:
|
59
|
+
- nosniff
|
60
|
+
Content-Type:
|
61
|
+
- application/json;charset=utf-8
|
62
|
+
Content-Length:
|
63
|
+
- '2307'
|
64
|
+
Date:
|
65
|
+
- Fri, 16 May 2014 21:36:26 GMT
|
66
|
+
body:
|
67
|
+
encoding: US-ASCII
|
68
|
+
string: '{"name":"update-tag-rule","help":{"full":"# SYNOPSIS\nUpdate the matching
|
69
|
+
rule for an existing tag\n\n# DESCRIPTION\nThis will change the rule of the
|
70
|
+
given tag to the new rule. The tag will be\nreevaluated against all nodes
|
71
|
+
and each node''s tag attribute will be updated to\nreflect whether the tag
|
72
|
+
now matches or not, i.e., the tag will be added\nto/removed from each node''s
|
73
|
+
tag as appropriate.\n\nIf the tag is used by any policies, the update will
|
74
|
+
only be performed if the\noptional parameter `force` is set to `true`. Otherwise,
|
75
|
+
it will fail.\n\n\n# Access Control\n\nThis command''s access control pattern:
|
76
|
+
`commands:update-tag-rule:%{name}`\n\nWords surrounded by `%{...}` are substitutions
|
77
|
+
from the input data: typically\nthe name of the object being modified, or
|
78
|
+
some other critical detail, these\nallow roles to be granted partial access
|
79
|
+
to modify the system.\n\nFor more detail on how the permission strings are
|
80
|
+
structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
81
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
82
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
83
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
84
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
85
|
+
The tag to change the rule of\n - This attribute is required\n - It must
|
86
|
+
be of type string.\n - It must match the name of an existing tag.\n\n *
|
87
|
+
rule\n - The new rule to apply to the tag\n - This attribute is required\n -
|
88
|
+
It must be of type array.\n\n * force\n - By default this command will fail
|
89
|
+
if the tag is in use by an existing\n policy. This flag allows you to override
|
90
|
+
that, and force the change to\n apply despite the tag being in use.\n \n This
|
91
|
+
will 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 to
|
93
|
+
the policy.\n - It must be of type boolean.\n\n\n\n# EXAMPLES\n An example
|
94
|
+
of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
|
95
|
+
\"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
|
96
|
+
true\n }\n\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
|
97
|
+
http_version:
|
98
|
+
recorded_at: Fri, 16 May 2014 21:36:26 GMT
|
99
|
+
recorded_with: VCR 2.5.0
|
@@ -0,0 +1,99 @@
|
|
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
|
+
- '4982'
|
29
|
+
Date:
|
30
|
+
- Fri, 16 May 2014 21:36:47 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.14.1-113-g8b33d83-dirty"}}'
|
34
|
+
http_version:
|
35
|
+
recorded_at: Fri, 16 May 2014 21:36:47 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.14.1-113-g8b33d83-dirty"'
|
58
|
+
X-Content-Type-Options:
|
59
|
+
- nosniff
|
60
|
+
Content-Type:
|
61
|
+
- application/json;charset=utf-8
|
62
|
+
Content-Length:
|
63
|
+
- '2307'
|
64
|
+
Date:
|
65
|
+
- Fri, 16 May 2014 21:36:47 GMT
|
66
|
+
body:
|
67
|
+
encoding: US-ASCII
|
68
|
+
string: '{"name":"update-tag-rule","help":{"full":"# SYNOPSIS\nUpdate the matching
|
69
|
+
rule for an existing tag\n\n# DESCRIPTION\nThis will change the rule of the
|
70
|
+
given tag to the new rule. The tag will be\nreevaluated against all nodes
|
71
|
+
and each node''s tag attribute will be updated to\nreflect whether the tag
|
72
|
+
now matches or not, i.e., the tag will be added\nto/removed from each node''s
|
73
|
+
tag as appropriate.\n\nIf the tag is used by any policies, the update will
|
74
|
+
only be performed if the\noptional parameter `force` is set to `true`. Otherwise,
|
75
|
+
it will fail.\n\n\n# Access Control\n\nThis command''s access control pattern:
|
76
|
+
`commands:update-tag-rule:%{name}`\n\nWords surrounded by `%{...}` are substitutions
|
77
|
+
from the input data: typically\nthe name of the object being modified, or
|
78
|
+
some other critical detail, these\nallow roles to be granted partial access
|
79
|
+
to modify the system.\n\nFor more detail on how the permission strings are
|
80
|
+
structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
81
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
82
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
83
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
84
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
85
|
+
The tag to change the rule of\n - This attribute is required\n - It must
|
86
|
+
be of type string.\n - It must match the name of an existing tag.\n\n *
|
87
|
+
rule\n - The new rule to apply to the tag\n - This attribute is required\n -
|
88
|
+
It must be of type array.\n\n * force\n - By default this command will fail
|
89
|
+
if the tag is in use by an existing\n policy. This flag allows you to override
|
90
|
+
that, and force the change to\n apply despite the tag being in use.\n \n This
|
91
|
+
will 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 to
|
93
|
+
the policy.\n - It must be of type boolean.\n\n\n\n# EXAMPLES\n An example
|
94
|
+
of updating a tag rule, and forcing reevaluation:\n \n {\n \"name\":
|
95
|
+
\"small\",\n \"rule\": [\"<=\", [\"fact\", \"processorcount\"], \"2\"],\n \"force\":
|
96
|
+
true\n }\n\n"},"schema":{"name":{"type":"string"},"rule":{"type":"array"},"force":{"type":"boolean"}}}'
|
97
|
+
http_version:
|
98
|
+
recorded_at: Fri, 16 May 2014 21:36:47 GMT
|
99
|
+
recorded_with: VCR 2.5.0
|