lumberg 1.0.1 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +1 -1
- data/README.md +184 -70
- data/Rakefile +3 -1
- data/lib/lumberg/config.rb +19 -0
- data/lib/lumberg/cpanel/addon_domain.rb +50 -0
- data/lib/lumberg/cpanel/backups.rb +16 -0
- data/lib/lumberg/cpanel/base.rb +56 -0
- data/lib/lumberg/cpanel/box_trapper.rb +18 -0
- data/lib/lumberg/cpanel/branding.rb +89 -0
- data/lib/lumberg/cpanel/contact.rb +38 -0
- data/lib/lumberg/cpanel/cron.rb +89 -0
- data/lib/lumberg/cpanel/dns_lookup.rb +23 -0
- data/lib/lumberg/cpanel/domain_keys.rb +37 -0
- data/lib/lumberg/cpanel/domain_lookup.rb +71 -0
- data/lib/lumberg/cpanel/email.rb +522 -0
- data/lib/lumberg/cpanel/file_manager.rb +146 -0
- data/lib/lumberg/cpanel/ftp.rb +101 -0
- data/lib/lumberg/cpanel/gpg.rb +36 -0
- data/lib/lumberg/cpanel/locale.rb +15 -0
- data/lib/lumberg/cpanel/mime.rb +34 -0
- data/lib/lumberg/cpanel/mysql.rb +66 -0
- data/lib/lumberg/cpanel/mysql_db.rb +190 -0
- data/lib/lumberg/cpanel/net.rb +28 -0
- data/lib/lumberg/cpanel/park.rb +58 -0
- data/lib/lumberg/cpanel/password.rb +52 -0
- data/lib/lumberg/cpanel/password_strength.rb +63 -0
- data/lib/lumberg/cpanel/random_data.rb +25 -0
- data/lib/lumberg/cpanel/redirect.rb +44 -0
- data/lib/lumberg/cpanel/ssl.rb +220 -0
- data/lib/lumberg/cpanel/sub_domain.rb +61 -0
- data/lib/lumberg/cpanel/support.rb +29 -0
- data/lib/lumberg/cpanel/zone_edit.rb +134 -0
- data/lib/lumberg/cpanel.rb +32 -0
- data/lib/lumberg/format_whm.rb +162 -0
- data/lib/lumberg/version.rb +1 -1
- data/lib/lumberg/whm/account.rb +29 -106
- data/lib/lumberg/whm/base.rb +3 -7
- data/lib/lumberg/whm/cert.rb +88 -0
- data/lib/lumberg/whm/dns.rb +49 -77
- data/lib/lumberg/whm/reseller.rb +25 -118
- data/lib/lumberg/whm/server.rb +163 -222
- data/lib/lumberg/whm/transfer_tool.rb +165 -0
- data/lib/lumberg/whm.rb +11 -9
- data/lib/lumberg/whostmgr/base.rb +13 -0
- data/lib/lumberg/whostmgr/ssl.rb +57 -0
- data/lib/lumberg/whostmgr.rb +6 -0
- data/lib/lumberg.rb +35 -8
- data/spec/config_spec.rb +28 -0
- data/spec/cpanel/addon_domain_spec.rb +84 -0
- data/spec/cpanel/backups_spec.rb +22 -0
- data/spec/cpanel/base_spec.rb +128 -0
- data/spec/cpanel/box_trapper_spec.rb +22 -0
- data/spec/cpanel/branding_spec.rb +46 -0
- data/spec/cpanel/contact_spec.rb +50 -0
- data/spec/cpanel/cron_spec.rb +161 -0
- data/spec/cpanel/dns_lookup_spec.rb +22 -0
- data/spec/cpanel/domain_keys_spec.rb +46 -0
- data/spec/cpanel/domain_lookup_spec.rb +77 -0
- data/spec/cpanel/email_spec.rb +639 -0
- data/spec/cpanel/file_manager_spec.rb +73 -0
- data/spec/cpanel/ftp_spec.rb +71 -0
- data/spec/cpanel/gpg_spec.rb +48 -0
- data/spec/cpanel/locale_spec.rb +23 -0
- data/spec/cpanel/mime_spec.rb +0 -0
- data/spec/cpanel/mysql_db_spec.rb +119 -0
- data/spec/cpanel/mysql_spec.rb +0 -0
- data/spec/cpanel/net_spec.rb +30 -0
- data/spec/cpanel/park_spec.rb +94 -0
- data/spec/cpanel/password_spec.rb +35 -0
- data/spec/cpanel/password_strength_spec.rb +50 -0
- data/spec/cpanel/random_data_spec.rb +24 -0
- data/spec/cpanel/redirect_spec.rb +0 -0
- data/spec/cpanel/ssl_spec.rb +158 -0
- data/spec/cpanel/sub_domain_spec.rb +72 -0
- data/spec/cpanel/support_spec.rb +38 -0
- data/spec/cpanel/zone_edit_spec.rb +0 -0
- data/spec/format_whm_spec.rb +53 -0
- data/spec/sample_certs/cpanel.crt +28 -0
- data/spec/sample_certs/cpanel.key +28 -0
- data/spec/sample_certs/main.crt +27 -0
- data/spec/sample_certs/sample.crt +26 -0
- data/spec/sample_certs/sample.key +27 -0
- data/spec/spec_helper.rb +10 -3
- data/spec/support/cpanel_matchers.rb +17 -0
- data/spec/vcr_cassettes/cpanel/addon_domain/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/addon_domain/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/addon_domain/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/backups/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/box_trapper/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_icons.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_image_types.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_object_types.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_pkgs.yml +40 -0
- data/spec/vcr_cassettes/cpanel/branding/list_sprites.yml +40 -0
- data/spec/vcr_cassettes/cpanel/contact/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/contact/update.yml +40 -0
- data/spec/vcr_cassettes/cpanel/cron/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/cron/edit.yml +114 -0
- data/spec/vcr_cassettes/cpanel/cron/email.yml +77 -0
- data/spec/vcr_cassettes/cpanel/cron/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/cron/remove.yml +151 -0
- data/spec/vcr_cassettes/cpanel/cron/set_email.yml +77 -0
- data/spec/vcr_cassettes/cpanel/dns_lookup/name_to_ip.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/add.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/available.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/installed.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_keys/remove.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/count.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/docroot.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/docroots.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/document_root.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/document_roots.yml +40 -0
- data/spec/vcr_cassettes/cpanel/domain_lookup/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/acceptable_encodings.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/accounts.yml +188 -0
- data/spec/vcr_cassettes/cpanel/email/add_account.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/add_filter.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/add_forwarder.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/add_mailing_list.yml +73 -0
- data/spec/vcr_cassettes/cpanel/email/add_mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/change_mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/change_password.yml +43 -0
- data/spec/vcr_cassettes/cpanel/email/check_local_delivery_local.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/check_local_delivery_remote.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/default_address.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/delete_mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/disk_usage.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/domains.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/domains_with_aliases.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/edit_quota.yml +112 -0
- data/spec/vcr_cassettes/cpanel/email/filters.yml +114 -0
- data/spec/vcr_cassettes/cpanel/email/forwarders.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/mail_dir.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/mail_dirs.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/mailing_lists.yml +73 -0
- data/spec/vcr_cassettes/cpanel/email/main_discard.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/mx.yml +40 -0
- data/spec/vcr_cassettes/cpanel/email/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/set_default_address.yml +43 -0
- data/spec/vcr_cassettes/cpanel/email/set_mail_delivery_local.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/set_mail_delivery_remote.yml +77 -0
- data/spec/vcr_cassettes/cpanel/email/set_mx_type.yml +40 -0
- data/spec/vcr_cassettes/cpanel/file_manager/disk_usage.yml +38 -0
- data/spec/vcr_cassettes/cpanel/file_manager/list.yml +38 -0
- data/spec/vcr_cassettes/cpanel/file_manager/operate.yml +77 -0
- data/spec/vcr_cassettes/cpanel/file_manager/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/file_manager/stat.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ftp/addftp.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/delftp.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/listftp.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/listftpsessions.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/listftpwithdisk.yml +95 -0
- data/spec/vcr_cassettes/cpanel/ftp/passwd.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ftp/setquota.yml +43 -0
- data/spec/vcr_cassettes/cpanel/gpg/count.yml +40 -0
- data/spec/vcr_cassettes/cpanel/gpg/count_private.yml +40 -0
- data/spec/vcr_cassettes/cpanel/gpg/list.yml +40 -0
- data/spec/vcr_cassettes/cpanel/gpg/list_private.yml +40 -0
- data/spec/vcr_cassettes/cpanel/locale/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_host.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_user.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/add_user_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/check_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_host.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_user.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/del_user_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/init_cache.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/number_of_dbs.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/repair_db.yml +42 -0
- data/spec/vcr_cassettes/cpanel/mysql_db/update_privs.yml +42 -0
- data/spec/vcr_cassettes/cpanel/net/query_hostname.yml +40 -0
- data/spec/vcr_cassettes/cpanel/net/traceroute.yml +40 -0
- data/spec/vcr_cassettes/cpanel/park/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/park/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/park/list_addon_domains.yml +77 -0
- data/spec/vcr_cassettes/cpanel/park/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/password/digest_authentication.yml +77 -0
- data/spec/vcr_cassettes/cpanel/password/modify.yml +77 -0
- data/spec/vcr_cassettes/cpanel/password_strength/all_required_strengths.yml +43 -0
- data/spec/vcr_cassettes/cpanel/password_strength/required_strength.yml +43 -0
- data/spec/vcr_cassettes/cpanel/password_strength/strength.yml +83 -0
- data/spec/vcr_cassettes/cpanel/random_data/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/fetchcabundle.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/gencrt.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ssl/gencsr.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ssl/genkey.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/installssl.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listcrts.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listcsrs.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listkeys.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/listsslitems.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/remove.yml +43 -0
- data/spec/vcr_cassettes/cpanel/ssl/showcrt.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ssl/showcsr.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ssl/showkey.yml +38 -0
- data/spec/vcr_cassettes/cpanel/ssl/uploadcrt.yml +40 -0
- data/spec/vcr_cassettes/cpanel/sub_domain/add.yml +77 -0
- data/spec/vcr_cassettes/cpanel/sub_domain/list.yml +77 -0
- data/spec/vcr_cassettes/cpanel/sub_domain/remove.yml +77 -0
- data/spec/vcr_cassettes/cpanel/support/contactable.yml +40 -0
- 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/cert/fetch_ssl_vhosts.yml +44 -0
- data/spec/vcr_cassettes/whm/cert/fetchsslinfo.yml +38 -0
- data/spec/vcr_cassettes/whm/cert/generatessl.yml +94 -0
- data/spec/vcr_cassettes/whm/cert/installssl.yml +38 -0
- data/spec/vcr_cassettes/whm/cert/listcrts.yml +38 -0
- 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/disk_usage.yml +45 -0
- data/spec/vcr_cassettes/whm/server/edit_hook.yml +44 -0
- 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/gettweaksetting.yml +44 -0
- data/spec/vcr_cassettes/whm/server/list_hooks.yml +44 -0
- 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/lookup_nameserver_ip.yml +44 -0
- 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/settweaksetting.yml +44 -0
- 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/themes.yml +38 -0
- data/spec/vcr_cassettes/whm/server/version.yml +22 -15
- data/spec/vcr_cassettes/whm/transfer_tool/check.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/create.yml +72 -0
- data/spec/vcr_cassettes/whm/transfer_tool/enqueue.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/pause.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/show_log.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/start.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/status.yml +44 -0
- data/spec/vcr_cassettes/whm/transfer_tool/validate_user.yml +44 -0
- data/spec/vcr_cassettes/whostmgr/ssl/create.yml +219 -0
- data/spec/vcr_cassettes/whostmgr/ssl/remove.yml +172 -0
- data/spec/vcr_cassettes/whostmgr/ssl/remove_data.yml +179 -0
- data/spec/whm/account_spec.rb +90 -249
- data/spec/whm/base_spec.rb +3 -7
- data/spec/whm/cert_spec.rb +110 -0
- data/spec/whm/dns_spec.rb +37 -155
- data/spec/whm/reseller_spec.rb +46 -114
- data/spec/whm/server_spec.rb +142 -156
- data/spec/whm/transfer_tool_spec.rb +172 -0
- data/spec/whm/whm_spec.rb +8 -8
- data/spec/whostmgr/ssl_spec.rb +55 -0
- metadata +528 -108
- data/.gitignore +0 -10
- data/.rspec +0 -2
- data/.rvmrc +0 -49
- data/.travis.yml +0 -11
- data/lib/lumberg/whm/args.rb +0 -113
- data/lib/net_http_hacked.rb +0 -42
- data/lumberg.gemspec +0 -28
- data/spec/vcr_cassettes/whm/server/response_type.yml +0 -85
- data/spec/whm/args_spec.rb +0 -179
@@ -0,0 +1,72 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Lumberg
|
4
|
+
describe Cpanel::SubDomain do
|
5
|
+
before(:each) do
|
6
|
+
@login = { host: @whm_host, hash: @whm_hash }
|
7
|
+
@server = Whm::Server.new(@login.dup)
|
8
|
+
|
9
|
+
@api_username = "lumberg"
|
10
|
+
@subd = Cpanel::SubDomain.new(
|
11
|
+
server: @server.dup,
|
12
|
+
api_username: @api_username
|
13
|
+
)
|
14
|
+
end
|
15
|
+
|
16
|
+
describe "#list" do
|
17
|
+
use_vcr_cassette "cpanel/sub_domain/list"
|
18
|
+
|
19
|
+
context "subdomains exist on the account" do
|
20
|
+
let(:result) { @subd.list }
|
21
|
+
subject { result[:params][:data] }
|
22
|
+
|
23
|
+
it "returns an array with info for each subdomain" do
|
24
|
+
subject.should be_an(Array)
|
25
|
+
subject.each {|info|
|
26
|
+
info.keys.should include(
|
27
|
+
:domainkey, :status, :reldir, :dir, :subdomain,
|
28
|
+
:rootdomain, :domain, :basedir
|
29
|
+
)
|
30
|
+
}
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context "subdomains do not exist on the account" do
|
35
|
+
before { @subd.api_username = "minimal" }
|
36
|
+
after { @subd.api_username = "lumberg" }
|
37
|
+
|
38
|
+
it "returns an empty array" do
|
39
|
+
@subd.list[:params][:data].should be_empty
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
describe "#remove" do
|
46
|
+
use_vcr_cassette "cpanel/sub_domain/remove"
|
47
|
+
|
48
|
+
it "removes a subdomain" do
|
49
|
+
# Add the subdomain first
|
50
|
+
@subd.add(domain: "foo", rootdomain: "lumberg-test.com")
|
51
|
+
|
52
|
+
result = @subd.remove(domain: "foo.lumberg-test.com")
|
53
|
+
result[:params][:data][0][:result].should == 1
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe "#add" do
|
58
|
+
use_vcr_cassette "cpanel/sub_domain/add"
|
59
|
+
|
60
|
+
it "adds a subdomain" do
|
61
|
+
# Delete the subdomain first
|
62
|
+
@subd.remove(domain: "sub.lumberg-test.com")
|
63
|
+
|
64
|
+
result = @subd.add(
|
65
|
+
domain: "sub",
|
66
|
+
rootdomain: "lumberg-test.com"
|
67
|
+
)
|
68
|
+
result[:params][:data][0][:result].should == 1
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module Lumberg
|
4
|
+
describe Cpanel::Support do
|
5
|
+
let(:server) { Whm::Server.new(host: @whm_host, hash: @whm_hash) }
|
6
|
+
let(:api_username) { "lumberg" }
|
7
|
+
let(:support) do
|
8
|
+
described_class.new(
|
9
|
+
server: server,
|
10
|
+
api_username: api_username
|
11
|
+
)
|
12
|
+
end
|
13
|
+
|
14
|
+
subject { support }
|
15
|
+
|
16
|
+
describe "::api_module" do
|
17
|
+
subject { described_class::api_module }
|
18
|
+
|
19
|
+
it { should == "Contactus" }
|
20
|
+
end
|
21
|
+
|
22
|
+
describe "#open_ticket" do
|
23
|
+
context "should open a new support request" do
|
24
|
+
pending
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "#contactable" do
|
29
|
+
context "support option enabled" do
|
30
|
+
use_vcr_cassette("cpanel/support/contactable", record: :new_episodes)
|
31
|
+
|
32
|
+
subject { support.contactable[:params][:data][0][:enabled] }
|
33
|
+
|
34
|
+
it { should == 1 }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
File without changes
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require "spec_helper"
|
3
|
+
|
4
|
+
describe Lumberg::FormatWhm do
|
5
|
+
subject { described_class.new({ }, :query, "data") }
|
6
|
+
|
7
|
+
context "gzip" do
|
8
|
+
let(:gzipped_data) do
|
9
|
+
"\u001F\x8B\b\u0000\u001E¹R\u0000\u0003+\xCE\xCFMUHI,I\u0004\u0000" +
|
10
|
+
"\u001E\xE9\xC2\xD9\t\u0000\u0000\u0000"
|
11
|
+
end
|
12
|
+
|
13
|
+
it "removes content encoding" do
|
14
|
+
env = { body: gzipped_data,
|
15
|
+
response_headers: { "content-encoding" => "gzip" } }
|
16
|
+
|
17
|
+
subject.on_complete(env)
|
18
|
+
|
19
|
+
env.should_not include "content-encoding"
|
20
|
+
|
21
|
+
env[:body][:params].should eq "some data"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
context "deflate" do
|
26
|
+
let(:compressed_data) do
|
27
|
+
"x\x9C+\xCE\xCFMUHI,I\x04\x00\x11\x81\x03o"
|
28
|
+
end
|
29
|
+
|
30
|
+
it "removes content encoding" do
|
31
|
+
env = { body: compressed_data,
|
32
|
+
response_headers: { "content-encoding" => "deflate" } }
|
33
|
+
|
34
|
+
subject.on_complete(env)
|
35
|
+
|
36
|
+
env.should_not include "content-encoding"
|
37
|
+
|
38
|
+
env[:body][:params].should eq "some data"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context "no content encoding" do
|
43
|
+
it "doesn't touch response headers" do
|
44
|
+
env = { body: "some data", response_headers: { foo: "bar" } }
|
45
|
+
|
46
|
+
subject.on_complete(env)
|
47
|
+
|
48
|
+
env[:response_headers].should include :foo
|
49
|
+
|
50
|
+
env[:body][:params].should eq "some data"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIEjzCCA3egAwIBAgIJAKUkEYvfuZIgMA0GCSqGSIb3DQEBBQUAMIGLMQswCQYD
|
3
|
+
VQQGEwJVUzELMAkGA1UECBMCSUwxEDAOBgNVBAcTB0NoaWNhZ28xEDAOBgNVBAoT
|
4
|
+
B0luaXRlY2gxDDAKBgNVBAsTA1RQUzEZMBcGA1UEAxMQbHVtYmVyZy10ZXN0LmNv
|
5
|
+
bTEiMCAGCSqGSIb3DQEJARYTbHVtYmVyZ0Bpbml0ZWNoLmNvbTAeFw0xMzA2MDQx
|
6
|
+
ODE1NDFaFw0xNDA2MDQxODE1NDFaMIGLMQswCQYDVQQGEwJVUzELMAkGA1UECBMC
|
7
|
+
SUwxEDAOBgNVBAcTB0NoaWNhZ28xEDAOBgNVBAoTB0luaXRlY2gxDDAKBgNVBAsT
|
8
|
+
A1RQUzEZMBcGA1UEAxMQbHVtYmVyZy10ZXN0LmNvbTEiMCAGCSqGSIb3DQEJARYT
|
9
|
+
bHVtYmVyZ0Bpbml0ZWNoLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
10
|
+
ggEBAKNqBG9PNJ/cd0u4AuYb+G4wJgOIgWfDeJ3AazHPKqT3lwSks1lp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v82wI8UmQ8Uz
|
26
|
+
C90UlTURf+RlV0rMuZtntC+WvhdJcbw1xhToUIWxe6DrCqu8NU/wzw==
|
27
|
+
-----END RSA PRIVATE KEY-----
|
data/spec/spec_helper.rb
CHANGED
@@ -2,13 +2,19 @@
|
|
2
2
|
require 'rspec'
|
3
3
|
require 'lumberg'
|
4
4
|
require 'lumberg/exceptions'
|
5
|
+
require 'webmock/rspec'
|
5
6
|
require 'vcr'
|
6
7
|
require 'timeout'
|
7
8
|
|
8
|
-
|
9
|
+
# Load supporting files in spec/support
|
10
|
+
Dir["#{Lumberg::base_path}/../spec/support/**/*.rb"].each do |f|
|
11
|
+
require f
|
12
|
+
end
|
13
|
+
|
14
|
+
VCR.configure do |c|
|
9
15
|
c.cassette_library_dir = 'spec/vcr_cassettes'
|
10
|
-
c.
|
11
|
-
c.default_cassette_options = {:
|
16
|
+
c.hook_into :webmock
|
17
|
+
c.default_cassette_options = { record: :none }
|
12
18
|
end
|
13
19
|
|
14
20
|
def live_test?
|
@@ -28,6 +34,7 @@ RSpec.configure do |c|
|
|
28
34
|
else
|
29
35
|
@whm_hash = 'iscool'
|
30
36
|
@whm_host = 'myhost.com'
|
37
|
+
Resolv.stub(:getaddress).with(@whm_host).and_return('11.22.33.44')
|
31
38
|
end
|
32
39
|
end
|
33
40
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
RSpec::Matchers.define :return_a_list do |method|
|
2
|
+
match do |subj|
|
3
|
+
subj[:params][:data].is_a?(Array)
|
4
|
+
end
|
5
|
+
|
6
|
+
failure_message_for_should do |subj|
|
7
|
+
"expected an Array at [:params][:data], got #{subj[:params][:data].class}"
|
8
|
+
end
|
9
|
+
|
10
|
+
failure_message_for_should_not do |subj|
|
11
|
+
"expected a non-Array at [:params][:data], got #{subj[:params][:data].class}"
|
12
|
+
end
|
13
|
+
|
14
|
+
description do
|
15
|
+
"return an Array at [:params][:data]"
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://myhost.com:2087/json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_func=addaddondomain&cpanel_jsonapi_module=AddonDomain&cpanel_jsonapi_user=lumberg&dir=public_html/test-magic.com/&newdomain=test-magic.com&subdomain=tmagic
|
6
|
+
body:
|
7
|
+
string: ""
|
8
|
+
headers:
|
9
|
+
User-Agent:
|
10
|
+
- Faraday v0.8.7
|
11
|
+
Accept:
|
12
|
+
- "*/*"
|
13
|
+
Authorization:
|
14
|
+
- WHM root:iscool
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 200
|
18
|
+
message: OK
|
19
|
+
headers:
|
20
|
+
Content-Type:
|
21
|
+
- text/plain; charset="utf-8"
|
22
|
+
Server:
|
23
|
+
- cpsrvd/11.32.6.3
|
24
|
+
Content-Length:
|
25
|
+
- "330"
|
26
|
+
X-Keep-Alive-Count:
|
27
|
+
- "1"
|
28
|
+
Connection:
|
29
|
+
- Keep-Alive
|
30
|
+
Date:
|
31
|
+
- Fri, 03 May 2013 13:48:34 GMT
|
32
|
+
Keep-Alive:
|
33
|
+
- timeout=70, max=200
|
34
|
+
body:
|
35
|
+
string: |
|
36
|
+
{"cpanelresult":{"data":[{"result":1,"reason":"Using nameservers with the following IPs: 204.13.161.145,204.13.160.143\ntest-magic.com was successfully parked on top of tmagic.lumberg-test.com"}],"module":"AddonDomain","apiversion":2,"event":{"result":1},"postevent":{"result":1},"preevent":{"result":1},"func":"addaddondomain"}}
|
37
|
+
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 03 May 2013 13:48:35 GMT
|
40
|
+
- request:
|
41
|
+
method: get
|
42
|
+
uri: https://myhost.com:2087/json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_func=deladdondomain&cpanel_jsonapi_module=AddonDomain&cpanel_jsonapi_user=lumberg&domain=test-magic.com&subdomain=tmagic_lumberg-test.com
|
43
|
+
body:
|
44
|
+
string: ""
|
45
|
+
headers:
|
46
|
+
User-Agent:
|
47
|
+
- Faraday v0.8.7
|
48
|
+
Accept:
|
49
|
+
- "*/*"
|
50
|
+
Authorization:
|
51
|
+
- WHM root:iscool
|
52
|
+
response:
|
53
|
+
status:
|
54
|
+
code: 200
|
55
|
+
message: OK
|
56
|
+
headers:
|
57
|
+
Content-Type:
|
58
|
+
- text/plain; charset="utf-8"
|
59
|
+
Server:
|
60
|
+
- cpsrvd/11.32.6.3
|
61
|
+
Content-Length:
|
62
|
+
- "402"
|
63
|
+
X-Keep-Alive-Count:
|
64
|
+
- "1"
|
65
|
+
Connection:
|
66
|
+
- Keep-Alive
|
67
|
+
Date:
|
68
|
+
- Fri, 03 May 2013 13:48:43 GMT
|
69
|
+
Keep-Alive:
|
70
|
+
- timeout=70, max=200
|
71
|
+
body:
|
72
|
+
string: |
|
73
|
+
{"cpanelresult":{"event":{"result":1},"apiversion":2,"data":[{"result":1,"reason":"Deleted domain: tmagic.lumberg-test.com\nThe zone file for 'lumberg-test.com' has been edited and your new data has been added to it.\r\nsaved lumberg-test.com\nThe subdomain, tmagic.lumberg-test.com has been removed."}],"module":"AddonDomain","preevent":{"result":1},"postevent":{"result":1},"func":"deladdondomain"}}
|
74
|
+
|
75
|
+
http_version:
|
76
|
+
recorded_at: Fri, 03 May 2013 13:48:44 GMT
|
77
|
+
recorded_with: VCR 2.0.1
|
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://myhost.com:2087/json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_func=listaddondomains&cpanel_jsonapi_module=AddonDomain&cpanel_jsonapi_user=lumberg
|
6
|
+
body:
|
7
|
+
string: ""
|
8
|
+
headers:
|
9
|
+
User-Agent:
|
10
|
+
- Faraday v0.8.7
|
11
|
+
Accept:
|
12
|
+
- "*/*"
|
13
|
+
Authorization:
|
14
|
+
- WHM root:iscool
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 200
|
18
|
+
message: OK
|
19
|
+
headers:
|
20
|
+
Content-Type:
|
21
|
+
- text/plain; charset="utf-8"
|
22
|
+
Server:
|
23
|
+
- cpsrvd/11.32.6.3
|
24
|
+
Content-Length:
|
25
|
+
- "163"
|
26
|
+
X-Keep-Alive-Count:
|
27
|
+
- "1"
|
28
|
+
Connection:
|
29
|
+
- Keep-Alive
|
30
|
+
Date:
|
31
|
+
- Fri, 03 May 2013 13:48:44 GMT
|
32
|
+
Keep-Alive:
|
33
|
+
- timeout=70, max=200
|
34
|
+
body:
|
35
|
+
string: |
|
36
|
+
{"cpanelresult":{"preevent":{"result":1},"data":[],"func":"listaddondomains","apiversion":2,"event":{"result":1},"postevent":{"result":1},"module":"AddonDomain"}}
|
37
|
+
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 03 May 2013 13:48:44 GMT
|
40
|
+
- request:
|
41
|
+
method: get
|
42
|
+
uri: https://myhost.com:2087/json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_func=listaddondomains&cpanel_jsonapi_module=AddonDomain&cpanel_jsonapi_user=minimal
|
43
|
+
body:
|
44
|
+
string: ""
|
45
|
+
headers:
|
46
|
+
User-Agent:
|
47
|
+
- Faraday v0.8.7
|
48
|
+
Accept:
|
49
|
+
- "*/*"
|
50
|
+
Authorization:
|
51
|
+
- WHM root:iscool
|
52
|
+
response:
|
53
|
+
status:
|
54
|
+
code: 200
|
55
|
+
message: OK
|
56
|
+
headers:
|
57
|
+
Content-Type:
|
58
|
+
- text/plain; charset="utf-8"
|
59
|
+
Server:
|
60
|
+
- cpsrvd/11.32.6.3
|
61
|
+
Content-Length:
|
62
|
+
- "163"
|
63
|
+
X-Keep-Alive-Count:
|
64
|
+
- "1"
|
65
|
+
Connection:
|
66
|
+
- Keep-Alive
|
67
|
+
Date:
|
68
|
+
- Fri, 03 May 2013 13:48:44 GMT
|
69
|
+
Keep-Alive:
|
70
|
+
- timeout=70, max=200
|
71
|
+
body:
|
72
|
+
string: |
|
73
|
+
{"cpanelresult":{"module":"AddonDomain","preevent":{"result":1},"event":{"result":1},"apiversion":2,"data":[],"postevent":{"result":1},"func":"listaddondomains"}}
|
74
|
+
|
75
|
+
http_version:
|
76
|
+
recorded_at: Fri, 03 May 2013 13:48:45 GMT
|
77
|
+
recorded_with: VCR 2.0.1
|
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://myhost.com:2087/json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_func=addaddondomain&cpanel_jsonapi_module=AddonDomain&cpanel_jsonapi_user=lumberg&dir=public_html/test-addon.com/&newdomain=test-addon.com&subdomain=testadd
|
6
|
+
body:
|
7
|
+
string: ""
|
8
|
+
headers:
|
9
|
+
User-Agent:
|
10
|
+
- Faraday v0.8.7
|
11
|
+
Accept:
|
12
|
+
- "*/*"
|
13
|
+
Authorization:
|
14
|
+
- WHM root:iscool
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 200
|
18
|
+
message: OK
|
19
|
+
headers:
|
20
|
+
Content-Type:
|
21
|
+
- text/plain; charset="utf-8"
|
22
|
+
Server:
|
23
|
+
- cpsrvd/11.32.6.3
|
24
|
+
Content-Length:
|
25
|
+
- "258"
|
26
|
+
X-Keep-Alive-Count:
|
27
|
+
- "1"
|
28
|
+
Connection:
|
29
|
+
- Keep-Alive
|
30
|
+
Date:
|
31
|
+
- Fri, 03 May 2013 13:48:15 GMT
|
32
|
+
Keep-Alive:
|
33
|
+
- timeout=70, max=200
|
34
|
+
body:
|
35
|
+
string: |
|
36
|
+
{"cpanelresult":{"data":[{"reason":"test-addon.com was successfully parked on top of testadd.lumberg-test.com","result":1}],"postevent":{"result":1},"preevent":{"result":1},"apiversion":2,"module":"AddonDomain","event":{"result":1},"func":"addaddondomain"}}
|
37
|
+
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 03 May 2013 13:48:16 GMT
|
40
|
+
- request:
|
41
|
+
method: get
|
42
|
+
uri: https://myhost.com:2087/json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_func=deladdondomain&cpanel_jsonapi_module=AddonDomain&cpanel_jsonapi_user=lumberg&domain=test-addon.com&subdomain=testadd_lumberg-test.com
|
43
|
+
body:
|
44
|
+
string: ""
|
45
|
+
headers:
|
46
|
+
User-Agent:
|
47
|
+
- Faraday v0.8.7
|
48
|
+
Accept:
|
49
|
+
- "*/*"
|
50
|
+
Authorization:
|
51
|
+
- WHM root:iscool
|
52
|
+
response:
|
53
|
+
status:
|
54
|
+
code: 200
|
55
|
+
message: OK
|
56
|
+
headers:
|
57
|
+
Content-Type:
|
58
|
+
- text/plain; charset="utf-8"
|
59
|
+
Server:
|
60
|
+
- cpsrvd/11.32.6.3
|
61
|
+
Content-Length:
|
62
|
+
- "404"
|
63
|
+
X-Keep-Alive-Count:
|
64
|
+
- "1"
|
65
|
+
Connection:
|
66
|
+
- Keep-Alive
|
67
|
+
Date:
|
68
|
+
- Fri, 03 May 2013 13:48:24 GMT
|
69
|
+
Keep-Alive:
|
70
|
+
- timeout=70, max=200
|
71
|
+
body:
|
72
|
+
string: |
|
73
|
+
{"cpanelresult":{"event":{"result":1},"apiversion":2,"module":"AddonDomain","preevent":{"result":1},"func":"deladdondomain","data":[{"result":1,"reason":"Deleted domain: testadd.lumberg-test.com\nThe zone file for 'lumberg-test.com' has been edited and your new data has been added to it.\r\nsaved lumberg-test.com\nThe subdomain, testadd.lumberg-test.com has been removed."}],"postevent":{"result":1}}}
|
74
|
+
|
75
|
+
http_version:
|
76
|
+
recorded_at: Fri, 03 May 2013 13:48:25 GMT
|
77
|
+
recorded_with: VCR 2.0.1
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://myhost.com:2087/json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_func=listfullbackups&cpanel_jsonapi_module=Backups&cpanel_jsonapi_user=lumberg
|
6
|
+
body:
|
7
|
+
string: ""
|
8
|
+
headers:
|
9
|
+
User-Agent:
|
10
|
+
- Faraday v0.8.7
|
11
|
+
Accept:
|
12
|
+
- "*/*"
|
13
|
+
Authorization:
|
14
|
+
- WHM root:iscool
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 200
|
18
|
+
message: OK
|
19
|
+
headers:
|
20
|
+
Content-Type:
|
21
|
+
- text/plain; charset="utf-8"
|
22
|
+
Server:
|
23
|
+
- cpsrvd/11.32.6.3
|
24
|
+
Content-Length:
|
25
|
+
- "419"
|
26
|
+
X-Keep-Alive-Count:
|
27
|
+
- "1"
|
28
|
+
Connection:
|
29
|
+
- Keep-Alive
|
30
|
+
Date:
|
31
|
+
- Fri, 03 May 2013 13:46:45 GMT
|
32
|
+
Keep-Alive:
|
33
|
+
- timeout=70, max=200
|
34
|
+
body:
|
35
|
+
string: |
|
36
|
+
{"cpanelresult":{"postevent":{"result":1},"func":"listfullbackups","module":"Backups","preevent":{"result":1},"apiversion":2,"event":{"result":1},"data":[{"localtime":"Wed Sep 26 14:21:14 2012","status":"complete","time":"1348687274","file":"backup-9.26.2012_14-21-14_lumberg.tar.gz"},{"localtime":"Wed Sep 26 14:21:50 2012","status":"complete","time":"1348687310","file":"backup-9.26.2012_14-21-50_lumberg.tar.gz"}]}}
|
37
|
+
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 03 May 2013 13:46:46 GMT
|
40
|
+
recorded_with: VCR 2.0.1
|
@@ -0,0 +1,40 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://myhost.com:2087/json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_func=accountmanagelist&cpanel_jsonapi_module=BoxTrapper&cpanel_jsonapi_user=lumberg
|
6
|
+
body:
|
7
|
+
string: ""
|
8
|
+
headers:
|
9
|
+
User-Agent:
|
10
|
+
- Faraday v0.8.7
|
11
|
+
Accept:
|
12
|
+
- "*/*"
|
13
|
+
Authorization:
|
14
|
+
- WHM root:iscool
|
15
|
+
response:
|
16
|
+
status:
|
17
|
+
code: 200
|
18
|
+
message: OK
|
19
|
+
headers:
|
20
|
+
Content-Type:
|
21
|
+
- text/plain; charset="utf-8"
|
22
|
+
Server:
|
23
|
+
- cpsrvd/11.32.6.3
|
24
|
+
Content-Length:
|
25
|
+
- "1070"
|
26
|
+
X-Keep-Alive-Count:
|
27
|
+
- "1"
|
28
|
+
Connection:
|
29
|
+
- Keep-Alive
|
30
|
+
Date:
|
31
|
+
- Fri, 03 May 2013 13:48:45 GMT
|
32
|
+
Keep-Alive:
|
33
|
+
- timeout=70, max=200
|
34
|
+
body:
|
35
|
+
string: |
|
36
|
+
{"cpanelresult":{"data":[{"enabled":0,"account":"account-test@lumberg-test.com","accounturi":"account-test%40lumberg-test.com","bg":"even","status":"disabled"},{"enabled":0,"account":"disk-usage-test@lumberg-test.com","accounturi":"disk-usage-test%40lumberg-test.com","bg":"odd","status":"disabled"},{"enabled":0,"account":"filters-test@lumberg-test.com","accounturi":"filters-test%40lumberg-test.com","bg":"even","status":"disabled"},{"enabled":0,"account":"lumberg","accounturi":"lumberg","bg":"odd","status":"disabled"},{"enabled":0,"account":"mail-dir-test@lumberg-test.com","accounturi":"mail-dir-test%40lumberg-test.com","bg":"even","status":"disabled"},{"enabled":0,"account":"mail-dirs-test@lumberg-test.com","accounturi":"mail-dirs-test%40lumberg-test.com","bg":"odd","status":"disabled"},{"enabled":0,"account":"test-account@lumberg-test.com","accounturi":"test-account%40lumberg-test.com","bg":"even","status":"disabled"}],"event":{"result":1},"func":"accountmanagelist","apiversion":2,"preevent":{"result":1},"postevent":{"result":1},"module":"BoxTrapper"}}
|
37
|
+
|
38
|
+
http_version:
|
39
|
+
recorded_at: Fri, 03 May 2013 13:48:45 GMT
|
40
|
+
recorded_with: VCR 2.0.1
|