vcloud 0.0.1.1
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 +5 -0
- data/Gemfile +14 -0
- data/Gemfile.lock +39 -0
- data/LICENSE +7 -0
- data/README.md +53 -0
- data/Rakefile +8 -0
- data/examples/hello_vcloud.rb +183 -0
- data/lib/vcloud.rb +16 -0
- data/lib/vcloud/base_vcloud_entity.rb +59 -0
- data/lib/vcloud/client.rb +117 -0
- data/lib/vcloud/constants.rb +38 -0
- data/lib/vcloud/errors.rb +31 -0
- data/lib/vcloud/parses_xml.rb +33 -0
- data/lib/vcloud/rest_api.rb +91 -0
- data/lib/vcloud/user.rb +5 -0
- data/lib/vcloud/user/catalog.rb +32 -0
- data/lib/vcloud/user/catalog_item.rb +10 -0
- data/lib/vcloud/user/error.rb +12 -0
- data/lib/vcloud/user/instantiate_vapp_template_params.rb +36 -0
- data/lib/vcloud/user/link.rb +30 -0
- data/lib/vcloud/user/network_config.rb +20 -0
- data/lib/vcloud/user/network_config_section.rb +20 -0
- data/lib/vcloud/user/org.rb +69 -0
- data/lib/vcloud/user/org_list.rb +10 -0
- data/lib/vcloud/user/reference.rb +27 -0
- data/lib/vcloud/user/task.rb +54 -0
- data/lib/vcloud/user/vapp.rb +103 -0
- data/lib/vcloud/user/vdc.rb +32 -0
- data/lib/version.rb +3 -0
- data/spec/catalog_item_spec.rb +35 -0
- data/spec/catalog_spec.rb +62 -0
- data/spec/client_spec.rb +87 -0
- data/spec/fixtures/catalog.xml +8 -0
- data/spec/fixtures/catalog_item.xml +6 -0
- data/spec/fixtures/error_login_404.html +24 -0
- data/spec/fixtures/instantiate_vapp_template_params.xml +11 -0
- data/spec/fixtures/network_config.xml +6 -0
- data/spec/fixtures/network_config_section.xml +6 -0
- data/spec/fixtures/org.xml +11 -0
- data/spec/fixtures/org_list.xml +4 -0
- data/spec/fixtures/session.xml +7 -0
- data/spec/fixtures/task.xml +6 -0
- data/spec/fixtures/vapp.xml +31 -0
- data/spec/fixtures/vapp_template.xml +74 -0
- data/spec/fixtures/vdc.xml +55 -0
- data/spec/instantiate_vapp_template_params_spec.rb +60 -0
- data/spec/network_config_section_spec.rb +42 -0
- data/spec/network_config_spec.rb +31 -0
- data/spec/org_spec.rb +99 -0
- data/spec/rest_api_spec.rb +48 -0
- data/spec/spec_helper.rb +20 -0
- data/spec/task_spec.rb +74 -0
- data/spec/vapp_spec.rb +85 -0
- data/spec/vdc_spec.rb +83 -0
- data/vcloud.gemspec +19 -0
- metadata +173 -0
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include WebMock::API
|
4
|
+
|
5
|
+
describe VCloud::RestApi do
|
6
|
+
describe 'when receiving an HTTP error code' do
|
7
|
+
it 'should handle a HTTP 401 error when logging in with a bad password' do
|
8
|
+
stub_request(:post, "https://someuser%40someorg:badpassword@some.vcloud.com/api/sessions").
|
9
|
+
with(:headers => {'Accept'=>'application/*+xml;version=1.5', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby'}).
|
10
|
+
to_return(:status => 401, :body => "", :headers => {})
|
11
|
+
|
12
|
+
session = VCloud::Client.new('https://some.vcloud.com/api/', '1.5')
|
13
|
+
expect { session.login('someuser@someorg', 'badpassword') }.to raise_error(VCloud::VCloudError) { |error|
|
14
|
+
error.major_error_code.should == 401
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should handle a HTTP 403 error when logging out with a bad token' do
|
19
|
+
stub_request(:post, "https://someuser%40someorg:password@some.vcloud.com/api/sessions").
|
20
|
+
with(:headers => {'Accept'=>'application/*+xml;version=1.5'}).
|
21
|
+
to_return(:status => 200, :body => fixture_file('session.xml'), :headers => {:x_vcloud_authorization => "abc123xyz"})
|
22
|
+
|
23
|
+
session = VCloud::Client.new('https://some.vcloud.com/api/', '1.5')
|
24
|
+
session.login('someuser@someorg', 'password')
|
25
|
+
|
26
|
+
stub_request(:delete, "https://some.vcloud.com/api/session").
|
27
|
+
with(:headers => {'Accept'=>'application/*+xml;version=1.5', 'X-Vcloud-Authorization'=>'bad token'}).
|
28
|
+
to_return(:status => 403, :body => "", :headers => {})
|
29
|
+
|
30
|
+
session.token[:x_vcloud_authorization] = "bad token"
|
31
|
+
expect { session.logout }.to raise_error(VCloud::VCloudError) { |error|
|
32
|
+
error.major_error_code.should == 403
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'should handle a HTTP 404 error when logging in with a bad API endpoint' do
|
37
|
+
stub_request(:post, "https://someuser%40someorg:password@some.vcloud.com/badapiendpoint/sessions").
|
38
|
+
with(:headers => {'Accept'=>'application/*+xml;version=1.5'}).
|
39
|
+
to_return(:status => 404, :body => fixture_file('error_login_404.html'), :headers => {})
|
40
|
+
|
41
|
+
session = VCloud::Client.new('https://some.vcloud.com/badapiendpoint/', '1.5')
|
42
|
+
|
43
|
+
expect { session.login('someuser@someorg', 'password') }.to raise_error(VCloud::VCloudError) { |error|
|
44
|
+
error.major_error_code.should == 404
|
45
|
+
}
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'webmock/rspec'
|
2
|
+
|
3
|
+
require_relative '../lib/vcloud'
|
4
|
+
|
5
|
+
RSpec.configure do |config|
|
6
|
+
config.before(:each) {
|
7
|
+
stub_request(:post, "https://someuser%40someorg:password@some.vcloud.com/api/sessions").
|
8
|
+
with(:headers => {'Accept'=>'application/*+xml;version=1.5'}).
|
9
|
+
to_return(:status => 200, :body => fixture_file('session.xml'), :headers => {:x_vcloud_authorization => "abc123xyz"})
|
10
|
+
|
11
|
+
@session = VCloud::Client.new('https://some.vcloud.com/api/', '1.5')
|
12
|
+
@session.login('someuser@someorg', 'password')
|
13
|
+
|
14
|
+
WebMock.reset!
|
15
|
+
}
|
16
|
+
end
|
17
|
+
|
18
|
+
def fixture_file(filename)
|
19
|
+
File.read(File.dirname(__FILE__) + "/fixtures/#{filename}")
|
20
|
+
end
|
data/spec/task_spec.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include WebMock::API
|
4
|
+
|
5
|
+
describe VCloud::Task do
|
6
|
+
describe 'when parsing #from_xml' do
|
7
|
+
before(:each) do
|
8
|
+
@task = VCloud::Task.from_xml(fixture_file('task.xml'))
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'should have correct values' do
|
12
|
+
@task.name.should == 'task'
|
13
|
+
@task.id.should == 'urn:vcloud:task:5acdbbab-0496-4a57-bf81-cec0be0ae8fb'
|
14
|
+
@task.type.should == 'application/vnd.vmware.vcloud.task+xml'
|
15
|
+
@task.href.should == "https://vcloud.com/api/task/5acdbbab-0496-4a57-bf81-cec0be0ae8fb"
|
16
|
+
@task.status.should == 'running'
|
17
|
+
@task.start_time.should == '2012-10-01T15:31:10.175-04:00'
|
18
|
+
@task.operation_name.should == 'vappUndeployPowerOff'
|
19
|
+
@task.operation.should == 'Stopping Virtual Application (6e2ec079-c533-4d99-8f29-2a90ba18da87)'
|
20
|
+
@task.expiry_time.should == '2012-12-30T15:31:10.175-05:00'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe 'when #wait_to_finish' do
|
25
|
+
before(:each) do
|
26
|
+
@task = VCloud::Task.from_xml(fixture_file('task.xml'))
|
27
|
+
@task.session = @session
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'should timeout' do
|
31
|
+
stub_request(:get, 'https://vcloud.com/api/task/5acdbbab-0496-4a57-bf81-cec0be0ae8fb').
|
32
|
+
with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.task+xml;version=1.5', 'X-Vcloud-Authorization'=>'abc123xyz'}).
|
33
|
+
to_return(:status => 200, :body => fixture_file('task.xml'))
|
34
|
+
|
35
|
+
lambda {@task.wait_to_finish(5)}.should raise_error(Timeout::Error)
|
36
|
+
end
|
37
|
+
|
38
|
+
it "should consider 'success' complete" do
|
39
|
+
stub_request(:get, 'https://vcloud.com/api/task/5acdbbab-0496-4a57-bf81-cec0be0ae8fb').
|
40
|
+
with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.task+xml;version=1.5', 'X-Vcloud-Authorization'=>'abc123xyz'}).
|
41
|
+
to_return(:status => 200, :body => lambda{|request| t=VCloud::Task.new;t.status='success';t.to_xml})
|
42
|
+
|
43
|
+
lambda {@task.wait_to_finish(54)}.should_not raise_error(Timeout::Error)
|
44
|
+
@task.status.should == 'success'
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should consider 'error' complete" do
|
48
|
+
stub_request(:get, 'https://vcloud.com/api/task/5acdbbab-0496-4a57-bf81-cec0be0ae8fb').
|
49
|
+
with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.task+xml;version=1.5', 'X-Vcloud-Authorization'=>'abc123xyz'}).
|
50
|
+
to_return(:status => 200, :body => lambda{|request| t=VCloud::Task.new;t.status='error';t.to_xml})
|
51
|
+
|
52
|
+
lambda {@task.wait_to_finish(54)}.should_not raise_error(Timeout::Error)
|
53
|
+
@task.status.should == 'error'
|
54
|
+
end
|
55
|
+
|
56
|
+
it "should consider 'canceled' complete" do
|
57
|
+
stub_request(:get, 'https://vcloud.com/api/task/5acdbbab-0496-4a57-bf81-cec0be0ae8fb').
|
58
|
+
with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.task+xml;version=1.5', 'X-Vcloud-Authorization'=>'abc123xyz'}).
|
59
|
+
to_return(:status => 200, :body => lambda{|request| t=VCloud::Task.new;t.status='canceled';t.to_xml})
|
60
|
+
|
61
|
+
lambda {@task.wait_to_finish(54)}.should_not raise_error(Timeout::Error)
|
62
|
+
@task.status.should == 'canceled'
|
63
|
+
end
|
64
|
+
|
65
|
+
it "should consider 'aborted' complete" do
|
66
|
+
stub_request(:get, 'https://vcloud.com/api/task/5acdbbab-0496-4a57-bf81-cec0be0ae8fb').
|
67
|
+
with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.task+xml;version=1.5', 'X-Vcloud-Authorization'=>'abc123xyz'}).
|
68
|
+
to_return(:status => 200, :body => lambda{|request| t=VCloud::Task.new;t.status='aborted';t.to_xml})
|
69
|
+
|
70
|
+
lambda {@task.wait_to_finish(54)}.should_not raise_error(Timeout::Error)
|
71
|
+
@task.status.should == 'aborted'
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
data/spec/vapp_spec.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include WebMock::API
|
4
|
+
|
5
|
+
describe VCloud::VApp do
|
6
|
+
|
7
|
+
before(:each) do
|
8
|
+
@vapp = VCloud::VApp.from_xml(fixture_file('vapp.xml'))
|
9
|
+
@vapp.session = @session
|
10
|
+
end
|
11
|
+
|
12
|
+
describe 'parses xml #from_xml' do
|
13
|
+
it 'should have correct values' do
|
14
|
+
@vapp.name.should == "Linux FTP server"
|
15
|
+
@vapp.id.should == 'urn:vcloud:vapp:aaa-bbb-ccc-ddd-eee-fff'
|
16
|
+
@vapp.type.should == 'application/vnd.vmware.vcloud.vApp+xml'
|
17
|
+
@vapp.href.should == "https://some.vcloud.com/api/vApp/vapp-aaa-bbb-ccc-ddd-eee-fff"
|
18
|
+
end
|
19
|
+
|
20
|
+
it 'should parse links' do
|
21
|
+
@vapp.links.should_not be_nil
|
22
|
+
@vapp.links.should have(14).items
|
23
|
+
|
24
|
+
@vapp.links.first.type.should == 'application/vnd.vmware.vcloud.vAppNetwork+xml'
|
25
|
+
@vapp.links.first.name.should == 'Dev VLAN'
|
26
|
+
@vapp.links.first.href.should == 'https://some.vcloud.com/api/network/aaa-bbb-ccc-ddd-eee-fff'
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'should parse tasks' do
|
30
|
+
@vapp.tasks.should_not be_nil
|
31
|
+
@vapp.tasks.should have(1).items
|
32
|
+
@vapp.tasks.first.status.should == 'running'
|
33
|
+
@vapp.tasks.first.operation_name.should == 'vdcInstantiateVapp'
|
34
|
+
@vapp.tasks.first.operation.should == 'Creating Virtual Application Linux FTP server(aaa-bbb-ccc-ddd-eee-fff)'
|
35
|
+
@vapp.tasks.first.expiry_time.should == '2012-12-19T10:40:08.286-05:00'
|
36
|
+
@vapp.tasks.first.name.should == 'task'
|
37
|
+
@vapp.tasks.first.id.should == 'urn:vcloud:task:aaa-bbb-ccc-ddd-eee-fff'
|
38
|
+
@vapp.tasks.first.href.should == 'https://some.vcloud.com/api/task/aaa-bbb-ccc-ddd-eee-fff'
|
39
|
+
|
40
|
+
@vapp.tasks.first.links.should have(1).item
|
41
|
+
@vapp.tasks.first.links.first.rel.should == 'task:cancel'
|
42
|
+
@vapp.tasks.first.links.first.href.should == 'https://some.vcloud.com/api/task/aaa-bbb-ccc-ddd-eee-fff/action/cancel'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
it "retrieves a VApp" do
|
47
|
+
stub_request(:get, 'https://some.vcloud.com/api/vApp/vapp-aaa-bbb-ccc-ddd-eee-fff').
|
48
|
+
with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.vApp+xml;version=1.5', 'X-Vcloud-Authorization'=>'abc123xyz'}).
|
49
|
+
to_return(:status => 200, :body => fixture_file('vapp.xml'))
|
50
|
+
|
51
|
+
vapp = VCloud::VApp.from_reference(stub(:href => 'https://some.vcloud.com/api/vApp/vapp-aaa-bbb-ccc-ddd-eee-fff'), @session)
|
52
|
+
|
53
|
+
vapp.name.should == "Linux FTP server"
|
54
|
+
vapp.href.should == 'https://some.vcloud.com/api/vApp/vapp-aaa-bbb-ccc-ddd-eee-fff'
|
55
|
+
end
|
56
|
+
|
57
|
+
it 'should #power_on' do
|
58
|
+
stub_request(:post, 'https://vcloud.diebold.dev/api/vApp/vapp-1/power/action/powerOn').
|
59
|
+
with(:headers => {'Accept'=>'application/*+xml;version=1.5', 'X-Vcloud-Authorization'=>'abc123xyz'}).
|
60
|
+
to_return(:status => 200, :body => fixture_file('task.xml'))
|
61
|
+
|
62
|
+
task = @vapp.power_on
|
63
|
+
task.should_not be_nil
|
64
|
+
end
|
65
|
+
|
66
|
+
it 'should #remove' do
|
67
|
+
stub_request(:delete, 'https://vcloud.diebold.dev/api/vApp/vapp-1').
|
68
|
+
with(:headers => {'Accept'=>'application/*+xml;version=1.5', 'X-Vcloud-Authorization'=>'abc123xyz'}).
|
69
|
+
to_return(:status => 200, :body => fixture_file('task.xml'))
|
70
|
+
|
71
|
+
task = @vapp.remove
|
72
|
+
task.should_not be_nil
|
73
|
+
end
|
74
|
+
|
75
|
+
it 'should #undeploy' do
|
76
|
+
stub_request(:post, 'https://vcloud.diebold.dev/api/vApp/vapp-1/action/undeploy').
|
77
|
+
with(:headers => {'Content-Type'=>'application/vnd.vmware.vcloud.undeployVAppParams+xml','Accept'=>'application/*+xml;version=1.5', 'X-Vcloud-Authorization'=>'abc123xyz'},
|
78
|
+
:body => lambda{p=VCloud::UndeployVAppParams.new;p.undeploy_power_action='powerOff';p.to_xml}.call).
|
79
|
+
to_return(:status => 200, :body => fixture_file('task.xml'))
|
80
|
+
|
81
|
+
task = @vapp.undeploy('powerOff')
|
82
|
+
task.should_not be_nil
|
83
|
+
end
|
84
|
+
|
85
|
+
end
|
data/spec/vdc_spec.rb
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
include WebMock::API
|
4
|
+
|
5
|
+
describe VCloud::Vdc do
|
6
|
+
before(:each) do
|
7
|
+
@vdc = VCloud::Vdc.from_xml(fixture_file('vdc.xml'))
|
8
|
+
end
|
9
|
+
|
10
|
+
describe 'when parsing xml #from_xml' do
|
11
|
+
it 'should have correct values' do
|
12
|
+
@vdc.name.should == 'TestVDC'
|
13
|
+
@vdc.id.should == 'urn:vcloud:vdc:aaa-bbb-ccc-ddd-eee-fff'
|
14
|
+
@vdc.type.should == 'application/vnd.vmware.vcloud.vdc+xml'
|
15
|
+
@vdc.href.should == 'https://some.vcloud.com/api/vdc/aaa-bbb-ccc-ddd-eee-fff'
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'should parese a network references' do
|
19
|
+
@vdc.network_references.should_not be_nil
|
20
|
+
@vdc.network_references.should have(1).items
|
21
|
+
@vdc.network_references.first.name.should == "Dev VLAN"
|
22
|
+
@vdc.network_references.first.href.should == "https://some.vcloud.com/api/network/aaa-bbb-ccc-ddd-eee-fff"
|
23
|
+
end
|
24
|
+
|
25
|
+
it 'should parse links' do
|
26
|
+
@vdc.links.should_not be_nil
|
27
|
+
@vdc.links.should have(10).items
|
28
|
+
@vdc.links.first.type.should == 'application/vnd.vmware.vcloud.org+xml'
|
29
|
+
@vdc.links.first.href.should == 'https://some.vcloud.com/api/org/aaa-bbb-ccc-ddd-eee-fff'
|
30
|
+
end
|
31
|
+
|
32
|
+
it 'should #get_network_references_by_name' do
|
33
|
+
refs_by_name = @vdc.get_network_references_by_name
|
34
|
+
refs_by_name.should have(1).items
|
35
|
+
|
36
|
+
refs_by_name['Dev VLAN'].type.should == 'application/vnd.vmware.vcloud.network+xml'
|
37
|
+
refs_by_name['Dev VLAN'].name.should == 'Dev VLAN'
|
38
|
+
refs_by_name['Dev VLAN'].href.should == 'https://some.vcloud.com/api/network/aaa-bbb-ccc-ddd-eee-fff'
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
it "should retrieve VDC #from_reference" do
|
43
|
+
stub_request(:get, "https://some.vcloud.com/api/vdc/aaa-bbb-ccc-ddd-eee-fff").
|
44
|
+
with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.vdc+xml;version=1.5', 'X-Vcloud-Authorization'=>'abc123xyz'}).
|
45
|
+
to_return(:status => 200, :body => fixture_file('vdc.xml'))
|
46
|
+
|
47
|
+
vdc = VCloud::Vdc.from_reference(stub(:href => 'https://some.vcloud.com/api/vdc/aaa-bbb-ccc-ddd-eee-fff'), @session)
|
48
|
+
|
49
|
+
WebMock.should have_requested(:get, 'https://some.vcloud.com/api/vdc/aaa-bbb-ccc-ddd-eee-fff').
|
50
|
+
with(:headers => {'Accept'=>'application/vnd.vmware.vcloud.vdc+xml;version=1.5', 'X-Vcloud-Authorization'=>'abc123xyz'})
|
51
|
+
|
52
|
+
vdc.id.should == "urn:vcloud:vdc:aaa-bbb-ccc-ddd-eee-fff"
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should #instantiate_vapp_template" do
|
56
|
+
net_section = VCloud::NetworkConfigSection.new
|
57
|
+
net_config = VCloud::NetworkConfig.new
|
58
|
+
net_config.network_name = "TestVappNetworkConfigNetwork"
|
59
|
+
net_config.parent_network_reference = VCloud::Reference.new({})
|
60
|
+
net_config.fence_mode = 'bridged'
|
61
|
+
net_section.network_configs << net_config
|
62
|
+
|
63
|
+
vapp_params = VCloud::InstantiateVAppTemplateParams.new
|
64
|
+
vapp_params.name = 'SomeVAppTemplateParams'
|
65
|
+
vapp_params.description = 'some descriptive string'
|
66
|
+
vapp_params.source_reference = VCloud::Reference.new({})
|
67
|
+
vapp_params.network_config_section = net_section
|
68
|
+
|
69
|
+
stub_request(:post, 'https://some.vcloud.com/api/vdc/aaa-bbb-ccc-ddd-eee-fff/action/instantiateVAppTemplate').
|
70
|
+
with(:headers => {'Accept'=>'application/*+xml;version=1.5', 'Content-Type'=>'application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml', 'X-Vcloud-Authorization'=>'abc123xyz'}).
|
71
|
+
to_return(:status => 200, :body => fixture_file('vapp.xml'))
|
72
|
+
|
73
|
+
vapp = @vdc.instantiate_vapp_template(vapp_params, @session)
|
74
|
+
|
75
|
+
WebMock.should have_requested(:post, 'https://some.vcloud.com/api/vdc/aaa-bbb-ccc-ddd-eee-fff/action/instantiateVAppTemplate').
|
76
|
+
with(:headers => {'Accept'=>'application/*+xml;version=1.5', 'Accept-Encoding'=>'gzip, deflate', 'Content-Type'=>'application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml', 'X-Vcloud-Authorization'=>'abc123xyz'})
|
77
|
+
|
78
|
+
vapp.id.should == 'urn:vcloud:vapp:aaa-bbb-ccc-ddd-eee-fff'
|
79
|
+
|
80
|
+
vapp.session.should == @session
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
data/vcloud.gemspec
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Brian McClain", "Zach Robinson"]
|
6
|
+
gem.description = %q{vCloud Director API Ruby Bindings}
|
7
|
+
gem.summary = gem.summary
|
8
|
+
gem.homepage = "https://github.com/DieboldInc/vcloud-ruby"
|
9
|
+
|
10
|
+
gem.files = `git ls-files`.split($\)
|
11
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
12
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
|
+
gem.name = "vcloud"
|
14
|
+
gem.require_paths = ["lib"]
|
15
|
+
gem.version = VCloud::VERSION
|
16
|
+
|
17
|
+
gem.add_dependency "rest-client"
|
18
|
+
gem.add_dependency 'nokogiri-happymapper'
|
19
|
+
end
|
metadata
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vcloud
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Brian McClain
|
9
|
+
- Zach Robinson
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2012-10-04 00:00:00.000000000 Z
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: rest-client
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ! '>='
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '0'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ! '>='
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '0'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: nokogiri-happymapper
|
33
|
+
requirement: !ruby/object:Gem::Requirement
|
34
|
+
none: false
|
35
|
+
requirements:
|
36
|
+
- - ! '>='
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
type: :runtime
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
none: false
|
43
|
+
requirements:
|
44
|
+
- - ! '>='
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
47
|
+
description: vCloud Director API Ruby Bindings
|
48
|
+
email:
|
49
|
+
executables: []
|
50
|
+
extensions: []
|
51
|
+
extra_rdoc_files: []
|
52
|
+
files:
|
53
|
+
- .gitignore
|
54
|
+
- Gemfile
|
55
|
+
- Gemfile.lock
|
56
|
+
- LICENSE
|
57
|
+
- README.md
|
58
|
+
- Rakefile
|
59
|
+
- examples/hello_vcloud.rb
|
60
|
+
- lib/vcloud.rb
|
61
|
+
- lib/vcloud/base_vcloud_entity.rb
|
62
|
+
- lib/vcloud/client.rb
|
63
|
+
- lib/vcloud/constants.rb
|
64
|
+
- lib/vcloud/errors.rb
|
65
|
+
- lib/vcloud/parses_xml.rb
|
66
|
+
- lib/vcloud/rest_api.rb
|
67
|
+
- lib/vcloud/user.rb
|
68
|
+
- lib/vcloud/user/catalog.rb
|
69
|
+
- lib/vcloud/user/catalog_item.rb
|
70
|
+
- lib/vcloud/user/error.rb
|
71
|
+
- lib/vcloud/user/instantiate_vapp_template_params.rb
|
72
|
+
- lib/vcloud/user/link.rb
|
73
|
+
- lib/vcloud/user/network_config.rb
|
74
|
+
- lib/vcloud/user/network_config_section.rb
|
75
|
+
- lib/vcloud/user/org.rb
|
76
|
+
- lib/vcloud/user/org_list.rb
|
77
|
+
- lib/vcloud/user/reference.rb
|
78
|
+
- lib/vcloud/user/task.rb
|
79
|
+
- lib/vcloud/user/vapp.rb
|
80
|
+
- lib/vcloud/user/vdc.rb
|
81
|
+
- lib/version.rb
|
82
|
+
- spec/catalog_item_spec.rb
|
83
|
+
- spec/catalog_spec.rb
|
84
|
+
- spec/client_spec.rb
|
85
|
+
- spec/fixtures/catalog.xml
|
86
|
+
- spec/fixtures/catalog_item.xml
|
87
|
+
- spec/fixtures/error_login_404.html
|
88
|
+
- spec/fixtures/instantiate_vapp_template_params.xml
|
89
|
+
- spec/fixtures/network_config.xml
|
90
|
+
- spec/fixtures/network_config_section.xml
|
91
|
+
- spec/fixtures/org.xml
|
92
|
+
- spec/fixtures/org_list.xml
|
93
|
+
- spec/fixtures/session.xml
|
94
|
+
- spec/fixtures/task.xml
|
95
|
+
- spec/fixtures/vapp.xml
|
96
|
+
- spec/fixtures/vapp_template.xml
|
97
|
+
- spec/fixtures/vdc.xml
|
98
|
+
- spec/instantiate_vapp_template_params_spec.rb
|
99
|
+
- spec/network_config_section_spec.rb
|
100
|
+
- spec/network_config_spec.rb
|
101
|
+
- spec/org_spec.rb
|
102
|
+
- spec/rest_api_spec.rb
|
103
|
+
- spec/spec_helper.rb
|
104
|
+
- spec/task_spec.rb
|
105
|
+
- spec/vapp_spec.rb
|
106
|
+
- spec/vdc_spec.rb
|
107
|
+
- vcloud.gemspec
|
108
|
+
- vendor/cache/addressable-2.3.2.gem
|
109
|
+
- vendor/cache/crack-0.3.1.gem
|
110
|
+
- vendor/cache/diff-lcs-1.1.3.gem
|
111
|
+
- vendor/cache/mime-types-1.19.gem
|
112
|
+
- vendor/cache/nokogiri-1.5.5.gem
|
113
|
+
- vendor/cache/rake-0.9.2.2.gem
|
114
|
+
- vendor/cache/rest-client-1.6.7.gem
|
115
|
+
- vendor/cache/rspec-2.11.0.gem
|
116
|
+
- vendor/cache/rspec-core-2.11.1.gem
|
117
|
+
- vendor/cache/rspec-expectations-2.11.3.gem
|
118
|
+
- vendor/cache/rspec-mocks-2.11.3.gem
|
119
|
+
- vendor/cache/webmock-1.8.10.gem
|
120
|
+
homepage: https://github.com/DieboldInc/vcloud-ruby
|
121
|
+
licenses: []
|
122
|
+
post_install_message:
|
123
|
+
rdoc_options: []
|
124
|
+
require_paths:
|
125
|
+
- lib
|
126
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
127
|
+
none: false
|
128
|
+
requirements:
|
129
|
+
- - ! '>='
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
segments:
|
133
|
+
- 0
|
134
|
+
hash: 1663315438711745401
|
135
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
136
|
+
none: false
|
137
|
+
requirements:
|
138
|
+
- - ! '>='
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
requirements: []
|
142
|
+
rubyforge_project:
|
143
|
+
rubygems_version: 1.8.24
|
144
|
+
signing_key:
|
145
|
+
specification_version: 3
|
146
|
+
summary: ''
|
147
|
+
test_files:
|
148
|
+
- spec/catalog_item_spec.rb
|
149
|
+
- spec/catalog_spec.rb
|
150
|
+
- spec/client_spec.rb
|
151
|
+
- spec/fixtures/catalog.xml
|
152
|
+
- spec/fixtures/catalog_item.xml
|
153
|
+
- spec/fixtures/error_login_404.html
|
154
|
+
- spec/fixtures/instantiate_vapp_template_params.xml
|
155
|
+
- spec/fixtures/network_config.xml
|
156
|
+
- spec/fixtures/network_config_section.xml
|
157
|
+
- spec/fixtures/org.xml
|
158
|
+
- spec/fixtures/org_list.xml
|
159
|
+
- spec/fixtures/session.xml
|
160
|
+
- spec/fixtures/task.xml
|
161
|
+
- spec/fixtures/vapp.xml
|
162
|
+
- spec/fixtures/vapp_template.xml
|
163
|
+
- spec/fixtures/vdc.xml
|
164
|
+
- spec/instantiate_vapp_template_params_spec.rb
|
165
|
+
- spec/network_config_section_spec.rb
|
166
|
+
- spec/network_config_spec.rb
|
167
|
+
- spec/org_spec.rb
|
168
|
+
- spec/rest_api_spec.rb
|
169
|
+
- spec/spec_helper.rb
|
170
|
+
- spec/task_spec.rb
|
171
|
+
- spec/vapp_spec.rb
|
172
|
+
- spec/vdc_spec.rb
|
173
|
+
has_rdoc:
|