ultravault 1.0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +15 -0
- data/Gemfile +2 -0
- data/README.md +88 -0
- data/Rakefile +17 -0
- data/lib/ultravault.rb +17 -0
- data/lib/ultravault/api_request.rb +26 -0
- data/lib/ultravault/client.rb +19 -0
- data/lib/ultravault/config.rb +55 -0
- data/lib/ultravault/data_objects/agent.rb +104 -0
- data/lib/ultravault/data_objects/disk_safe.rb +64 -0
- data/lib/ultravault/data_objects/recovery_point.rb +24 -0
- data/lib/ultravault/soap_service.rb +29 -0
- data/lib/ultravault/soap_service/agent_service.rb +62 -0
- data/lib/ultravault/soap_service/disk_safe_service.rb +18 -0
- data/lib/ultravault/soap_service/recovery_point_service.rb +21 -0
- data/test/all.rb +6 -0
- data/test/integration/client_code.rb +88 -0
- data/test/support/fixtures.rb +4 -0
- data/test/support/fixtures/agent_service.rb +56 -0
- data/test/support/fixtures/disk_safe.rb +35 -0
- data/test/support/fixtures/disk_safe_service.rb +60 -0
- data/test/support/fixtures/recovery_point_service.rb +26 -0
- data/test/test_helper.rb +35 -0
- data/test/unit/lib/ultravault/data_objects/test_agent.rb +133 -0
- data/test/unit/lib/ultravault/data_objects/test_disk_safe.rb +150 -0
- data/test/unit/lib/ultravault/data_objects/test_recovery_point.rb +59 -0
- data/test/unit/lib/ultravault/soap_service/test_agent_service.rb +139 -0
- data/test/unit/lib/ultravault/soap_service/test_disk_safe_service.rb +40 -0
- data/test/unit/lib/ultravault/soap_service/test_recovery_point_service.rb +39 -0
- data/test/unit/lib/ultravault/test_api_request.rb +36 -0
- data/test/unit/lib/ultravault/test_client.rb +47 -0
- data/test/unit/lib/ultravault/test_config.rb +37 -0
- data/test/unit/lib/ultravault/test_soap_service.rb +41 -0
- data/test/vcr_cassettes/agent_by_id.yml +41 -0
- data/test/vcr_cassettes/all_agents.yml +118 -0
- data/test/vcr_cassettes/create_mod_rm_agents.yml +158 -0
- data/ultravault.gemspec +25 -0
- metadata +212 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
require_relative '../../../../test_helper'
|
2
|
+
|
3
|
+
module UltraVault
|
4
|
+
class DiskSafeServiceTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
context 'a new disk safe service' do
|
7
|
+
|
8
|
+
setup do
|
9
|
+
load_disk_safe_service_fixtures
|
10
|
+
end
|
11
|
+
|
12
|
+
context '#find_disksafes_by_agent_id' do
|
13
|
+
setup do
|
14
|
+
UltraVault::ApiRequest.expects(:new).returns(stub(endpoint: 'foo',
|
15
|
+
namespace: 'bar'))
|
16
|
+
@service = UltraVault::DiskSafeService.new
|
17
|
+
@client = stub
|
18
|
+
@service.expects(:client).returns(@client)
|
19
|
+
end
|
20
|
+
|
21
|
+
should "return an array of disksafe objects if there are any" do
|
22
|
+
@client.expects(:request).with(
|
23
|
+
:getDiskSafesForAgent, agent: { id: 'foo' }).returns(mock(to_hash: @disk_safes_by_agent_id_wrapper))
|
24
|
+
UltraVault::DiskSafe.expects(:new).returns(stub)
|
25
|
+
disk_safes = @service.find_disksafes_by_agent_id('foo')
|
26
|
+
assert disk_safes.each {|ds| ds.is_a? UltraVault::DiskSafe }
|
27
|
+
end
|
28
|
+
|
29
|
+
should "raise an error if it does not exist" do
|
30
|
+
error = Savon::SOAP::Fault.new(stub(body: 'foo'))
|
31
|
+
@client.expects(:request).with(
|
32
|
+
:getDiskSafesForAgent, agent: { id: 'bar' }).raises(error)
|
33
|
+
assert_raise Savon::SOAP::Fault do
|
34
|
+
disk_safes = @service.find_disksafes_by_agent_id('bar')
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require_relative '../../../../test_helper'
|
2
|
+
|
3
|
+
module UltraVault
|
4
|
+
class RecoveryPointServiceTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
context 'a new recovery point service' do
|
7
|
+
|
8
|
+
setup do
|
9
|
+
load_recovery_point_service_fixtures
|
10
|
+
end
|
11
|
+
|
12
|
+
context '#find_recovery_points_by_disk_safe_id' do
|
13
|
+
setup do
|
14
|
+
ApiRequest.expects(:new).returns(stub(endpoint: 'foo',
|
15
|
+
namespace: 'bar'))
|
16
|
+
@service = RecoveryPointService.new
|
17
|
+
@client = stub
|
18
|
+
@service.expects(:client).returns(@client)
|
19
|
+
end
|
20
|
+
should "return recovery point objects if present" do
|
21
|
+
@client.expects(:request).with(
|
22
|
+
:getRecoveryPoints, diskSafe: { id: 'foo' },
|
23
|
+
includeMerged: false).returns(mock(to_hash: @recovery_points_by_disk_safe_id_wrapper))
|
24
|
+
recovery_points = @service.find_recovery_points_by_disk_safe_id('foo')
|
25
|
+
end
|
26
|
+
|
27
|
+
should "raise an error if there are no recovery points" do
|
28
|
+
error = Savon::SOAP::Fault.new(stub(body: 'foo'))
|
29
|
+
@client.expects(:request).with(
|
30
|
+
:getRecoveryPoints, diskSafe: { id: 'bar' },
|
31
|
+
includeMerged: false).raises(error)
|
32
|
+
assert_raise Savon::SOAP::Fault do
|
33
|
+
recovery_points = @service.find_recovery_points_by_disk_safe_id('bar')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative '../../../test_helper'
|
2
|
+
|
3
|
+
module UltraVault
|
4
|
+
class ApiRequestTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
context "A new api request" do
|
7
|
+
|
8
|
+
setup do
|
9
|
+
@params = { host: 'foo.bar.baz', port: 9080, service: 'Foo',
|
10
|
+
api_version: 1, ssl: false}
|
11
|
+
end
|
12
|
+
|
13
|
+
context "attributes" do
|
14
|
+
|
15
|
+
setup do
|
16
|
+
@api_request = ApiRequest.new(@params)
|
17
|
+
end
|
18
|
+
|
19
|
+
should "return an endpoint" do
|
20
|
+
assert_equal "http://#{@params[:host]}:#{@params[:port]}/#{@params[:service]}", @api_request.endpoint
|
21
|
+
end
|
22
|
+
|
23
|
+
should "use the correct protocol for the endpoint" do
|
24
|
+
@api_request = ApiRequest.new(@params.merge(ssl: true))
|
25
|
+
assert_equal "https://#{@params[:host]}:#{@params[:port]}/#{@params[:service]}", @api_request.endpoint
|
26
|
+
end
|
27
|
+
|
28
|
+
should "return a namespace" do
|
29
|
+
assert_equal "http://#{@params[:service].downcase}.api.server.backup.r1soft.com/", @api_request.namespace
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require_relative '../../../test_helper'
|
2
|
+
|
3
|
+
module UltraVault
|
4
|
+
class ClientTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
context "creating a client" do
|
7
|
+
|
8
|
+
setup do
|
9
|
+
@options = { endpoint: "some.valid.url", namespace: 'foo.bar.baz',
|
10
|
+
username: "foo", password: "bar" }
|
11
|
+
@client = Client.new @options
|
12
|
+
@savon_client = @client.instance_variable_get("@client")
|
13
|
+
end
|
14
|
+
|
15
|
+
context '#initialize' do
|
16
|
+
should "pass off connection options to savon client" do
|
17
|
+
Savon::Client.expects(:new)
|
18
|
+
Client.new @options
|
19
|
+
end
|
20
|
+
|
21
|
+
should "set the endpoint" do
|
22
|
+
assert_equal @savon_client.wsdl.endpoint,
|
23
|
+
@options[:endpoint]
|
24
|
+
end
|
25
|
+
|
26
|
+
should "set the namespace" do
|
27
|
+
assert_equal @savon_client.wsdl.namespace,
|
28
|
+
@options[:namespace]
|
29
|
+
end
|
30
|
+
|
31
|
+
should "set the credentials" do
|
32
|
+
assert_equal @savon_client.http.auth.basic,
|
33
|
+
[@options[:username], @options[:password]]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context "#request" do
|
38
|
+
should "pass action and args to the savon client" do
|
39
|
+
action, args = "foo", ["bar", "baz"]
|
40
|
+
@savon_client.expects(:request).with(action, :body => args)
|
41
|
+
@client.request(action, args)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative '../../../test_helper'
|
2
|
+
|
3
|
+
module UltraVault
|
4
|
+
class ConfigTest < Test::Unit::TestCase
|
5
|
+
context "overriding config" do
|
6
|
+
|
7
|
+
setup do
|
8
|
+
UltraVault.configure do |config|
|
9
|
+
config.host = 'baz.bar.foo'
|
10
|
+
config.port = 5000
|
11
|
+
config.api_version = 4
|
12
|
+
config.ssl = true
|
13
|
+
config.username = 'bar'
|
14
|
+
config.password = 'foo'
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
should "be configurable" do
|
19
|
+
assert_equal UltraVault.config.host, "baz.bar.foo"
|
20
|
+
assert_equal UltraVault.config.port, 5000
|
21
|
+
assert_equal UltraVault.config.api_version, 4
|
22
|
+
assert_equal UltraVault.config.ssl, true
|
23
|
+
assert_equal UltraVault.config.username, "bar"
|
24
|
+
assert_equal UltraVault.config.password, "foo"
|
25
|
+
end
|
26
|
+
|
27
|
+
should "be configurable via hash" do
|
28
|
+
assert_equal UltraVault.config.host, 'baz.bar.foo'
|
29
|
+
UltraVault.config = { :host => 'baz' }
|
30
|
+
assert_equal UltraVault.config.host, 'baz'
|
31
|
+
# Make sure defaults not reverted
|
32
|
+
assert_equal UltraVault.config.api_version, 4
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require_relative '../../../test_helper'
|
2
|
+
|
3
|
+
module UltraVault
|
4
|
+
class SoapServiceTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
context "#initialize" do
|
7
|
+
should "pass off the right actions" do
|
8
|
+
ApiRequest.expects(:new).returns(stub_everything)
|
9
|
+
Client.expects(:new)
|
10
|
+
@service = SoapService.new(:Agent)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context 'a new soap service' do
|
15
|
+
|
16
|
+
setup do
|
17
|
+
@service = SoapService.new(:Agent)
|
18
|
+
load_agent_service_fixtures
|
19
|
+
end
|
20
|
+
|
21
|
+
context "#client" do
|
22
|
+
@service.respond_to? :client
|
23
|
+
end
|
24
|
+
|
25
|
+
context "#extract_params" do
|
26
|
+
should "drill into the hash and unwrap it" do
|
27
|
+
assert_equal @service.send(:extract_params,
|
28
|
+
@agent_by_id_wrapper, :get_agent_by_id_response),
|
29
|
+
@agent_by_id
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context "#extract_params_array" do
|
34
|
+
should "drill into the hash and unwrap into an array" do
|
35
|
+
assert_equal @service.send(:extract_params_array,
|
36
|
+
@all_agents_wrapper, :get_agents_response), @all_agents
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://foo:bar@foo.bar.baz:9080/Agent
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
9
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://agent.api.server.backup.r1soft.com/"
|
10
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><getAgentByID><id>157b9915-0ec8-45cd-a04f-aeea13f48c8e</id></getAgentByID></env:Body></env:Envelope>
|
11
|
+
headers:
|
12
|
+
Soapaction:
|
13
|
+
- ! '"getAgentByID"'
|
14
|
+
Content-Type:
|
15
|
+
- text/xml;charset=UTF-8
|
16
|
+
Content-Length:
|
17
|
+
- '371'
|
18
|
+
Accept:
|
19
|
+
- ! '*/*'
|
20
|
+
User-Agent:
|
21
|
+
- Ruby
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- Apache-Coyote/1.1
|
29
|
+
Content-Type:
|
30
|
+
- text/xml;charset=UTF-8
|
31
|
+
Content-Length:
|
32
|
+
- '451'
|
33
|
+
Date:
|
34
|
+
- Wed, 21 Mar 2012 13:49:11 GMT
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getAgentByIDResponse
|
38
|
+
xmlns:ns1="http://agent.api.server.backup.r1soft.com/"><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>tarragon</description><hostname>2.3.4.5</hostname><id>157b9915-0ec8-45cd-a04f-aeea13f48c8e</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return></ns1:getAgentByIDResponse></soap:Body></soap:Envelope>
|
39
|
+
http_version:
|
40
|
+
recorded_at: Wed, 21 Mar 2012 13:49:11 GMT
|
41
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,118 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://foo:bar@foo.bar.baz:9080/Agent
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
9
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://agent.api.server.backup.r1soft.com/"
|
10
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><getAgents></getAgents></env:Body></env:Envelope>
|
11
|
+
headers:
|
12
|
+
Soapaction:
|
13
|
+
- ! '"getAgents"'
|
14
|
+
Content-Type:
|
15
|
+
- text/xml;charset=UTF-8
|
16
|
+
Content-Length:
|
17
|
+
- '320'
|
18
|
+
Accept:
|
19
|
+
- ! '*/*'
|
20
|
+
User-Agent:
|
21
|
+
- Ruby
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- Apache-Coyote/1.1
|
29
|
+
Content-Type:
|
30
|
+
- text/xml;charset=UTF-8
|
31
|
+
Transfer-Encoding:
|
32
|
+
- chunked
|
33
|
+
Date:
|
34
|
+
- Wed, 21 Mar 2012 13:49:09 GMT
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getAgentsResponse
|
38
|
+
xmlns:ns1="http://agent.api.server.backup.r1soft.com/"><return><databaseAddOnEnabled>true</databaseAddOnEnabled><description>melbourne-puppet</description><hostname>3.4.5.6</hostname><id>c521115d-2e28-4121-8310-317cd72edb3a</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>true</databaseAddOnEnabled><description>nice</description><hostname>5.6.7.8</hostname><id>e0ec8512-219c-4e37-835d-8d760066be13</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>melbourne-infra</description><hostname>6.5.4.27</hostname><id>15820add-c05c-473d-85aa-7e3a9a1c8b34</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>salinas
|
39
|
+
(exchange2)</description><hostname>1.2.3.4</hostname><id>864bf58f-c502-40db-8b78-b818ba6ece48</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>cottondale</description><hostname>4.5.6.7</hostname><id>a66543b7-9083-4143-8cf2-b586c2cb7d1e</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>true</databaseAddOnEnabled><description>melbourne-crm</description><hostname>6.5.4.22</hostname><id>c13e6967-c1b1-472e-8e81-4d924fc3b849</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>caen</description><hostname>6.5.4.17</hostname><id>34b81a78-9614-480a-8eef-bee0a9d41ca5</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>true</databaseAddOnEnabled><description>melbourne-website</description><hostname>6.5.4.8</hostname><id>3bf521be-7204-4fed-940a-57633c8138b3</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>true</databaseAddOnEnabled><description>melbourne-support</description><hostname>6.5.4.4</hostname><id>69df32df-1910-4c5e-96b6-aa1f1c2302e7</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>true</databaseAddOnEnabled><description>melbourne-dcaccess</description><hostname>6.5.4.20</hostname><id>d5f33857-aad0-487e-97a0-c5c6b5c654be</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>exchange</description><hostname>6.5.4.7</hostname><id>d179350f-9431-4328-992a-0db49cdc3fdc</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>wds</description><hostname>6.5.4.16</hostname><id>307203a4-2099-4aed-992a-4eb8bf484e3f</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>dc2</description><hostname>6.5.4.24</hostname><id>a5de03e0-630c-4b53-9c17-2847fb353793</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>true</databaseAddOnEnabled><description>serverlove-website</description><hostname>6.5.4.10</hostname><id>6df9f74c-bde3-4a85-9c66-41f0270ea6b9</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>tarragon</description><hostname>2.3.4.5</hostname><id>157b9915-0ec8-45cd-a04f-aeea13f48c8e</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>stockholm</description><hostname>6.5.4.14</hostname><id>018adf28-5a17-49b7-a505-4ed2eb75b611</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>true</databaseAddOnEnabled><description>melbourne-kickstart</description><hostname>6.5.4.19</hostname><id>6b6acd3b-0e9f-4950-a608-62236f344015</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>true</databaseAddOnEnabled><description>melbourne-wombat</description><hostname>6.5.4.29</hostname><id>5f141e65-3e0b-4fea-a9fd-afb15ce32517</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>infradc1</description><hostname>6.5.4.30</hostname><id>cbe6e421-b241-4449-ac8e-1100a1bd4ccf</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>true</databaseAddOnEnabled><description>melbourne-wiki</description><hostname>6.5.4.9</hostname><id>897aaa19-f286-4471-ae2a-82e607873e6b</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>wasabi</description><hostname>6.5.4.23</hostname><id>ec63d6ab-e5eb-4136-b14c-52154c8b9e06</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>true</databaseAddOnEnabled><description>melbourne-ns1</description><hostname>6.5.4.18</hostname><id>4f7f3f0b-bbab-43e8-ba87-ef5469478549</id><osType>LINUX</osType><portNumber>1167</portNumber></return><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>WSUS</description><hostname>6.5.4.13</hostname><id>64b3ca2f-5b4f-47fe-bec9-99728e292dfa</id><osType>WINDOWS</osType><portNumber>1167</portNumber></return></ns1:getAgentsResponse></soap:Body></soap:Envelope>
|
40
|
+
http_version:
|
41
|
+
recorded_at: Wed, 21 Mar 2012 13:49:09 GMT
|
42
|
+
- request:
|
43
|
+
method: post
|
44
|
+
uri: http://foo:bar@foo.bar.baz:9080/DiskSafe
|
45
|
+
body:
|
46
|
+
encoding: US-ASCII
|
47
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
48
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://disksafe.api.server.backup.r1soft.com/"
|
49
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><getDiskSafesForAgent><agent><id>c521115d-2e28-4121-8310-317cd72edb3a</id></agent></getDiskSafesForAgent></env:Body></env:Envelope>
|
50
|
+
headers:
|
51
|
+
Soapaction:
|
52
|
+
- ! '"getDiskSafesForAgent"'
|
53
|
+
Content-Type:
|
54
|
+
- text/xml;charset=UTF-8
|
55
|
+
Content-Length:
|
56
|
+
- '405'
|
57
|
+
Accept:
|
58
|
+
- ! '*/*'
|
59
|
+
User-Agent:
|
60
|
+
- Ruby
|
61
|
+
response:
|
62
|
+
status:
|
63
|
+
code: 200
|
64
|
+
message: OK
|
65
|
+
headers:
|
66
|
+
Server:
|
67
|
+
- Apache-Coyote/1.1
|
68
|
+
Content-Type:
|
69
|
+
- text/xml;charset=UTF-8
|
70
|
+
Content-Length:
|
71
|
+
- '2558'
|
72
|
+
Date:
|
73
|
+
- Wed, 21 Mar 2012 13:49:11 GMT
|
74
|
+
body:
|
75
|
+
encoding: US-ASCII
|
76
|
+
string: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getDiskSafesForAgentResponse
|
77
|
+
xmlns:ns1="http://disksafe.api.server.backup.r1soft.com/"><return><agentID>c521115d-2e28-4121-8310-317cd72edb3a</agentID><backupPartitionTable>true</backupPartitionTable><backupUnmountedDevices>false</backupUnmountedDevices><bytesOnDisk>82688893950</bytesOnDisk><compressionLevel>LOW</compressionLevel><compressionType>QUICKLZ</compressionType><deltasInDiskSafe>28431842</deltasInDiskSafe><description>melbourne-puppet</description><deviceBackupType>CHOOSE_DEVICES_TO_BACKUP</deviceBackupType><deviceCount>3</deviceCount><deviceList><allocatedBlocks>4103886</allocatedBlocks><blockSize>4096</blockSize><capacity>60943237120</capacity><contentID>92ae8a1e-dd88-40a6-9e73-cbf4a0ff333d</contentID><deviceContentType>Ext2/3/4</deviceContentType><devicePath>/dev/dm-1</devicePath><enabled>true</enabled><mountPoint>/</mountPoint><mounted>true</mounted><totalBlocks>14878720</totalBlocks></deviceList><deviceList><allocatedBlocks>35690</allocatedBlocks><blockSize>1024</blockSize><capacity>298844160</capacity><contentID>5d102a69-8130-4ce6-94d5-35ff5989626f</contentID><deviceContentType>Ext2/3/4</deviceContentType><devicePath>/dev/xvda1</devicePath><enabled>true</enabled><mountPoint>/boot</mountPoint><mounted>true</mounted><totalBlocks>291840</totalBlocks></deviceList><diskSafeAttributeMap><entry><key>ARCHIVE_POINT_LIMIT</key><value>-1</value></entry><entry><key>RECOVERY_POINT_LIMIT</key><value>-1</value></entry><entry><key>QUOTA_TYPE</key><value>NONE</value></entry><entry><key>SOFT_QUOTA_VALUE</key><value>-1.0</value></entry><entry><key>ARCHIVING_ENABLED</key><value>true</value></entry><entry><key>REPLICATION_FREQUENCY_LIMIT</key><value>NO_LIMIT</value></entry><entry><key>CONTROLPANELS_ENABLED</key><value>true</value></entry><entry><key>FILE_EXCLUDES_ENABLED</key><value>true</value></entry><entry><key>HARD_QUOTA_VALUE</key><value>-1.0</value></entry></diskSafeAttributeMap><id>5aa8c653-3fcf-4229-b29e-7c88fce9133b</id><open>true</open><path>/data/internal/5aa8c653-3fcf-4229-b29e-7c88fce9133b</path><recoveryPointCount>406</recoveryPointCount><size>82688893950</size><sizeOfDeltasInDiskSafe>43752230841</sizeOfDeltasInDiskSafe><totalFreePages>999943</totalFreePages><totalFreePagesBytes>32766132224</totalFreePagesBytes><totalPageBytes>82567135232</totalPageBytes><totalPageCount>2519749</totalPageCount><volumeID>2bb5d10d-ed25-48b1-8eaa-1e0df2e129b4</volumeID></return></ns1:getDiskSafesForAgentResponse></soap:Body></soap:Envelope>
|
78
|
+
http_version:
|
79
|
+
recorded_at: Wed, 21 Mar 2012 13:49:11 GMT
|
80
|
+
- request:
|
81
|
+
method: post
|
82
|
+
uri: http://foo:bar@foo.bar.baz:9080/RecoveryPoints
|
83
|
+
body:
|
84
|
+
encoding: US-ASCII
|
85
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
86
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://recoverypoints.api.server.backup.r1soft.com/"
|
87
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><getRecoveryPoints><diskSafe><id>5aa8c653-3fcf-4229-b29e-7c88fce9133b</id></diskSafe><includeMerged>false</includeMerged></getRecoveryPoints></env:Body></env:Envelope>
|
88
|
+
headers:
|
89
|
+
Soapaction:
|
90
|
+
- ! '"getRecoveryPoints"'
|
91
|
+
Content-Type:
|
92
|
+
- text/xml;charset=UTF-8
|
93
|
+
Content-Length:
|
94
|
+
- '447'
|
95
|
+
Accept:
|
96
|
+
- ! '*/*'
|
97
|
+
User-Agent:
|
98
|
+
- Ruby
|
99
|
+
response:
|
100
|
+
status:
|
101
|
+
code: 200
|
102
|
+
message: OK
|
103
|
+
headers:
|
104
|
+
Server:
|
105
|
+
- Apache-Coyote/1.1
|
106
|
+
Content-Type:
|
107
|
+
- text/xml;charset=UTF-8
|
108
|
+
Content-Length:
|
109
|
+
- '2273'
|
110
|
+
Date:
|
111
|
+
- Wed, 21 Mar 2012 13:49:11 GMT
|
112
|
+
body:
|
113
|
+
encoding: US-ASCII
|
114
|
+
string: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:getRecoveryPointsResponse
|
115
|
+
xmlns:ns1="http://recoverypoints.api.server.backup.r1soft.com/"><return><agentID>c521115d-2e28-4121-8310-317cd72edb3a</agentID><createdOnTimestampInMillis>1331769764685</createdOnTimestampInMillis><diskSafeID>5aa8c653-3fcf-4229-b29e-7c88fce9133b</diskSafeID><recoveryPointID>400</recoveryPointID><recoveryPointState>AVAILABLE</recoveryPointState></return><return><agentID>c521115d-2e28-4121-8310-317cd72edb3a</agentID><createdOnTimestampInMillis>1331856179742</createdOnTimestampInMillis><diskSafeID>5aa8c653-3fcf-4229-b29e-7c88fce9133b</diskSafeID><recoveryPointID>401</recoveryPointID><recoveryPointState>AVAILABLE</recoveryPointState></return><return><agentID>c521115d-2e28-4121-8310-317cd72edb3a</agentID><createdOnTimestampInMillis>1331942557109</createdOnTimestampInMillis><diskSafeID>5aa8c653-3fcf-4229-b29e-7c88fce9133b</diskSafeID><recoveryPointID>402</recoveryPointID><recoveryPointState>AVAILABLE</recoveryPointState></return><return><agentID>c521115d-2e28-4121-8310-317cd72edb3a</agentID><createdOnTimestampInMillis>1332028949804</createdOnTimestampInMillis><diskSafeID>5aa8c653-3fcf-4229-b29e-7c88fce9133b</diskSafeID><recoveryPointID>403</recoveryPointID><recoveryPointState>AVAILABLE</recoveryPointState></return><return><agentID>c521115d-2e28-4121-8310-317cd72edb3a</agentID><createdOnTimestampInMillis>1332115356268</createdOnTimestampInMillis><diskSafeID>5aa8c653-3fcf-4229-b29e-7c88fce9133b</diskSafeID><recoveryPointID>404</recoveryPointID><recoveryPointState>AVAILABLE</recoveryPointState></return><return><agentID>c521115d-2e28-4121-8310-317cd72edb3a</agentID><createdOnTimestampInMillis>1332201820586</createdOnTimestampInMillis><diskSafeID>5aa8c653-3fcf-4229-b29e-7c88fce9133b</diskSafeID><recoveryPointID>405</recoveryPointID><recoveryPointState>AVAILABLE</recoveryPointState></return><return><agentID>c521115d-2e28-4121-8310-317cd72edb3a</agentID><createdOnTimestampInMillis>1332288127082</createdOnTimestampInMillis><diskSafeID>5aa8c653-3fcf-4229-b29e-7c88fce9133b</diskSafeID><recoveryPointID>406</recoveryPointID><recoveryPointState>AVAILABLE</recoveryPointState></return></ns1:getRecoveryPointsResponse></soap:Body></soap:Envelope>
|
116
|
+
http_version:
|
117
|
+
recorded_at: Wed, 21 Mar 2012 13:49:11 GMT
|
118
|
+
recorded_with: VCR 2.0.0
|
@@ -0,0 +1,158 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: http://foo:bar@foo.bar.baz:9080/Agent
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
9
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://agent.api.server.backup.r1soft.com/"
|
10
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><createAgentWithObject><agent><hostname>foobar.com</hostname><portNumber>9080</portNumber><description>foobarbazbar</description><osType>linux</osType></agent></createAgentWithObject></env:Body></env:Envelope>
|
11
|
+
headers:
|
12
|
+
Soapaction:
|
13
|
+
- ! '"createAgentWithObject"'
|
14
|
+
Content-Type:
|
15
|
+
- text/xml;charset=UTF-8
|
16
|
+
Content-Length:
|
17
|
+
- '480'
|
18
|
+
Accept:
|
19
|
+
- ! '*/*'
|
20
|
+
User-Agent:
|
21
|
+
- Ruby
|
22
|
+
response:
|
23
|
+
status:
|
24
|
+
code: 200
|
25
|
+
message: OK
|
26
|
+
headers:
|
27
|
+
Server:
|
28
|
+
- Apache-Coyote/1.1
|
29
|
+
Content-Type:
|
30
|
+
- text/xml;charset=UTF-8
|
31
|
+
Content-Length:
|
32
|
+
- '470'
|
33
|
+
Date:
|
34
|
+
- Mon, 26 Mar 2012 13:31:25 GMT
|
35
|
+
body:
|
36
|
+
encoding: US-ASCII
|
37
|
+
string: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:createAgentWithObjectResponse
|
38
|
+
xmlns:ns1="http://agent.api.server.backup.r1soft.com/"><return><databaseAddOnEnabled>false</databaseAddOnEnabled><description>foobarbazbar</description><hostname>foobar.com</hostname><id>ab165e7a-481c-4baa-8826-d9ea680f953d</id><osType>UNKNOWN</osType><portNumber>9080</portNumber></return></ns1:createAgentWithObjectResponse></soap:Body></soap:Envelope>
|
39
|
+
http_version:
|
40
|
+
recorded_at: Mon, 26 Mar 2012 13:32:18 GMT
|
41
|
+
- request:
|
42
|
+
method: post
|
43
|
+
uri: http://foo:bar@foo.bar.baz:9080/Agent
|
44
|
+
body:
|
45
|
+
encoding: US-ASCII
|
46
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
47
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://agent.api.server.backup.r1soft.com/"
|
48
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><updateAgent><agent><databaseAddOnEnabled>false</databaseAddOnEnabled><description>foobarbazbar</description><hostname>bazbar</hostname><id>ab165e7a-481c-4baa-8826-d9ea680f953d</id><osType>UNKNOWN</osType><portNumber>9080</portNumber></agent></updateAgent></env:Body></env:Envelope>
|
49
|
+
headers:
|
50
|
+
Soapaction:
|
51
|
+
- ! '"updateAgent"'
|
52
|
+
Content-Type:
|
53
|
+
- text/xml;charset=UTF-8
|
54
|
+
Content-Length:
|
55
|
+
- '553'
|
56
|
+
Accept:
|
57
|
+
- ! '*/*'
|
58
|
+
User-Agent:
|
59
|
+
- Ruby
|
60
|
+
response:
|
61
|
+
status:
|
62
|
+
code: 200
|
63
|
+
message: OK
|
64
|
+
headers:
|
65
|
+
Server:
|
66
|
+
- Apache-Coyote/1.1
|
67
|
+
Content-Type:
|
68
|
+
- text/xml;charset=UTF-8
|
69
|
+
Content-Length:
|
70
|
+
- '215'
|
71
|
+
Date:
|
72
|
+
- Mon, 26 Mar 2012 13:31:25 GMT
|
73
|
+
body:
|
74
|
+
encoding: US-ASCII
|
75
|
+
string: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:updateAgentResponse
|
76
|
+
xmlns:ns1="http://agent.api.server.backup.r1soft.com/"></ns1:updateAgentResponse></soap:Body></soap:Envelope>
|
77
|
+
http_version:
|
78
|
+
recorded_at: Mon, 26 Mar 2012 13:32:18 GMT
|
79
|
+
- request:
|
80
|
+
method: post
|
81
|
+
uri: http://foo:bar@foo.bar.baz:9080/Agent
|
82
|
+
body:
|
83
|
+
encoding: US-ASCII
|
84
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
85
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://agent.api.server.backup.r1soft.com/"
|
86
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><deleteAgentById><id>ab165e7a-481c-4baa-8826-d9ea680f953d</id></deleteAgentById></env:Body></env:Envelope>
|
87
|
+
headers:
|
88
|
+
Soapaction:
|
89
|
+
- ! '"deleteAgentById"'
|
90
|
+
Content-Type:
|
91
|
+
- text/xml;charset=UTF-8
|
92
|
+
Content-Length:
|
93
|
+
- '377'
|
94
|
+
Accept:
|
95
|
+
- ! '*/*'
|
96
|
+
User-Agent:
|
97
|
+
- Ruby
|
98
|
+
response:
|
99
|
+
status:
|
100
|
+
code: 200
|
101
|
+
message: OK
|
102
|
+
headers:
|
103
|
+
Server:
|
104
|
+
- Apache-Coyote/1.1
|
105
|
+
Content-Type:
|
106
|
+
- text/xml;charset=UTF-8
|
107
|
+
Content-Length:
|
108
|
+
- '223'
|
109
|
+
Date:
|
110
|
+
- Mon, 26 Mar 2012 13:31:25 GMT
|
111
|
+
body:
|
112
|
+
encoding: US-ASCII
|
113
|
+
string: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:deleteAgentByIdResponse
|
114
|
+
xmlns:ns1="http://agent.api.server.backup.r1soft.com/"></ns1:deleteAgentByIdResponse></soap:Body></soap:Envelope>
|
115
|
+
http_version:
|
116
|
+
recorded_at: Mon, 26 Mar 2012 13:32:18 GMT
|
117
|
+
- request:
|
118
|
+
method: post
|
119
|
+
uri: http://foo:bar@foo.bar.baz:9080/Agent
|
120
|
+
body:
|
121
|
+
encoding: US-ASCII
|
122
|
+
string: <?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
123
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://agent.api.server.backup.r1soft.com/"
|
124
|
+
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Body><getAgentByID><id>ab165e7a-481c-4baa-8826-d9ea680f953d</id></getAgentByID></env:Body></env:Envelope>
|
125
|
+
headers:
|
126
|
+
Soapaction:
|
127
|
+
- ! '"getAgentByID"'
|
128
|
+
Content-Type:
|
129
|
+
- text/xml;charset=UTF-8
|
130
|
+
Content-Length:
|
131
|
+
- '371'
|
132
|
+
Accept:
|
133
|
+
- ! '*/*'
|
134
|
+
User-Agent:
|
135
|
+
- Ruby
|
136
|
+
response:
|
137
|
+
status:
|
138
|
+
code: 500
|
139
|
+
message: Internal Server Error
|
140
|
+
headers:
|
141
|
+
Server:
|
142
|
+
- Apache-Coyote/1.1
|
143
|
+
Content-Type:
|
144
|
+
- text/xml;charset=UTF-8
|
145
|
+
Content-Length:
|
146
|
+
- '436'
|
147
|
+
Date:
|
148
|
+
- Mon, 26 Mar 2012 13:31:25 GMT
|
149
|
+
Connection:
|
150
|
+
- close
|
151
|
+
body:
|
152
|
+
encoding: US-ASCII
|
153
|
+
string: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Server</faultcode><faultstring>The
|
154
|
+
specified agent ID ('ab165e7a-481c-4baa-8826-d9ea680f953d') does not exist
|
155
|
+
on this server.</faultstring><detail><ns1:UnknownObjectFault xmlns:ns1="http://agent.api.server.backup.r1soft.com/"><code>UnknownObject</code></ns1:UnknownObjectFault></detail></soap:Fault></soap:Body></soap:Envelope>
|
156
|
+
http_version:
|
157
|
+
recorded_at: Mon, 26 Mar 2012 13:32:18 GMT
|
158
|
+
recorded_with: VCR 2.0.0
|