pe-razor-client 0.15.2.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/NEWS.md +27 -0
  3. data/bin/razor +27 -2
  4. data/lib/razor/cli.rb +11 -2
  5. data/lib/razor/cli/command.rb +150 -0
  6. data/lib/razor/cli/document.rb +8 -4
  7. data/lib/razor/cli/format.rb +46 -22
  8. data/lib/razor/cli/navigate.rb +28 -156
  9. data/lib/razor/cli/parse.rb +49 -7
  10. data/lib/razor/cli/query.rb +69 -0
  11. data/lib/razor/cli/table_format.rb +41 -0
  12. data/lib/razor/cli/transforms.rb +25 -0
  13. data/lib/razor/cli/version.rb +1 -1
  14. data/lib/razor/cli/views.yaml +53 -2
  15. data/spec/cli/command_spec.rb +66 -0
  16. data/spec/cli/format_spec.rb +95 -5
  17. data/spec/cli/navigate_spec.rb +50 -6
  18. data/spec/cli/parse_spec.rb +42 -2
  19. data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_in_string.yml +233 -0
  20. data/spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_spaces.yml +281 -548
  21. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_--help_command_.yml +160 -37
  22. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_-h_command_.yml +160 -37
  23. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_--help_.yml +160 -37
  24. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_-h_.yml +160 -37
  25. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_command_help_.yml +160 -37
  26. data/spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_help_command_.yml +160 -37
  27. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_preserve_that_across_navigation.yml +10 -10
  28. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_authentication/should_supply_that_to_the_API_service.yml +5 -5
  29. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_invalid_parameter/should_fail_with_bad_JSON.yml +71 -166
  30. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_invalid_parameter/should_fail_with_malformed_argument.yml +109 -59
  31. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_array/should_merge_an_array_into_an_existing_array.yml +527 -1360
  32. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_array/should_merge_the_arguments_as_an_array.yml +528 -1361
  33. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_array/should_merge_the_arguments_into_an_existing_array.yml +528 -1361
  34. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_construct_a_json_object.yml +80 -111
  35. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_construct_a_json_object_with_unicode.yml +137 -123
  36. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_fail_with_mixed_types_array_then_hash_.yml +71 -166
  37. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_multiple_arguments_with_same_name/combining_as_an_object/should_fail_with_mixed_types_hash_then_array_.yml +71 -102
  38. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_no_parameters/should_fail_with_bad_JSON.yml +98 -5
  39. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_limit.yml +69 -0
  40. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_start.yml +69 -0
  41. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_not_fail_when_query_returns_details_for_one_item.yml +313 -0
  42. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_store_query_without_query_parameters.yml +557 -0
  43. 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
  44. data/spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_throw_an_error_if_the_query_parameter_is_not_in_the_API_from_a_single_item.yml +280 -0
  45. data/spec/fixtures/vcr/Razor_CLI_Parse/_new/_help/should_print_a_list_of_known_endpoints.yml +5 -5
  46. data/spec/spec_helper.rb +8 -4
  47. metadata +26 -7
@@ -0,0 +1,36 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://fred:dead@localhost:8150/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
+ - '5650'
29
+ Date:
30
+ - Mon, 09 Mar 2015 19:55:07 GMT
31
+ body:
32
+ encoding: US-ASCII
33
+ string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8150/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8150/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8150/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8150/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8150/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8150/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8150/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8150/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8150/api/collections/nodes","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8150/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8150/api/collections/commands"},{"name":"events","rel":"http://api.puppetlabs.com/razor/v1/collections/events","id":"http://localhost:8150/api/collections/events","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8150/api/collections/hooks"}],"version":{"server":"v0.16.1-18-gd3acc7a-dirty"}}'
34
+ http_version:
35
+ recorded_at: Mon, 09 Mar 2015 19:55:07 GMT
36
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,280 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://localhost:8150/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
+ - '5650'
29
+ Date:
30
+ - Mon, 09 Mar 2015 19:55:18 GMT
31
+ body:
32
+ encoding: US-ASCII
33
+ string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8150/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8150/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8150/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8150/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8150/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8150/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8150/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8150/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8150/api/collections/nodes","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8150/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8150/api/collections/commands"},{"name":"events","rel":"http://api.puppetlabs.com/razor/v1/collections/events","id":"http://localhost:8150/api/collections/events","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8150/api/collections/hooks"}],"version":{"server":"v0.16.1-18-gd3acc7a-dirty"}}'
34
+ http_version:
35
+ recorded_at: Mon, 09 Mar 2015 19:55:18 GMT
36
+ - request:
37
+ method: get
38
+ uri: http://localhost:8150/api/commands/register-node
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ Accept:
44
+ - application/json
45
+ Accept-Encoding:
46
+ - gzip, deflate
47
+ User-Agent:
48
+ - Ruby
49
+ response:
50
+ status:
51
+ code: 200
52
+ message: OK
53
+ headers:
54
+ Server:
55
+ - Apache-Coyote/1.1
56
+ Etag:
57
+ - '"server-version-v0.16.1-18-gd3acc7a-dirty"'
58
+ X-Content-Type-Options:
59
+ - nosniff
60
+ Content-Type:
61
+ - application/json;charset=utf-8
62
+ Content-Length:
63
+ - '6207'
64
+ Date:
65
+ - Mon, 09 Mar 2015 19:55:18 GMT
66
+ body:
67
+ encoding: US-ASCII
68
+ string: '{"name":"register-node","help":{"summary":"Register a node with Razor
69
+ before it is discovered","description":"In order to make brownfield deployments
70
+ of Razor easier we allow users to\nregister nodes explicitly. This command
71
+ allows you to perform the same\nregistration that would happen when a new
72
+ node checked in, ahead of time.\n\nIn order for this to be effective the hw_info
73
+ must contain enough information\nthat the node can successfully be matched
74
+ during the iPXE boot phase.\n\nIf the node matches an existing node, in keeping
75
+ with the overall policy of\ncommands declaring desired state, the node installed
76
+ field will be updated to\nmatch the value in this command.\n\nThe final state
77
+ is that a node with the supplied hardware information, and the\ndesired installed
78
+ state, will be present in the database, regardless of it\nexisting before
79
+ hand or not.","schema":"# Access Control\n\nThis command''s access control
80
+ pattern: `commands:register-node`\n\nFor more detail on how the permission
81
+ strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
82
+ pattern is expanded\nand then a permission check applied to it, before the
83
+ command is authorized.\n\nThese checks only apply if security is enabled in
84
+ the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
85
+ http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * installed\n -
86
+ Should the node be considered ''installed'' already? Installed nodes are\n not
87
+ eligible for policy matching, and will simply boot locally.\n - This attribute
88
+ is required.\n - It must be of type boolean.\n\n * hw_info\n - The hardware
89
+ information for the node. This is used to match the node on first\n boot
90
+ with the record in the database. The order of MAC address assignment in\n this
91
+ data is not significant, as a node with reordered MAC addresses will be\n treated
92
+ as the same node.\n - This attribute is required.\n - It must be of type
93
+ object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
94
+ serial\n - The DMI serial number of the node\n - It must be of type
95
+ string.\n \n * asset\n - The DMI asset tag of the node\n -
96
+ It must be of type string.\n \n * uuid\n - The DMI UUID of the node\n -
97
+ It must be of type string.\n","examples":{"api":"Register a machine before
98
+ you boot it, and note that it already has an OS\ninstalled, so should not
99
+ be subject to policy-based reinstallation:\n\n {\n \"hw_info\": {\n \"net0\": \"78:31:c1:be:c8:00\",\n \"net1\": \"72:00:01:f2:13:f0\",\n \"net2\": \"72:00:01:f2:13:f1\",\n \"serial\":
100
+ \"xxxxxxxxxxx\",\n \"asset\": \"Asset-1234567890\",\n \"uuid\": \"Not
101
+ Settable\"\n },\n \"installed\": true\n }","cli":"Register a
102
+ machine before you boot it, and note that it already has an OS\ninstalled,
103
+ so should not be subject to policy-based reinstallation:\n\n razor register-node
104
+ --hw-info net0=78:31:c1:be:c8:00 \\\n --hw-info net1=72:00:01:f2:13:f0
105
+ \\\n --hw-info net2=72:00:01:f2:13:f1 \\\n --hw-info serial=xxxxxxxxxxx
106
+ \\\n --hw-info asset=Asset-1234567890 \\\n --hw-info uuid=\"Not
107
+ Settable\" \\\n --installed"},"full":"# SYNOPSIS\nRegister a node with
108
+ Razor before it is discovered\n\n# DESCRIPTION\nIn order to make brownfield
109
+ deployments of Razor easier we allow users to\nregister nodes explicitly. This
110
+ command allows you to perform the same\nregistration that would happen when
111
+ a new node checked in, ahead of time.\n\nIn order for this to be effective
112
+ the hw_info must contain enough information\nthat the node can successfully
113
+ be matched during the iPXE boot phase.\n\nIf the node matches an existing
114
+ node, in keeping with the overall policy of\ncommands declaring desired state,
115
+ the node installed field will be updated to\nmatch the value in this command.\n\nThe
116
+ final state is that a node with the supplied hardware information, and the\ndesired
117
+ installed state, will be present in the database, regardless of it\nexisting
118
+ before hand or not.\n# Access Control\n\nThis command''s access control pattern:
119
+ `commands:register-node`\n\nFor more detail on how the permission strings
120
+ are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
121
+ pattern is expanded\nand then a permission check applied to it, before the
122
+ command is authorized.\n\nThese checks only apply if security is enabled in
123
+ the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
124
+ http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * installed\n -
125
+ Should the node be considered ''installed'' already? Installed nodes are\n not
126
+ eligible for policy matching, and will simply boot locally.\n - This attribute
127
+ is required.\n - It must be of type boolean.\n\n * hw_info\n - The hardware
128
+ information for the node. This is used to match the node on first\n boot
129
+ with the record in the database. The order of MAC address assignment in\n this
130
+ data is not significant, as a node with reordered MAC addresses will be\n treated
131
+ as the same node.\n - This attribute is required.\n - It must be of type
132
+ object.\n - It must be between 1 and Infinity in length.\n # Attributes\n \n *
133
+ serial\n - The DMI serial number of the node\n - It must be of type
134
+ string.\n \n * asset\n - The DMI asset tag of the node\n -
135
+ It must be of type string.\n \n * uuid\n - The DMI UUID of the node\n -
136
+ It must be of type string.\n\n# EXAMPLES\n\n Register a machine before you
137
+ boot it, and note that it already has an OS\n installed, so should not be
138
+ subject to policy-based reinstallation:\n \n {\n \"hw_info\":
139
+ {\n \"net0\": \"78:31:c1:be:c8:00\",\n \"net1\": \"72:00:01:f2:13:f0\",\n \"net2\": \"72:00:01:f2:13:f1\",\n \"serial\":
140
+ \"xxxxxxxxxxx\",\n \"asset\": \"Asset-1234567890\",\n \"uuid\": \"Not
141
+ Settable\"\n },\n \"installed\": true\n }\n"},"schema":{"installed":{"type":"boolean"},"hw_info":{"type":"object","aliases":["hw-info"]}}}'
142
+ http_version:
143
+ recorded_at: Mon, 09 Mar 2015 19:55:18 GMT
144
+ - request:
145
+ method: post
146
+ uri: http://localhost:8150/api/commands/register-node
147
+ body:
148
+ encoding: UTF-8
149
+ string: '{"installed":true,"hw_info":{"net0":"78:31:c1:be:c8:00"}}'
150
+ headers:
151
+ Accept:
152
+ - application/json
153
+ Accept-Encoding:
154
+ - gzip, deflate
155
+ Content-Type:
156
+ - application/json
157
+ Content-Length:
158
+ - '57'
159
+ User-Agent:
160
+ - Ruby
161
+ response:
162
+ status:
163
+ code: 202
164
+ message: Accepted
165
+ headers:
166
+ Server:
167
+ - Apache-Coyote/1.1
168
+ X-Content-Type-Options:
169
+ - nosniff
170
+ Content-Type:
171
+ - application/json;charset=utf-8
172
+ Content-Length:
173
+ - '203'
174
+ Date:
175
+ - Mon, 09 Mar 2015 19:55:18 GMT
176
+ body:
177
+ encoding: US-ASCII
178
+ string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8150/api/collections/nodes/node1","name":"node1","command":"http://localhost:8150/api/collections/commands/1"}'
179
+ http_version:
180
+ recorded_at: Mon, 09 Mar 2015 19:55:18 GMT
181
+ - request:
182
+ method: get
183
+ uri: http://localhost:8150/api/collections/nodes/node1
184
+ body:
185
+ encoding: US-ASCII
186
+ string: ''
187
+ headers:
188
+ Accept:
189
+ - application/json
190
+ Accept-Encoding:
191
+ - gzip, deflate
192
+ User-Agent:
193
+ - Ruby
194
+ response:
195
+ status:
196
+ code: 200
197
+ message: OK
198
+ headers:
199
+ Server:
200
+ - Apache-Coyote/1.1
201
+ X-Content-Type-Options:
202
+ - nosniff
203
+ Content-Type:
204
+ - application/json;charset=utf-8
205
+ Content-Length:
206
+ - '409'
207
+ Date:
208
+ - Mon, 09 Mar 2015 19:55:18 GMT
209
+ body:
210
+ encoding: US-ASCII
211
+ string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8150/api/collections/nodes/node1","name":"node1","hw_info":{"mac":["78:31:c1:be:c8:00"]},"log":{"id":"http://localhost:8150/api/collections/nodes/node1/log","name":"log","params":{"limit":{"type":"number"},"start":{"type":"number"}}},"tags":[],"state":{"installed":"true","installed_at":"2015-03-09T14:55:18-05:00"}}'
212
+ http_version:
213
+ recorded_at: Mon, 09 Mar 2015 19:55:18 GMT
214
+ - request:
215
+ method: get
216
+ uri: http://fred:dead@localhost:8150/api
217
+ body:
218
+ encoding: US-ASCII
219
+ string: ''
220
+ headers:
221
+ Accept:
222
+ - application/json
223
+ Accept-Encoding:
224
+ - gzip, deflate
225
+ User-Agent:
226
+ - Ruby
227
+ response:
228
+ status:
229
+ code: 200
230
+ message: OK
231
+ headers:
232
+ Server:
233
+ - Apache-Coyote/1.1
234
+ X-Content-Type-Options:
235
+ - nosniff
236
+ Content-Type:
237
+ - application/json;charset=utf-8
238
+ Content-Length:
239
+ - '5650'
240
+ Date:
241
+ - Mon, 09 Mar 2015 19:55:18 GMT
242
+ body:
243
+ encoding: US-ASCII
244
+ string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8150/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8150/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8150/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8150/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8150/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8150/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8150/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8150/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8150/api/collections/nodes","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8150/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8150/api/collections/commands"},{"name":"events","rel":"http://api.puppetlabs.com/razor/v1/collections/events","id":"http://localhost:8150/api/collections/events","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8150/api/collections/hooks"}],"version":{"server":"v0.16.1-18-gd3acc7a-dirty"}}'
245
+ http_version:
246
+ recorded_at: Mon, 09 Mar 2015 19:55:18 GMT
247
+ - request:
248
+ method: get
249
+ uri: http://fred:dead@localhost:8150/api/collections/nodes
250
+ body:
251
+ encoding: US-ASCII
252
+ string: ''
253
+ headers:
254
+ Accept:
255
+ - application/json
256
+ Accept-Encoding:
257
+ - gzip, deflate
258
+ User-Agent:
259
+ - Ruby
260
+ response:
261
+ status:
262
+ code: 200
263
+ message: OK
264
+ headers:
265
+ Server:
266
+ - Apache-Coyote/1.1
267
+ X-Content-Type-Options:
268
+ - nosniff
269
+ Content-Type:
270
+ - application/json;charset=utf-8
271
+ Content-Length:
272
+ - '226'
273
+ Date:
274
+ - Mon, 09 Mar 2015 19:55:18 GMT
275
+ body:
276
+ encoding: US-ASCII
277
+ string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes","items":[{"spec":"http://api.puppetlabs.com/razor/v1/collections/nodes/member","id":"http://localhost:8150/api/collections/nodes/node1","name":"node1"}],"total":1}'
278
+ http_version:
279
+ recorded_at: Mon, 09 Mar 2015 19:55:18 GMT
280
+ recorded_with: VCR 2.5.0
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: http://localhost:8080/api
5
+ uri: http://localhost:8150/api
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -25,12 +25,12 @@ http_interactions:
25
25
  Content-Type:
26
26
  - application/json;charset=utf-8
27
27
  Content-Length:
28
- - '4982'
28
+ - '5650'
29
29
  Date:
30
- - Fri, 16 May 2014 21:38:24 GMT
30
+ - Mon, 09 Mar 2015 19:55:47 GMT
31
31
  body:
32
32
  encoding: US-ASCII
33
- string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost: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"}}'
33
+ string: '{"commands":[{"name":"add-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/add-policy-tag","id":"http://localhost:8150/api/commands/add-policy-tag"},{"name":"create-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/create-broker","id":"http://localhost:8150/api/commands/create-broker"},{"name":"create-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/create-hook","id":"http://localhost:8150/api/commands/create-hook"},{"name":"create-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/create-policy","id":"http://localhost:8150/api/commands/create-policy"},{"name":"create-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/create-repo","id":"http://localhost:8150/api/commands/create-repo"},{"name":"create-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/create-tag","id":"http://localhost:8150/api/commands/create-tag"},{"name":"create-task","rel":"http://api.puppetlabs.com/razor/v1/commands/create-task","id":"http://localhost:8150/api/commands/create-task"},{"name":"delete-broker","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-broker","id":"http://localhost:8150/api/commands/delete-broker"},{"name":"delete-hook","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-hook","id":"http://localhost:8150/api/commands/delete-hook"},{"name":"delete-node","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-node","id":"http://localhost:8150/api/commands/delete-node"},{"name":"delete-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-policy","id":"http://localhost:8150/api/commands/delete-policy"},{"name":"delete-repo","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-repo","id":"http://localhost:8150/api/commands/delete-repo"},{"name":"delete-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/delete-tag","id":"http://localhost:8150/api/commands/delete-tag"},{"name":"disable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/disable-policy","id":"http://localhost:8150/api/commands/disable-policy"},{"name":"enable-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/enable-policy","id":"http://localhost:8150/api/commands/enable-policy"},{"name":"modify-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-node-metadata","id":"http://localhost:8150/api/commands/modify-node-metadata"},{"name":"modify-policy-max-count","rel":"http://api.puppetlabs.com/razor/v1/commands/modify-policy-max-count","id":"http://localhost:8150/api/commands/modify-policy-max-count"},{"name":"move-policy","rel":"http://api.puppetlabs.com/razor/v1/commands/move-policy","id":"http://localhost:8150/api/commands/move-policy"},{"name":"reboot-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reboot-node","id":"http://localhost:8150/api/commands/reboot-node"},{"name":"register-node","rel":"http://api.puppetlabs.com/razor/v1/commands/register-node","id":"http://localhost:8150/api/commands/register-node"},{"name":"reinstall-node","rel":"http://api.puppetlabs.com/razor/v1/commands/reinstall-node","id":"http://localhost:8150/api/commands/reinstall-node"},{"name":"remove-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-node-metadata","id":"http://localhost:8150/api/commands/remove-node-metadata"},{"name":"remove-policy-tag","rel":"http://api.puppetlabs.com/razor/v1/commands/remove-policy-tag","id":"http://localhost:8150/api/commands/remove-policy-tag"},{"name":"set-node-desired-power-state","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-desired-power-state","id":"http://localhost:8150/api/commands/set-node-desired-power-state"},{"name":"set-node-hw-info","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-hw-info","id":"http://localhost:8150/api/commands/set-node-hw-info"},{"name":"set-node-ipmi-credentials","rel":"http://api.puppetlabs.com/razor/v1/commands/set-node-ipmi-credentials","id":"http://localhost:8150/api/commands/set-node-ipmi-credentials"},{"name":"update-node-metadata","rel":"http://api.puppetlabs.com/razor/v1/commands/update-node-metadata","id":"http://localhost:8150/api/commands/update-node-metadata"},{"name":"update-tag-rule","rel":"http://api.puppetlabs.com/razor/v1/commands/update-tag-rule","id":"http://localhost:8150/api/commands/update-tag-rule"}],"collections":[{"name":"brokers","rel":"http://api.puppetlabs.com/razor/v1/collections/brokers","id":"http://localhost:8150/api/collections/brokers"},{"name":"repos","rel":"http://api.puppetlabs.com/razor/v1/collections/repos","id":"http://localhost:8150/api/collections/repos"},{"name":"tags","rel":"http://api.puppetlabs.com/razor/v1/collections/tags","id":"http://localhost:8150/api/collections/tags"},{"name":"policies","rel":"http://api.puppetlabs.com/razor/v1/collections/policies","id":"http://localhost:8150/api/collections/policies"},{"name":"nodes","rel":"http://api.puppetlabs.com/razor/v1/collections/nodes","id":"http://localhost:8150/api/collections/nodes","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"tasks","rel":"http://api.puppetlabs.com/razor/v1/collections/tasks","id":"http://localhost:8150/api/collections/tasks"},{"name":"commands","rel":"http://api.puppetlabs.com/razor/v1/collections/commands","id":"http://localhost:8150/api/collections/commands"},{"name":"events","rel":"http://api.puppetlabs.com/razor/v1/collections/events","id":"http://localhost:8150/api/collections/events","params":{"start":{"type":"number"},"limit":{"type":"number"}}},{"name":"hooks","rel":"http://api.puppetlabs.com/razor/v1/collections/hooks","id":"http://localhost:8150/api/collections/hooks"}],"version":{"server":"v0.16.1-18-gd3acc7a-dirty"}}'
34
34
  http_version:
35
- recorded_at: Fri, 16 May 2014 21:38:24 GMT
35
+ recorded_at: Mon, 09 Mar 2015 19:55:47 GMT
36
36
  recorded_with: VCR 2.5.0
data/spec/spec_helper.rb CHANGED
@@ -29,19 +29,23 @@ end
29
29
  def reset_db
30
30
  razor_admin_path = ENV['razor-admin'] || 'bin/razor-admin'
31
31
  db_environment = ENV['server-database-environment'] || 'development'
32
- # The `cd` business is a workaround, since running `razor-admin` from a different directory currently fails.
33
- system("cd ../razor-server && #{razor_admin_path} -e #{db_environment} reset-database")
32
+ # The `cd` business is a workaround, since running `razor-admin` from a
33
+ # different directory currently fails. Without the `Bundler` wrap, it uses
34
+ # the same bundler environment for the shell command, leading to errors
35
+ # relating to gems on razor-server that are not included in the razor-client
36
+ # bundle.
37
+ Bundler.with_clean_env {system("cd ../razor-server && #{razor_admin_path} -e #{db_environment} reset-database")}
34
38
  end
35
39
 
36
40
  # Record one cassette for each test
37
41
  RSpec.configure do |c|
38
42
  c.treat_symbols_as_metadata_keys_with_true_values = true
39
43
  c.before(:each) do
40
- ENV::delete('RAZOR_API')
44
+ ENV::store('RAZOR_API', 'http://localhost:8150/api')
41
45
  end
42
46
  # Make tests have no side effects when [re-]recording.
43
47
  if vcr_recording?
44
48
  c.before(:all) { reset_db }
45
- c.after(:each) { reset_db }
49
+ c.after(:each, :vcr => true) { reset_db }
46
50
  end
47
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pe-razor-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.2.2
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-31 00:00:00.000000000 Z
11
+ date: 2015-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types
@@ -53,19 +53,19 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '1.7'
55
55
  - !ruby/object:Gem::Dependency
56
- name: terminal-table
56
+ name: command_line_reporter
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - '>'
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '3.0'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - '>'
67
67
  - !ruby/object:Gem::Version
68
- version: '0'
68
+ version: '3.0'
69
69
  description: |
70
70
  Razor is an advanced provisioning application which can deploy both bare-metal
71
71
  and virtual systems. It's aimed at solving the problem of how to bring new
@@ -82,10 +82,13 @@ extra_rdoc_files: []
82
82
  files:
83
83
  - bin/razor
84
84
  - lib/razor/cli.rb
85
+ - lib/razor/cli/command.rb
85
86
  - lib/razor/cli/document.rb
86
87
  - lib/razor/cli/format.rb
87
88
  - lib/razor/cli/navigate.rb
88
89
  - lib/razor/cli/parse.rb
90
+ - lib/razor/cli/query.rb
91
+ - lib/razor/cli/table_format.rb
89
92
  - lib/razor/cli/transforms.rb
90
93
  - lib/razor/cli/version.rb
91
94
  - lib/razor/cli/views.rb
@@ -94,9 +97,11 @@ files:
94
97
  - NEWS.md
95
98
  - README.md
96
99
  - LICENSE
100
+ - spec/cli/command_spec.rb
97
101
  - spec/cli/format_spec.rb
98
102
  - spec/cli/navigate_spec.rb
99
103
  - spec/cli/parse_spec.rb
104
+ - spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_in_string.yml
100
105
  - spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_spaces.yml
101
106
  - spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_--help_command_.yml
102
107
  - spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_-h_command_.yml
@@ -116,6 +121,12 @@ files:
116
121
  - 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
117
122
  - 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
118
123
  - spec/fixtures/vcr/Razor_CLI_Navigate/with_no_parameters/should_fail_with_bad_JSON.yml
124
+ - spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_limit.yml
125
+ - spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_start.yml
126
+ - spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_not_fail_when_query_returns_details_for_one_item.yml
127
+ - spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_store_query_without_query_parameters.yml
128
+ - spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_throw_an_error_if_the_query_parameter_is_not_in_the_API.yml
129
+ - 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
119
130
  - spec/fixtures/vcr/Razor_CLI_Parse/_new/_help/should_print_a_list_of_known_endpoints.yml
120
131
  - spec/spec_helper.rb
121
132
  - spec/testing.md
@@ -145,9 +156,11 @@ signing_key:
145
156
  specification_version: 4
146
157
  summary: Razor is an advanced provisioning application
147
158
  test_files:
159
+ - spec/cli/command_spec.rb
148
160
  - spec/cli/format_spec.rb
149
161
  - spec/cli/navigate_spec.rb
150
162
  - spec/cli/parse_spec.rb
163
+ - spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_in_string.yml
151
164
  - spec/fixtures/vcr/Razor_CLI_Navigate/argument_formatting/should_allow_spaces.yml
152
165
  - spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_--help_command_.yml
153
166
  - spec/fixtures/vcr/Razor_CLI_Navigate/for_command_help/should_provide_command_help_for_razor_-h_command_.yml
@@ -167,6 +180,12 @@ test_files:
167
180
  - 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
168
181
  - 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
169
182
  - spec/fixtures/vcr/Razor_CLI_Navigate/with_no_parameters/should_fail_with_bad_JSON.yml
183
+ - spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_limit.yml
184
+ - spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_append_start.yml
185
+ - spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_not_fail_when_query_returns_details_for_one_item.yml
186
+ - spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_store_query_without_query_parameters.yml
187
+ - spec/fixtures/vcr/Razor_CLI_Navigate/with_query_parameters/should_throw_an_error_if_the_query_parameter_is_not_in_the_API.yml
188
+ - 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
170
189
  - spec/fixtures/vcr/Razor_CLI_Parse/_new/_help/should_print_a_list_of_known_endpoints.yml
171
190
  - spec/spec_helper.rb
172
191
  - spec/testing.md