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
|
+
# Needed to make the client work on Ruby 1.8.7
|
2
|
+
unless Kernel.respond_to?(:require_relative)
|
3
|
+
module Kernel
|
4
|
+
def require_relative(path)
|
5
|
+
require File.join(File.dirname(caller[0]), path.to_str)
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
require "rspec/expectations"
|
11
|
+
require_relative '../spec_helper'
|
12
|
+
|
13
|
+
describe Razor::CLI::Format do
|
14
|
+
include described_class
|
15
|
+
|
16
|
+
def format(doc, args = {})
|
17
|
+
args = {:format => 'short', :args => ['something', 'else'], :query? => true, :show_command_help? => false}.merge(args)
|
18
|
+
parse = double(args)
|
19
|
+
format_document doc, parse
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'additional details' do
|
23
|
+
it "tells additional details for a hash" do
|
24
|
+
doc = {'abc' => {'def' => 'ghi'}}
|
25
|
+
result = format doc
|
26
|
+
result.should =~ /Query additional details via: `razor something else \[abc\]`\z/
|
27
|
+
end
|
28
|
+
it "tells additional details for an array" do
|
29
|
+
doc = {'abc' => ['def']}
|
30
|
+
result = format doc
|
31
|
+
result.should =~ /Query additional details via: `razor something else \[abc\]`\z/
|
32
|
+
end
|
33
|
+
it "tells multiple additional details" do
|
34
|
+
doc = {'abc' => ['def'], 'ghi' => {'jkl' => 'mno'}}
|
35
|
+
result = format doc
|
36
|
+
result.should =~ /Query additional details via: `razor something else \[abc, ghi\]`\z/
|
37
|
+
end
|
38
|
+
it "tells no additional details for a string" do
|
39
|
+
doc = {'abc' => 'def'}
|
40
|
+
result = format doc
|
41
|
+
result.should_not =~ /Query additional details/
|
42
|
+
end
|
43
|
+
it "hides array spec array from additional details" do
|
44
|
+
doc = {'abc' => [], 'spec' => ['def', 'jkl']}
|
45
|
+
result = format doc
|
46
|
+
result.should =~ /Query additional details via: `razor something else \[abc\]`\z/
|
47
|
+
end
|
48
|
+
it "hides array +spec array from additional details" do
|
49
|
+
doc = {'abc' => [], '+spec' => ['def', 'jkl']}
|
50
|
+
result = format doc
|
51
|
+
result.should =~ /Query additional details via: `razor something else \[abc\]`\z/
|
52
|
+
end
|
53
|
+
it "only shows additional details for nested objects" do
|
54
|
+
doc = {'one-prop' => 'val', 'abc' => [], 'prop' => 'jkl'}
|
55
|
+
result = format doc
|
56
|
+
result.should =~ /Query additional details via: `razor something else \[abc\]`\z/
|
57
|
+
end
|
58
|
+
it "tells how to query by name" do
|
59
|
+
doc = {'items' => [{'name' => 'entirely'}, {'name' => 'bar'} ]}
|
60
|
+
result = format doc
|
61
|
+
result.should =~ /Query an entry by including its name, e.g. `razor something else entirely`\z/
|
62
|
+
end
|
63
|
+
it "hides for commands" do
|
64
|
+
doc = {'items' => [{'name' => 'entirely'}, {'name' => 'bar'} ]}
|
65
|
+
result = format doc, query?: false
|
66
|
+
result.should_not =~ /Query an entry by including its name/
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
context 'empty display' do
|
71
|
+
it "works right when it has nothing to display as a table" do
|
72
|
+
doc = {"spec"=>"http://api.puppetlabs.com/razor/v1/collections/policies", "items"=>[]}
|
73
|
+
result = format doc
|
74
|
+
result.should == "There are no items for this query."
|
75
|
+
end
|
76
|
+
it "works right when it has nothing to display as a list" do
|
77
|
+
doc = {"spec"=>"http://api.puppetlabs.com/razor/v1/collections/policies/member", "items"=>[]}
|
78
|
+
result = format doc
|
79
|
+
result.should == "There are no items for this query."
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
context 'tabular display' do
|
84
|
+
it "works right when columns do not match up" do
|
85
|
+
doc = {"spec"=>"http://api.puppetlabs.com/razor/v1/collections/nodes/log",
|
86
|
+
"items"=>[{'a' => 'b', 'c' => 'd'},
|
87
|
+
{'b' => 'c', 'e' => 'f'}]}
|
88
|
+
result = format doc
|
89
|
+
result.should == <<-OUTPUT.rstrip
|
90
|
+
+---+---+---+---+
|
91
|
+
| a | c | b | e |
|
92
|
+
+---+---+---+---+
|
93
|
+
| b | d | | |
|
94
|
+
| | | c | f |
|
95
|
+
+---+---+---+---+
|
96
|
+
OUTPUT
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
data/spec/cli/navigate_spec.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
1
2
|
# Needed to make the client work on Ruby 1.8.7
|
2
3
|
unless Kernel.respond_to?(:require_relative)
|
3
4
|
module Kernel
|
@@ -20,7 +21,7 @@ describe Razor::CLI::Navigate do
|
|
20
21
|
|
21
22
|
context "with a single item path", :vcr do
|
22
23
|
subject(:nav) {Razor::CLI::Parse.new(["tags"]).navigate}
|
23
|
-
it { nav.get_document.should == []}
|
24
|
+
it { nav.get_document['items'].should == []}
|
24
25
|
|
25
26
|
it do
|
26
27
|
nav.get_document;
|
@@ -34,6 +35,114 @@ describe Razor::CLI::Navigate do
|
|
34
35
|
it {expect{nav.get_document}.to raise_error Razor::CLI::NavigationError}
|
35
36
|
end
|
36
37
|
|
38
|
+
context "with invalid parameter", :vcr do
|
39
|
+
it "should fail with bad JSON" do
|
40
|
+
nav = Razor::CLI::Parse.new(['create-broker', '--name', 'broker', '--type', 'puppet', '--configuration', 'not-json']).navigate
|
41
|
+
expect{nav.get_document}.to raise_error(ArgumentError, /Invalid JSON for argument 'configuration'/)
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should fail with malformed argument" do
|
45
|
+
nav = Razor::CLI::Parse.new(['create-tag', '--name', 'tag_2', '--inva_lid']).navigate
|
46
|
+
expect{nav.get_document}.to raise_error(ArgumentError, /Unexpected argument --inva_lid/)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
context "with no parameters", :vcr do
|
51
|
+
it "should fail with bad JSON" do
|
52
|
+
nav = Razor::CLI::Parse.new(['update-tag-rule']).navigate
|
53
|
+
expect{nav.get_document}.to raise_error(Razor::CLI::Error, /No arguments for command/)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
context "with multiple arguments with same name", :vcr do
|
58
|
+
context "combining as an array" do
|
59
|
+
before(:each) do
|
60
|
+
# Prerequisites
|
61
|
+
nav = Razor::CLI::Parse.new(['create-repo', '--name', 'name', '--url', 'http://url.com/some.iso', '--task', 'noop']).navigate.get_document
|
62
|
+
nav = Razor::CLI::Parse.new(['create-broker', '--name', 'puppet', '--configuration', '{"server": "puppet.example.org", "environment": "production"}', '--broker-type', 'puppet']).navigate.get_document
|
63
|
+
nav = Razor::CLI::Parse.new(['create-tag', '--name', 'tag1', '--rule', '["=", ["fact", "processorcount"], "1"]']).navigate.get_document
|
64
|
+
nav = Razor::CLI::Parse.new(['create-tag', '--name', 'tag2', '--rule', '["=", ["fact", "processorcount"], "2"]']).navigate.get_document
|
65
|
+
end
|
66
|
+
it "should merge the arguments as an array" do
|
67
|
+
nav = Razor::CLI::Parse.new(['create-policy',
|
68
|
+
'--name', 'test', '--hostname', 'abc.com', '--root-password', 'abc',
|
69
|
+
'--task', 'noop', '--repo', 'name', '--broker', 'puppet', '--tag', 'tag1', '--tag', 'tag2']).navigate
|
70
|
+
tags = nav.get_document['tags'].to_s
|
71
|
+
tags.should =~ /tag1/
|
72
|
+
tags.should =~ /tag2/
|
73
|
+
end
|
74
|
+
it "should merge the arguments into an existing array" do
|
75
|
+
nav = Razor::CLI::Parse.new(['create-policy',
|
76
|
+
'--name', 'test', '--hostname', 'abc.com', '--root-password', 'abc',
|
77
|
+
'--task', 'noop', '--repo', 'name', '--broker', 'puppet', '--tags', '["tag1"]', '--tag', 'tag2']).navigate
|
78
|
+
tags = nav.get_document['tags'].to_s
|
79
|
+
tags.should =~ /tag1/
|
80
|
+
tags.should =~ /tag2/
|
81
|
+
end
|
82
|
+
it "should merge an array into an existing array" do
|
83
|
+
nav = Razor::CLI::Parse.new(['create-policy',
|
84
|
+
'--name', 'test', '--hostname', 'abc.com', '--root-password', 'abc',
|
85
|
+
'--task', 'noop', '--repo', 'name', '--broker', 'puppet', '--tags', '["tag1"]', '--tags', '["tag2"]']).navigate
|
86
|
+
tags = nav.get_document['tags'].to_s
|
87
|
+
tags.should =~ /tag1/
|
88
|
+
tags.should =~ /tag2/
|
89
|
+
end
|
90
|
+
end
|
91
|
+
context "combining as an object" do
|
92
|
+
it "should construct a json object" do
|
93
|
+
nav = Razor::CLI::Parse.new(['create-broker', '--name', 'broker1', '--broker-type', 'puppet',
|
94
|
+
'--configuration', 'server=puppet.example.org', '--configuration',
|
95
|
+
'environment=production']).navigate
|
96
|
+
keys = nav.get_document['configuration'].keys
|
97
|
+
keys.should include 'server'
|
98
|
+
keys.should include 'environment'
|
99
|
+
end
|
100
|
+
it "should construct a json object with unicode", :preserve_exact_body_bytes do
|
101
|
+
doc = Razor::CLI::Parse.new(['register-node', '--installed', 'true', '--hw-info', '{"net0": "abcdef"}']).navigate.get_document
|
102
|
+
name = doc['name']
|
103
|
+
nav = Razor::CLI::Parse.new(['modify-node-metadata', '--node', name, '--update', 'keyᓱ123=valueᓱ1']).navigate
|
104
|
+
nav.get_document['metadata'].should == {'keyᓱ123' => 'valueᓱ1'}
|
105
|
+
end
|
106
|
+
it "should fail with mixed types (array then hash)" do
|
107
|
+
nav = Razor::CLI::Parse.new(['create-broker', '--name', 'broker2', '--broker-type', 'puppet',
|
108
|
+
'--configuration', '["server"]',
|
109
|
+
'--configuration', 'environment=production']).navigate
|
110
|
+
expect {nav.get_document}.to raise_error(ArgumentError, "Cannot handle mixed types for argument configuration")
|
111
|
+
end
|
112
|
+
it "should fail with mixed types (hash then array)" do
|
113
|
+
nav = Razor::CLI::Parse.new(['create-broker', '--name', 'broker3', '--broker-type', 'puppet',
|
114
|
+
'--configuration', 'environment=production',
|
115
|
+
'--configuration', '["server"]']).navigate
|
116
|
+
expect {nav.get_document}.to raise_error(ArgumentError, "Cannot handle mixed types for argument configuration")
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
context "argument formatting", :vcr do
|
122
|
+
it "should allow spaces" do
|
123
|
+
Razor::CLI::Parse.new(['create-repo', '--name', 'separate with spaces', '--url', 'http://url.com/some.iso', '--task', 'noop']).navigate.get_document
|
124
|
+
Razor::CLI::Parse.new(['create-repo', '--name="double-quote with spaces"', '--url', 'http://url.com/some.iso', '--task', 'noop']).navigate.get_document
|
125
|
+
Razor::CLI::Parse.new(['create-repo', '--name=\'single-quote with spaces\'', '--url', 'http://url.com/some.iso', '--task', 'noop']).navigate.get_document
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
context "for command help", :vcr do
|
130
|
+
[['command', '--help'], ['command', '-h'],
|
131
|
+
['--help', 'command'], ['-h', 'command'],
|
132
|
+
['help', 'command'], ['command', 'help']].
|
133
|
+
each do |scenario|
|
134
|
+
it "should provide command help for `razor #{scenario.join ' '}`" do
|
135
|
+
scenario = scenario.map { |name| name.sub('command', 'update-tag-rule') }
|
136
|
+
parse = Razor::CLI::Parse.new(scenario)
|
137
|
+
nav = parse.navigate
|
138
|
+
document = nav.get_document
|
139
|
+
document["name"].should == "update-tag-rule"
|
140
|
+
document["help"].class.should <= Hash
|
141
|
+
parse.should be_show_command_help
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
37
146
|
context "with authentication", :vcr do
|
38
147
|
AuthArg = %w[-u http://fred:dead@localhost:8080/api].freeze
|
39
148
|
|
@@ -45,7 +154,7 @@ describe Razor::CLI::Navigate do
|
|
45
154
|
|
46
155
|
it "should preserve that across navigation" do
|
47
156
|
nav = Razor::CLI::Parse.new(AuthArg + ['tags']).navigate
|
48
|
-
nav.get_document.should == []
|
157
|
+
nav.get_document['items'].should == []
|
49
158
|
URI.parse(nav.last_url.to_s).userinfo.should == "fred:dead"
|
50
159
|
end
|
51
160
|
end
|
data/spec/cli/parse_spec.rb
CHANGED
@@ -25,6 +25,26 @@ describe Razor::CLI::Parse do
|
|
25
25
|
it {parse("-h").show_help?.should be true}
|
26
26
|
end
|
27
27
|
|
28
|
+
context "with a '-h COMMAND'" do
|
29
|
+
it {parse("-h", "create-policy").show_command_help?.should be true}
|
30
|
+
end
|
31
|
+
|
32
|
+
context "with a '--help COMMAND'" do
|
33
|
+
it {parse("--help", "create-policy").show_command_help?.should be true}
|
34
|
+
end
|
35
|
+
|
36
|
+
context "with a 'help COMMAND'" do
|
37
|
+
it {parse("help", "create-policy").show_command_help?.should be true}
|
38
|
+
end
|
39
|
+
|
40
|
+
context "with a 'help COMMAND'" do
|
41
|
+
it {parse("create-policy", "help").show_command_help?.should be true}
|
42
|
+
end
|
43
|
+
|
44
|
+
context "with a 'COMMAND var help'" do
|
45
|
+
it {parse("create-policy", "var", "help").show_command_help?.should_not be true}
|
46
|
+
end
|
47
|
+
|
28
48
|
context "with a '-d'" do
|
29
49
|
it {parse("-d").dump_response?.should be true}
|
30
50
|
end
|
@@ -0,0 +1,966 @@
|
|
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
|
+
- Wed, 21 May 2014 21:40:46 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-125-g591a14d-dirty"}}'
|
34
|
+
http_version:
|
35
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
36
|
+
- request:
|
37
|
+
method: get
|
38
|
+
uri: http://localhost:8080/api/commands/create-repo
|
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-125-g591a14d-dirty"'
|
58
|
+
X-Content-Type-Options:
|
59
|
+
- nosniff
|
60
|
+
Content-Type:
|
61
|
+
- application/json;charset=utf-8
|
62
|
+
Content-Length:
|
63
|
+
- '3227'
|
64
|
+
Date:
|
65
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
66
|
+
body:
|
67
|
+
encoding: US-ASCII
|
68
|
+
string: '{"name":"create-repo","help":{"full":"# SYNOPSIS\nCreate a new repository,
|
69
|
+
from an ISO image or a URL\n\n# DESCRIPTION\nCreate a new repository, which
|
70
|
+
can either contain the content to install a\nnode, or simply point to an existing
|
71
|
+
online repository by URL.\n\n\n# Access Control\n\nThis command''s access
|
72
|
+
control pattern: `commands:create-repo:%{name}`\n\nWords surrounded by `%{...}`
|
73
|
+
are substitutions from the input data: typically\nthe name of the object being
|
74
|
+
modified, or some other critical detail, these\nallow roles to be granted
|
75
|
+
partial access to modify the system.\n\nFor more detail on how the permission
|
76
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
77
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
78
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
79
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
80
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
81
|
+
The name of the repository.\n - This attribute is required\n - It must
|
82
|
+
be of type string.\n - It must be between 1 and 250 in length.\n\n * url\n -
|
83
|
+
The URL of the remote repository to use.\n - It must be of type string.\n -
|
84
|
+
If present, iso-url must not be present.\n - It must be between 1 and 1000
|
85
|
+
in length.\n\n * iso-url\n - The URL of the ISO image to download and unpack
|
86
|
+
to create the\n repository. This can be an HTTP or HTTPS URL, or it can
|
87
|
+
be a\n file URL.\n \n In the later case, the file path is interpreted
|
88
|
+
as a path on the\n Razor server, rather than a path on the client. This
|
89
|
+
requires that\n you manually place the ISO image on the server before invoking
|
90
|
+
the\n command.\n - It must be of type string.\n - If present, url must
|
91
|
+
not be present.\n - It must be between 1 and 1000 in length.\n\n * task\n -
|
92
|
+
The name of the task associated with this repository. This is used to\n install
|
93
|
+
nodes that match a policy using this repository; generally it\n should match
|
94
|
+
the OS that the URL or ISO-URL attributes point to.\n - This attribute is
|
95
|
+
required\n - It must be of type string.\n\n\n\n# EXAMPLES\n Create a repository
|
96
|
+
from an ISO image, which will be downloaded and unpacked\n by the razor-server
|
97
|
+
in the background:\n \n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
98
|
+
\"http://example.com/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n You
|
99
|
+
can also unpack an ISO image from a file *on the server*; this does not\n upload
|
100
|
+
the file from the client:\n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
101
|
+
\"file:///tmp/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n Finally,
|
102
|
+
you can providing a `url` property when you create the repository;\n this
|
103
|
+
form is merely a pointer to a resource somehwere and nothing will be\n downloaded
|
104
|
+
onto the Razor server:\n \n {\n \"name\": \"fedora19\",\n \"url\": \"http://mirrors.n-ix.net/fedora/linux/releases/19/Fedora/x86_64/os/\"\n \"task\":
|
105
|
+
\"fedora\"\n }\n\n"},"schema":{"name":{"type":"string"},"url":{"type":"string"},"iso-url":{"type":"string"},"task":{"type":"string"}}}'
|
106
|
+
http_version:
|
107
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
108
|
+
- request:
|
109
|
+
method: get
|
110
|
+
uri: http://localhost:8080/api/commands/create-repo
|
111
|
+
body:
|
112
|
+
encoding: US-ASCII
|
113
|
+
string: ''
|
114
|
+
headers:
|
115
|
+
Accept:
|
116
|
+
- application/json
|
117
|
+
Accept-Encoding:
|
118
|
+
- gzip, deflate
|
119
|
+
User-Agent:
|
120
|
+
- Ruby
|
121
|
+
response:
|
122
|
+
status:
|
123
|
+
code: 200
|
124
|
+
message: OK
|
125
|
+
headers:
|
126
|
+
Server:
|
127
|
+
- Apache-Coyote/1.1
|
128
|
+
Etag:
|
129
|
+
- '"server-version-v0.14.1-125-g591a14d-dirty"'
|
130
|
+
X-Content-Type-Options:
|
131
|
+
- nosniff
|
132
|
+
Content-Type:
|
133
|
+
- application/json;charset=utf-8
|
134
|
+
Content-Length:
|
135
|
+
- '3227'
|
136
|
+
Date:
|
137
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
138
|
+
body:
|
139
|
+
encoding: US-ASCII
|
140
|
+
string: '{"name":"create-repo","help":{"full":"# SYNOPSIS\nCreate a new repository,
|
141
|
+
from an ISO image or a URL\n\n# DESCRIPTION\nCreate a new repository, which
|
142
|
+
can either contain the content to install a\nnode, or simply point to an existing
|
143
|
+
online repository by URL.\n\n\n# Access Control\n\nThis command''s access
|
144
|
+
control pattern: `commands:create-repo:%{name}`\n\nWords surrounded by `%{...}`
|
145
|
+
are substitutions from the input data: typically\nthe name of the object being
|
146
|
+
modified, or some other critical detail, these\nallow roles to be granted
|
147
|
+
partial access to modify the system.\n\nFor more detail on how the permission
|
148
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
149
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
150
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
151
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
152
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
153
|
+
The name of the repository.\n - This attribute is required\n - It must
|
154
|
+
be of type string.\n - It must be between 1 and 250 in length.\n\n * url\n -
|
155
|
+
The URL of the remote repository to use.\n - It must be of type string.\n -
|
156
|
+
If present, iso-url must not be present.\n - It must be between 1 and 1000
|
157
|
+
in length.\n\n * iso-url\n - The URL of the ISO image to download and unpack
|
158
|
+
to create the\n repository. This can be an HTTP or HTTPS URL, or it can
|
159
|
+
be a\n file URL.\n \n In the later case, the file path is interpreted
|
160
|
+
as a path on the\n Razor server, rather than a path on the client. This
|
161
|
+
requires that\n you manually place the ISO image on the server before invoking
|
162
|
+
the\n command.\n - It must be of type string.\n - If present, url must
|
163
|
+
not be present.\n - It must be between 1 and 1000 in length.\n\n * task\n -
|
164
|
+
The name of the task associated with this repository. This is used to\n install
|
165
|
+
nodes that match a policy using this repository; generally it\n should match
|
166
|
+
the OS that the URL or ISO-URL attributes point to.\n - This attribute is
|
167
|
+
required\n - It must be of type string.\n\n\n\n# EXAMPLES\n Create a repository
|
168
|
+
from an ISO image, which will be downloaded and unpacked\n by the razor-server
|
169
|
+
in the background:\n \n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
170
|
+
\"http://example.com/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n You
|
171
|
+
can also unpack an ISO image from a file *on the server*; this does not\n upload
|
172
|
+
the file from the client:\n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
173
|
+
\"file:///tmp/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n Finally,
|
174
|
+
you can providing a `url` property when you create the repository;\n this
|
175
|
+
form is merely a pointer to a resource somehwere and nothing will be\n downloaded
|
176
|
+
onto the Razor server:\n \n {\n \"name\": \"fedora19\",\n \"url\": \"http://mirrors.n-ix.net/fedora/linux/releases/19/Fedora/x86_64/os/\"\n \"task\":
|
177
|
+
\"fedora\"\n }\n\n"},"schema":{"name":{"type":"string"},"url":{"type":"string"},"iso-url":{"type":"string"},"task":{"type":"string"}}}'
|
178
|
+
http_version:
|
179
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
180
|
+
- request:
|
181
|
+
method: get
|
182
|
+
uri: http://localhost:8080/api/commands/create-repo
|
183
|
+
body:
|
184
|
+
encoding: US-ASCII
|
185
|
+
string: ''
|
186
|
+
headers:
|
187
|
+
Accept:
|
188
|
+
- application/json
|
189
|
+
Accept-Encoding:
|
190
|
+
- gzip, deflate
|
191
|
+
User-Agent:
|
192
|
+
- Ruby
|
193
|
+
response:
|
194
|
+
status:
|
195
|
+
code: 200
|
196
|
+
message: OK
|
197
|
+
headers:
|
198
|
+
Server:
|
199
|
+
- Apache-Coyote/1.1
|
200
|
+
Etag:
|
201
|
+
- '"server-version-v0.14.1-125-g591a14d-dirty"'
|
202
|
+
X-Content-Type-Options:
|
203
|
+
- nosniff
|
204
|
+
Content-Type:
|
205
|
+
- application/json;charset=utf-8
|
206
|
+
Content-Length:
|
207
|
+
- '3227'
|
208
|
+
Date:
|
209
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
210
|
+
body:
|
211
|
+
encoding: US-ASCII
|
212
|
+
string: '{"name":"create-repo","help":{"full":"# SYNOPSIS\nCreate a new repository,
|
213
|
+
from an ISO image or a URL\n\n# DESCRIPTION\nCreate a new repository, which
|
214
|
+
can either contain the content to install a\nnode, or simply point to an existing
|
215
|
+
online repository by URL.\n\n\n# Access Control\n\nThis command''s access
|
216
|
+
control pattern: `commands:create-repo:%{name}`\n\nWords surrounded by `%{...}`
|
217
|
+
are substitutions from the input data: typically\nthe name of the object being
|
218
|
+
modified, or some other critical detail, these\nallow roles to be granted
|
219
|
+
partial access to modify the system.\n\nFor more detail on how the permission
|
220
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
221
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
222
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
223
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
224
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
225
|
+
The name of the repository.\n - This attribute is required\n - It must
|
226
|
+
be of type string.\n - It must be between 1 and 250 in length.\n\n * url\n -
|
227
|
+
The URL of the remote repository to use.\n - It must be of type string.\n -
|
228
|
+
If present, iso-url must not be present.\n - It must be between 1 and 1000
|
229
|
+
in length.\n\n * iso-url\n - The URL of the ISO image to download and unpack
|
230
|
+
to create the\n repository. This can be an HTTP or HTTPS URL, or it can
|
231
|
+
be a\n file URL.\n \n In the later case, the file path is interpreted
|
232
|
+
as a path on the\n Razor server, rather than a path on the client. This
|
233
|
+
requires that\n you manually place the ISO image on the server before invoking
|
234
|
+
the\n command.\n - It must be of type string.\n - If present, url must
|
235
|
+
not be present.\n - It must be between 1 and 1000 in length.\n\n * task\n -
|
236
|
+
The name of the task associated with this repository. This is used to\n install
|
237
|
+
nodes that match a policy using this repository; generally it\n should match
|
238
|
+
the OS that the URL or ISO-URL attributes point to.\n - This attribute is
|
239
|
+
required\n - It must be of type string.\n\n\n\n# EXAMPLES\n Create a repository
|
240
|
+
from an ISO image, which will be downloaded and unpacked\n by the razor-server
|
241
|
+
in the background:\n \n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
242
|
+
\"http://example.com/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n You
|
243
|
+
can also unpack an ISO image from a file *on the server*; this does not\n upload
|
244
|
+
the file from the client:\n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
245
|
+
\"file:///tmp/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n Finally,
|
246
|
+
you can providing a `url` property when you create the repository;\n this
|
247
|
+
form is merely a pointer to a resource somehwere and nothing will be\n downloaded
|
248
|
+
onto the Razor server:\n \n {\n \"name\": \"fedora19\",\n \"url\": \"http://mirrors.n-ix.net/fedora/linux/releases/19/Fedora/x86_64/os/\"\n \"task\":
|
249
|
+
\"fedora\"\n }\n\n"},"schema":{"name":{"type":"string"},"url":{"type":"string"},"iso-url":{"type":"string"},"task":{"type":"string"}}}'
|
250
|
+
http_version:
|
251
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
252
|
+
- request:
|
253
|
+
method: post
|
254
|
+
uri: http://localhost:8080/api/commands/create-repo
|
255
|
+
body:
|
256
|
+
encoding: UTF-8
|
257
|
+
string: '{"name":"separate with spaces","url":"http://url.com/some.iso","task":"noop"}'
|
258
|
+
headers:
|
259
|
+
Accept:
|
260
|
+
- application/json
|
261
|
+
Accept-Encoding:
|
262
|
+
- gzip, deflate
|
263
|
+
Content-Type:
|
264
|
+
- application/json
|
265
|
+
Content-Length:
|
266
|
+
- '77'
|
267
|
+
User-Agent:
|
268
|
+
- Ruby
|
269
|
+
response:
|
270
|
+
status:
|
271
|
+
code: 202
|
272
|
+
message: Accepted
|
273
|
+
headers:
|
274
|
+
Server:
|
275
|
+
- Apache-Coyote/1.1
|
276
|
+
X-Content-Type-Options:
|
277
|
+
- nosniff
|
278
|
+
Content-Type:
|
279
|
+
- application/json;charset=utf-8
|
280
|
+
Content-Length:
|
281
|
+
- '237'
|
282
|
+
Date:
|
283
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
284
|
+
body:
|
285
|
+
encoding: US-ASCII
|
286
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/repos/member","id":"http://localhost:8080/api/collections/repos/separate%20with%20spaces","name":"separate
|
287
|
+
with spaces","command":"http://localhost:8080/api/collections/commands/1"}'
|
288
|
+
http_version:
|
289
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
290
|
+
- request:
|
291
|
+
method: get
|
292
|
+
uri: http://localhost:8080/api/collections/repos/separate%20with%20spaces
|
293
|
+
body:
|
294
|
+
encoding: US-ASCII
|
295
|
+
string: ''
|
296
|
+
headers:
|
297
|
+
Accept:
|
298
|
+
- application/json
|
299
|
+
Accept-Encoding:
|
300
|
+
- gzip, deflate
|
301
|
+
User-Agent:
|
302
|
+
- Ruby
|
303
|
+
response:
|
304
|
+
status:
|
305
|
+
code: 200
|
306
|
+
message: OK
|
307
|
+
headers:
|
308
|
+
Server:
|
309
|
+
- Apache-Coyote/1.1
|
310
|
+
X-Content-Type-Options:
|
311
|
+
- nosniff
|
312
|
+
Content-Type:
|
313
|
+
- application/json;charset=utf-8
|
314
|
+
Content-Length:
|
315
|
+
- '371'
|
316
|
+
Date:
|
317
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
318
|
+
body:
|
319
|
+
encoding: US-ASCII
|
320
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/repos/member","id":"http://localhost:8080/api/collections/repos/separate%20with%20spaces","name":"separate
|
321
|
+
with spaces","iso_url":null,"url":"http://url.com/some.iso","task":{"spec":"http://api.puppetlabs.com/razor/v1/collections/tasks/member","id":"http://localhost:8080/api/collections/tasks/noop","name":"noop"}}'
|
322
|
+
http_version:
|
323
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
324
|
+
- request:
|
325
|
+
method: get
|
326
|
+
uri: http://localhost:8080/api
|
327
|
+
body:
|
328
|
+
encoding: US-ASCII
|
329
|
+
string: ''
|
330
|
+
headers:
|
331
|
+
Accept:
|
332
|
+
- application/json
|
333
|
+
Accept-Encoding:
|
334
|
+
- gzip, deflate
|
335
|
+
User-Agent:
|
336
|
+
- Ruby
|
337
|
+
response:
|
338
|
+
status:
|
339
|
+
code: 200
|
340
|
+
message: OK
|
341
|
+
headers:
|
342
|
+
Server:
|
343
|
+
- Apache-Coyote/1.1
|
344
|
+
X-Content-Type-Options:
|
345
|
+
- nosniff
|
346
|
+
Content-Type:
|
347
|
+
- application/json;charset=utf-8
|
348
|
+
Content-Length:
|
349
|
+
- '4982'
|
350
|
+
Date:
|
351
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
352
|
+
body:
|
353
|
+
encoding: US-ASCII
|
354
|
+
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-125-g591a14d-dirty"}}'
|
355
|
+
http_version:
|
356
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
357
|
+
- request:
|
358
|
+
method: get
|
359
|
+
uri: http://localhost:8080/api/commands/create-repo
|
360
|
+
body:
|
361
|
+
encoding: US-ASCII
|
362
|
+
string: ''
|
363
|
+
headers:
|
364
|
+
Accept:
|
365
|
+
- application/json
|
366
|
+
Accept-Encoding:
|
367
|
+
- gzip, deflate
|
368
|
+
User-Agent:
|
369
|
+
- Ruby
|
370
|
+
response:
|
371
|
+
status:
|
372
|
+
code: 200
|
373
|
+
message: OK
|
374
|
+
headers:
|
375
|
+
Server:
|
376
|
+
- Apache-Coyote/1.1
|
377
|
+
Etag:
|
378
|
+
- '"server-version-v0.14.1-125-g591a14d-dirty"'
|
379
|
+
X-Content-Type-Options:
|
380
|
+
- nosniff
|
381
|
+
Content-Type:
|
382
|
+
- application/json;charset=utf-8
|
383
|
+
Content-Length:
|
384
|
+
- '3227'
|
385
|
+
Date:
|
386
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
387
|
+
body:
|
388
|
+
encoding: US-ASCII
|
389
|
+
string: '{"name":"create-repo","help":{"full":"# SYNOPSIS\nCreate a new repository,
|
390
|
+
from an ISO image or a URL\n\n# DESCRIPTION\nCreate a new repository, which
|
391
|
+
can either contain the content to install a\nnode, or simply point to an existing
|
392
|
+
online repository by URL.\n\n\n# Access Control\n\nThis command''s access
|
393
|
+
control pattern: `commands:create-repo:%{name}`\n\nWords surrounded by `%{...}`
|
394
|
+
are substitutions from the input data: typically\nthe name of the object being
|
395
|
+
modified, or some other critical detail, these\nallow roles to be granted
|
396
|
+
partial access to modify the system.\n\nFor more detail on how the permission
|
397
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
398
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
399
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
400
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
401
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
402
|
+
The name of the repository.\n - This attribute is required\n - It must
|
403
|
+
be of type string.\n - It must be between 1 and 250 in length.\n\n * url\n -
|
404
|
+
The URL of the remote repository to use.\n - It must be of type string.\n -
|
405
|
+
If present, iso-url must not be present.\n - It must be between 1 and 1000
|
406
|
+
in length.\n\n * iso-url\n - The URL of the ISO image to download and unpack
|
407
|
+
to create the\n repository. This can be an HTTP or HTTPS URL, or it can
|
408
|
+
be a\n file URL.\n \n In the later case, the file path is interpreted
|
409
|
+
as a path on the\n Razor server, rather than a path on the client. This
|
410
|
+
requires that\n you manually place the ISO image on the server before invoking
|
411
|
+
the\n command.\n - It must be of type string.\n - If present, url must
|
412
|
+
not be present.\n - It must be between 1 and 1000 in length.\n\n * task\n -
|
413
|
+
The name of the task associated with this repository. This is used to\n install
|
414
|
+
nodes that match a policy using this repository; generally it\n should match
|
415
|
+
the OS that the URL or ISO-URL attributes point to.\n - This attribute is
|
416
|
+
required\n - It must be of type string.\n\n\n\n# EXAMPLES\n Create a repository
|
417
|
+
from an ISO image, which will be downloaded and unpacked\n by the razor-server
|
418
|
+
in the background:\n \n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
419
|
+
\"http://example.com/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n You
|
420
|
+
can also unpack an ISO image from a file *on the server*; this does not\n upload
|
421
|
+
the file from the client:\n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
422
|
+
\"file:///tmp/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n Finally,
|
423
|
+
you can providing a `url` property when you create the repository;\n this
|
424
|
+
form is merely a pointer to a resource somehwere and nothing will be\n downloaded
|
425
|
+
onto the Razor server:\n \n {\n \"name\": \"fedora19\",\n \"url\": \"http://mirrors.n-ix.net/fedora/linux/releases/19/Fedora/x86_64/os/\"\n \"task\":
|
426
|
+
\"fedora\"\n }\n\n"},"schema":{"name":{"type":"string"},"url":{"type":"string"},"iso-url":{"type":"string"},"task":{"type":"string"}}}'
|
427
|
+
http_version:
|
428
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
429
|
+
- request:
|
430
|
+
method: get
|
431
|
+
uri: http://localhost:8080/api/commands/create-repo
|
432
|
+
body:
|
433
|
+
encoding: US-ASCII
|
434
|
+
string: ''
|
435
|
+
headers:
|
436
|
+
Accept:
|
437
|
+
- application/json
|
438
|
+
Accept-Encoding:
|
439
|
+
- gzip, deflate
|
440
|
+
User-Agent:
|
441
|
+
- Ruby
|
442
|
+
response:
|
443
|
+
status:
|
444
|
+
code: 200
|
445
|
+
message: OK
|
446
|
+
headers:
|
447
|
+
Server:
|
448
|
+
- Apache-Coyote/1.1
|
449
|
+
Etag:
|
450
|
+
- '"server-version-v0.14.1-125-g591a14d-dirty"'
|
451
|
+
X-Content-Type-Options:
|
452
|
+
- nosniff
|
453
|
+
Content-Type:
|
454
|
+
- application/json;charset=utf-8
|
455
|
+
Content-Length:
|
456
|
+
- '3227'
|
457
|
+
Date:
|
458
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
459
|
+
body:
|
460
|
+
encoding: US-ASCII
|
461
|
+
string: '{"name":"create-repo","help":{"full":"# SYNOPSIS\nCreate a new repository,
|
462
|
+
from an ISO image or a URL\n\n# DESCRIPTION\nCreate a new repository, which
|
463
|
+
can either contain the content to install a\nnode, or simply point to an existing
|
464
|
+
online repository by URL.\n\n\n# Access Control\n\nThis command''s access
|
465
|
+
control pattern: `commands:create-repo:%{name}`\n\nWords surrounded by `%{...}`
|
466
|
+
are substitutions from the input data: typically\nthe name of the object being
|
467
|
+
modified, or some other critical detail, these\nallow roles to be granted
|
468
|
+
partial access to modify the system.\n\nFor more detail on how the permission
|
469
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
470
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
471
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
472
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
473
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
474
|
+
The name of the repository.\n - This attribute is required\n - It must
|
475
|
+
be of type string.\n - It must be between 1 and 250 in length.\n\n * url\n -
|
476
|
+
The URL of the remote repository to use.\n - It must be of type string.\n -
|
477
|
+
If present, iso-url must not be present.\n - It must be between 1 and 1000
|
478
|
+
in length.\n\n * iso-url\n - The URL of the ISO image to download and unpack
|
479
|
+
to create the\n repository. This can be an HTTP or HTTPS URL, or it can
|
480
|
+
be a\n file URL.\n \n In the later case, the file path is interpreted
|
481
|
+
as a path on the\n Razor server, rather than a path on the client. This
|
482
|
+
requires that\n you manually place the ISO image on the server before invoking
|
483
|
+
the\n command.\n - It must be of type string.\n - If present, url must
|
484
|
+
not be present.\n - It must be between 1 and 1000 in length.\n\n * task\n -
|
485
|
+
The name of the task associated with this repository. This is used to\n install
|
486
|
+
nodes that match a policy using this repository; generally it\n should match
|
487
|
+
the OS that the URL or ISO-URL attributes point to.\n - This attribute is
|
488
|
+
required\n - It must be of type string.\n\n\n\n# EXAMPLES\n Create a repository
|
489
|
+
from an ISO image, which will be downloaded and unpacked\n by the razor-server
|
490
|
+
in the background:\n \n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
491
|
+
\"http://example.com/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n You
|
492
|
+
can also unpack an ISO image from a file *on the server*; this does not\n upload
|
493
|
+
the file from the client:\n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
494
|
+
\"file:///tmp/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n Finally,
|
495
|
+
you can providing a `url` property when you create the repository;\n this
|
496
|
+
form is merely a pointer to a resource somehwere and nothing will be\n downloaded
|
497
|
+
onto the Razor server:\n \n {\n \"name\": \"fedora19\",\n \"url\": \"http://mirrors.n-ix.net/fedora/linux/releases/19/Fedora/x86_64/os/\"\n \"task\":
|
498
|
+
\"fedora\"\n }\n\n"},"schema":{"name":{"type":"string"},"url":{"type":"string"},"iso-url":{"type":"string"},"task":{"type":"string"}}}'
|
499
|
+
http_version:
|
500
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
501
|
+
- request:
|
502
|
+
method: get
|
503
|
+
uri: http://localhost:8080/api/commands/create-repo
|
504
|
+
body:
|
505
|
+
encoding: US-ASCII
|
506
|
+
string: ''
|
507
|
+
headers:
|
508
|
+
Accept:
|
509
|
+
- application/json
|
510
|
+
Accept-Encoding:
|
511
|
+
- gzip, deflate
|
512
|
+
User-Agent:
|
513
|
+
- Ruby
|
514
|
+
response:
|
515
|
+
status:
|
516
|
+
code: 200
|
517
|
+
message: OK
|
518
|
+
headers:
|
519
|
+
Server:
|
520
|
+
- Apache-Coyote/1.1
|
521
|
+
Etag:
|
522
|
+
- '"server-version-v0.14.1-125-g591a14d-dirty"'
|
523
|
+
X-Content-Type-Options:
|
524
|
+
- nosniff
|
525
|
+
Content-Type:
|
526
|
+
- application/json;charset=utf-8
|
527
|
+
Content-Length:
|
528
|
+
- '3227'
|
529
|
+
Date:
|
530
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
531
|
+
body:
|
532
|
+
encoding: US-ASCII
|
533
|
+
string: '{"name":"create-repo","help":{"full":"# SYNOPSIS\nCreate a new repository,
|
534
|
+
from an ISO image or a URL\n\n# DESCRIPTION\nCreate a new repository, which
|
535
|
+
can either contain the content to install a\nnode, or simply point to an existing
|
536
|
+
online repository by URL.\n\n\n# Access Control\n\nThis command''s access
|
537
|
+
control pattern: `commands:create-repo:%{name}`\n\nWords surrounded by `%{...}`
|
538
|
+
are substitutions from the input data: typically\nthe name of the object being
|
539
|
+
modified, or some other critical detail, these\nallow roles to be granted
|
540
|
+
partial access to modify the system.\n\nFor more detail on how the permission
|
541
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
542
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
543
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
544
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
545
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
546
|
+
The name of the repository.\n - This attribute is required\n - It must
|
547
|
+
be of type string.\n - It must be between 1 and 250 in length.\n\n * url\n -
|
548
|
+
The URL of the remote repository to use.\n - It must be of type string.\n -
|
549
|
+
If present, iso-url must not be present.\n - It must be between 1 and 1000
|
550
|
+
in length.\n\n * iso-url\n - The URL of the ISO image to download and unpack
|
551
|
+
to create the\n repository. This can be an HTTP or HTTPS URL, or it can
|
552
|
+
be a\n file URL.\n \n In the later case, the file path is interpreted
|
553
|
+
as a path on the\n Razor server, rather than a path on the client. This
|
554
|
+
requires that\n you manually place the ISO image on the server before invoking
|
555
|
+
the\n command.\n - It must be of type string.\n - If present, url must
|
556
|
+
not be present.\n - It must be between 1 and 1000 in length.\n\n * task\n -
|
557
|
+
The name of the task associated with this repository. This is used to\n install
|
558
|
+
nodes that match a policy using this repository; generally it\n should match
|
559
|
+
the OS that the URL or ISO-URL attributes point to.\n - This attribute is
|
560
|
+
required\n - It must be of type string.\n\n\n\n# EXAMPLES\n Create a repository
|
561
|
+
from an ISO image, which will be downloaded and unpacked\n by the razor-server
|
562
|
+
in the background:\n \n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
563
|
+
\"http://example.com/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n You
|
564
|
+
can also unpack an ISO image from a file *on the server*; this does not\n upload
|
565
|
+
the file from the client:\n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
566
|
+
\"file:///tmp/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n Finally,
|
567
|
+
you can providing a `url` property when you create the repository;\n this
|
568
|
+
form is merely a pointer to a resource somehwere and nothing will be\n downloaded
|
569
|
+
onto the Razor server:\n \n {\n \"name\": \"fedora19\",\n \"url\": \"http://mirrors.n-ix.net/fedora/linux/releases/19/Fedora/x86_64/os/\"\n \"task\":
|
570
|
+
\"fedora\"\n }\n\n"},"schema":{"name":{"type":"string"},"url":{"type":"string"},"iso-url":{"type":"string"},"task":{"type":"string"}}}'
|
571
|
+
http_version:
|
572
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
573
|
+
- request:
|
574
|
+
method: post
|
575
|
+
uri: http://localhost:8080/api/commands/create-repo
|
576
|
+
body:
|
577
|
+
encoding: UTF-8
|
578
|
+
string: '{"name":"double-quote with spaces\"","url":"http://url.com/some.iso","task":"noop"}'
|
579
|
+
headers:
|
580
|
+
Accept:
|
581
|
+
- application/json
|
582
|
+
Accept-Encoding:
|
583
|
+
- gzip, deflate
|
584
|
+
Content-Type:
|
585
|
+
- application/json
|
586
|
+
Content-Length:
|
587
|
+
- '83'
|
588
|
+
User-Agent:
|
589
|
+
- Ruby
|
590
|
+
response:
|
591
|
+
status:
|
592
|
+
code: 202
|
593
|
+
message: Accepted
|
594
|
+
headers:
|
595
|
+
Server:
|
596
|
+
- Apache-Coyote/1.1
|
597
|
+
X-Content-Type-Options:
|
598
|
+
- nosniff
|
599
|
+
Content-Type:
|
600
|
+
- application/json;charset=utf-8
|
601
|
+
Content-Length:
|
602
|
+
- '250'
|
603
|
+
Date:
|
604
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
605
|
+
body:
|
606
|
+
encoding: US-ASCII
|
607
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/repos/member","id":"http://localhost:8080/api/collections/repos/double-quote%20with%20spaces%22","name":"double-quote
|
608
|
+
with spaces\"","command":"http://localhost:8080/api/collections/commands/2"}'
|
609
|
+
http_version:
|
610
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
611
|
+
- request:
|
612
|
+
method: get
|
613
|
+
uri: http://localhost:8080/api/collections/repos/double-quote%20with%20spaces%22
|
614
|
+
body:
|
615
|
+
encoding: US-ASCII
|
616
|
+
string: ''
|
617
|
+
headers:
|
618
|
+
Accept:
|
619
|
+
- application/json
|
620
|
+
Accept-Encoding:
|
621
|
+
- gzip, deflate
|
622
|
+
User-Agent:
|
623
|
+
- Ruby
|
624
|
+
response:
|
625
|
+
status:
|
626
|
+
code: 200
|
627
|
+
message: OK
|
628
|
+
headers:
|
629
|
+
Server:
|
630
|
+
- Apache-Coyote/1.1
|
631
|
+
X-Content-Type-Options:
|
632
|
+
- nosniff
|
633
|
+
Content-Type:
|
634
|
+
- application/json;charset=utf-8
|
635
|
+
Content-Length:
|
636
|
+
- '384'
|
637
|
+
Date:
|
638
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
639
|
+
body:
|
640
|
+
encoding: US-ASCII
|
641
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/repos/member","id":"http://localhost:8080/api/collections/repos/double-quote%20with%20spaces%22","name":"double-quote
|
642
|
+
with spaces\"","iso_url":null,"url":"http://url.com/some.iso","task":{"spec":"http://api.puppetlabs.com/razor/v1/collections/tasks/member","id":"http://localhost:8080/api/collections/tasks/noop","name":"noop"}}'
|
643
|
+
http_version:
|
644
|
+
recorded_at: Wed, 21 May 2014 21:40:46 GMT
|
645
|
+
- request:
|
646
|
+
method: get
|
647
|
+
uri: http://localhost:8080/api
|
648
|
+
body:
|
649
|
+
encoding: US-ASCII
|
650
|
+
string: ''
|
651
|
+
headers:
|
652
|
+
Accept:
|
653
|
+
- application/json
|
654
|
+
Accept-Encoding:
|
655
|
+
- gzip, deflate
|
656
|
+
User-Agent:
|
657
|
+
- Ruby
|
658
|
+
response:
|
659
|
+
status:
|
660
|
+
code: 200
|
661
|
+
message: OK
|
662
|
+
headers:
|
663
|
+
Server:
|
664
|
+
- Apache-Coyote/1.1
|
665
|
+
X-Content-Type-Options:
|
666
|
+
- nosniff
|
667
|
+
Content-Type:
|
668
|
+
- application/json;charset=utf-8
|
669
|
+
Content-Length:
|
670
|
+
- '4982'
|
671
|
+
Date:
|
672
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
673
|
+
body:
|
674
|
+
encoding: US-ASCII
|
675
|
+
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-125-g591a14d-dirty"}}'
|
676
|
+
http_version:
|
677
|
+
recorded_at: Wed, 21 May 2014 21:40:47 GMT
|
678
|
+
- request:
|
679
|
+
method: get
|
680
|
+
uri: http://localhost:8080/api/commands/create-repo
|
681
|
+
body:
|
682
|
+
encoding: US-ASCII
|
683
|
+
string: ''
|
684
|
+
headers:
|
685
|
+
Accept:
|
686
|
+
- application/json
|
687
|
+
Accept-Encoding:
|
688
|
+
- gzip, deflate
|
689
|
+
User-Agent:
|
690
|
+
- Ruby
|
691
|
+
response:
|
692
|
+
status:
|
693
|
+
code: 200
|
694
|
+
message: OK
|
695
|
+
headers:
|
696
|
+
Server:
|
697
|
+
- Apache-Coyote/1.1
|
698
|
+
Etag:
|
699
|
+
- '"server-version-v0.14.1-125-g591a14d-dirty"'
|
700
|
+
X-Content-Type-Options:
|
701
|
+
- nosniff
|
702
|
+
Content-Type:
|
703
|
+
- application/json;charset=utf-8
|
704
|
+
Content-Length:
|
705
|
+
- '3227'
|
706
|
+
Date:
|
707
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
708
|
+
body:
|
709
|
+
encoding: US-ASCII
|
710
|
+
string: '{"name":"create-repo","help":{"full":"# SYNOPSIS\nCreate a new repository,
|
711
|
+
from an ISO image or a URL\n\n# DESCRIPTION\nCreate a new repository, which
|
712
|
+
can either contain the content to install a\nnode, or simply point to an existing
|
713
|
+
online repository by URL.\n\n\n# Access Control\n\nThis command''s access
|
714
|
+
control pattern: `commands:create-repo:%{name}`\n\nWords surrounded by `%{...}`
|
715
|
+
are substitutions from the input data: typically\nthe name of the object being
|
716
|
+
modified, or some other critical detail, these\nallow roles to be granted
|
717
|
+
partial access to modify the system.\n\nFor more detail on how the permission
|
718
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
719
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
720
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
721
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
722
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
723
|
+
The name of the repository.\n - This attribute is required\n - It must
|
724
|
+
be of type string.\n - It must be between 1 and 250 in length.\n\n * url\n -
|
725
|
+
The URL of the remote repository to use.\n - It must be of type string.\n -
|
726
|
+
If present, iso-url must not be present.\n - It must be between 1 and 1000
|
727
|
+
in length.\n\n * iso-url\n - The URL of the ISO image to download and unpack
|
728
|
+
to create the\n repository. This can be an HTTP or HTTPS URL, or it can
|
729
|
+
be a\n file URL.\n \n In the later case, the file path is interpreted
|
730
|
+
as a path on the\n Razor server, rather than a path on the client. This
|
731
|
+
requires that\n you manually place the ISO image on the server before invoking
|
732
|
+
the\n command.\n - It must be of type string.\n - If present, url must
|
733
|
+
not be present.\n - It must be between 1 and 1000 in length.\n\n * task\n -
|
734
|
+
The name of the task associated with this repository. This is used to\n install
|
735
|
+
nodes that match a policy using this repository; generally it\n should match
|
736
|
+
the OS that the URL or ISO-URL attributes point to.\n - This attribute is
|
737
|
+
required\n - It must be of type string.\n\n\n\n# EXAMPLES\n Create a repository
|
738
|
+
from an ISO image, which will be downloaded and unpacked\n by the razor-server
|
739
|
+
in the background:\n \n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
740
|
+
\"http://example.com/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n You
|
741
|
+
can also unpack an ISO image from a file *on the server*; this does not\n upload
|
742
|
+
the file from the client:\n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
743
|
+
\"file:///tmp/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n Finally,
|
744
|
+
you can providing a `url` property when you create the repository;\n this
|
745
|
+
form is merely a pointer to a resource somehwere and nothing will be\n downloaded
|
746
|
+
onto the Razor server:\n \n {\n \"name\": \"fedora19\",\n \"url\": \"http://mirrors.n-ix.net/fedora/linux/releases/19/Fedora/x86_64/os/\"\n \"task\":
|
747
|
+
\"fedora\"\n }\n\n"},"schema":{"name":{"type":"string"},"url":{"type":"string"},"iso-url":{"type":"string"},"task":{"type":"string"}}}'
|
748
|
+
http_version:
|
749
|
+
recorded_at: Wed, 21 May 2014 21:40:47 GMT
|
750
|
+
- request:
|
751
|
+
method: get
|
752
|
+
uri: http://localhost:8080/api/commands/create-repo
|
753
|
+
body:
|
754
|
+
encoding: US-ASCII
|
755
|
+
string: ''
|
756
|
+
headers:
|
757
|
+
Accept:
|
758
|
+
- application/json
|
759
|
+
Accept-Encoding:
|
760
|
+
- gzip, deflate
|
761
|
+
User-Agent:
|
762
|
+
- Ruby
|
763
|
+
response:
|
764
|
+
status:
|
765
|
+
code: 200
|
766
|
+
message: OK
|
767
|
+
headers:
|
768
|
+
Server:
|
769
|
+
- Apache-Coyote/1.1
|
770
|
+
Etag:
|
771
|
+
- '"server-version-v0.14.1-125-g591a14d-dirty"'
|
772
|
+
X-Content-Type-Options:
|
773
|
+
- nosniff
|
774
|
+
Content-Type:
|
775
|
+
- application/json;charset=utf-8
|
776
|
+
Content-Length:
|
777
|
+
- '3227'
|
778
|
+
Date:
|
779
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
780
|
+
body:
|
781
|
+
encoding: US-ASCII
|
782
|
+
string: '{"name":"create-repo","help":{"full":"# SYNOPSIS\nCreate a new repository,
|
783
|
+
from an ISO image or a URL\n\n# DESCRIPTION\nCreate a new repository, which
|
784
|
+
can either contain the content to install a\nnode, or simply point to an existing
|
785
|
+
online repository by URL.\n\n\n# Access Control\n\nThis command''s access
|
786
|
+
control pattern: `commands:create-repo:%{name}`\n\nWords surrounded by `%{...}`
|
787
|
+
are substitutions from the input data: typically\nthe name of the object being
|
788
|
+
modified, or some other critical detail, these\nallow roles to be granted
|
789
|
+
partial access to modify the system.\n\nFor more detail on how the permission
|
790
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
791
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
792
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
793
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
794
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
795
|
+
The name of the repository.\n - This attribute is required\n - It must
|
796
|
+
be of type string.\n - It must be between 1 and 250 in length.\n\n * url\n -
|
797
|
+
The URL of the remote repository to use.\n - It must be of type string.\n -
|
798
|
+
If present, iso-url must not be present.\n - It must be between 1 and 1000
|
799
|
+
in length.\n\n * iso-url\n - The URL of the ISO image to download and unpack
|
800
|
+
to create the\n repository. This can be an HTTP or HTTPS URL, or it can
|
801
|
+
be a\n file URL.\n \n In the later case, the file path is interpreted
|
802
|
+
as a path on the\n Razor server, rather than a path on the client. This
|
803
|
+
requires that\n you manually place the ISO image on the server before invoking
|
804
|
+
the\n command.\n - It must be of type string.\n - If present, url must
|
805
|
+
not be present.\n - It must be between 1 and 1000 in length.\n\n * task\n -
|
806
|
+
The name of the task associated with this repository. This is used to\n install
|
807
|
+
nodes that match a policy using this repository; generally it\n should match
|
808
|
+
the OS that the URL or ISO-URL attributes point to.\n - This attribute is
|
809
|
+
required\n - It must be of type string.\n\n\n\n# EXAMPLES\n Create a repository
|
810
|
+
from an ISO image, which will be downloaded and unpacked\n by the razor-server
|
811
|
+
in the background:\n \n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
812
|
+
\"http://example.com/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n You
|
813
|
+
can also unpack an ISO image from a file *on the server*; this does not\n upload
|
814
|
+
the file from the client:\n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
815
|
+
\"file:///tmp/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n Finally,
|
816
|
+
you can providing a `url` property when you create the repository;\n this
|
817
|
+
form is merely a pointer to a resource somehwere and nothing will be\n downloaded
|
818
|
+
onto the Razor server:\n \n {\n \"name\": \"fedora19\",\n \"url\": \"http://mirrors.n-ix.net/fedora/linux/releases/19/Fedora/x86_64/os/\"\n \"task\":
|
819
|
+
\"fedora\"\n }\n\n"},"schema":{"name":{"type":"string"},"url":{"type":"string"},"iso-url":{"type":"string"},"task":{"type":"string"}}}'
|
820
|
+
http_version:
|
821
|
+
recorded_at: Wed, 21 May 2014 21:40:47 GMT
|
822
|
+
- request:
|
823
|
+
method: get
|
824
|
+
uri: http://localhost:8080/api/commands/create-repo
|
825
|
+
body:
|
826
|
+
encoding: US-ASCII
|
827
|
+
string: ''
|
828
|
+
headers:
|
829
|
+
Accept:
|
830
|
+
- application/json
|
831
|
+
Accept-Encoding:
|
832
|
+
- gzip, deflate
|
833
|
+
User-Agent:
|
834
|
+
- Ruby
|
835
|
+
response:
|
836
|
+
status:
|
837
|
+
code: 200
|
838
|
+
message: OK
|
839
|
+
headers:
|
840
|
+
Server:
|
841
|
+
- Apache-Coyote/1.1
|
842
|
+
Etag:
|
843
|
+
- '"server-version-v0.14.1-125-g591a14d-dirty"'
|
844
|
+
X-Content-Type-Options:
|
845
|
+
- nosniff
|
846
|
+
Content-Type:
|
847
|
+
- application/json;charset=utf-8
|
848
|
+
Content-Length:
|
849
|
+
- '3227'
|
850
|
+
Date:
|
851
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
852
|
+
body:
|
853
|
+
encoding: US-ASCII
|
854
|
+
string: '{"name":"create-repo","help":{"full":"# SYNOPSIS\nCreate a new repository,
|
855
|
+
from an ISO image or a URL\n\n# DESCRIPTION\nCreate a new repository, which
|
856
|
+
can either contain the content to install a\nnode, or simply point to an existing
|
857
|
+
online repository by URL.\n\n\n# Access Control\n\nThis command''s access
|
858
|
+
control pattern: `commands:create-repo:%{name}`\n\nWords surrounded by `%{...}`
|
859
|
+
are substitutions from the input data: typically\nthe name of the object being
|
860
|
+
modified, or some other critical detail, these\nallow roles to be granted
|
861
|
+
partial access to modify the system.\n\nFor more detail on how the permission
|
862
|
+
strings are structured and work, you can\nsee the [Shiro Permissions documentation][shiro]. That
|
863
|
+
pattern is expanded\nand then a permission check applied to it, before the
|
864
|
+
command is authorized.\n\nThese checks only apply if security is enabled in
|
865
|
+
the Razor configuration\nfile; on this server security is currently disabled.\n\n[shiro]:
|
866
|
+
http://shiro.apache.org/permissions.html\n\n# Attributes\n\n * name\n -
|
867
|
+
The name of the repository.\n - This attribute is required\n - It must
|
868
|
+
be of type string.\n - It must be between 1 and 250 in length.\n\n * url\n -
|
869
|
+
The URL of the remote repository to use.\n - It must be of type string.\n -
|
870
|
+
If present, iso-url must not be present.\n - It must be between 1 and 1000
|
871
|
+
in length.\n\n * iso-url\n - The URL of the ISO image to download and unpack
|
872
|
+
to create the\n repository. This can be an HTTP or HTTPS URL, or it can
|
873
|
+
be a\n file URL.\n \n In the later case, the file path is interpreted
|
874
|
+
as a path on the\n Razor server, rather than a path on the client. This
|
875
|
+
requires that\n you manually place the ISO image on the server before invoking
|
876
|
+
the\n command.\n - It must be of type string.\n - If present, url must
|
877
|
+
not be present.\n - It must be between 1 and 1000 in length.\n\n * task\n -
|
878
|
+
The name of the task associated with this repository. This is used to\n install
|
879
|
+
nodes that match a policy using this repository; generally it\n should match
|
880
|
+
the OS that the URL or ISO-URL attributes point to.\n - This attribute is
|
881
|
+
required\n - It must be of type string.\n\n\n\n# EXAMPLES\n Create a repository
|
882
|
+
from an ISO image, which will be downloaded and unpacked\n by the razor-server
|
883
|
+
in the background:\n \n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
884
|
+
\"http://example.com/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n You
|
885
|
+
can also unpack an ISO image from a file *on the server*; this does not\n upload
|
886
|
+
the file from the client:\n {\n \"name\": \"fedora19\",\n \"iso-url\":
|
887
|
+
\"file:///tmp/Fedora-19-x86_64-DVD.iso\"\n \"task\": \"fedora\"\n }\n \n Finally,
|
888
|
+
you can providing a `url` property when you create the repository;\n this
|
889
|
+
form is merely a pointer to a resource somehwere and nothing will be\n downloaded
|
890
|
+
onto the Razor server:\n \n {\n \"name\": \"fedora19\",\n \"url\": \"http://mirrors.n-ix.net/fedora/linux/releases/19/Fedora/x86_64/os/\"\n \"task\":
|
891
|
+
\"fedora\"\n }\n\n"},"schema":{"name":{"type":"string"},"url":{"type":"string"},"iso-url":{"type":"string"},"task":{"type":"string"}}}'
|
892
|
+
http_version:
|
893
|
+
recorded_at: Wed, 21 May 2014 21:40:47 GMT
|
894
|
+
- request:
|
895
|
+
method: post
|
896
|
+
uri: http://localhost:8080/api/commands/create-repo
|
897
|
+
body:
|
898
|
+
encoding: UTF-8
|
899
|
+
string: '{"name":"single-quote with spaces''","url":"http://url.com/some.iso","task":"noop"}'
|
900
|
+
headers:
|
901
|
+
Accept:
|
902
|
+
- application/json
|
903
|
+
Accept-Encoding:
|
904
|
+
- gzip, deflate
|
905
|
+
Content-Type:
|
906
|
+
- application/json
|
907
|
+
Content-Length:
|
908
|
+
- '82'
|
909
|
+
User-Agent:
|
910
|
+
- Ruby
|
911
|
+
response:
|
912
|
+
status:
|
913
|
+
code: 202
|
914
|
+
message: Accepted
|
915
|
+
headers:
|
916
|
+
Server:
|
917
|
+
- Apache-Coyote/1.1
|
918
|
+
X-Content-Type-Options:
|
919
|
+
- nosniff
|
920
|
+
Content-Type:
|
921
|
+
- application/json;charset=utf-8
|
922
|
+
Content-Length:
|
923
|
+
- '247'
|
924
|
+
Date:
|
925
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
926
|
+
body:
|
927
|
+
encoding: US-ASCII
|
928
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/repos/member","id":"http://localhost:8080/api/collections/repos/single-quote%20with%20spaces''","name":"single-quote
|
929
|
+
with spaces''","command":"http://localhost:8080/api/collections/commands/3"}'
|
930
|
+
http_version:
|
931
|
+
recorded_at: Wed, 21 May 2014 21:40:47 GMT
|
932
|
+
- request:
|
933
|
+
method: get
|
934
|
+
uri: http://localhost:8080/api/collections/repos/single-quote%20with%20spaces'
|
935
|
+
body:
|
936
|
+
encoding: US-ASCII
|
937
|
+
string: ''
|
938
|
+
headers:
|
939
|
+
Accept:
|
940
|
+
- application/json
|
941
|
+
Accept-Encoding:
|
942
|
+
- gzip, deflate
|
943
|
+
User-Agent:
|
944
|
+
- Ruby
|
945
|
+
response:
|
946
|
+
status:
|
947
|
+
code: 200
|
948
|
+
message: OK
|
949
|
+
headers:
|
950
|
+
Server:
|
951
|
+
- Apache-Coyote/1.1
|
952
|
+
X-Content-Type-Options:
|
953
|
+
- nosniff
|
954
|
+
Content-Type:
|
955
|
+
- application/json;charset=utf-8
|
956
|
+
Content-Length:
|
957
|
+
- '381'
|
958
|
+
Date:
|
959
|
+
- Wed, 21 May 2014 21:40:46 GMT
|
960
|
+
body:
|
961
|
+
encoding: US-ASCII
|
962
|
+
string: '{"spec":"http://api.puppetlabs.com/razor/v1/collections/repos/member","id":"http://localhost:8080/api/collections/repos/single-quote%20with%20spaces''","name":"single-quote
|
963
|
+
with spaces''","iso_url":null,"url":"http://url.com/some.iso","task":{"spec":"http://api.puppetlabs.com/razor/v1/collections/tasks/member","id":"http://localhost:8080/api/collections/tasks/noop","name":"noop"}}'
|
964
|
+
http_version:
|
965
|
+
recorded_at: Wed, 21 May 2014 21:40:47 GMT
|
966
|
+
recorded_with: VCR 2.5.0
|