mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #2184 from nosborn/vcloud_director_versions
[vcloud_director] Add get_supported_versions request.
This commit is contained in:
commit
a40a37110c
3 changed files with 1189 additions and 0 deletions
|
@ -107,6 +107,7 @@ module Fog
|
|||
request :post_vapp_undeploy
|
||||
request :delete_vapp
|
||||
request :get_current_session
|
||||
request :get_supported_versions
|
||||
|
||||
class Model < Fog::Model
|
||||
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