2010-05-02 21:46:43 -07:00
|
|
|
module Fog
|
|
|
|
module Vcloud
|
|
|
|
module Terremark
|
|
|
|
module Vcloud
|
2010-06-18 07:58:09 +08:00
|
|
|
extend Fog::Vcloud::Extension
|
2010-05-02 21:46:43 -07:00
|
|
|
|
2010-06-18 07:58:09 +08:00
|
|
|
versions "v0.8"
|
2010-05-02 21:46:43 -07:00
|
|
|
|
2010-06-18 07:58:09 +08:00
|
|
|
request_path 'fog/vcloud/terremark/vcloud/requests'
|
|
|
|
request :get_vdc
|
2010-05-02 21:46:43 -07:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
# If we don't support any versions the service does, then raise an error.
|
|
|
|
# If the @version that super selected isn't in our supported list, then select one that is.
|
|
|
|
def check_versions
|
|
|
|
super
|
|
|
|
unless (supported_version_ids & Versions::SUPPORTED).length > 0
|
|
|
|
raise UnsupportedVersion.new("\nService @ #{@versions_uri} supports: #{supported_version_ids.join(', ')}\n" +
|
|
|
|
"Fog::Vcloud::Terremark::Vcloud supports: #{Versions::SUPPORTED.join(', ')}")
|
|
|
|
end
|
|
|
|
unless supported_version_ids.include?(@version)
|
|
|
|
@version = (supported_version_ids & Versions::SUPPORTED).sort.first
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|