mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[vcloud_director] Add get_supported_versions request.
This commit is contained in:
parent
1173bd9cf7
commit
66b6808a5f
3 changed files with 1189 additions and 0 deletions
|
@ -107,6 +107,7 @@ module Fog
|
||||||
request :post_vapp_undeploy
|
request :post_vapp_undeploy
|
||||||
request :delete_vapp
|
request :delete_vapp
|
||||||
request :get_current_session
|
request :get_current_session
|
||||||
|
request :get_supported_versions
|
||||||
|
|
||||||
class Model < Fog::Model
|
class Model < Fog::Model
|
||||||
def initialize(attrs={})
|
def initialize(attrs={})
|
||||||
|
|
1160
lib/fog/vcloud_director/requests/compute/get_supported_versions.rb
Normal file
1160
lib/fog/vcloud_director/requests/compute/get_supported_versions.rb
Normal file
File diff suppressed because it is too large
Load diff
28
tests/vcloud_director/requests/compute/versions_tests.rb
Normal file
28
tests/vcloud_director/requests/compute/versions_tests.rb
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
Shindo.tests('Compute::VcloudDirector | versions requests', ['vclouddirector']) do
|
||||||
|
|
||||||
|
SUPPORTED_VERSIONS_FORMAT = {
|
||||||
|
:xmlns => 'http://www.vmware.com/vcloud/versions',
|
||||||
|
:xmlns_xsi => 'http://www.w3.org/2001/XMLSchema-instance',
|
||||||
|
:xsi_schemaLocation => String,
|
||||||
|
:VersionInfo => [{
|
||||||
|
:Version => String,
|
||||||
|
:LoginUrl => String,
|
||||||
|
:MediaTypeMapping => [{
|
||||||
|
:MediaType => String,
|
||||||
|
:ComplexTypeName => String,
|
||||||
|
:SchemaLocation => String
|
||||||
|
}]
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
@service = Fog::Compute::VcloudDirector.new
|
||||||
|
|
||||||
|
tests('#get_supported_versions').formats(SUPPORTED_VERSIONS_FORMAT) do
|
||||||
|
@versions = @service.get_supported_versions.body
|
||||||
|
end
|
||||||
|
|
||||||
|
tests('API 5.1 is supported').returns(true) do
|
||||||
|
!!@versions[:VersionInfo].detect {|i| i[:Version] == '5.1'}
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
Loading…
Reference in a new issue