lumberg 1.0.1 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (306) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +1 -1
  3. data/README.md +184 -70
  4. data/Rakefile +3 -1
  5. data/lib/lumberg/config.rb +19 -0
  6. data/lib/lumberg/cpanel/addon_domain.rb +50 -0
  7. data/lib/lumberg/cpanel/backups.rb +16 -0
  8. data/lib/lumberg/cpanel/base.rb +56 -0
  9. data/lib/lumberg/cpanel/box_trapper.rb +18 -0
  10. data/lib/lumberg/cpanel/branding.rb +89 -0
  11. data/lib/lumberg/cpanel/contact.rb +38 -0
  12. data/lib/lumberg/cpanel/cron.rb +89 -0
  13. data/lib/lumberg/cpanel/dns_lookup.rb +23 -0
  14. data/lib/lumberg/cpanel/domain_keys.rb +37 -0
  15. data/lib/lumberg/cpanel/domain_lookup.rb +71 -0
  16. data/lib/lumberg/cpanel/email.rb +522 -0
  17. data/lib/lumberg/cpanel/file_manager.rb +146 -0
  18. data/lib/lumberg/cpanel/ftp.rb +101 -0
  19. data/lib/lumberg/cpanel/gpg.rb +36 -0
  20. data/lib/lumberg/cpanel/locale.rb +15 -0
  21. data/lib/lumberg/cpanel/mime.rb +34 -0
  22. data/lib/lumberg/cpanel/mysql.rb +66 -0
  23. data/lib/lumberg/cpanel/mysql_db.rb +190 -0
  24. data/lib/lumberg/cpanel/net.rb +28 -0
  25. data/lib/lumberg/cpanel/park.rb +58 -0
  26. data/lib/lumberg/cpanel/password.rb +52 -0
  27. data/lib/lumberg/cpanel/password_strength.rb +63 -0
  28. data/lib/lumberg/cpanel/random_data.rb +25 -0
  29. data/lib/lumberg/cpanel/redirect.rb +44 -0
  30. data/lib/lumberg/cpanel/ssl.rb +220 -0
  31. data/lib/lumberg/cpanel/sub_domain.rb +61 -0
  32. data/lib/lumberg/cpanel/support.rb +29 -0
  33. data/lib/lumberg/cpanel/zone_edit.rb +134 -0
  34. data/lib/lumberg/cpanel.rb +32 -0
  35. data/lib/lumberg/format_whm.rb +162 -0
  36. data/lib/lumberg/version.rb +1 -1
  37. data/lib/lumberg/whm/account.rb +29 -106
  38. data/lib/lumberg/whm/base.rb +3 -7
  39. data/lib/lumberg/whm/cert.rb +88 -0
  40. data/lib/lumberg/whm/dns.rb +49 -77
  41. data/lib/lumberg/whm/reseller.rb +25 -118
  42. data/lib/lumberg/whm/server.rb +163 -222
  43. data/lib/lumberg/whm/transfer_tool.rb +165 -0
  44. data/lib/lumberg/whm.rb +11 -9
  45. data/lib/lumberg/whostmgr/base.rb +13 -0
  46. data/lib/lumberg/whostmgr/ssl.rb +57 -0
  47. data/lib/lumberg/whostmgr.rb +6 -0
  48. data/lib/lumberg.rb +35 -8
  49. data/spec/config_spec.rb +28 -0
  50. data/spec/cpanel/addon_domain_spec.rb +84 -0
  51. data/spec/cpanel/backups_spec.rb +22 -0
  52. data/spec/cpanel/base_spec.rb +128 -0
  53. data/spec/cpanel/box_trapper_spec.rb +22 -0
  54. data/spec/cpanel/branding_spec.rb +46 -0
  55. data/spec/cpanel/contact_spec.rb +50 -0
  56. data/spec/cpanel/cron_spec.rb +161 -0
  57. data/spec/cpanel/dns_lookup_spec.rb +22 -0
  58. data/spec/cpanel/domain_keys_spec.rb +46 -0
  59. data/spec/cpanel/domain_lookup_spec.rb +77 -0
  60. data/spec/cpanel/email_spec.rb +639 -0
  61. data/spec/cpanel/file_manager_spec.rb +73 -0
  62. data/spec/cpanel/ftp_spec.rb +71 -0
  63. data/spec/cpanel/gpg_spec.rb +48 -0
  64. data/spec/cpanel/locale_spec.rb +23 -0
  65. data/spec/cpanel/mime_spec.rb +0 -0
  66. data/spec/cpanel/mysql_db_spec.rb +119 -0
  67. data/spec/cpanel/mysql_spec.rb +0 -0
  68. data/spec/cpanel/net_spec.rb +30 -0
  69. data/spec/cpanel/park_spec.rb +94 -0
  70. data/spec/cpanel/password_spec.rb +35 -0
  71. data/spec/cpanel/password_strength_spec.rb +50 -0
  72. data/spec/cpanel/random_data_spec.rb +24 -0
  73. data/spec/cpanel/redirect_spec.rb +0 -0
  74. data/spec/cpanel/ssl_spec.rb +158 -0
  75. data/spec/cpanel/sub_domain_spec.rb +72 -0
  76. data/spec/cpanel/support_spec.rb +38 -0
  77. data/spec/cpanel/zone_edit_spec.rb +0 -0
  78. data/spec/format_whm_spec.rb +53 -0
  79. data/spec/sample_certs/cpanel.crt +28 -0
  80. data/spec/sample_certs/cpanel.key +28 -0
  81. data/spec/sample_certs/main.crt +27 -0
  82. data/spec/sample_certs/sample.crt +26 -0
  83. data/spec/sample_certs/sample.key +27 -0
  84. data/spec/spec_helper.rb +10 -3
  85. data/spec/support/cpanel_matchers.rb +17 -0
  86. data/spec/vcr_cassettes/cpanel/addon_domain/add.yml +77 -0
  87. data/spec/vcr_cassettes/cpanel/addon_domain/list.yml +77 -0
  88. data/spec/vcr_cassettes/cpanel/addon_domain/remove.yml +77 -0
  89. data/spec/vcr_cassettes/cpanel/backups/list.yml +40 -0
  90. data/spec/vcr_cassettes/cpanel/box_trapper/list.yml +40 -0
  91. data/spec/vcr_cassettes/cpanel/branding/list_icons.yml +40 -0
  92. data/spec/vcr_cassettes/cpanel/branding/list_image_types.yml +40 -0
  93. data/spec/vcr_cassettes/cpanel/branding/list_object_types.yml +40 -0
  94. data/spec/vcr_cassettes/cpanel/branding/list_pkgs.yml +40 -0
  95. data/spec/vcr_cassettes/cpanel/branding/list_sprites.yml +40 -0
  96. data/spec/vcr_cassettes/cpanel/contact/show.yml +40 -0
  97. data/spec/vcr_cassettes/cpanel/contact/update.yml +40 -0
  98. data/spec/vcr_cassettes/cpanel/cron/add.yml +77 -0
  99. data/spec/vcr_cassettes/cpanel/cron/edit.yml +114 -0
  100. data/spec/vcr_cassettes/cpanel/cron/email.yml +77 -0
  101. data/spec/vcr_cassettes/cpanel/cron/list.yml +77 -0
  102. data/spec/vcr_cassettes/cpanel/cron/remove.yml +151 -0
  103. data/spec/vcr_cassettes/cpanel/cron/set_email.yml +77 -0
  104. data/spec/vcr_cassettes/cpanel/dns_lookup/name_to_ip.yml +40 -0
  105. data/spec/vcr_cassettes/cpanel/domain_keys/add.yml +40 -0
  106. data/spec/vcr_cassettes/cpanel/domain_keys/available.yml +40 -0
  107. data/spec/vcr_cassettes/cpanel/domain_keys/installed.yml +40 -0
  108. data/spec/vcr_cassettes/cpanel/domain_keys/remove.yml +40 -0
  109. data/spec/vcr_cassettes/cpanel/domain_lookup/count.yml +40 -0
  110. data/spec/vcr_cassettes/cpanel/domain_lookup/docroot.yml +40 -0
  111. data/spec/vcr_cassettes/cpanel/domain_lookup/docroots.yml +40 -0
  112. data/spec/vcr_cassettes/cpanel/domain_lookup/document_root.yml +40 -0
  113. data/spec/vcr_cassettes/cpanel/domain_lookup/document_roots.yml +40 -0
  114. data/spec/vcr_cassettes/cpanel/domain_lookup/list.yml +40 -0
  115. data/spec/vcr_cassettes/cpanel/email/acceptable_encodings.yml +40 -0
  116. data/spec/vcr_cassettes/cpanel/email/accounts.yml +188 -0
  117. data/spec/vcr_cassettes/cpanel/email/add_account.yml +77 -0
  118. data/spec/vcr_cassettes/cpanel/email/add_filter.yml +77 -0
  119. data/spec/vcr_cassettes/cpanel/email/add_forwarder.yml +77 -0
  120. data/spec/vcr_cassettes/cpanel/email/add_mailing_list.yml +73 -0
  121. data/spec/vcr_cassettes/cpanel/email/add_mx.yml +40 -0
  122. data/spec/vcr_cassettes/cpanel/email/change_mx.yml +40 -0
  123. data/spec/vcr_cassettes/cpanel/email/change_password.yml +43 -0
  124. data/spec/vcr_cassettes/cpanel/email/check_local_delivery_local.yml +77 -0
  125. data/spec/vcr_cassettes/cpanel/email/check_local_delivery_remote.yml +77 -0
  126. data/spec/vcr_cassettes/cpanel/email/default_address.yml +40 -0
  127. data/spec/vcr_cassettes/cpanel/email/delete_mx.yml +40 -0
  128. data/spec/vcr_cassettes/cpanel/email/disk_usage.yml +77 -0
  129. data/spec/vcr_cassettes/cpanel/email/domains.yml +40 -0
  130. data/spec/vcr_cassettes/cpanel/email/domains_with_aliases.yml +77 -0
  131. data/spec/vcr_cassettes/cpanel/email/edit_quota.yml +112 -0
  132. data/spec/vcr_cassettes/cpanel/email/filters.yml +114 -0
  133. data/spec/vcr_cassettes/cpanel/email/forwarders.yml +77 -0
  134. data/spec/vcr_cassettes/cpanel/email/mail_dir.yml +77 -0
  135. data/spec/vcr_cassettes/cpanel/email/mail_dirs.yml +77 -0
  136. data/spec/vcr_cassettes/cpanel/email/mailing_lists.yml +73 -0
  137. data/spec/vcr_cassettes/cpanel/email/main_discard.yml +40 -0
  138. data/spec/vcr_cassettes/cpanel/email/mx.yml +40 -0
  139. data/spec/vcr_cassettes/cpanel/email/remove.yml +77 -0
  140. data/spec/vcr_cassettes/cpanel/email/set_default_address.yml +43 -0
  141. data/spec/vcr_cassettes/cpanel/email/set_mail_delivery_local.yml +77 -0
  142. data/spec/vcr_cassettes/cpanel/email/set_mail_delivery_remote.yml +77 -0
  143. data/spec/vcr_cassettes/cpanel/email/set_mx_type.yml +40 -0
  144. data/spec/vcr_cassettes/cpanel/file_manager/disk_usage.yml +38 -0
  145. data/spec/vcr_cassettes/cpanel/file_manager/list.yml +38 -0
  146. data/spec/vcr_cassettes/cpanel/file_manager/operate.yml +77 -0
  147. data/spec/vcr_cassettes/cpanel/file_manager/show.yml +40 -0
  148. data/spec/vcr_cassettes/cpanel/file_manager/stat.yml +38 -0
  149. data/spec/vcr_cassettes/cpanel/ftp/addftp.yml +43 -0
  150. data/spec/vcr_cassettes/cpanel/ftp/delftp.yml +43 -0
  151. data/spec/vcr_cassettes/cpanel/ftp/listftp.yml +43 -0
  152. data/spec/vcr_cassettes/cpanel/ftp/listftpsessions.yml +43 -0
  153. data/spec/vcr_cassettes/cpanel/ftp/listftpwithdisk.yml +95 -0
  154. data/spec/vcr_cassettes/cpanel/ftp/passwd.yml +43 -0
  155. data/spec/vcr_cassettes/cpanel/ftp/setquota.yml +43 -0
  156. data/spec/vcr_cassettes/cpanel/gpg/count.yml +40 -0
  157. data/spec/vcr_cassettes/cpanel/gpg/count_private.yml +40 -0
  158. data/spec/vcr_cassettes/cpanel/gpg/list.yml +40 -0
  159. data/spec/vcr_cassettes/cpanel/gpg/list_private.yml +40 -0
  160. data/spec/vcr_cassettes/cpanel/locale/show.yml +40 -0
  161. data/spec/vcr_cassettes/cpanel/mysql_db/add_db.yml +42 -0
  162. data/spec/vcr_cassettes/cpanel/mysql_db/add_host.yml +42 -0
  163. data/spec/vcr_cassettes/cpanel/mysql_db/add_user.yml +42 -0
  164. data/spec/vcr_cassettes/cpanel/mysql_db/add_user_db.yml +42 -0
  165. data/spec/vcr_cassettes/cpanel/mysql_db/check_db.yml +42 -0
  166. data/spec/vcr_cassettes/cpanel/mysql_db/del_db.yml +42 -0
  167. data/spec/vcr_cassettes/cpanel/mysql_db/del_host.yml +42 -0
  168. data/spec/vcr_cassettes/cpanel/mysql_db/del_user.yml +42 -0
  169. data/spec/vcr_cassettes/cpanel/mysql_db/del_user_db.yml +42 -0
  170. data/spec/vcr_cassettes/cpanel/mysql_db/init_cache.yml +42 -0
  171. data/spec/vcr_cassettes/cpanel/mysql_db/number_of_dbs.yml +42 -0
  172. data/spec/vcr_cassettes/cpanel/mysql_db/repair_db.yml +42 -0
  173. data/spec/vcr_cassettes/cpanel/mysql_db/update_privs.yml +42 -0
  174. data/spec/vcr_cassettes/cpanel/net/query_hostname.yml +40 -0
  175. data/spec/vcr_cassettes/cpanel/net/traceroute.yml +40 -0
  176. data/spec/vcr_cassettes/cpanel/park/add.yml +77 -0
  177. data/spec/vcr_cassettes/cpanel/park/list.yml +77 -0
  178. data/spec/vcr_cassettes/cpanel/park/list_addon_domains.yml +77 -0
  179. data/spec/vcr_cassettes/cpanel/park/remove.yml +77 -0
  180. data/spec/vcr_cassettes/cpanel/password/digest_authentication.yml +77 -0
  181. data/spec/vcr_cassettes/cpanel/password/modify.yml +77 -0
  182. data/spec/vcr_cassettes/cpanel/password_strength/all_required_strengths.yml +43 -0
  183. data/spec/vcr_cassettes/cpanel/password_strength/required_strength.yml +43 -0
  184. data/spec/vcr_cassettes/cpanel/password_strength/strength.yml +83 -0
  185. data/spec/vcr_cassettes/cpanel/random_data/show.yml +40 -0
  186. data/spec/vcr_cassettes/cpanel/ssl/fetchcabundle.yml +40 -0
  187. data/spec/vcr_cassettes/cpanel/ssl/gencrt.yml +43 -0
  188. data/spec/vcr_cassettes/cpanel/ssl/gencsr.yml +43 -0
  189. data/spec/vcr_cassettes/cpanel/ssl/genkey.yml +40 -0
  190. data/spec/vcr_cassettes/cpanel/ssl/installssl.yml +40 -0
  191. data/spec/vcr_cassettes/cpanel/ssl/listcrts.yml +40 -0
  192. data/spec/vcr_cassettes/cpanel/ssl/listcsrs.yml +40 -0
  193. data/spec/vcr_cassettes/cpanel/ssl/listkeys.yml +40 -0
  194. data/spec/vcr_cassettes/cpanel/ssl/listsslitems.yml +40 -0
  195. data/spec/vcr_cassettes/cpanel/ssl/remove.yml +43 -0
  196. data/spec/vcr_cassettes/cpanel/ssl/showcrt.yml +38 -0
  197. data/spec/vcr_cassettes/cpanel/ssl/showcsr.yml +38 -0
  198. data/spec/vcr_cassettes/cpanel/ssl/showkey.yml +38 -0
  199. data/spec/vcr_cassettes/cpanel/ssl/uploadcrt.yml +40 -0
  200. data/spec/vcr_cassettes/cpanel/sub_domain/add.yml +77 -0
  201. data/spec/vcr_cassettes/cpanel/sub_domain/list.yml +77 -0
  202. data/spec/vcr_cassettes/cpanel/sub_domain/remove.yml +77 -0
  203. data/spec/vcr_cassettes/cpanel/support/contactable.yml +40 -0
  204. data/spec/vcr_cassettes/whm/account/accountsummary.yml +41 -29
  205. data/spec/vcr_cassettes/whm/account/changepackage.yml +73 -43
  206. data/spec/vcr_cassettes/whm/account/createacct.yml +101 -31
  207. data/spec/vcr_cassettes/whm/account/domainuserdata.yml +43 -29
  208. data/spec/vcr_cassettes/whm/account/editquota.yml +78 -57
  209. data/spec/vcr_cassettes/whm/account/limitbw.yml +79 -57
  210. data/spec/vcr_cassettes/whm/account/listaccts.yml +195 -100
  211. data/spec/vcr_cassettes/whm/account/listsuspended.yml +41 -29
  212. data/spec/vcr_cassettes/whm/account/modifyacct.yml +61 -42
  213. data/spec/vcr_cassettes/whm/account/myprivs.yml +41 -29
  214. data/spec/vcr_cassettes/whm/account/passwd.yml +44 -29
  215. data/spec/vcr_cassettes/whm/account/removeacct.yml +134 -57
  216. data/spec/vcr_cassettes/whm/account/restoreaccount.yml +310 -135
  217. data/spec/vcr_cassettes/whm/account/setsiteip.yml +166 -127
  218. data/spec/vcr_cassettes/whm/account/suspend.yml +75 -43
  219. data/spec/vcr_cassettes/whm/account/unsuspend.yml +46 -29
  220. data/spec/vcr_cassettes/whm/cert/fetch_ssl_vhosts.yml +44 -0
  221. data/spec/vcr_cassettes/whm/cert/fetchsslinfo.yml +38 -0
  222. data/spec/vcr_cassettes/whm/cert/generatessl.yml +94 -0
  223. data/spec/vcr_cassettes/whm/cert/installssl.yml +38 -0
  224. data/spec/vcr_cassettes/whm/cert/listcrts.yml +38 -0
  225. data/spec/vcr_cassettes/whm/dns/adddns.yml +61 -43
  226. data/spec/vcr_cassettes/whm/dns/addzonerecord.yml +42 -29
  227. data/spec/vcr_cassettes/whm/dns/dumpzone.yml +44 -29
  228. data/spec/vcr_cassettes/whm/dns/editzonerecord.yml +61 -43
  229. data/spec/vcr_cassettes/whm/dns/getzonerecord.yml +60 -43
  230. data/spec/vcr_cassettes/whm/dns/killdns.yml +42 -29
  231. data/spec/vcr_cassettes/whm/dns/listmxs.yml +23 -15
  232. data/spec/vcr_cassettes/whm/dns/listzones.yml +22 -15
  233. data/spec/vcr_cassettes/whm/dns/lookupnsip.yml +40 -29
  234. data/spec/vcr_cassettes/whm/dns/removezonerecord.yml +61 -43
  235. data/spec/vcr_cassettes/whm/dns/resetzone.yml +42 -29
  236. data/spec/vcr_cassettes/whm/dns/resolvedomainname.yml +40 -29
  237. data/spec/vcr_cassettes/whm/dns/savemxs.yml +23 -15
  238. data/spec/vcr_cassettes/whm/reseller/acctcounts.yml +41 -29
  239. data/spec/vcr_cassettes/whm/reseller/listacls.yml +22 -15
  240. data/spec/vcr_cassettes/whm/reseller/listresellers.yml +22 -15
  241. data/spec/vcr_cassettes/whm/reseller/resellerstats.yml +42 -29
  242. data/spec/vcr_cassettes/whm/reseller/saveacllist.yml +76 -57
  243. data/spec/vcr_cassettes/whm/reseller/setacls.yml +40 -29
  244. data/spec/vcr_cassettes/whm/reseller/setresellerips.yml +42 -28
  245. data/spec/vcr_cassettes/whm/reseller/setresellerlimits.yml +41 -29
  246. data/spec/vcr_cassettes/whm/reseller/setresellermainip.yml +59 -43
  247. data/spec/vcr_cassettes/whm/reseller/setresellernameservers.yml +58 -43
  248. data/spec/vcr_cassettes/whm/reseller/setresellerpackagelimit.yml +61 -43
  249. data/spec/vcr_cassettes/whm/reseller/setupreseller.yml +41 -29
  250. data/spec/vcr_cassettes/whm/reseller/suspendreseller.yml +75 -44
  251. data/spec/vcr_cassettes/whm/reseller/terminatereseller.yml +83 -46
  252. data/spec/vcr_cassettes/whm/reseller/unsetupreseller.yml +41 -29
  253. data/spec/vcr_cassettes/whm/reseller/unsuspendreseller.yml +46 -29
  254. data/spec/vcr_cassettes/whm/server/addip.yml +24 -15
  255. data/spec/vcr_cassettes/whm/server/applist.yml +22 -15
  256. data/spec/vcr_cassettes/whm/server/delip.yml +23 -15
  257. data/spec/vcr_cassettes/whm/server/disk_usage.yml +45 -0
  258. data/spec/vcr_cassettes/whm/server/edit_hook.yml +44 -0
  259. data/spec/vcr_cassettes/whm/server/gethostname.yml +22 -15
  260. data/spec/vcr_cassettes/whm/server/getlanglist.yml +22 -15
  261. data/spec/vcr_cassettes/whm/server/gettweaksetting.yml +44 -0
  262. data/spec/vcr_cassettes/whm/server/list_hooks.yml +44 -0
  263. data/spec/vcr_cassettes/whm/server/listips.yml +22 -15
  264. data/spec/vcr_cassettes/whm/server/loadavg.yml +26 -19
  265. data/spec/vcr_cassettes/whm/server/lookup_nameserver_ip.yml +44 -0
  266. data/spec/vcr_cassettes/whm/server/my_function.yml +59 -43
  267. data/spec/vcr_cassettes/whm/server/nvget.yml +22 -15
  268. data/spec/vcr_cassettes/whm/server/nvset.yml +22 -15
  269. data/spec/vcr_cassettes/whm/server/reboot.yml +22 -15
  270. data/spec/vcr_cassettes/whm/server/sethostname.yml +24 -15
  271. data/spec/vcr_cassettes/whm/server/setresolvers.yml +23 -15
  272. data/spec/vcr_cassettes/whm/server/settweaksetting.yml +44 -0
  273. data/spec/vcr_cassettes/whm/server/showbw.yml +22 -15
  274. data/spec/vcr_cassettes/whm/server/systemloadavg.yml +40 -29
  275. data/spec/vcr_cassettes/whm/server/themes.yml +38 -0
  276. data/spec/vcr_cassettes/whm/server/version.yml +22 -15
  277. data/spec/vcr_cassettes/whm/transfer_tool/check.yml +44 -0
  278. data/spec/vcr_cassettes/whm/transfer_tool/create.yml +72 -0
  279. data/spec/vcr_cassettes/whm/transfer_tool/enqueue.yml +44 -0
  280. data/spec/vcr_cassettes/whm/transfer_tool/pause.yml +44 -0
  281. data/spec/vcr_cassettes/whm/transfer_tool/show_log.yml +44 -0
  282. data/spec/vcr_cassettes/whm/transfer_tool/start.yml +44 -0
  283. data/spec/vcr_cassettes/whm/transfer_tool/status.yml +44 -0
  284. data/spec/vcr_cassettes/whm/transfer_tool/validate_user.yml +44 -0
  285. data/spec/vcr_cassettes/whostmgr/ssl/create.yml +219 -0
  286. data/spec/vcr_cassettes/whostmgr/ssl/remove.yml +172 -0
  287. data/spec/vcr_cassettes/whostmgr/ssl/remove_data.yml +179 -0
  288. data/spec/whm/account_spec.rb +90 -249
  289. data/spec/whm/base_spec.rb +3 -7
  290. data/spec/whm/cert_spec.rb +110 -0
  291. data/spec/whm/dns_spec.rb +37 -155
  292. data/spec/whm/reseller_spec.rb +46 -114
  293. data/spec/whm/server_spec.rb +142 -156
  294. data/spec/whm/transfer_tool_spec.rb +172 -0
  295. data/spec/whm/whm_spec.rb +8 -8
  296. data/spec/whostmgr/ssl_spec.rb +55 -0
  297. metadata +528 -108
  298. data/.gitignore +0 -10
  299. data/.rspec +0 -2
  300. data/.rvmrc +0 -49
  301. data/.travis.yml +0 -11
  302. data/lib/lumberg/whm/args.rb +0 -113
  303. data/lib/net_http_hacked.rb +0 -42
  304. data/lumberg.gemspec +0 -28
  305. data/spec/vcr_cassettes/whm/server/response_type.yml +0 -85
  306. data/spec/whm/args_spec.rb +0 -179
@@ -1,18 +1,18 @@
1
1
  module Lumberg
2
2
  module Whm
3
3
  # Some WHM functions require different params for the same 'thing'
4
- # e.g. some accept 'username' while others accept 'user'
5
- # Be sure to keep our API consistent and work around those inconsistencies internally
4
+ # e.g. some accept 'username' while others accept 'user'
5
+ # Be sure to keep our API consistent and work around those inconsistencies internally
6
6
  class Account < Base
7
7
 
8
8
  # Creates a hosting account and sets up its associated domain information
9
9
  #
10
- # ==== Required
10
+ # ==== Required
11
11
  # * <tt>:username</tt> - PENDING
12
12
  # * <tt>:domain</tt> - PENDING
13
13
  # * <tt>:password</tt> - PENDING
14
14
  #
15
- # ==== Optional
15
+ # ==== Optional
16
16
  # * <tt>:plan</tt> - PENDING
17
17
  # * <tt>:pkgname</tt> - PENDING
18
18
  # * <tt>:savepkg</tt> - PENDING
@@ -22,71 +22,44 @@ module Lumberg
22
22
  # * <tt>:cgi</tt> - PENDING
23
23
  # * <tt>:</tt> - PENDING
24
24
  def create(options = {})
25
- Args.new(options) do |c|
26
- c.requires :username, :domain, :password
27
- c.booleans :savepkg, :ip, :cgi, :frontpage, :hasshell, :useregns, :reseller, :forcedns
28
- c.optionals :plan, :pkgname, :savepkg, :featurelist, :quota, :ip, :cgi,
29
- :frontpage, :hasshell, :contactemail, :cpmod, :maxftp, :maxsql, :maxpop, :maxlst,
30
- :maxsub, :maxpark, :maxaddon, :bwlimit, :customip, :language, :useregns, :hasuseregns,
31
- :reseller, :forcedns, :mxcheck
32
- end
33
-
34
25
  server.perform_request('createacct', options)
35
26
  end
36
27
 
37
28
  # Permanently removes a cPanel account
38
29
  #
39
- # ==== Required
30
+ # ==== Required
40
31
  # * <tt>:username</tt> - PENDING
41
32
  def remove(options = {})
42
- Args.new(options) do |c|
43
- c.requires :username
44
- c.booleans :keepdns
45
- end
46
-
47
33
  options[:user] = options.delete(:username)
48
34
  server.perform_request('removeacct', options)
49
35
  end
50
36
 
51
37
  # Changes the password of a domain owner (cPanel) or reseller (WHM) account
52
38
  #
53
- # ==== Required
39
+ # ==== Required
54
40
  # * <tt>:username</tt> - PENDING
55
41
  # * <tt>:password</tt> - PENDING
56
42
  def change_password(options = {})
57
- Args.new(options) do |c|
58
- c.requires :username, :password
59
- c.booleans :db_pass_update
60
- end
61
-
62
43
  options[:user] = options.delete(:username)
63
44
  options[:pass] = options.delete(:password)
64
- server.perform_request('passwd', options.merge(:key => 'passwd'))
45
+ server.perform_request('passwd', options.merge(response_key: 'passwd'))
65
46
  end
66
47
 
67
48
  # Displays pertinent information about a specific account
68
49
  #
69
- # ==== Required
50
+ # ==== Required
70
51
  # * <tt>:username</tt> - PENDING
71
52
  def summary(options = {})
72
- Args.new(options) do |c|
73
- c.requires :username
74
- end
75
-
76
53
  options[:user] = options.delete(:username)
77
54
  server.perform_request('accountsummary', options)
78
55
  end
79
56
 
80
57
  # Modifies the bandwidth usage (transfer) limit for a specific account
81
58
  #
82
- # ==== Required
59
+ # ==== Required
83
60
  # * <tt>:username</tt> - PENDING
84
61
  # * <tt>:bwlimit</tt> - PENDING
85
62
  def limit_bandwidth(options = {})
86
- Args.new(options) do |c|
87
- c.requires :username, :bwlimit
88
- end
89
-
90
63
  verify_user(options[:username]) do
91
64
  options[:user] = options.delete(:username)
92
65
  server.perform_request('limitbw', options) do |s|
@@ -98,14 +71,10 @@ module Lumberg
98
71
  # Lists all accounts on the server, and also allows you to search for a specific account or set of accounts
99
72
 
100
73
  #
101
- # ==== Optional
74
+ # ==== Optional
102
75
  # * <tt>:searchtype</tt> - PENDING
103
76
  # * <tt>:search</tt> - PENDING
104
77
  def list(options = {})
105
- Args.new(options) do |c|
106
- c.optionals :searchtype, :search
107
- end
108
-
109
78
  server.perform_request('listaccts', options) do |s|
110
79
  s.boolean_params = :suspended
111
80
  end
@@ -113,10 +82,10 @@ module Lumberg
113
82
 
114
83
  # Modifies settings for an account
115
84
  #
116
- # ==== Required
85
+ # ==== Required
117
86
  # * <tt>:username</tt> - PENDING
118
87
  #
119
- # ==== Optional
88
+ # ==== Optional
120
89
  # * <tt>:domain</tt> - PENDING
121
90
  # * <tt>:newuser</tt> - PENDING
122
91
  # * <tt>:owner</tt> - PENDING
@@ -133,11 +102,6 @@ module Lumberg
133
102
  # * <tt>:MAXADDON</tt> - PENDING
134
103
  # * <tt>:shell</tt> - PENDING
135
104
  def modify(options = {})
136
- Args.new(options) do |c|
137
- c.requires :username
138
- c.optionals :domain, :newuser, :owner, :CPTHEME, :HASCGI, :LANG, :LOCALE, :MAXFTP, :MAXSQL, :MAXPOP, :MAXLST, :MAXSUB, :MAXPARK, :MAXADDON, :shell
139
- end
140
-
141
105
  options[:user] = options.delete(:username)
142
106
  server.perform_request('modifyacct', options) do |s|
143
107
  s.boolean_params = :DEMO
@@ -146,24 +110,20 @@ module Lumberg
146
110
 
147
111
  # Changes an account's disk space usage quota
148
112
  #
149
- # ==== Required
113
+ # ==== Required
150
114
  # * <tt>:username</tt> - PENDING
151
115
  # * <tt>:quota</tt> - PENDING
152
116
  def edit_quota(options = {})
153
- Args.new(options) do |c|
154
- c.requires :username, :quota
155
- end
156
-
157
117
  options[:user] = options.delete(:username)
158
118
  server.perform_request('editquota', options)
159
119
  end
160
120
 
161
121
  # Adds a new hosting package
162
122
  #
163
- # ==== Required
123
+ # ==== Required
164
124
  # * <tt>:name</tt> - PENDING
165
125
  #
166
- # ==== Optional
126
+ # ==== Optional
167
127
  # * <tt>:featurelist</tt> - PENDING
168
128
  # * <tt>:quota</tt> - PENDING
169
129
  # * <tt>:ip</tt> - PENDING
@@ -181,69 +141,46 @@ module Lumberg
181
141
  # * <tt>:hasshell</tt> - PENDING
182
142
  # * <tt>:bwlimit</tt> - PENDING
183
143
  def add_package(options = {})
184
- Args.new(options) do |c|
185
- c.requires :name
186
- c.optionals :featurelist, :quota, :ip, :cgi, :frontpage, :cpmod, :language, :maxftp, :maxsql, :maxpop, :maxlists, :maxsub, :maxpark, :maxaddon, :hasshell, :bwlimit
187
- c.booleans :ip, :cgi, :frontpage, :hasshell
188
- end
189
-
190
144
  server.perform_request('addpkg', options)
191
145
  end
192
146
 
193
147
  # Changes the hosting package associated with a cPanel account
194
148
  #
195
- # ==== Required
149
+ # ==== Required
196
150
  # * <tt>:username</tt> - PENDING
197
151
  # * <tt>:pkg</tt> - PENDING
198
152
  def change_package(options = {})
199
- Args.new(options) do |c|
200
- c.requires :username, :pkg
201
- end
202
-
203
153
  options[:user] = options.delete(:username)
204
154
  server.perform_request('changepackage', options)
205
155
  end
206
156
 
207
157
  # Obtains user data for a specific domain
208
158
  #
209
- # ==== Required
159
+ # ==== Required
210
160
  # * <tt>:domain</tt> - PENDING
211
161
  def domain_user_data(options = {})
212
- Args.new(options) do |c|
213
- c.requires :domain
214
- end
215
-
216
- server.perform_request('domainuserdata', options.merge(:key => 'userdata')) do |s|
162
+ server.perform_request('domainuserdata', options.merge(response_key: 'userdata')) do |s|
217
163
  s.boolean_params = :hascgi
218
164
  end
219
165
  end
220
166
 
221
167
  # Prevents a cPanel user from accessing his or her account. Once an account is suspended, it can be un-suspended to allow a user to access the account again
222
168
  #
223
- # ==== Required
169
+ # ==== Required
224
170
  # * <tt>:username</tt> - PENDING
225
171
  #
226
- # ==== Optional
172
+ # ==== Optional
227
173
  # * <tt>:reason</tt> - PENDING
228
174
  def suspend(options ={})
229
- Args.new(options) do |c|
230
- c.requires :username
231
- c.optionals :reason
232
- end
233
-
234
175
  options[:user] = options.delete(:username)
235
176
  server.perform_request('suspendacct', options)
236
177
  end
237
178
 
238
179
  # Unsuspend a suspended account. When a user's account is unsuspended, he or she will be able to access cPanel again
239
180
  #
240
- # ==== Required
181
+ # ==== Required
241
182
  # * <tt>:username</tt> - PENDING
242
183
  def unsuspend(options ={})
243
- Args.new(options) do |c|
244
- c.requires :username
245
- end
246
-
247
184
  options[:user] = options.delete(:username)
248
185
  server.perform_request('unsuspendacct', options)
249
186
  end
@@ -255,15 +192,11 @@ module Lumberg
255
192
 
256
193
  # Generates a list of features you are allowed to use in WHM. Each feature will display either a 1 or 0. You are only able to use features with a corresponding 1
257
194
  #
258
- # ==== Required
195
+ # ==== Required
259
196
  # * <tt>:username</tt> - PENDING
260
197
  def privs(options ={})
261
- Args.new(options) do |c|
262
- c.requires :username
263
- end
264
-
265
198
  verify_user(options[:username]) do
266
- resp = server.perform_request('myprivs', options.merge(:key => 'privs')) do |s|
199
+ resp = server.perform_request('myprivs', options.merge(response_key: 'privs')) do |s|
267
200
  s.boolean_params = :all
268
201
  end
269
202
  # if you get this far, it's successful
@@ -274,21 +207,16 @@ module Lumberg
274
207
 
275
208
  # Changes the IP address of a website, or a user account, hosted on your server
276
209
  #
277
- # ==== Required
210
+ # ==== Required
278
211
  # * <tt>:ip</tt> - PENDING
279
212
  def set_site_ip(options = {})
280
- Args.new(options) do |c|
281
- c.requires :ip
282
- c.one_of :username, :domain
283
- end
284
-
285
213
  options[:user] = options.delete(:username) if options[:username]
286
214
  server.perform_request('setsiteip', options)
287
215
  end
288
216
 
289
217
  # Restores a user's account from a backup file. You may restore a monthly, weekly, or daily backup
290
218
  #
291
- # ==== Required
219
+ # ==== Required
292
220
  # * <tt>:username</tt> - PENDING
293
221
  # * <tt>:type</tt> - PENDING
294
222
  # * <tt>:all</tt> - PENDING
@@ -297,18 +225,13 @@ module Lumberg
297
225
  # * <tt>:mysql</tt> - PENDING
298
226
  # * <tt>:subs</tt> - PENDING
299
227
  def restore_account(options = {})
300
- Args.new(options) do |c|
301
- c.requires "api.version".to_sym, :username, :type, :all, :ip, :mail, :mysql, :subs
302
- c.booleans :all, :ip, :mail, :mysql, :subs
303
- end
304
-
305
228
  options[:user] = options.delete(:username) if options[:username]
306
- server.perform_request('restoreaccount', options.merge(:key => 'metadata'))
229
+ server.perform_request('restoreaccount', options.merge(response_key: 'metadata'))
307
230
  end
308
231
 
309
- protected
232
+ protected
310
233
  # Some WHM API methods always return a result, even if the user
311
- # doesn't actually exist. This makes it seem like your request
234
+ # doesn't actually exist. This makes it seem like your request
312
235
  # was successful when it really wasn't
313
236
  #
314
237
  # Example
@@ -316,7 +239,7 @@ module Lumberg
316
239
  # change_password()
317
240
  # end
318
241
  def verify_user(username, &block)
319
- exists = summary(:username => username)
242
+ exists = summary(username: username)
320
243
  if exists[:success]
321
244
  yield
322
245
  else
@@ -5,18 +5,14 @@ module Lumberg
5
5
  attr_accessor :server
6
6
 
7
7
  #
8
- # ==== Required
8
+ # ==== Required
9
9
  # * <tt>:server</tt> - PENDING
10
10
  def initialize(options = {})
11
- Args.new(options) do |c|
12
- c.requires :server
13
- end
14
-
15
- @server = setup_server options.delete(:server)
11
+ @server = setup_server options.delete(:server)
16
12
  end
17
13
 
18
14
  def setup_server(value)
19
- if value.is_a?(Whm::Server)
15
+ if value.is_a?(Whm::Server)
20
16
  value
21
17
  else
22
18
  Whm::Server.new value
@@ -0,0 +1,88 @@
1
+ module Lumberg
2
+ module Whm
3
+ class Cert < Base
4
+
5
+ # Displays the SSL certificate, private key, and CA bundle/intermediate
6
+ # certificate associated with a specified domain. Alternatively, it can
7
+ # display the private key and CA bundle associated with a specified cert
8
+ #
9
+ # ==== Required
10
+ # * <tt>:domain</tt> - PENDING
11
+ # * <tt>:crtdata</tt> - PENDING
12
+ #
13
+ # ==== Optional
14
+ # * <tt>none</tt> - PENDING
15
+ def fetchsslinfo(options = {})
16
+ server.force_response_type = :ssl
17
+ result = server.perform_request('fetchsslinfo', options)
18
+ end
19
+
20
+ # Public: Generates a Certificate Signing Request
21
+ #
22
+ # options - Hash options for API call params (default: {}):
23
+ # :city - The city in which your server resides.
24
+ # :company - The name of the company.
25
+ # :company_division - The division of your company.
26
+ # :country - A two letter abbreviation for the country.
27
+ # :email - A valid email address that will correspond to
28
+ # the certificate signing request
29
+ # :host - The domain that corresponds to the csr.
30
+ # :state - A two letter abbreviation that corresponds to the
31
+ # state.
32
+ # :pass - The password of the csr.
33
+ # :xemail - Email address to which the certificate will be
34
+ # sent (String)
35
+ # :noemail - (Boolean) and dependent value. Set to "1" when
36
+ # :xemail is empty
37
+ #
38
+ # Returns Hash API response.
39
+ def generatessl(options = {})
40
+ options[:co] = options.delete(:company)
41
+ options[:cod] = options.delete(:company_division)
42
+
43
+ server.force_response_type = :ssl
44
+ result = server.perform_request('generatessl', options)
45
+ end
46
+
47
+ # Install an SSL certificate
48
+ #
49
+ # ==== Required
50
+ # * <tt>:user</tt> - PENDING
51
+ # * <tt>:domain</tt> - PENDING
52
+ # * <tt>:cert</tt> - PENDING
53
+ # * <tt>:key</tt> - PENDING
54
+ # * <tt>:cab</tt> - PENDING
55
+ # * <tt>:ip</tt> - PENDING
56
+ #
57
+ # ==== Optional
58
+ # * <tt>none</tt> - PENDING
59
+ def installssl(options = {})
60
+ result = server.perform_request('installssl', options)
61
+ end
62
+
63
+ # List all the domains on the server that have SSL certificates installed
64
+ #
65
+ # ==== Required
66
+ # * <tt>none</tt> - PENDING
67
+ #
68
+ # ==== Optional
69
+ # * <tt>none</tt> - PENDING
70
+ def listcrts(options = {})
71
+ server.force_response_type = :ssl
72
+ result = server.perform_request('listcrts', options.merge(response_key: 'crt'))
73
+ end
74
+
75
+ # Public: Gets information about each vhost on the server and the SSL
76
+ # certificates that are installed on them.
77
+ #
78
+ # Returs a Hash
79
+ def fetch_ssl_vhosts
80
+ server.perform_request(
81
+ 'fetch_ssl_vhosts', {
82
+ :"api.version" => 1,
83
+ response_key: "data"
84
+ })
85
+ end
86
+ end
87
+ end
88
+ end
@@ -4,28 +4,23 @@ module Lumberg
4
4
  # Creates a DNS zone. All zone information other than domain name and IP address is created based on the standard zone template in WHM.
5
5
  # Your MX, nameserver, domain PTR, and A records will all be generated automatically
6
6
  #
7
- # ==== Required
7
+ # ==== Required
8
8
  # * <tt>:domain</tt> - PENDING
9
9
  # * <tt>:ip</tt> - PENDING
10
10
  #
11
- # ==== Optional
11
+ # ==== Optional
12
12
  # * <tt>:template</tt> - PENDING
13
13
  # * <tt>:trueowner</tt> - PENDING
14
14
  def add_zone(options = {})
15
- Args.new(options) do |c|
16
- c.requires :domain, :ip
17
- c.optionals :template, :trueowner
18
- end
19
-
20
15
  server.perform_request('adddns', options)
21
16
  end
22
17
 
23
18
  # Adds a DNS zone record to the server
24
19
  #
25
- # ==== Required
20
+ # ==== Required
26
21
  # * <tt>:zone</tt> - PENDING
27
22
  #
28
- # ==== Optional
23
+ # ==== Optional
29
24
  # * <tt>:name</tt> - PENDING
30
25
  # * <tt>:address</tt> - PENDING
31
26
  # * <tt>:type</tt> - PENDING
@@ -37,70 +32,53 @@ module Lumberg
37
32
  # * <tt>:preference</tt> - PENDING
38
33
  # * <tt>:ttl</tt> - PENDING
39
34
  def add_zone_record(options = {})
40
- Args.new(options) do |c|
41
- c.requires :zone
42
- c.optionals :name, :address, :type, :class, :cname, :exchange, :nsdname, :ptdrname, :preference, :ttl
43
- end
44
-
45
35
  server.perform_request('addzonerecord', options)
46
36
  end
47
37
 
48
38
  # Generates a list of all domains and corresponding DNS zones associated with your server
49
39
  def list_zones(options = {})
50
- server.perform_request('listzones', options.merge(:key => 'zone'))
40
+ server.perform_request('listzones', options.merge(response_key: 'zone'))
51
41
  end
52
42
 
53
43
  # Return zone records for a domain.
54
- #
55
- # To use this function most effectively, you may first wish to run the dumpzone function for the domain(s) whose record(s) you wish to retrieve.
44
+ #
45
+ # To use this function most effectively, you may first wish to run the dumpzone function for the domain(s) whose record(s) you wish to retrieve.
56
46
  # The Line output variable from that function call can then be used as a reference to create the input for this function.
57
47
  #
58
- # ==== Required
48
+ # ==== Required
59
49
  # * <tt>:domain</tt> - PENDING
60
50
  # * <tt>:Line</tt> - PENDING
61
51
  def get_zone_record(options = {})
62
- Args.new(options) do |c|
63
- c.requires :domain, :Line
64
- end
65
-
66
52
  server.perform_request('getzonerecord', options)
67
53
  end
68
54
 
69
55
  # Displays the DNS zone configuration for a specific domain
70
56
  #
71
- # ==== Required
57
+ # ==== Required
72
58
  # * <tt>:domain</tt> - PENDING
73
59
  def dump_zone(options = {})
74
- Args.new(options) do |c|
75
- c.requires :domain
76
- end
77
-
78
60
  server.perform_request('dumpzone', options)
79
61
  end
80
62
 
81
63
  # Attempts to resolve an IP address for a specified domain name
82
64
  #
83
- # ==== Required
65
+ # ==== Required
84
66
  # * <tt>:domain</tt> - PENDING
85
67
  # * <tt>:"api.version".to_sym</tt> - PENDING
86
68
  def resolve_domain(options = {})
87
- Args.new(options) do |c|
88
- c.requires :domain, "api.version".to_sym
89
- end
90
-
91
- server.perform_request('resolvedomainname', options.merge(:key => 'data'))
69
+ server.perform_request('resolvedomainname', options.merge(response_key: 'data'))
92
70
  end
93
71
 
94
72
  # Allows you to edit a DNS zone record on the server.
95
73
  #
96
- # To use this function most effectively, you should first run the dumpzone function for the domain(s) whose record(s) you wish to edit.
74
+ # To use this function most effectively, you should first run the dumpzone function for the domain(s) whose record(s) you wish to edit.
97
75
  # The output of that function call will be used as a reference to create the input for this function.
98
76
  #
99
- # ==== Required
77
+ # ==== Required
100
78
  # * <tt>:domain</tt> - PENDING
101
79
  # * <tt>:Line</tt> - PENDING
102
80
  #
103
- # ==== Optional
81
+ # ==== Optional
104
82
  # * <tt>:address</tt> - PENDING
105
83
  # * <tt>:class</tt> - PENDING
106
84
  # * <tt>:cname</tt> - PENDING
@@ -110,94 +88,88 @@ module Lumberg
110
88
  # * <tt>:minimum</tt> - PENDING
111
89
  # * <tt>:mname</tt> - PENDING
112
90
  def edit_zone_record(options = {})
113
- Args.new(options) do |c|
114
- c.requires :domain, :Line
115
- c.optionals :address, :class, :cname, :exchange, :preference, :expire, :minimum, :mname,
116
- :name, :nsdname, :raw, :refresh, :retry, :rname, :serial, :ttl, :type, :txtdata
117
- end
118
-
119
91
  server.perform_request('editzonerecord', options)
120
92
  end
121
93
 
122
94
  # Deletes a DNS zone
123
95
  #
124
- # ==== Required
96
+ # ==== Required
125
97
  # * <tt>:domain</tt> - PENDING
126
98
  def kill_dns(options = {})
127
- Args.new(options) do |c|
128
- c.requires :domain
129
- end
130
-
131
99
  server.perform_request('killdns', options)
132
100
  end
133
101
 
134
102
  # Obtains the IP address of a registered nameserver from the root nameservers
135
103
  #
136
- # ==== Required
104
+ # ==== Required
137
105
  # * <tt>:nameserver</tt> - PENDING
138
106
  def lookup_nameserver_ip(options = {})
139
- Args.new(options) do |c|
140
- c.requires :nameserver
141
- end
142
-
143
- server.perform_request('lookupnsip', options.merge(:key => 'ip'))
107
+ server.perform_request('lookupnsip', options.merge(response_key: 'ip'))
144
108
  end
145
109
 
146
110
  # Allows you to remove a DNS zone record from the server.
147
- #
148
- # To use this function most effectively, you should first run the dumpzone function for the domain(s) whose record(s) you wish to remove.
111
+ #
112
+ # To use this function most effectively, you should first run the dumpzone function for the domain(s) whose record(s) you wish to remove.
149
113
  # The output of that function call will be used as a reference to create the input for this function.
150
114
  #
151
- # ==== Required
115
+ # ==== Required
152
116
  # * <tt>:zone</tt> - PENDING
153
117
  # * <tt>:Line</tt> - PENDING
154
118
  def remove_zone_record(options = {})
155
- Args.new(options) do |c|
156
- c.requires :zone, :Line
157
- end
158
-
159
119
  server.perform_request('removezonerecord', options)
160
120
  end
161
121
 
162
122
  # Restore a DNS zone to its default values. This includes any subdomain DNS records associated with the domain.
163
- #
164
- # This function can be useful for restoring DNS zones that have become corrupted or have been improperly edited.
123
+ #
124
+ # This function can be useful for restoring DNS zones that have become corrupted or have been improperly edited.
165
125
  # It will also restore zone file subdomains listed in the server's httpd.conf file, along with default settings for new accounts.
166
126
  #
167
- # ==== Required
127
+ # ==== Required
168
128
  # * <tt>:domain</tt> - PENDING
169
129
  # * <tt>:zone</tt> - PENDING
170
130
  def reset_zone(options = {})
171
- Args.new(options) do |c|
172
- c.requires :domain, :zone
173
- end
174
-
175
131
  server.perform_request('resetzone', options)
176
132
  end
177
133
 
134
+ # This function will change a specified domain's MX records
135
+ #
136
+ # ==== Required
137
+ # * <tt>:domain</tt> - PENDING
138
+ # * <tt>:exchange</tt> - PENDING
139
+ # * <tt>:oldexchange</tt> - PENDING
140
+ # * <tt>:oldpreference</tt> - PENDING
141
+ # * <tt>:preference</tt> - PENDING
142
+ # * <tt>:alwaysaccept</tt> - PENDING
143
+ def change_mx(options = {})
144
+ server.perform_request('changemx', options.merge(response_key: 'data'))
145
+ end
146
+
147
+ # This function will add an MX record to a specified domain
148
+ #
149
+ # ==== Required
150
+ # * <tt>:domain</tt> - PENDING
151
+ # * <tt>:exchange</tt> - PENDING
152
+ # * <tt>:preference</tt> - PENDING
153
+ # * <tt>:alwaysaccept</tt> - PENDING
154
+ def add_mx(options = {})
155
+ server.perform_request('addmx', options.merge(response_key: 'data'))
156
+ end
157
+
178
158
  # This function will list a specified domain's MX records
179
159
  #
180
160
  # *This function is only available in version 11.27/11.28+*
181
161
  #
182
- # ==== Required
162
+ # ==== Required
183
163
  # * <tt>:domain</tt> - PENDING
184
164
  # * <tt>:"api.version".to_sym</tt> - PENDING
185
165
  def list_mxs(options = {})
186
- Args.new(options) do |c|
187
- c.requires :domain, "api.version".to_sym
188
- end
189
-
190
- server.perform_request('listmxs', options.merge(:key => 'data'))
166
+ server.perform_request('listmxs', options.merge(response_key: 'data'))
191
167
  end
192
168
 
193
169
  # This function will add an MX record
194
170
  #
195
171
  # *This function is only available in version 11.27/11.28+*
196
172
  def save_mx(options = {})
197
- Args.new(options) do |c|
198
- c.requires "api.version".to_sym, :domain, :name, :exchange, :preference
199
- end
200
-
201
173
  server.perform_request('savemxs', options)
202
174
  end
203
175
  end