1
0
Fork 0
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:
Nick Osborn 2013-09-26 23:35:23 +01:00
parent 1173bd9cf7
commit 66b6808a5f
3 changed files with 1189 additions and 0 deletions

View file

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

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