1
0
Fork 0
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:
Nick Osborn 2013-09-26 23:42:11 -07:00
commit a40a37110c
3 changed files with 1189 additions and 0 deletions

View file

@ -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={})

File diff suppressed because it is too large Load diff

View 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