lumberg 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/.travis.yml +9 -3
  2. data/LICENSE +1 -1
  3. data/README.md +1 -1
  4. data/Rakefile +3 -1
  5. data/lib/lumberg.rb +32 -7
  6. data/lib/lumberg/config.rb +19 -0
  7. data/lib/lumberg/format_whm.rb +102 -0
  8. data/lib/lumberg/version.rb +1 -1
  9. data/lib/lumberg/whm/server.rb +42 -163
  10. data/lumberg.gemspec +7 -4
  11. data/spec/config_spec.rb +28 -0
  12. data/spec/spec_helper.rb +3 -3
  13. data/spec/vcr_cassettes/whm/account/accountsummary.yml +41 -29
  14. data/spec/vcr_cassettes/whm/account/changepackage.yml +73 -43
  15. data/spec/vcr_cassettes/whm/account/createacct.yml +101 -31
  16. data/spec/vcr_cassettes/whm/account/domainuserdata.yml +43 -29
  17. data/spec/vcr_cassettes/whm/account/editquota.yml +78 -57
  18. data/spec/vcr_cassettes/whm/account/limitbw.yml +79 -57
  19. data/spec/vcr_cassettes/whm/account/listaccts.yml +195 -100
  20. data/spec/vcr_cassettes/whm/account/listsuspended.yml +41 -29
  21. data/spec/vcr_cassettes/whm/account/modifyacct.yml +61 -42
  22. data/spec/vcr_cassettes/whm/account/myprivs.yml +41 -29
  23. data/spec/vcr_cassettes/whm/account/passwd.yml +44 -29
  24. data/spec/vcr_cassettes/whm/account/removeacct.yml +134 -57
  25. data/spec/vcr_cassettes/whm/account/restoreaccount.yml +310 -135
  26. data/spec/vcr_cassettes/whm/account/setsiteip.yml +166 -127
  27. data/spec/vcr_cassettes/whm/account/suspend.yml +75 -43
  28. data/spec/vcr_cassettes/whm/account/unsuspend.yml +46 -29
  29. data/spec/vcr_cassettes/whm/dns/adddns.yml +61 -43
  30. data/spec/vcr_cassettes/whm/dns/addzonerecord.yml +42 -29
  31. data/spec/vcr_cassettes/whm/dns/dumpzone.yml +44 -29
  32. data/spec/vcr_cassettes/whm/dns/editzonerecord.yml +61 -43
  33. data/spec/vcr_cassettes/whm/dns/getzonerecord.yml +60 -43
  34. data/spec/vcr_cassettes/whm/dns/killdns.yml +42 -29
  35. data/spec/vcr_cassettes/whm/dns/listmxs.yml +23 -15
  36. data/spec/vcr_cassettes/whm/dns/listzones.yml +22 -15
  37. data/spec/vcr_cassettes/whm/dns/lookupnsip.yml +40 -29
  38. data/spec/vcr_cassettes/whm/dns/removezonerecord.yml +61 -43
  39. data/spec/vcr_cassettes/whm/dns/resetzone.yml +42 -29
  40. data/spec/vcr_cassettes/whm/dns/resolvedomainname.yml +40 -29
  41. data/spec/vcr_cassettes/whm/dns/savemxs.yml +23 -15
  42. data/spec/vcr_cassettes/whm/reseller/acctcounts.yml +41 -29
  43. data/spec/vcr_cassettes/whm/reseller/listacls.yml +22 -15
  44. data/spec/vcr_cassettes/whm/reseller/listresellers.yml +22 -15
  45. data/spec/vcr_cassettes/whm/reseller/resellerstats.yml +42 -29
  46. data/spec/vcr_cassettes/whm/reseller/saveacllist.yml +76 -57
  47. data/spec/vcr_cassettes/whm/reseller/setacls.yml +40 -29
  48. data/spec/vcr_cassettes/whm/reseller/setresellerips.yml +42 -28
  49. data/spec/vcr_cassettes/whm/reseller/setresellerlimits.yml +41 -29
  50. data/spec/vcr_cassettes/whm/reseller/setresellermainip.yml +59 -43
  51. data/spec/vcr_cassettes/whm/reseller/setresellernameservers.yml +58 -43
  52. data/spec/vcr_cassettes/whm/reseller/setresellerpackagelimit.yml +61 -43
  53. data/spec/vcr_cassettes/whm/reseller/setupreseller.yml +41 -29
  54. data/spec/vcr_cassettes/whm/reseller/suspendreseller.yml +75 -44
  55. data/spec/vcr_cassettes/whm/reseller/terminatereseller.yml +83 -46
  56. data/spec/vcr_cassettes/whm/reseller/unsetupreseller.yml +41 -29
  57. data/spec/vcr_cassettes/whm/reseller/unsuspendreseller.yml +46 -29
  58. data/spec/vcr_cassettes/whm/server/addip.yml +24 -15
  59. data/spec/vcr_cassettes/whm/server/applist.yml +22 -15
  60. data/spec/vcr_cassettes/whm/server/delip.yml +23 -15
  61. data/spec/vcr_cassettes/whm/server/gethostname.yml +22 -15
  62. data/spec/vcr_cassettes/whm/server/getlanglist.yml +22 -15
  63. data/spec/vcr_cassettes/whm/server/listips.yml +22 -15
  64. data/spec/vcr_cassettes/whm/server/loadavg.yml +26 -19
  65. data/spec/vcr_cassettes/whm/server/my_function.yml +59 -43
  66. data/spec/vcr_cassettes/whm/server/nvget.yml +22 -15
  67. data/spec/vcr_cassettes/whm/server/nvset.yml +22 -15
  68. data/spec/vcr_cassettes/whm/server/reboot.yml +22 -15
  69. data/spec/vcr_cassettes/whm/server/sethostname.yml +24 -15
  70. data/spec/vcr_cassettes/whm/server/setresolvers.yml +23 -15
  71. data/spec/vcr_cassettes/whm/server/showbw.yml +22 -15
  72. data/spec/vcr_cassettes/whm/server/systemloadavg.yml +40 -29
  73. data/spec/vcr_cassettes/whm/server/version.yml +22 -15
  74. data/spec/whm/account_spec.rb +0 -1
  75. data/spec/whm/server_spec.rb +2 -106
  76. metadata +98 -26
  77. data/lib/net_http_hacked.rb +0 -42
  78. data/spec/vcr_cassettes/whm/server/response_type.yml +0 -85
data/lumberg.gemspec CHANGED
@@ -14,11 +14,14 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.rubyforge_project = "lumberg"
16
16
 
17
- s.add_dependency 'json'
17
+ s.add_dependency 'json', '~> 1.7.3'
18
+ s.add_dependency 'excon' , '~> 0.14.0'
19
+ s.add_runtime_dependency 'faraday', '~> 0.8.1'
20
+ s.add_runtime_dependency 'faraday_middleware', '~> 0.8.4'
18
21
  s.add_runtime_dependency('jruby-openssl', '~> 0.7.3') if RUBY_PLATFORM == 'java'
19
- s.add_development_dependency 'rspec', '~> 2.8.0'
20
- s.add_development_dependency 'fakeweb', '~> 1.3.0'
21
- s.add_development_dependency 'vcr', '~> 1.11.3'
22
+ s.add_development_dependency 'rspec', '~> 2.10.0'
23
+ s.add_development_dependency 'webmock', '~> 1.8.7'
24
+ s.add_development_dependency 'vcr', '~> 2.0.0rc2'
22
25
  s.add_development_dependency 'rake', '~> 0.9.2.2'
23
26
 
24
27
  s.files = `git ls-files`.split("\n")
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ describe Lumberg::Config do
4
+ before(:each) do
5
+ @config = Lumberg::Config.new
6
+ end
7
+
8
+ describe "#new" do
9
+ it "sets up the @config hash" do
10
+ @config.options.should == {}
11
+ end
12
+ end
13
+
14
+ describe "#[]" do
15
+ it "behaves like an array" do
16
+ @config.options[:something] = 1
17
+ @config[:something].should == 1
18
+ end
19
+ end
20
+
21
+ describe "#debug" do
22
+ it "configures net/http to log to console" do
23
+ @config.options[:debug].should be_nil
24
+ @config.debug true
25
+ @config.options[:debug].should == true
26
+ end
27
+ end
28
+ end
data/spec/spec_helper.rb CHANGED
@@ -5,10 +5,10 @@ require 'lumberg/exceptions'
5
5
  require 'vcr'
6
6
  require 'timeout'
7
7
 
8
- VCR.config do |c|
8
+ VCR.configure do |c|
9
9
  c.cassette_library_dir = 'spec/vcr_cassettes'
10
- c.stub_with :fakeweb
11
- c.default_cassette_options = {:record => :new_episodes}
10
+ c.hook_into :webmock
11
+ c.default_cassette_options = {:record => :none}
12
12
  end
13
13
 
14
14
  def live_test?
@@ -1,43 +1,55 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
5
  uri: https://myhost.com:2087/json-api/accountsummary?user=summary
6
- body:
7
- headers:
8
- authorization:
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Authorization:
9
11
  - WHM root:iscool
10
- response: !ruby/struct:VCR::Response
11
- status: !ruby/struct:VCR::ResponseStatus
12
+ response:
13
+ status:
12
14
  code: 200
13
15
  message: OK
14
- headers:
15
- server:
16
+ headers:
17
+ Server:
16
18
  - cpsrvd/11.28.64
17
- transfer-encoding:
19
+ Transfer-Encoding:
18
20
  - chunked
19
- content-type:
21
+ Content-Type:
20
22
  - text/plain
21
- body: "{\"status\":1,\"statusmsg\":\"Ok\",\"acct\":[{\"startdate\":\"10 Dec 16 10:24\",\"plan\":\"default\",\"suspended\":0,\"theme\":\"na4\",\"shell\":\"/usr/local/cpanel/bin/jailshell\",\"maxpop\":\"unlimited\",\"maxlst\":\"unlimited\",\"maxaddons\":\"9999\",\"suspendtime\":null,\"ip\":\"192.1.2.3\",\"maxsub\":\"unlimited\",\"domain\":\"summary.com\",\"maxsql\":\"unlimited\",\"partition\":\"home\",\"maxftp\":\"unlimited\",\"user\":\"summary\",\"suspendreason\":\"not suspended\",\"unix_startdate\":\"1292516679\",\"diskused\":\"0M\",\"maxparked\":\"9999\",\"email\":\"timtesting@timtesting.com\",\"disklimit\":\"unlimited\",\"owner\":\"root\"}]}"
22
- http_version: "1.1"
23
- - !ruby/struct:VCR::HTTPInteraction
24
- request: !ruby/struct:VCR::Request
25
- method: :get
23
+ body:
24
+ encoding: UTF-8
25
+ string: ! '{"status":1,"statusmsg":"Ok","acct":[{"startdate":"10 Dec 16 10:24","plan":"default","suspended":0,"theme":"na4","shell":"/usr/local/cpanel/bin/jailshell","maxpop":"unlimited","maxlst":"unlimited","maxaddons":"9999","suspendtime":null,"ip":"192.1.2.3","maxsub":"unlimited","domain":"summary.com","maxsql":"unlimited","partition":"home","maxftp":"unlimited","user":"summary","suspendreason":"not
26
+ suspended","unix_startdate":"1292516679","diskused":"0M","maxparked":"9999","email":"timtesting@timtesting.com","disklimit":"unlimited","owner":"root"}]}'
27
+ http_version: '1.1'
28
+ recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
29
+ - request:
30
+ method: get
26
31
  uri: https://myhost.com:2087/json-api/accountsummary?user=notexists
27
- body:
28
- headers:
29
- authorization:
32
+ body:
33
+ encoding: US-ASCII
34
+ string: ''
35
+ headers:
36
+ Authorization:
30
37
  - WHM root:iscool
31
- response: !ruby/struct:VCR::Response
32
- status: !ruby/struct:VCR::ResponseStatus
38
+ response:
39
+ status:
33
40
  code: 200
34
41
  message: OK
35
- headers:
36
- server:
42
+ headers:
43
+ Server:
37
44
  - cpsrvd/11.28.64
38
- transfer-encoding:
45
+ Transfer-Encoding:
39
46
  - chunked
40
- content-type:
47
+ Content-Type:
41
48
  - text/plain
42
- body: "{\"status\":0,\"statusmsg\":\"Account does not exist\",\"acct\":null}"
43
- http_version: "1.1"
49
+ body:
50
+ encoding: UTF-8
51
+ string: ! '{"status":0,"statusmsg":"Account does not exist","acct":null}'
52
+ http_version: '1.1'
53
+ recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
54
+ recorded_with: VCR 2.0.0
55
+ ...
@@ -1,64 +1,94 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
5
  uri: https://myhost.com:2087/json-api/changepackage?pkg=default&user=notexists
6
- body:
7
- headers:
8
- authorization:
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Authorization:
9
11
  - WHM root:iscool
10
- response: !ruby/struct:VCR::Response
11
- status: !ruby/struct:VCR::ResponseStatus
12
+ response:
13
+ status:
12
14
  code: 200
13
15
  message: OK
14
- headers:
15
- content-type:
16
+ headers:
17
+ Content-Type:
16
18
  - text/plain
17
- server:
19
+ Server:
18
20
  - cpsrvd/11.28.64
19
- transfer-encoding:
21
+ Transfer-Encoding:
20
22
  - chunked
21
- body: "{\"result\":[{\"status\":0,\"statusmsg\":\"Sorry the user notexists does not exist\",\"rawout\":null}]}"
22
- http_version: "1.1"
23
- - !ruby/struct:VCR::HTTPInteraction
24
- request: !ruby/struct:VCR::Request
25
- method: :get
23
+ body:
24
+ encoding: UTF-8
25
+ string: ! '{"result":[{"status":0,"statusmsg":"Sorry the user notexists does
26
+ not exist","rawout":null}]}'
27
+ http_version: '1.1'
28
+ recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
29
+ - request:
30
+ method: get
26
31
  uri: https://myhost.com:2087/json-api/changepackage?pkg=fakepackage&user=changeme
27
- body:
28
- headers:
29
- authorization:
32
+ body:
33
+ encoding: US-ASCII
34
+ string: ''
35
+ headers:
36
+ Authorization:
30
37
  - WHM root:iscool
31
- response: !ruby/struct:VCR::Response
32
- status: !ruby/struct:VCR::ResponseStatus
38
+ response:
39
+ status:
33
40
  code: 200
34
41
  message: OK
35
- headers:
36
- content-type:
42
+ headers:
43
+ Content-Type:
37
44
  - text/plain
38
- server:
45
+ Server:
39
46
  - cpsrvd/11.28.64
40
- transfer-encoding:
47
+ Transfer-Encoding:
41
48
  - chunked
42
- body: "{\"result\":[{\"status\":0,\"statusmsg\":\"Specified package does not exist.\",\"rawout\":null}]}"
43
- http_version: "1.1"
44
- - !ruby/struct:VCR::HTTPInteraction
45
- request: !ruby/struct:VCR::Request
46
- method: :get
49
+ body:
50
+ encoding: UTF-8
51
+ string: ! '{"result":[{"status":0,"statusmsg":"Specified package does not exist.","rawout":null}]}'
52
+ http_version: '1.1'
53
+ recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
54
+ - request:
55
+ method: get
47
56
  uri: https://myhost.com:2087/json-api/changepackage?pkg=gold&user=changeme
48
- body:
49
- headers:
50
- authorization:
57
+ body:
58
+ encoding: US-ASCII
59
+ string: ''
60
+ headers:
61
+ Authorization:
51
62
  - WHM root:iscool
52
- response: !ruby/struct:VCR::Response
53
- status: !ruby/struct:VCR::ResponseStatus
63
+ response:
64
+ status:
54
65
  code: 200
55
66
  message: OK
56
- headers:
57
- content-type:
67
+ headers:
68
+ Content-Type:
58
69
  - text/plain
59
- server:
70
+ Server:
60
71
  - cpsrvd/11.28.64
61
- transfer-encoding:
72
+ Transfer-Encoding:
62
73
  - chunked
63
- body: "{\"result\":[{\"status\":1,\"statusmsg\":\"Account Upgrade/Downgrade Complete for changeme\",\"rawout\":\"<pre>\\nChanging bwlimit to unlimited Meg\\nChanging Feature List to default\\nChanging max pop accounts from unlimited to unlimited\\nChanging max sql accounts from unlimited to unlimited\\nChanging max ftp accounts from unlimited to unlimited\\nChanging max lists from unlimited to unlimited\\nChanging max sub domains from unlimited to unlimited\\nChanging language from en to en\\nChanging max parked domains from 0 to 0\\nChanging max addon domains from 0 to 0\\nShell Access Set Correctly (noshell)\\nChanging cPanel theme from to \\nChanging plan from gold to gold\\nResetting QUOTA....\\nUsing Universal Quota Support (quota=0)\\nBandwidth limit (0) is lower than (unlimited) (all limits removed)<br /><blockquote><div style='float:left;'>Enabling...</div><div style='float:left;'>...example.com...</div><div style='float:left;'>Done</div></blockquote><br /><div class='clearit' style='clear:both; width:80%;'>&nbsp;</div><span class=\\\"b2\\\">Warning, this will not change shared IP accounts to dedicated IP accounts, or the reverse.</span>\\n\"}]}"
64
- http_version: "1.1"
74
+ body:
75
+ encoding: UTF-8
76
+ string: ! '{"result":[{"status":1,"statusmsg":"Account Upgrade/Downgrade Complete
77
+ for changeme","rawout":"<pre>\nChanging bwlimit to unlimited Meg\nChanging
78
+ Feature List to default\nChanging max pop accounts from unlimited to unlimited\nChanging
79
+ max sql accounts from unlimited to unlimited\nChanging max ftp accounts from
80
+ unlimited to unlimited\nChanging max lists from unlimited to unlimited\nChanging
81
+ max sub domains from unlimited to unlimited\nChanging language from en to
82
+ en\nChanging max parked domains from 0 to 0\nChanging max addon domains from
83
+ 0 to 0\nShell Access Set Correctly (noshell)\nChanging cPanel theme from to
84
+ \nChanging plan from gold to gold\nResetting QUOTA....\nUsing Universal Quota
85
+ Support (quota=0)\nBandwidth limit (0) is lower than (unlimited) (all limits
86
+ removed)<br /><blockquote><div style=''float:left;''>Enabling...</div><div
87
+ style=''float:left;''>...example.com...</div><div style=''float:left;''>Done</div></blockquote><br
88
+ /><div class=''clearit'' style=''clear:both; width:80%;''>&nbsp;</div><span
89
+ class=\"b2\">Warning, this will not change shared IP accounts to dedicated
90
+ IP accounts, or the reverse.</span>\n"}]}'
91
+ http_version: '1.1'
92
+ recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
93
+ recorded_with: VCR 2.0.0
94
+ ...
@@ -1,43 +1,113 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
5
- uri: https://myhost.com:2087/json-api/createacct?domain=valid-thing.com&password=hummingbird123&username=valid
6
- body:
7
- headers:
8
- authorization:
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://myhost.com:2087/json-api/createacct?domain=invalid-thing.com&password=hummingbird123&username=invalid
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Authorization:
9
11
  - WHM root:iscool
10
- response: !ruby/struct:VCR::Response
11
- status: !ruby/struct:VCR::ResponseStatus
12
+ response:
13
+ status:
12
14
  code: 200
13
15
  message: OK
14
- headers:
15
- server:
16
+ headers:
17
+ Server:
16
18
  - cpsrvd/11.28.64
17
- transfer-encoding:
19
+ Transfer-Encoding:
18
20
  - chunked
19
- content-type:
21
+ Content-Type:
20
22
  - text/plain
21
- body: "{\"result\":[{\"status\":1,\"statusmsg\":\"Account Creation Ok\",\"rawout\":\"<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Checking input data...System has 237 free ips.\\n...Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>WWWAcct 12.5.0 (c) 2010 cPanel, Inc....\\n\\nDns Zone check is enabled.\\n+===================================+\\n| New Account Info |\\n+===================================+\\n| Domain: valid-thing.com\\n| Ip: 192.1.2.3 (n)\\n| HasCgi: y\\n| UserName: valid\\n| PassWord: hummingbird123\\n| CpanelMod: x3\\n| HomeRoot: /home\\n| Quota: 0 Meg\\n| NameServer1: dns.example.com\\n| NameServer2: dns2.example.com\\n| NameServer3: \\n| NameServer4: \\n| Contact Email: \\n| Package: default\\n| Feature List: default\\n| Language: en\\n+===================================+\\n...Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Running pre creation script (/scripts/prewwwacct)......Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Adding User...Removing Shell Access (n)\\n...Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Copying skel files from /root/cpanel3-skel/ to /home/valid/......Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Adding Entries to httpd.conf......Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Setting up Mail & Local Domains...localdomains...valiases ...vdomainaliases...vfilters......Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Configuring DNS...\\nError: There is a problem communicating with the name server.\\nWe may be doing maintenance to this feature or the DNS server.\\nPlease try again and if this problem continues please report it to the server administrator.\\n\\n...Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Restarting apache......Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\nChanging password for valid\\nPassword for valid has been changed\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Updating Authentication Databases...Updating ftp passwords for valid\\nFtp password files updated.\\nFtp vhost passwords synced\\n...Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Verifying MX Records and Setting up Databases...Reconfiguring Mail Routing:\\n<ul><li>LOCAL MAIL EXCHANGER: This server will serve as a primary mail exchanger for valid-thing.com's mail.:<br /> This configuration has been manually selected.<br /><br /></li></ul>...Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Sending Account Information......Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\nSystem has 237 free ips.\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Running post creation scripts (/scripts/legacypostwwwacct, /scripts/postwwwacct, /scripts/postwwwacctuser)......Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\nwwwacct creation finished\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Setting up Domain Pointers......Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Setting Reseller Privs......Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n<table style=\\\"border-bottom: 1px #ccc dotted;\\\"><tr><td width=\\\"100%\\\"><pre>Account Creation Complete!!!...Account Creation Ok...Done</pre></td><td width=\\\"30\\\"><img align=absmiddle src=\\\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\\\"></td></tr></table>\\n\",\"options\":{\"nameserver4\":null,\"nameserver\":\"dns.example.com\",\"nameserverentry2\":null,\"nameserverentry3\":null,\"nameserverentry4\":null,\"nameserverentry\":null,\"ip\":\"192.1.2.3\",\"nameservera2\":null,\"nameservera3\":null,\"package\":\"default\",\"nameservera4\":null,\"nameserver2\":\"dns2.example.com\",\"nameservera\":null,\"nameserver3\":null}}]}"
22
- http_version: "1.1"
23
- - !ruby/struct:VCR::HTTPInteraction
24
- request: !ruby/struct:VCR::Request
25
- method: :get
26
- uri: https://myhost.com:2087/json-api/createacct?domain=invalid-thing.com&password=hummingbird123&username=invalid
27
- body:
28
- headers:
29
- authorization:
23
+ body:
24
+ encoding: UTF-8
25
+ string: ! '{"result":[{"status":0,"statusmsg":"Sorry, a group for that username
26
+ already exists.","rawout":null,"options":null}]}'
27
+ http_version: '1.1'
28
+ recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
29
+ - request:
30
+ method: get
31
+ uri: https://myhost.com:2087/json-api/createacct?domain=valid-thing.com&password=hummingbird123&username=valid
32
+ body:
33
+ encoding: US-ASCII
34
+ string: ''
35
+ headers:
36
+ Authorization:
30
37
  - WHM root:iscool
31
- response: !ruby/struct:VCR::Response
32
- status: !ruby/struct:VCR::ResponseStatus
38
+ response:
39
+ status:
33
40
  code: 200
34
41
  message: OK
35
- headers:
36
- server:
42
+ headers:
43
+ Server:
37
44
  - cpsrvd/11.28.64
38
- transfer-encoding:
45
+ Transfer-Encoding:
39
46
  - chunked
40
- content-type:
47
+ Content-Type:
41
48
  - text/plain
42
- body: "{\"result\":[{\"status\":0,\"statusmsg\":\"Sorry, a group for that username already exists.\",\"rawout\":null,\"options\":null}]}"
43
- http_version: "1.1"
49
+ body:
50
+ encoding: UTF-8
51
+ string: ! '{"result":[{"status":1,"statusmsg":"Account Creation Ok","rawout":"<table
52
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Checking
53
+ input data...System has 237 free ips.\n...Done</pre></td><td width=\"30\"><img
54
+ align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
55
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>WWWAcct
56
+ 12.5.0 (c) 2010 cPanel, Inc....\n\nDns Zone check is enabled.\n+===================================+\n|
57
+ New Account Info |\n+===================================+\n|
58
+ Domain: valid-thing.com\n| Ip: 192.1.2.3 (n)\n| HasCgi: y\n| UserName: valid\n|
59
+ PassWord: hummingbird123\n| CpanelMod: x3\n| HomeRoot: /home\n| Quota: 0 Meg\n|
60
+ NameServer1: dns.example.com\n| NameServer2: dns2.example.com\n| NameServer3:
61
+ \n| NameServer4: \n| Contact Email: \n| Package: default\n| Feature List:
62
+ default\n| Language: en\n+===================================+\n...Done</pre></td><td
63
+ width=\"30\"><img align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
64
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Running
65
+ pre creation script (/scripts/prewwwacct)......Done</pre></td><td width=\"30\"><img
66
+ align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
67
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Adding
68
+ User...Removing Shell Access (n)\n...Done</pre></td><td width=\"30\"><img
69
+ align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
70
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Copying
71
+ skel files from /root/cpanel3-skel/ to /home/valid/......Done</pre></td><td
72
+ width=\"30\"><img align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
73
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Adding
74
+ Entries to httpd.conf......Done</pre></td><td width=\"30\"><img align=absmiddle
75
+ src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
76
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Setting
77
+ up Mail & Local Domains...localdomains...valiases ...vdomainaliases...vfilters......Done</pre></td><td
78
+ width=\"30\"><img align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
79
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Configuring
80
+ DNS...\nError: There is a problem communicating with the name server.\nWe
81
+ may be doing maintenance to this feature or the DNS server.\nPlease try again
82
+ and if this problem continues please report it to the server administrator.\n\n...Done</pre></td><td
83
+ width=\"30\"><img align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
84
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Restarting
85
+ apache......Done</pre></td><td width=\"30\"><img align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\nChanging
86
+ password for valid\nPassword for valid has been changed\n<table style=\"border-bottom:
87
+ 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Updating Authentication Databases...Updating
88
+ ftp passwords for valid\nFtp password files updated.\nFtp vhost passwords
89
+ synced\n...Done</pre></td><td width=\"30\"><img align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
90
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Verifying
91
+ MX Records and Setting up Databases...Reconfiguring Mail Routing:\n<ul><li>LOCAL
92
+ MAIL EXCHANGER: This server will serve as a primary mail exchanger for valid-thing.com''s
93
+ mail.:<br /> This configuration has been manually selected.<br /><br /></li></ul>...Done</pre></td><td
94
+ width=\"30\"><img align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
95
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Sending
96
+ Account Information......Done</pre></td><td width=\"30\"><img align=absmiddle
97
+ src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\nSystem
98
+ has 237 free ips.\n<table style=\"border-bottom: 1px #ccc dotted;\"><tr><td
99
+ width=\"100%\"><pre>Running post creation scripts (/scripts/legacypostwwwacct,
100
+ /scripts/postwwwacct, /scripts/postwwwacctuser)......Done</pre></td><td width=\"30\"><img
101
+ align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\nwwwacct
102
+ creation finished\n<table style=\"border-bottom: 1px #ccc dotted;\"><tr><td
103
+ width=\"100%\"><pre>Setting up Domain Pointers......Done</pre></td><td width=\"30\"><img
104
+ align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
105
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Setting
106
+ Reseller Privs......Done</pre></td><td width=\"30\"><img align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n<table
107
+ style=\"border-bottom: 1px #ccc dotted;\"><tr><td width=\"100%\"><pre>Account
108
+ Creation Complete!!!...Account Creation Ok...Done</pre></td><td width=\"30\"><img
109
+ align=absmiddle src=\"/cPanel_magic_revision_1266536260/cjt/images/icons/success.png\"></td></tr></table>\n","options":{"nameserver4":null,"nameserver":"dns.example.com","nameserverentry2":null,"nameserverentry3":null,"nameserverentry4":null,"nameserverentry":null,"ip":"192.1.2.3","nameservera2":null,"nameservera3":null,"package":"default","nameservera4":null,"nameserver2":"dns2.example.com","nameservera":null,"nameserver3":null}}]}'
110
+ http_version: '1.1'
111
+ recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
112
+ recorded_with: VCR 2.0.0
113
+ ...
@@ -1,43 +1,57 @@
1
- ---
2
- - !ruby/struct:VCR::HTTPInteraction
3
- request: !ruby/struct:VCR::Request
4
- method: :get
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
5
  uri: https://myhost.com:2087/json-api/domainuserdata?domain=notexists.com
6
- body:
7
- headers:
8
- authorization:
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Authorization:
9
11
  - WHM root:iscool
10
- response: !ruby/struct:VCR::Response
11
- status: !ruby/struct:VCR::ResponseStatus
12
+ response:
13
+ status:
12
14
  code: 200
13
15
  message: OK
14
- headers:
15
- content-type:
16
+ headers:
17
+ Content-Type:
16
18
  - text/plain
17
- server:
19
+ Server:
18
20
  - cpsrvd/11.28.64
19
- transfer-encoding:
21
+ Transfer-Encoding:
20
22
  - chunked
21
- body: "{\"result\":[{\"status\":0,\"statusmsg\":\"Unable to determine account owner for domain.\"}]}"
22
- http_version: "1.1"
23
- - !ruby/struct:VCR::HTTPInteraction
24
- request: !ruby/struct:VCR::Request
25
- method: :get
23
+ body:
24
+ encoding: UTF-8
25
+ string: ! '{"result":[{"status":0,"statusmsg":"Unable to determine account owner
26
+ for domain."}]}'
27
+ http_version: '1.1'
28
+ recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
29
+ - request:
30
+ method: get
26
31
  uri: https://myhost.com:2087/json-api/domainuserdata?domain=example.com
27
- body:
28
- headers:
29
- authorization:
32
+ body:
33
+ encoding: US-ASCII
34
+ string: ''
35
+ headers:
36
+ Authorization:
30
37
  - WHM root:iscool
31
- response: !ruby/struct:VCR::Response
32
- status: !ruby/struct:VCR::ResponseStatus
38
+ response:
39
+ status:
33
40
  code: 200
34
41
  message: OK
35
- headers:
36
- content-type:
42
+ headers:
43
+ Content-Type:
37
44
  - text/plain
38
- server:
45
+ Server:
39
46
  - cpsrvd/11.28.64
40
- transfer-encoding:
47
+ Transfer-Encoding:
41
48
  - chunked
42
- body: "{\"result\":[{\"status\":1,\"statusmsg\":\"Obtained userdata.\"}],\"userdata\":{\"usecanonicalname\":\"Off\",\"port\":\"80\",\"phpopenbasedirprotect\":\"1\",\"group\":\"changeme\",\"documentroot\":\"/home/changeme/public_html\",\"hascgi\":\"0\",\"serveradmin\":\"webmaster@example.com\",\"options\":\"-ExecCGI -Includes\",\"user\":\"changeme\",\"customlog\":[{\"format\":\"combined\",\"target\":\"/usr/local/apache/domlogs/example.com\"},{\"format\":\"\\\"%{%s}t %I .\\\\n%{%s}t %O .\\\"\",\"target\":\"/usr/local/apache/domlogs/example.com-bytes_log\"}],\"servername\":\"example.com\",\"ip\":\"192.1.2.3\",\"scriptalias\":[{\"path\":\"/home/changeme/public_html/cgi-bin\",\"url\":\"/cgi-bin/\"}],\"serveralias\":\"www.example.com\",\"homedir\":\"/home/changeme\",\"owner\":\"root\"}}"
43
- http_version: "1.1"
49
+ body:
50
+ encoding: UTF-8
51
+ string: ! '{"result":[{"status":1,"statusmsg":"Obtained userdata."}],"userdata":{"usecanonicalname":"Off","port":"80","phpopenbasedirprotect":"1","group":"changeme","documentroot":"/home/changeme/public_html","hascgi":"0","serveradmin":"webmaster@example.com","options":"-ExecCGI
52
+ -Includes","user":"changeme","customlog":[{"format":"combined","target":"/usr/local/apache/domlogs/example.com"},{"format":"\"%{%s}t
53
+ %I .\\n%{%s}t %O .\"","target":"/usr/local/apache/domlogs/example.com-bytes_log"}],"servername":"example.com","ip":"192.1.2.3","scriptalias":[{"path":"/home/changeme/public_html/cgi-bin","url":"/cgi-bin/"}],"serveralias":"www.example.com","homedir":"/home/changeme","owner":"root"}}'
54
+ http_version: '1.1'
55
+ recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
56
+ recorded_with: VCR 2.0.0
57
+ ...