lumberg 1.1.1 → 2.0.0.pre3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +1 -6
- data/README.md +130 -23
- data/lib/lumberg.rb +2 -0
- data/lib/lumberg/cpanel.rb +29 -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 +491 -0
- data/lib/lumberg/cpanel/file_manager.rb +146 -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/net.rb +28 -0
- data/lib/lumberg/cpanel/park.rb +58 -0
- data/lib/lumberg/cpanel/password.rb +52 -0
- data/lib/lumberg/cpanel/random_data.rb +25 -0
- data/lib/lumberg/cpanel/redirect.rb +44 -0
- data/lib/lumberg/cpanel/ssl.rb +198 -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/format_whm.rb +24 -1
- data/lib/lumberg/version.rb +1 -1
- data/lib/lumberg/whm.rb +2 -1
- data/lib/lumberg/whm/account.rb +4 -4
- data/lib/lumberg/whm/cert.rb +69 -0
- data/lib/lumberg/whm/dns.rb +28 -4
- data/lib/lumberg/whm/reseller.rb +4 -4
- data/lib/lumberg/whm/server.rb +64 -15
- data/lumberg.gemspec +4 -3
- data/spec/config_spec.rb +2 -2
- 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 +615 -0
- data/spec/cpanel/file_manager_spec.rb +73 -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_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/random_data_spec.rb +24 -0
- data/spec/cpanel/redirect_spec.rb +0 -0
- data/spec/cpanel/ssl_spec.rb +138 -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/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 +7 -1
- 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/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_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/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/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/random_data/show.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/fetchcabundle.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/gencrt.yml +40 -0
- data/spec/vcr_cassettes/cpanel/ssl/gencsr.yml +40 -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/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/cert/fetchsslinfo.yml +38 -0
- data/spec/vcr_cassettes/whm/cert/generatessl.yml +38 -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/server/gettweaksetting.yml +44 -0
- data/spec/vcr_cassettes/whm/server/settweaksetting.yml +44 -0
- data/spec/vcr_cassettes/whm/server/themes.yml +38 -0
- data/spec/whm/cert_spec.rb +62 -0
- data/spec/whm/server_spec.rb +79 -3
- metadata +376 -34
- data/.rvmrc +0 -49
@@ -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,28 @@
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
2
|
+
MIIEjzCCA3egAwIBAgIJAKUkEYvfuZIgMA0GCSqGSIb3DQEBBQUAMIGLMQswCQYD
|
3
|
+
VQQGEwJVUzELMAkGA1UECBMCSUwxEDAOBgNVBAcTB0NoaWNhZ28xEDAOBgNVBAoT
|
4
|
+
B0luaXRlY2gxDDAKBgNVBAsTA1RQUzEZMBcGA1UEAxMQbHVtYmVyZy10ZXN0LmNv
|
5
|
+
bTEiMCAGCSqGSIb3DQEJARYTbHVtYmVyZ0Bpbml0ZWNoLmNvbTAeFw0xMzA2MDQx
|
6
|
+
ODE1NDFaFw0xNDA2MDQxODE1NDFaMIGLMQswCQYDVQQGEwJVUzELMAkGA1UECBMC
|
7
|
+
SUwxEDAOBgNVBAcTB0NoaWNhZ28xEDAOBgNVBAoTB0luaXRlY2gxDDAKBgNVBAsT
|
8
|
+
A1RQUzEZMBcGA1UEAxMQbHVtYmVyZy10ZXN0LmNvbTEiMCAGCSqGSIb3DQEJARYT
|
9
|
+
bHVtYmVyZ0Bpbml0ZWNoLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
|
10
|
+
ggEBAKNqBG9PNJ/cd0u4AuYb+G4wJgOIgWfDeJ3AazHPKqT3lwSks1lpOgfDbcdK
|
11
|
+
IcoD5nNyug/C4PegwKt+ZtAsfyKsbijvQaq+V3zFvXNHYtiu0aqBKr5xCJ/wVNVE
|
12
|
+
IqW4kwSg6rLuaGJdEPbfKyJJV/DJnebh3FK5M2mle+hWy/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15 @@ require 'lumberg/exceptions'
|
|
5
5
|
require 'vcr'
|
6
6
|
require 'timeout'
|
7
7
|
|
8
|
+
# Load supporting files in spec/support
|
9
|
+
Dir["#{Lumberg::base_path}/../spec/support/**/*.rb"].each do |f|
|
10
|
+
require f
|
11
|
+
end
|
12
|
+
|
8
13
|
VCR.configure do |c|
|
9
14
|
c.cassette_library_dir = 'spec/vcr_cassettes'
|
10
15
|
c.hook_into :webmock
|
11
|
-
c.default_cassette_options = {:record => :none}
|
16
|
+
c.default_cassette_options = {:record => :none, :serialize_with => :syck}
|
12
17
|
end
|
13
18
|
|
14
19
|
def live_test?
|
@@ -31,3 +36,4 @@ RSpec.configure do |c|
|
|
31
36
|
end
|
32
37
|
end
|
33
38
|
end
|
39
|
+
|
@@ -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
|