lumberg 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +9 -3
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/Rakefile +3 -1
- data/lib/lumberg.rb +32 -7
- data/lib/lumberg/config.rb +19 -0
- data/lib/lumberg/format_whm.rb +102 -0
- data/lib/lumberg/version.rb +1 -1
- data/lib/lumberg/whm/server.rb +42 -163
- data/lumberg.gemspec +7 -4
- data/spec/config_spec.rb +28 -0
- data/spec/spec_helper.rb +3 -3
- data/spec/vcr_cassettes/whm/account/accountsummary.yml +41 -29
- data/spec/vcr_cassettes/whm/account/changepackage.yml +73 -43
- data/spec/vcr_cassettes/whm/account/createacct.yml +101 -31
- data/spec/vcr_cassettes/whm/account/domainuserdata.yml +43 -29
- data/spec/vcr_cassettes/whm/account/editquota.yml +78 -57
- data/spec/vcr_cassettes/whm/account/limitbw.yml +79 -57
- data/spec/vcr_cassettes/whm/account/listaccts.yml +195 -100
- data/spec/vcr_cassettes/whm/account/listsuspended.yml +41 -29
- data/spec/vcr_cassettes/whm/account/modifyacct.yml +61 -42
- data/spec/vcr_cassettes/whm/account/myprivs.yml +41 -29
- data/spec/vcr_cassettes/whm/account/passwd.yml +44 -29
- data/spec/vcr_cassettes/whm/account/removeacct.yml +134 -57
- data/spec/vcr_cassettes/whm/account/restoreaccount.yml +310 -135
- data/spec/vcr_cassettes/whm/account/setsiteip.yml +166 -127
- data/spec/vcr_cassettes/whm/account/suspend.yml +75 -43
- data/spec/vcr_cassettes/whm/account/unsuspend.yml +46 -29
- data/spec/vcr_cassettes/whm/dns/adddns.yml +61 -43
- data/spec/vcr_cassettes/whm/dns/addzonerecord.yml +42 -29
- data/spec/vcr_cassettes/whm/dns/dumpzone.yml +44 -29
- data/spec/vcr_cassettes/whm/dns/editzonerecord.yml +61 -43
- data/spec/vcr_cassettes/whm/dns/getzonerecord.yml +60 -43
- data/spec/vcr_cassettes/whm/dns/killdns.yml +42 -29
- data/spec/vcr_cassettes/whm/dns/listmxs.yml +23 -15
- data/spec/vcr_cassettes/whm/dns/listzones.yml +22 -15
- data/spec/vcr_cassettes/whm/dns/lookupnsip.yml +40 -29
- data/spec/vcr_cassettes/whm/dns/removezonerecord.yml +61 -43
- data/spec/vcr_cassettes/whm/dns/resetzone.yml +42 -29
- data/spec/vcr_cassettes/whm/dns/resolvedomainname.yml +40 -29
- data/spec/vcr_cassettes/whm/dns/savemxs.yml +23 -15
- data/spec/vcr_cassettes/whm/reseller/acctcounts.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/listacls.yml +22 -15
- data/spec/vcr_cassettes/whm/reseller/listresellers.yml +22 -15
- data/spec/vcr_cassettes/whm/reseller/resellerstats.yml +42 -29
- data/spec/vcr_cassettes/whm/reseller/saveacllist.yml +76 -57
- data/spec/vcr_cassettes/whm/reseller/setacls.yml +40 -29
- data/spec/vcr_cassettes/whm/reseller/setresellerips.yml +42 -28
- data/spec/vcr_cassettes/whm/reseller/setresellerlimits.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/setresellermainip.yml +59 -43
- data/spec/vcr_cassettes/whm/reseller/setresellernameservers.yml +58 -43
- data/spec/vcr_cassettes/whm/reseller/setresellerpackagelimit.yml +61 -43
- data/spec/vcr_cassettes/whm/reseller/setupreseller.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/suspendreseller.yml +75 -44
- data/spec/vcr_cassettes/whm/reseller/terminatereseller.yml +83 -46
- data/spec/vcr_cassettes/whm/reseller/unsetupreseller.yml +41 -29
- data/spec/vcr_cassettes/whm/reseller/unsuspendreseller.yml +46 -29
- data/spec/vcr_cassettes/whm/server/addip.yml +24 -15
- data/spec/vcr_cassettes/whm/server/applist.yml +22 -15
- data/spec/vcr_cassettes/whm/server/delip.yml +23 -15
- data/spec/vcr_cassettes/whm/server/gethostname.yml +22 -15
- data/spec/vcr_cassettes/whm/server/getlanglist.yml +22 -15
- data/spec/vcr_cassettes/whm/server/listips.yml +22 -15
- data/spec/vcr_cassettes/whm/server/loadavg.yml +26 -19
- data/spec/vcr_cassettes/whm/server/my_function.yml +59 -43
- data/spec/vcr_cassettes/whm/server/nvget.yml +22 -15
- data/spec/vcr_cassettes/whm/server/nvset.yml +22 -15
- data/spec/vcr_cassettes/whm/server/reboot.yml +22 -15
- data/spec/vcr_cassettes/whm/server/sethostname.yml +24 -15
- data/spec/vcr_cassettes/whm/server/setresolvers.yml +23 -15
- data/spec/vcr_cassettes/whm/server/showbw.yml +22 -15
- data/spec/vcr_cassettes/whm/server/systemloadavg.yml +40 -29
- data/spec/vcr_cassettes/whm/server/version.yml +22 -15
- data/spec/whm/account_spec.rb +0 -1
- data/spec/whm/server_spec.rb +2 -106
- metadata +98 -26
- data/lib/net_http_hacked.rb +0 -42
- data/spec/vcr_cassettes/whm/server/response_type.yml +0 -85
@@ -1,64 +1,79 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
|
4
|
-
method:
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
5
|
uri: https://myhost.com:2087/json-api/acctcounts?user=notexists
|
6
|
-
body:
|
7
|
-
|
8
|
-
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Authorization:
|
9
11
|
- WHM root:iscool
|
10
|
-
response:
|
11
|
-
status:
|
12
|
+
response:
|
13
|
+
status:
|
12
14
|
code: 200
|
13
15
|
message: OK
|
14
|
-
headers:
|
15
|
-
|
16
|
+
headers:
|
17
|
+
Server:
|
16
18
|
- cpsrvd/11.28.64
|
17
|
-
|
19
|
+
Transfer-Encoding:
|
18
20
|
- chunked
|
19
|
-
|
21
|
+
Content-Type:
|
20
22
|
- text/plain
|
21
|
-
body:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
body:
|
24
|
+
encoding: UTF-8
|
25
|
+
string: ! '{"result":[{"status":0,"statusmsg":"Specified user is not a reseller."}]}'
|
26
|
+
http_version: '1.1'
|
27
|
+
recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
|
28
|
+
- request:
|
29
|
+
method: get
|
26
30
|
uri: https://myhost.com:2087/json-api/setresellernameservers?user=bob
|
27
|
-
body:
|
28
|
-
|
29
|
-
|
31
|
+
body:
|
32
|
+
encoding: US-ASCII
|
33
|
+
string: ''
|
34
|
+
headers:
|
35
|
+
Authorization:
|
30
36
|
- WHM root:iscool
|
31
|
-
response:
|
32
|
-
status:
|
37
|
+
response:
|
38
|
+
status:
|
33
39
|
code: 200
|
34
40
|
message: OK
|
35
|
-
headers:
|
36
|
-
|
41
|
+
headers:
|
42
|
+
Server:
|
37
43
|
- cpsrvd/11.28.64
|
38
|
-
|
44
|
+
Transfer-Encoding:
|
39
45
|
- chunked
|
40
|
-
|
46
|
+
Content-Type:
|
41
47
|
- text/plain
|
42
|
-
body:
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: ! '{"result":[{"status":1,"statusmsg":"Set resellers nameservers."}]}'
|
51
|
+
http_version: '1.1'
|
52
|
+
recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
|
53
|
+
- request:
|
54
|
+
method: get
|
47
55
|
uri: https://myhost.com:2087/json-api/setresellernameservers?nameservers=ns1.example.com&user=bob
|
48
|
-
body:
|
49
|
-
|
50
|
-
|
56
|
+
body:
|
57
|
+
encoding: US-ASCII
|
58
|
+
string: ''
|
59
|
+
headers:
|
60
|
+
Authorization:
|
51
61
|
- WHM root:iscool
|
52
|
-
response:
|
53
|
-
status:
|
62
|
+
response:
|
63
|
+
status:
|
54
64
|
code: 200
|
55
65
|
message: OK
|
56
|
-
headers:
|
57
|
-
|
66
|
+
headers:
|
67
|
+
Server:
|
58
68
|
- cpsrvd/11.28.64
|
59
|
-
|
69
|
+
Transfer-Encoding:
|
60
70
|
- chunked
|
61
|
-
|
71
|
+
Content-Type:
|
62
72
|
- text/plain
|
63
|
-
body:
|
64
|
-
|
73
|
+
body:
|
74
|
+
encoding: UTF-8
|
75
|
+
string: ! '{"result":[{"status":1,"statusmsg":"Set resellers nameservers."}]}'
|
76
|
+
http_version: '1.1'
|
77
|
+
recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
|
78
|
+
recorded_with: VCR 2.0.0
|
79
|
+
...
|
@@ -1,64 +1,82 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
|
4
|
-
method:
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
5
|
uri: https://myhost.com:2087/json-api/setresellerpackagelimit?allowed=1&no_limit=0&package=gold&user=bob
|
6
|
-
body:
|
7
|
-
|
8
|
-
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Authorization:
|
9
11
|
- WHM root:iscool
|
10
|
-
response:
|
11
|
-
status:
|
12
|
+
response:
|
13
|
+
status:
|
12
14
|
code: 200
|
13
15
|
message: OK
|
14
|
-
headers:
|
15
|
-
|
16
|
+
headers:
|
17
|
+
Server:
|
16
18
|
- cpsrvd/11.28.64
|
17
|
-
|
19
|
+
Transfer-Encoding:
|
18
20
|
- chunked
|
19
|
-
|
21
|
+
Content-Type:
|
20
22
|
- text/plain
|
21
|
-
body:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
body:
|
24
|
+
encoding: UTF-8
|
25
|
+
string: ! '{"result":[{"status":1,"statusmsg":"Successfully set reseller package
|
26
|
+
limit."}]}'
|
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/setresellerpackagelimit?no_limit=1&package=gold&user=bob
|
27
|
-
body:
|
28
|
-
|
29
|
-
|
32
|
+
body:
|
33
|
+
encoding: US-ASCII
|
34
|
+
string: ''
|
35
|
+
headers:
|
36
|
+
Authorization:
|
30
37
|
- WHM root:iscool
|
31
|
-
response:
|
32
|
-
status:
|
38
|
+
response:
|
39
|
+
status:
|
33
40
|
code: 200
|
34
41
|
message: OK
|
35
|
-
headers:
|
36
|
-
|
42
|
+
headers:
|
43
|
+
Server:
|
37
44
|
- cpsrvd/11.28.64
|
38
|
-
|
45
|
+
Transfer-Encoding:
|
39
46
|
- chunked
|
40
|
-
|
47
|
+
Content-Type:
|
41
48
|
- text/plain
|
42
|
-
body:
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
49
|
+
body:
|
50
|
+
encoding: UTF-8
|
51
|
+
string: ! '{"result":[{"status":1,"statusmsg":"Successfully set reseller package
|
52
|
+
limit."}]}'
|
53
|
+
http_version: '1.1'
|
54
|
+
recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
|
55
|
+
- request:
|
56
|
+
method: get
|
47
57
|
uri: https://myhost.com:2087/json-api/setresellerpackagelimit?allowed=1&no_limit=0&package=gold&user=bob
|
48
|
-
body:
|
49
|
-
|
50
|
-
|
58
|
+
body:
|
59
|
+
encoding: US-ASCII
|
60
|
+
string: ''
|
61
|
+
headers:
|
62
|
+
Authorization:
|
51
63
|
- WHM root:iscool
|
52
|
-
response:
|
53
|
-
status:
|
64
|
+
response:
|
65
|
+
status:
|
54
66
|
code: 200
|
55
67
|
message: OK
|
56
|
-
headers:
|
57
|
-
|
68
|
+
headers:
|
69
|
+
Server:
|
58
70
|
- cpsrvd/11.28.64
|
59
|
-
|
71
|
+
Transfer-Encoding:
|
60
72
|
- chunked
|
61
|
-
|
73
|
+
Content-Type:
|
62
74
|
- text/plain
|
63
|
-
body:
|
64
|
-
|
75
|
+
body:
|
76
|
+
encoding: UTF-8
|
77
|
+
string: ! '{"result":[{"status":1,"statusmsg":"Successfully set reseller package
|
78
|
+
limit."}]}'
|
79
|
+
http_version: '1.1'
|
80
|
+
recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
|
81
|
+
recorded_with: VCR 2.0.0
|
82
|
+
...
|
@@ -1,43 +1,55 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
|
4
|
-
method:
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
5
|
uri: https://myhost.com:2087/json-api/setupreseller?user=bob
|
6
|
-
body:
|
7
|
-
|
8
|
-
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Authorization:
|
9
11
|
- WHM root:iscool
|
10
|
-
response:
|
11
|
-
status:
|
12
|
+
response:
|
13
|
+
status:
|
12
14
|
code: 200
|
13
15
|
message: OK
|
14
|
-
headers:
|
15
|
-
|
16
|
+
headers:
|
17
|
+
Server:
|
16
18
|
- cpsrvd/11.28.64
|
17
|
-
|
19
|
+
Transfer-Encoding:
|
18
20
|
- chunked
|
19
|
-
|
21
|
+
Content-Type:
|
20
22
|
- text/plain
|
21
|
-
body:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
body:
|
24
|
+
encoding: UTF-8
|
25
|
+
string: ! '{"result":[{"status":1,"statusmsg":null}]}'
|
26
|
+
http_version: '1.1'
|
27
|
+
recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
|
28
|
+
- request:
|
29
|
+
method: get
|
26
30
|
uri: https://myhost.com:2087/json-api/setupreseller?user=invalid
|
27
|
-
body:
|
28
|
-
|
29
|
-
|
31
|
+
body:
|
32
|
+
encoding: US-ASCII
|
33
|
+
string: ''
|
34
|
+
headers:
|
35
|
+
Authorization:
|
30
36
|
- WHM root:iscool
|
31
|
-
response:
|
32
|
-
status:
|
37
|
+
response:
|
38
|
+
status:
|
33
39
|
code: 200
|
34
40
|
message: OK
|
35
|
-
headers:
|
36
|
-
|
41
|
+
headers:
|
42
|
+
Server:
|
37
43
|
- cpsrvd/11.28.64
|
38
|
-
|
44
|
+
Transfer-Encoding:
|
39
45
|
- chunked
|
40
|
-
|
46
|
+
Content-Type:
|
41
47
|
- text/plain
|
42
|
-
body:
|
43
|
-
|
48
|
+
body:
|
49
|
+
encoding: UTF-8
|
50
|
+
string: ! '{"result":[{"status":0,"statusmsg":"_setupreseller called for a user
|
51
|
+
that does not exist. (invalid)"}]}'
|
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,95 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
|
4
|
-
method:
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
5
|
uri: https://myhost.com:2087/json-api/suspendreseller?user=bob
|
6
|
-
body:
|
7
|
-
|
8
|
-
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Authorization:
|
9
11
|
- WHM root:iscool
|
10
|
-
response:
|
11
|
-
status:
|
12
|
+
response:
|
13
|
+
status:
|
12
14
|
code: 200
|
13
15
|
message: OK
|
14
|
-
headers:
|
15
|
-
|
16
|
+
headers:
|
17
|
+
Server:
|
16
18
|
- cpsrvd/11.28.64
|
17
|
-
|
19
|
+
Transfer-Encoding:
|
18
20
|
- chunked
|
19
|
-
|
21
|
+
Content-Type:
|
20
22
|
- text/plain
|
21
|
-
body:
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
23
|
+
body:
|
24
|
+
encoding: UTF-8
|
25
|
+
string: ! '{"result":[{"status":1,"statusmsg":"Finished suspending reseller."}],"output":"Changing
|
26
|
+
Shell to /bin/false...Changing shell for bob.\nWarning: \"/bin/false\" is
|
27
|
+
not listed in /etc/shells\nShell changed.\nDone\nLocking Password...Locking
|
28
|
+
password for user bob.\npasswd: Success\nDone\nSuspending mysql users\nNotification
|
29
|
+
=> notify@example.com via EMAIL [level => 3]\nUsing Universal Quota Support
|
30
|
+
(quota=0)\nSuspended document root /home/bob/public_html\nUsing Universal
|
31
|
+
Quota Support (quota=0)\nSuspending FTP accounts...\nUpdating ftp passwords
|
32
|
+
for bob\nFtp password files updated.\nFtp vhost passwords synced\nbob''s account
|
33
|
+
has been suspended\n"}'
|
34
|
+
http_version: '1.1'
|
35
|
+
recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
|
36
|
+
- request:
|
37
|
+
method: get
|
38
|
+
uri: https://myhost.com:2087/json-api/suspendreseller?reason=some%20reason&user=bob
|
39
|
+
body:
|
40
|
+
encoding: US-ASCII
|
41
|
+
string: ''
|
42
|
+
headers:
|
43
|
+
Authorization:
|
30
44
|
- WHM root:iscool
|
31
|
-
response:
|
32
|
-
status:
|
45
|
+
response:
|
46
|
+
status:
|
33
47
|
code: 200
|
34
48
|
message: OK
|
35
|
-
headers:
|
36
|
-
|
49
|
+
headers:
|
50
|
+
Server:
|
37
51
|
- cpsrvd/11.28.64
|
38
|
-
|
52
|
+
Transfer-Encoding:
|
39
53
|
- chunked
|
40
|
-
|
54
|
+
Content-Type:
|
41
55
|
- text/plain
|
42
|
-
body:
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
56
|
+
body:
|
57
|
+
encoding: UTF-8
|
58
|
+
string: ! '{"result":[{"status":1,"statusmsg":"Finished suspending reseller."}],"output":"Changing
|
59
|
+
Shell to /bin/false...Changing shell for bob.\nWarning: \"/bin/false\" is
|
60
|
+
not listed in /etc/shells\nShell not changed.\nDone\nLocking Password...Locking
|
61
|
+
password for user bob.\npasswd: Success\nDone\nSuspending mysql users\nNotification
|
62
|
+
=> notify@example.com via EMAIL [level => 3]\nAccount previously suspended
|
63
|
+
(password was locked).\nUsing Universal Quota Support (quota=0)\nSuspended
|
64
|
+
document root /home/bob/public_html\nUsing Universal Quota Support (quota=0)\nUpdating
|
65
|
+
ftp passwords for bob\nFtp password files updated.\nFtp vhost passwords synced\nbob''s
|
66
|
+
account has been suspended\n"}'
|
67
|
+
http_version: '1.1'
|
68
|
+
recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
|
69
|
+
- request:
|
70
|
+
method: get
|
47
71
|
uri: https://myhost.com:2087/json-api/suspendreseller?user=notexists
|
48
|
-
body:
|
49
|
-
|
50
|
-
|
72
|
+
body:
|
73
|
+
encoding: US-ASCII
|
74
|
+
string: ''
|
75
|
+
headers:
|
76
|
+
Authorization:
|
51
77
|
- WHM root:iscool
|
52
|
-
response:
|
53
|
-
status:
|
78
|
+
response:
|
79
|
+
status:
|
54
80
|
code: 200
|
55
81
|
message: OK
|
56
|
-
headers:
|
57
|
-
|
82
|
+
headers:
|
83
|
+
Server:
|
58
84
|
- cpsrvd/11.28.64
|
59
|
-
|
85
|
+
Transfer-Encoding:
|
60
86
|
- chunked
|
61
|
-
|
87
|
+
Content-Type:
|
62
88
|
- text/plain
|
63
|
-
body:
|
64
|
-
|
89
|
+
body:
|
90
|
+
encoding: UTF-8
|
91
|
+
string: ! '{"result":[{"status":0,"statusmsg":"Specified user is not a reseller."}]}'
|
92
|
+
http_version: '1.1'
|
93
|
+
recorded_at: Wed, 07 Mar 2012 21:53:52 GMT
|
94
|
+
recorded_with: VCR 2.0.0
|
95
|
+
...
|