class Fog::Compute::VcloudDirector::Mock
Public Instance Methods
delete_disk(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/delete_disk.rb, line 27 def delete_disk(id) unless data[:disks][id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.disk:#{id})\"" ) end owner = { :href => make_href("disk/#{id}"), :type => 'application/vnd.vmware.vcloud.disk+xml' } task_id = enqueue_task( "Deleting Disk(#{id})", 'vdcDeleteDisk', owner, :on_success => lambda do data[:disks].delete(id) end ) body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location, }.merge(task_body(task_id)) Excon::Response.new( :status => 202, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
delete_media(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/delete_media.rb, line 90 def delete_media(id) unless media = data[:medias][id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.media:#{id})\"" ) end owner = { :href => make_href("media/#{id}"), :type => 'application/vnd.vmware.vcloud.media+xml' } task_id = enqueue_task( "Deleting Media File(#{media[:file][:uuid]})", 'vdcDeleteMedia', owner, :on_success => lambda do data[:medias].delete(id) end ) body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location, }.merge(task_body(task_id)) Excon::Response.new( :status => 202, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
delete_network(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/delete_network.rb, line 29 def delete_network(id) unless data[:networks][id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.orgVdcNetwork:#{id})\"" ) end owner = { :href => make_href("network/#{id}"), :type => 'application/vnd.vmware.vcloud.network+xml' } task_id = enqueue_task( "Deleting Network(#{id})", 'DeleteNetwork', owner, :on_success => lambda do data[:networks].delete(id) end ) body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location, }.merge(task_body(task_id)) Excon::Response.new( :status => 202, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
get_catalog(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_catalog.rb, line 29 def get_catalog(id) unless catalog = data[:catalogs][id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.catalog:#{id})\"." ) end Fog::Mock.not_implemented catalog.is_used_here # avoid warning from syntax checker end
get_current_session()
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_current_session.rb, line 42 def get_current_session body = {:href => make_href('session/'), :type => 'application/vnd.vmware.vcloud.session+xml', :org => data[:org][:name], :user => user_name, :Link => [{:href => make_href('org/'), :type => 'application/vnd.vmware.vcloud.orgList+xml', :rel => 'down'}, {:href => make_href('admin/'), :type => 'application/vnd.vmware.admin.vcloud+xml', :rel => 'down'}, {:href => make_href("org/#{data[:org][:uuid]}"), :name => data[:org][:name], :type => 'application/vnd.vmware.vcloud.org+xml', :rel => 'down'}, {:href => make_href('query'), :type => 'application/vnd.vmware.vcloud.query.queryList+xml', :rel => 'down'}, {:href => make_href('entity/'), :type => 'application/vnd.vmware.vcloud.entity+xml', :rel => 'entityResolver'}]} if @api_version.to_f >= 5.1 body[:Link] << { :href => make_href('extensibility'), :type => 'application/vnd.vmware.vcloud.apiextensibility+xml', :rel => 'down:extensibility' } end Excon::Response.new( :body => body, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :status => 200 ) end
get_disk(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_disk.rb, line 44 def get_disk(id) unless data[:disks][id] raise Fog::Compute::VcloudDirector::Forbidden.new( 'No access to entity "com.vmware.vcloud.entity.disk:%s".' % id ) end body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location }.merge(disk_body(id)) Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{@version}"}, :body => body ) end
get_disk_owner(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_disk_owner.rb, line 38 def get_disk_owner(id) unless data[:disks][id] raise Fog::Compute::VcloudDirector::Forbidden.new( 'No access to entity "com.vmware.vcloud.entity.disk:%s".' % id ) end body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location, :Link => { :href => make_href("disk/#{id}"), :type => 'application/vnd.vmware.vcloud.disk+xml', :rel => 'up' }, :User => { :href => make_href("admin/user/#{user_uuid}"), :name => user_name, :type => 'application/vnd.vmware.admin.user+xml', } } Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{@version}"}, :body => body ) end
get_edge_gateway(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_edge_gateway.rb, line 54 def get_edge_gateway(id) unless edge_gateway = data[:edge_gateways][id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.gateway:#{id})\"" ) end vdc_id = edge_gateway[:vdc] body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :status => "1", :name => edge_gateway[:name], :id => "urn:vcloud:gateway:#{id}", :type => "application/vnd.vmware.admin.edgeGateway+xml", :href => make_href("admin/edgeGateway/#{id}"), :xsi_schemaLocation => xsi_schema_location, :Link =>[{:rel => "up", :type => "application/vnd.vmware.vcloud.vdc+xml", :href => make_href("vdc/#{vdc_id}")}, {:rel => "edgeGateway:redeploy", :href => make_href("admin/edgeGateway/#{id}/action/redeploy")}, {:rel => "edgeGateway:configureServices", :type => "application/vnd.vmware.admin.edgeGatewayServiceConfiguration+xml", :href => make_href("admin/edgeGateway/#{id}/action/configureServices")}, {:rel => "edgeGateway:reapplyServices", :href => make_href("admin/edgeGateway/#{id}/action/reapplyServices")}, {:rel => "edgeGateway:syncSyslogSettings", :href => make_href("admin/edgeGateway/#{id}/action/syncSyslogServerSettings")}], :Description => "vCloud CI (nft00052i2)", :Configuration => edge_gateway[:Configuration].dup } body[:Configuration][:GatewayInterfaces][:GatewayInterface] += edge_gateway[:networks].map do |network| extras = { :Network => { :type => "application/vnd.vmware.admin.network+xml", :name => "anything", :href => make_href("admin/network/#{network}") }, :Name => data[:networks][network][:name], :DisplayName => data[:networks][network][:name] } data[:networks][network].merge extras end Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
get_execute_query(type=nil, options={})
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_execute_query.rb, line 120 def get_execute_query(type=nil, options={}) unless options[:fields].nil? Fog::Mock.not_implemented("Fields are not yet implemented in get_execute_query Mock for #{type}") end unless options[:format].nil? || options[:format] == 'records' Fog::Mock.not_implemented("Formats #{options[:format]} is not yet implemented in get_execute_query Mock for #{type}") end # NB: default is to sort by 'Database ID' (uuid?). Does this matter? unless options[:sortAsc].nil? && options[:sortDesc].nil? Fog::Mock.not_implemented("Sorting by field is not yet implemented in get_execute_query Mock for #{type}") end # NB: default offset is 0 unless options[:offset].nil? Fog::Mock.not_implemented("Offset results are not yet implemented in get_execute_query Mock for #{type}") end # NB: default page is 1 if options.key?(:page) && options[:page].to_i != 1 Fog::Mock.not_implemented("Paginated results are not yet implemented in get_execute_query Mock for #{type}") end # NB: default pageSize is 25 unless options[:pageSize].nil? Fog::Mock.not_implemented("Paginated results are not yet implemented in get_execute_query Mock for #{type}") end if type.nil? body = all_types else body = fetch_items(type, options) end Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
get_media(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_media.rb, line 29 def get_media(id) unless data[:medias][id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.media:#{id})\"." ) end body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location }.merge(media_body(id)) Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=>#{@api_version}"}, :body => body ) end
get_media_owner(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_media_owner.rb, line 38 def get_media_owner(id) unless data[:medias][id] raise Fog::Compute::VcloudDirector::Forbidden.new( 'No access to entity "com.vmware.vcloud.entity.media:%s".' % id ) end body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location, :Link => { :href => make_href("media/#{id}"), :type => 'application/vnd.vmware.vcloud.media+xml', :rel => 'up' }, :User => { :href => make_href("admin/user/#{user_uuid}"), :name => user_name, :type => 'application/vnd.vmware.admin.user+xml', } } Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{@version}"}, :body => body ) end
get_network(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_network.rb, line 32 def get_network(id) Fog::Logger.deprecation("#{self} => #get_network is deprecated, use #get_network_complete instead [light_black](#{caller.first})[/]") unless network = data[:networks][id] raise Fog::Compute::VcloudDirector::Forbidden.new( 'This operation is denied.' ) end body = {:name=>network[:name], :href=>make_href("network/#{id}"), :type=>"application/vnd.vmware.vcloud.orgNetwork+xml", :id=>id, :description=>nil, :is_inherited=>network[:IsInherited], :gateway=>network[:Gateway], :netmask=>network[:Netmask], :dns1=>network[:Dns1], :dns2=>network[:Dns2], :dns_suffix=>network[:DnsSuffix]} body[:ip_ranges] = network[:IpRanges].map do |ip_range| {:start_address=>ip_range[:StartAddress], :end_address=>ip_range[:EndAddress]} end Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
get_network_complete(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_network_complete.rb, line 29 def get_network_complete(id) unless network = data[:networks][id] raise Fog::Compute::VcloudDirector::Forbidden.new( 'This operation is denied.' ) end body = { :name => network[:name], :href => make_href("network/#{id}"), :type => "application/vnd.vmware.vcloud.orgNetwork+xml", :id => id, :Description => network[:Description], :Configuration => { :IpScopes => { :IpScope => { :IsInherited => network[:IsInherited].to_s, :Gateway => network[:Gateway], :Netmask => network[:Netmask], :Dns1 => network[:Dns1], :Dns2 => network[:Dns2], :DnsSuffix => network[:DnsSuffix], :IsEnabled => true.to_s, :IpRanges => { :IpRange => [], }, } }, :FenceMode => network[:FenceMode], :RetainNetInfoAcrossDeployments => false.to_s, }, :IsShared => network[:IsShared].to_s, } body[:Configuration][:IpScopes][:IpScope][:IpRanges][:IpRange] = network[:IpRanges].map do |ip_range| {:StartAddress => ip_range[:StartAddress], :EndAddress => ip_range[:EndAddress]} end Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
get_org_vdc_gateways(vdc_id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_org_vdc_gateways.rb, line 32 def get_org_vdc_gateways(vdc_id) unless data[:vdcs][vdc_id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.vdc:#{vdc_id})\"." ) end body = {:xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :total => "1", :pageSize => "25", :page => "1", :name => "edgeGateways", :type => "application/vnd.vmware.vcloud.query.records+xml", :href => make_href("admin/vdc/#{vdc_id}edgeGateways?page=1&pageSize=25&format=records"), :xsi_schemaLocation => xsi_schema_location, :Link => [{:rel => "alternate", :type => "application/vnd.vmware.vcloud.query.references+xml", :href => make_href("admin/vdc/#{vdc_id}edgeGateways?page=1&pageSize=25&format=references")}, {:rel => "alternate", :type => "application/vnd.vmware.vcloud.query.idrecords+xml", :href => make_href("admin/vdc/#{vdc_id}edgeGateways?page=1&pageSize=25&format=records")}], :EdgeGatewayRecord => []} vdc_edge_gateways = data[:edge_gateways].select do |id, edge_gateway| edge_gateway[:vdc] == vdc_id end body[:EdgeGatewayRecord] += vdc_edge_gateways.map do |id, edge_gateway| {:vdc => make_href("vdc/#{vdc_id}"), :numberOfOrgNetworks => "1", :numberOfExtNetworks => "1", :name => edge_gateway[:name], :isBusy => "false", :haStatus => "DISABLED", :gatewayStatus => "READY", :href => make_href("admin/edgeGateway/#{id}"), :isSyslogServerSettingInSync => "true"} end Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
get_organization(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_organization.rb, line 29 def get_organization(id) unless id == data[:org][:uuid] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"com.vmware.vcloud.entity.org:#{id}\"" ) end org = data[:org] body = {:href=>make_href("org/#{id}"), :type=>"application/vnd.vmware.vcloud.org+xml", :id=>"urn:vcloud:org:#{id}", :name=>org[:name], :Link=> [{:href=>make_href("tasksList/#{id}"), :type=>"application/vnd.vmware.vcloud.tasksList+xml", :rel=>"down"}, {:href=>make_href("admin/org/#{id}/catalogs"), :type=>"application/vnd.vmware.admin.catalog+xml", :rel=>"add"}, {:href=>make_href("org/#{id}/metadata"), :type=>"application/vnd.vmware.vcloud.metadata+xml", :rel=>"down"}], :Description=>org[:description]||'', :Tasks=>{:Task=>[]}, :FullName=>org[:full_name]} body[:Link] += data[:catalogs].map do |catalog_id, catalog| [{:href=>make_href("catalog/#{catalog_id}"), :name=>catalog[:name], :type=>"application/vnd.vmware.vcloud.catalog+xml", :rel=>"down"}, {:href=>make_href("org/#{id}/catalog/#{catalog_id}/controlAccess/"), :type=>"application/vnd.vmware.vcloud.controlAccess+xml", :rel=>"down"}, {:href=> make_href("org/#{id}/catalog/#{catalog_id}/action/controlAccess"), :type=>"application/vnd.vmware.vcloud.controlAccess+xml", :rel=>"controlAccess"}] end.flatten body[:Link] += data[:networks].map do |network_id, network| {:href=>make_href("network/#{network_id}"), :name=>network[:name], :type=>"application/vnd.vmware.vcloud.orgNetwork+xml", :rel=>"down"} end body[:Link] += data[:vdcs].map do |vdc_id, vdc| {:href=>make_href("vdc/#{vdc_id}"), :name=>vdc[:name], :type=>"application/vnd.vmware.vcloud.vdc+xml", :rel=>"down"} end if api_version.to_f >= 5.1 body[:Link] << {:href=>make_href('supportedSystemsInfo/'), :type=>"application/vnd.vmware.vcloud.supportedSystemsInfo+xml", :rel=>"down"} end Excon::Response.new( :body => body, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :status => 200 ) end
get_organizations()
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_organizations.rb, line 34 def get_organizations body = {:href=>make_href('org/'), :type=>"application/vnd.vmware.vcloud.orgList+xml", :Org=> [{:href=>make_href("org/#{data[:org][:uuid]}"), :name=>data[:org][:name], :type=>"application/vnd.vmware.vcloud.org+xml"}]} Excon::Response.new( :body => body, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :status => 200 ) end
get_supported_systems_info()
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_supported_systems_info.rb, line 25 def get_supported_systems_info body = # this is a subset of the full list {:xmlns=>xmlns, :xmlns_xsi=>xmlns_xsi, :type=>"application/vnd.vmware.vcloud.supportedSystemsInfo+xml", :href=>make_href('supportedSystemsInfo/'), :xsi_schemaLocation=>xsi_schema_location, :OperatingSystemFamilyInfo=> [{:Name=>"Microsoft Windows", :OperatingSystemFamilyId=>"1", :OperatingSystem=> [{:OperatingSystemId=>"85", :DefaultHardDiskAdapterType=>"4", :MinimumHardDiskSizeGigabytes=>"40", :MinimumMemoryMegabytes=>"512", :Name=>"Microsoft Windows Server 2012 (64-bit)", :InternalName=>"windows8Server64Guest", :Supported=>"true", :x64=>"true", :MaximumCpuCount=>"64", :MinimumHardwareVersion=>"8", :PersonalizationEnabled=>"true", :PersonalizationAuto=>"true", :SysprepPackagingSupported=>"true", :SupportsMemHotAdd=>"true", :cimOsId=>"74", :CimVersion=>"0", :SupportedForCreate=>"true"}, {:OperatingSystemId=>"3", :DefaultHardDiskAdapterType=>"4", :MinimumHardDiskSizeGigabytes=>"40", :MinimumMemoryMegabytes=>"512", :Name=>"Microsoft Windows Server 2008 R2 (64-bit)", :InternalName=>"windows7Server64Guest", :Supported=>"true", :x64=>"true", :MaximumCpuCount=>"64", :MinimumHardwareVersion=>"4", :PersonalizationEnabled=>"true", :PersonalizationAuto=>"true", :SysprepPackagingSupported=>"true", :SupportsMemHotAdd=>"true", :cimOsId=>"102", :CimVersion=>"0", :SupportedForCreate=>"true"}, {:OperatingSystemId=>"4", :DefaultHardDiskAdapterType=>"4", :MinimumHardDiskSizeGigabytes=>"40", :MinimumMemoryMegabytes=>"512", :Name=>"Microsoft Windows Server 2008 (32-bit)", :InternalName=>"winLonghornGuest", :Supported=>"true", :x64=>"false", :MaximumCpuCount=>"64", :MinimumHardwareVersion=>"4", :PersonalizationEnabled=>"true", :PersonalizationAuto=>"true", :SysprepPackagingSupported=>"true", :SupportsMemHotAdd=>"true", :cimOsId=>"73", :CimVersion=>"0", :SupportedForCreate=>"true"}]}, {:Name=>"Linux", :OperatingSystemFamilyId=>"2", :OperatingSystem=> [{:OperatingSystemId=>"48", :DefaultHardDiskAdapterType=>"3", :MinimumHardDiskSizeGigabytes=>"8", :MinimumMemoryMegabytes=>"64", :Name=>"Ubuntu Linux (64-bit)", :InternalName=>"ubuntu64Guest", :Supported=>"true", :x64=>"true", :MaximumCpuCount=>"64", :MinimumHardwareVersion=>"4", :PersonalizationEnabled=>"true", :PersonalizationAuto=>"true", :SysprepPackagingSupported=>"false", :SupportsMemHotAdd=>"true", :cimOsId=>"94", :CimVersion=>"0", :SupportedForCreate=>"true"}, {:OperatingSystemId=>"47", :DefaultHardDiskAdapterType=>"3", :MinimumHardDiskSizeGigabytes=>"8", :MinimumMemoryMegabytes=>"64", :Name=>"Ubuntu Linux (32-bit)", :InternalName=>"ubuntuGuest", :Supported=>"true", :x64=>"false", :MaximumCpuCount=>"64", :MinimumHardwareVersion=>"4", :PersonalizationEnabled=>"true", :PersonalizationAuto=>"true", :SysprepPackagingSupported=>"false", :SupportsMemHotAdd=>"true", :cimOsId=>"93", :CimVersion=>"0", :SupportedForCreate=>"true"}, {:OperatingSystemId=>"50", :DefaultHardDiskAdapterType=>"3", :MinimumHardDiskSizeGigabytes=>"8", :MinimumMemoryMegabytes=>"32", :Name=>"Other 2.6.x Linux (64-bit)", :InternalName=>"other26xLinux64Guest", :Supported=>"true", :x64=>"true", :MaximumCpuCount=>"64", :MinimumHardwareVersion=>"7", :PersonalizationEnabled=>"true", :PersonalizationAuto=>"true", :SysprepPackagingSupported=>"false", :SupportsMemHotAdd=>"true", :cimOsId=>"100", :CimVersion=>"0", :SupportedForCreate=>"true"}, {:OperatingSystemId=>"49", :DefaultHardDiskAdapterType=>"3", :MinimumHardDiskSizeGigabytes=>"8", :MinimumMemoryMegabytes=>"32", :Name=>"Other 2.6.x Linux (32-bit)", :InternalName=>"other26xLinuxGuest", :Supported=>"true", :x64=>"false", :MaximumCpuCount=>"64", :MinimumHardwareVersion=>"7", :PersonalizationEnabled=>"true", :PersonalizationAuto=>"true", :SysprepPackagingSupported=>"false", :SupportsMemHotAdd=>"true", :cimOsId=>"99", :CimVersion=>"0", :SupportedForCreate=>"true"}, {:OperatingSystemId=>"54", :DefaultHardDiskAdapterType=>"3", :MinimumHardDiskSizeGigabytes=>"8", :MinimumMemoryMegabytes=>"32", :Name=>"Other Linux (64-bit)", :InternalName=>"otherLinux64Guest", :Supported=>"true", :x64=>"true", :MaximumCpuCount=>"64", :MinimumHardwareVersion=>"4", :PersonalizationEnabled=>"true", :PersonalizationAuto=>"true", :SysprepPackagingSupported=>"false", :SupportsMemHotAdd=>"false", :cimOsId=>"101", :CimVersion=>"0", :SupportedForCreate=>"true"}, {:OperatingSystemId=>"53", :DefaultHardDiskAdapterType=>"3", :MinimumHardDiskSizeGigabytes=>"8", :MinimumMemoryMegabytes=>"32", :Name=>"Other Linux (32-bit)", :InternalName=>"otherLinuxGuest", :Supported=>"true", :x64=>"false", :MaximumCpuCount=>"64", :MinimumHardwareVersion=>"4", :PersonalizationEnabled=>"true", :PersonalizationAuto=>"true", :SysprepPackagingSupported=>"false", :SupportsMemHotAdd=>"false", :cimOsId=>"36", :CimVersion=>"0", :SupportedForCreate=>"true"}]}, {:Name=>"Other", :OperatingSystemFamilyId=>"3", :OperatingSystem=> [{:OperatingSystemId=>"68", :DefaultHardDiskAdapterType=>"3", :MinimumHardDiskSizeGigabytes=>"8", :MinimumMemoryMegabytes=>"32", :Name=>"Other (64-bit)", :InternalName=>"otherGuest64", :Supported=>"true", :x64=>"true", :MaximumCpuCount=>"64", :MinimumHardwareVersion=>"4", :PersonalizationEnabled=>"false", :PersonalizationAuto=>"false", :SysprepPackagingSupported=>"false", :SupportsMemHotAdd=>"true", :cimOsId=>"102", :CimVersion=>"0", :SupportedForCreate=>"true"}, {:OperatingSystemId=>"67", :DefaultHardDiskAdapterType=>"3", :MinimumHardDiskSizeGigabytes=>"8", :MinimumMemoryMegabytes=>"32", :Name=>"Other (32-bit)", :InternalName=>"otherGuest", :Supported=>"true", :x64=>"false", :MaximumCpuCount=>"64", :MinimumHardwareVersion=>"4", :PersonalizationEnabled=>"false", :PersonalizationAuto=>"false", :SysprepPackagingSupported=>"false", :SupportsMemHotAdd=>"true", :cimOsId=>"1", :CimVersion=>"0", :SupportedForCreate=>"true"}]}]} Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
get_supported_versions()
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_supported_versions.rb, line 24 def get_supported_versions body = {:xmlns=>"http://www.vmware.com/vcloud/versions", :xmlns_xsi=>xmlns_xsi, :xsi_schemaLocation=>xsi_schema_location, :VersionInfo=> [{:Version=>"1.5", :LoginUrl=>make_href("sessions"), :MediaTypeMapping=> [{:MediaType=> "application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml", :ComplexTypeName=>"InstantiateVAppTemplateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwProviderVdcReferences+xml", :ComplexTypeName=>"VMWProviderVdcReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.customizationSection+xml", :ComplexTypeName=>"CustomizationSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.prepareHostParams+xml", :ComplexTypeName=>"PrepareHostParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.relocateVmParams+xml", :ComplexTypeName=>"RelocateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.org+xml", :ComplexTypeName=>"OrgType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.vmwExternalNetworkReferences+xml", :ComplexTypeName=>"VMWExternalNetworkReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.vcloud.networkConnectionSection+xml", :ComplexTypeName=>"NetworkConnectionSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.host+xml", :ComplexTypeName=>"HostType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.catalogItem+xml", :ComplexTypeName=>"CatalogItemType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.owner+xml", :ComplexTypeName=>"OwnerType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vdc+xml", :ComplexTypeName=>"VdcType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vdc+xml", :ComplexTypeName=>"AdminVdcType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.catalog+xml", :ComplexTypeName=>"AdminCatalogType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.recomposeVAppParams+xml", :ComplexTypeName=>"RecomposeVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.importVmIntoExistingVAppParams+xml", :ComplexTypeName=>"ImportVmIntoExistingVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.taskExtensionRequestUpdateProgressOperationParams+xml", :ComplexTypeName=>"TaskExtensionRequestUpdateProgressParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.catalog+xml", :ComplexTypeName=>"CatalogType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.cloneVAppTemplateParams+xml", :ComplexTypeName=>"CloneVAppTemplateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.providervdc+xml", :ComplexTypeName=>"ProviderVdcType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmsObjectRefsList+xml", :ComplexTypeName=>"VmObjectRefsListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.undeployVAppParams+xml", :ComplexTypeName=>"UndeployVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vdcReferences+xml", :ComplexTypeName=>"VdcReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.systemPasswordPolicySettings+xml", :ComplexTypeName=>"SystemPasswordPolicySettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vApp+xml", :ComplexTypeName=>"VAppType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.taskExtensionRequest+xml", :ComplexTypeName=>"TaskExtensionRequestType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vimServerNetworks+xml", :ComplexTypeName=>"VimObjectRefListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwprovidervdc+xml", :ComplexTypeName=>"VMWProviderVdcType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.orgSettings+xml", :ComplexTypeName=>"OrgSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.captureVAppParams+xml", :ComplexTypeName=>"CaptureVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.screenTicket+xml", :ComplexTypeName=>"ScreenTicketType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.runtimeInfoSection+xml", :ComplexTypeName=>"RuntimeInfoSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.tasksList+xml", :ComplexTypeName=>"TasksListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.amqpSettingsTest+xml", :ComplexTypeName=>"AmqpSettingsTestType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.extensionSettings+xml", :ComplexTypeName=>"TaskExtensionSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.importVmAsVAppTemplateParams+xml", :ComplexTypeName=>"ImportVmAsVAppTemplateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.organizationGeneralSettings+xml", :ComplexTypeName=>"OrgGeneralSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.registerVimServerParams+xml", :ComplexTypeName=>"RegisterVimServerParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.network+xml", :ComplexTypeName=>"OrgNetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml", :ComplexTypeName=>"UploadVAppTemplateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.datastore+xml", :ComplexTypeName=>"DatastoreType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.metadata+xml", :ComplexTypeName=>"MetadataType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.licensingReportList+xml", :ComplexTypeName=>"LicensingReportListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwNetworkPool+xml", :ComplexTypeName=>"VMWNetworkPoolType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.systemSettings+xml", :ComplexTypeName=>"SystemSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwHostReferences+xml", :ComplexTypeName=>"VMWHostReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.taskExtensionRequestOperationParams+xml", :ComplexTypeName=>"TaskExtensionRequestOperationParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.metadata.value+xml", :ComplexTypeName=>"MetadataValueType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.taskOperationList+xml", :ComplexTypeName=>"TaskOperationListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.media+xml", :ComplexTypeName=>"MediaType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.productSections+xml", :ComplexTypeName=>"ProductSectionListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.amqpSettings+xml", :ComplexTypeName=>"AmqpSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vAppTemplate+xml", :ComplexTypeName=>"VAppTemplateType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.deployVAppParams+xml", :ComplexTypeName=>"DeployVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.importVmIntoExistingVAppTemplateParams+xml", :ComplexTypeName=>"ImportVmIntoExistingVAppTemplateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.resourcePoolList+xml", :ComplexTypeName=>"ResourcePoolListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.networkConfigSection+xml", :ComplexTypeName=>"NetworkConfigSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.OrganizationVdcResourcePoolSet+xml", :ComplexTypeName=>"OrganizationResourcePoolSetType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.organizationPasswordPolicySettings+xml", :ComplexTypeName=>"OrgPasswordPolicySettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.publishCatalogParams+xml", :ComplexTypeName=>"PublishCatalogParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwExtension+xml", :ComplexTypeName=>"VMWExtensionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml", :ComplexTypeName=>"MediaInsertOrEjectParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vmPendingQuestion+xml", :ComplexTypeName=>"VmPendingQuestionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.notificationsSettings+xml", :ComplexTypeName=>"NotificationsSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.ldapUserSettings+xml", :ComplexTypeName=>"LdapUserAttributesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.right+xml", :ComplexTypeName=>"RightType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.ldapSettings+xml", :ComplexTypeName=>"LdapSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.organization+xml", :ComplexTypeName=>"AdminOrgType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.orgList+xml", :ComplexTypeName=>"OrgListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.vAppTemplateLeaseSettings+xml", :ComplexTypeName=>"OrgVAppTemplateLeaseSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwVimServerReferences+xml", :ComplexTypeName=>"VMWVimServerReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwexternalnet+xml", :ComplexTypeName=>"VMWExternalNetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.entity+xml", :ComplexTypeName=>"EntityType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.cloneMediaParams+xml", :ComplexTypeName=>"CloneMediaParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.licensingReport+xml", :ComplexTypeName=>"LicensingReportType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.importMediaParams+xml", :ComplexTypeName=>"ImportMediaParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.resourcePoolSetUpdateParams+xml", :ComplexTypeName=>"UpdateResourcePoolSetParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.taskExtensionRequestList+xml", :ComplexTypeName=>"ReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vmPendingAnswer+xml", :ComplexTypeName=>"VmQuestionAnswerType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.rasdItemsList+xml", :ComplexTypeName=>"RasdItemsListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.generalSettings+xml", :ComplexTypeName=>"GeneralSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwNetworkPoolReferences+xml", :ComplexTypeName=>"VMWNetworkPoolReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.group+xml", :ComplexTypeName=>"GroupType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.controlAccess+xml", :ComplexTypeName=>"ControlAccessParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.ldapGroupSettings+xml", :ComplexTypeName=>"LdapGroupAttributesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.user+xml", :ComplexTypeName=>"UserType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vcloud+xml", :ComplexTypeName=>"VCloudType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.uberAdminSettings+xml", :ComplexTypeName=>"UberAdminSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwvirtualcenter+xml", :ComplexTypeName=>"VimServerType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.leaseSettingsSection+xml", :ComplexTypeName=>"LeaseSettingsSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.composeVAppParams+xml", :ComplexTypeName=>"ComposeVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.organizationEmailSettings+xml", :ComplexTypeName=>"OrgEmailSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vm+xml", :ComplexTypeName=>"VmType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.vmwProviderVdcResourcePoolSet+xml", :ComplexTypeName=>"VMWProviderVdcResourcePoolSetType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.cloneVAppParams+xml", :ComplexTypeName=>"CloneVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.vcloud.guestCustomizationSection+xml", :ComplexTypeName=>"GuestCustomizationSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.task+xml", :ComplexTypeName=>"TaskType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.session+xml", :ComplexTypeName=>"SessionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vAppLeaseSettings+xml", :ComplexTypeName=>"OrgLeaseSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.importVmAsVAppParams+xml", :ComplexTypeName=>"ImportVmAsVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.role+xml", :ComplexTypeName=>"RoleType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.rasdItem+xml", :ComplexTypeName=>"RASD_Type", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.startupSection+xml", :ComplexTypeName=>"StartupSection_Type", :SchemaLocation=> "http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.virtualHardwareSection+xml", :ComplexTypeName=>"VirtualHardwareSection_Type", :SchemaLocation=> "http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.operatingSystemSection+xml", :ComplexTypeName=>"OperatingSystemSection_Type", :SchemaLocation=> "http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.networkSection+xml", :ComplexTypeName=>"NetworkSection_Type", :SchemaLocation=> "http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vAppNetwork+xml", :ComplexTypeName=>"VAppNetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.network+xml", :ComplexTypeName=>"NetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.orgNetwork+xml", :ComplexTypeName=>"OrgNetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwexternalnet+xml", :ComplexTypeName=>"VMWExternalNetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}]}, {:Version=>"5.1", :LoginUrl=>make_href("sessions"), :MediaTypeMapping=> [{:MediaType=> "application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml", :ComplexTypeName=>"InstantiateVAppTemplateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwprovidervdc+xml", :ComplexTypeName=>"MergeParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.organizationFederationSettings+xml", :ComplexTypeName=>"OrgFederationSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.emailSettings+xml", :ComplexTypeName=>"EmailSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.prepareHostParams+xml", :ComplexTypeName=>"PrepareHostParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.org+xml", :ComplexTypeName=>"OrgType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.aclRule+xml", :ComplexTypeName=>"AclRuleType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.organizationLdapSettings+xml", :ComplexTypeName=>"OrgLdapSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.vcloud.networkConnectionSection+xml", :ComplexTypeName=>"NetworkConnectionSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.owner+xml", :ComplexTypeName=>"OwnerType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vdc+xml", :ComplexTypeName=>"AdminVdcType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.importVmIntoExistingVAppParams+xml", :ComplexTypeName=>"ImportVmIntoExistingVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.catalog+xml", :ComplexTypeName=>"CatalogType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.cloneVAppTemplateParams+xml", :ComplexTypeName=>"CloneVAppTemplateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.createVdcParams+xml", :ComplexTypeName=>"CreateVdcParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmsObjectRefsList+xml", :ComplexTypeName=>"VmObjectRefsListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.undeployVAppParams+xml", :ComplexTypeName=>"UndeployVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.createSnapshotParams+xml", :ComplexTypeName=>"CreateSnapshotParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.blockingTask+xml", :ComplexTypeName=>"BlockingTaskType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwPvdcStorageProfile+xml", :ComplexTypeName=>"VMWProviderVdcStorageProfileType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.allocatedNetworkAddress+xml", :ComplexTypeName=>"AllocatedIpAddressesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vimServerNetworks+xml", :ComplexTypeName=>"VimObjectRefListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.blockingTaskOperationParams+xml", :ComplexTypeName=>"BlockingTaskOperationParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.updateProviderVdcStorageProfiles+xml", :ComplexTypeName=>"UpdateProviderVdcStorageProfilesParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.bundleUploadSocket+xml", :ComplexTypeName=>"BundleUploadSocketType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.gateway+xml", :ComplexTypeName=>"GatewayType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.screenTicket+xml", :ComplexTypeName=>"ScreenTicketType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.resourceClassAction+xml", :ComplexTypeName=>"ResourceClassActionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.event+xml", :ComplexTypeName=>"EventType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.tasksList+xml", :ComplexTypeName=>"TasksListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.migrateVmParams+xml", :ComplexTypeName=>"MigrateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.diskCreateParams+xml", :ComplexTypeName=>"DiskCreateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.registerVAppParams+xml", :ComplexTypeName=>"RegisterVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.organizationGeneralSettings+xml", :ComplexTypeName=>"OrgGeneralSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.registerVimServerParams+xml", :ComplexTypeName=>"RegisterVimServerParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.datastore+xml", :ComplexTypeName=>"DatastoreType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.vcloud.diskAttachOrDetachParams+xml", :ComplexTypeName=>"DiskAttachOrDetachParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.updateRightsParams+xml", :ComplexTypeName=>"UpdateRightsParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.metadata+xml", :ComplexTypeName=>"MetadataType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vdcStorageProfile+xml", :ComplexTypeName=>"AdminVdcStorageProfileType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.systemSettings+xml", :ComplexTypeName=>"SystemSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwHostReferences+xml", :ComplexTypeName=>"VMWHostReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.userEntityRights+xml", :ComplexTypeName=>"UserEntityRightsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.metadata.value+xml", :ComplexTypeName=>"MetadataValueType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.media+xml", :ComplexTypeName=>"MediaType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.brandingSettings+xml", :ComplexTypeName=>"BrandingSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.updateVdcStorageProfiles+xml", :ComplexTypeName=>"UpdateVdcStorageProfilesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.amqpSettings+xml", :ComplexTypeName=>"AmqpSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.resourceClass+xml", :ComplexTypeName=>"ResourceClassType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.deployVAppParams+xml", :ComplexTypeName=>"DeployVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.resourcePoolList+xml", :ComplexTypeName=>"ResourcePoolListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vdcStorageProfile+xml", :ComplexTypeName=>"VdcStorageProfileType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.networkConfigSection+xml", :ComplexTypeName=>"NetworkConfigSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.OrganizationVdcResourcePoolSet+xml", :ComplexTypeName=>"OrganizationResourcePoolSetType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.createProviderVdcParams+xml", :ComplexTypeName=>"VMWProviderVdcParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.publishCatalogParams+xml", :ComplexTypeName=>"PublishCatalogParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwExtension+xml", :ComplexTypeName=>"VMWExtensionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.notificationsSettings+xml", :ComplexTypeName=>"NotificationsSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.right+xml", :ComplexTypeName=>"RightType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.supportedSystemsInfo+xml", :ComplexTypeName=>"SupportedOperatingSystemsInfoType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vm.complianceResult+xml", :ComplexTypeName=>"ComplianceResultType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.orgList+xml", :ComplexTypeName=>"OrgListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwVimServerReferences+xml", :ComplexTypeName=>"VMWVimServerReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwexternalnet+xml", :ComplexTypeName=>"VMWExternalNetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.entity+xml", :ComplexTypeName=>"EntityType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.cloneMediaParams+xml", :ComplexTypeName=>"CloneMediaParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.licensingReport+xml", :ComplexTypeName=>"LicensingReportType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.apiDefinition+xml", :ComplexTypeName=>"ApiDefinitionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vshieldmanager+xml", :ComplexTypeName=>"ShieldManagerType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.blockingTaskList+xml", :ComplexTypeName=>"ReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vmPendingAnswer+xml", :ComplexTypeName=>"VmQuestionAnswerType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.rasdItemsList+xml", :ComplexTypeName=>"RasdItemsListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.generalSettings+xml", :ComplexTypeName=>"GeneralSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.group+xml", :ComplexTypeName=>"GroupType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.controlAccess+xml", :ComplexTypeName=>"ControlAccessParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.user+xml", :ComplexTypeName=>"UserType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwvirtualcenter+xml", :ComplexTypeName=>"VimServerType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.strandedItem+xml", :ComplexTypeName=>"StrandedItemType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.leaseSettingsSection+xml", :ComplexTypeName=>"LeaseSettingsSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.organizationEmailSettings+xml", :ComplexTypeName=>"OrgEmailSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.cloneVAppParams+xml", :ComplexTypeName=>"CloneVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.task+xml", :ComplexTypeName=>"TaskType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vAppLeaseSettings+xml", :ComplexTypeName=>"OrgLeaseSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.role+xml", :ComplexTypeName=>"RoleType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwProviderVdcReferences+xml", :ComplexTypeName=>"VMWProviderVdcReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.customizationSection+xml", :ComplexTypeName=>"CustomizationSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.service+xml", :ComplexTypeName=>"ServiceType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.relocateVmParams+xml", :ComplexTypeName=>"RelocateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.rights+xml", :ComplexTypeName=>"RightRefsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.vmwExternalNetworkReferences+xml", :ComplexTypeName=>"VMWExternalNetworkReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.disk+xml", :ComplexTypeName=>"DiskType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.kerberosSettings+xml", :ComplexTypeName=>"KerberosSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.operationLimitsSettings+xml", :ComplexTypeName=>"OrgOperationLimitsSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.host+xml", :ComplexTypeName=>"HostType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.catalogItem+xml", :ComplexTypeName=>"CatalogItemType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.entityReferences+xml", :ComplexTypeName=>"EntityReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vdc+xml", :ComplexTypeName=>"VdcType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.catalog+xml", :ComplexTypeName=>"AdminCatalogType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.recomposeVAppParams+xml", :ComplexTypeName=>"RecomposeVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.orgVdcNetwork+xml", :ComplexTypeName=>"OrgVdcNetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.providervdc+xml", :ComplexTypeName=>"ProviderVdcType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.blockingTaskUpdateProgressOperationParams+xml", :ComplexTypeName=>"BlockingTaskUpdateProgressParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vdcReferences+xml", :ComplexTypeName=>"VdcReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.systemPasswordPolicySettings+xml", :ComplexTypeName=>"SystemPasswordPolicySettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vApp+xml", :ComplexTypeName=>"VAppType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwprovidervdc+xml", :ComplexTypeName=>"VMWProviderVdcType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vms+xml", :ComplexTypeName=>"VmsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.orgSettings+xml", :ComplexTypeName=>"OrgSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.apiFilter+xml", :ComplexTypeName=>"ApiFilterType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.captureVAppParams+xml", :ComplexTypeName=>"CaptureVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vmCapabilitiesSection+xml", :ComplexTypeName=>"VmCapabilitiesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.runtimeInfoSection+xml", :ComplexTypeName=>"RuntimeInfoSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.amqpSettingsTest+xml", :ComplexTypeName=>"AmqpSettingsTestType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.importVmAsVAppTemplateParams+xml", :ComplexTypeName=>"ImportVmAsVAppTemplateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.guestPersonalizationSettings+xml", :ComplexTypeName=>"OrgGuestPersonalizationSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.orgNetwork+xml", :ComplexTypeName=>"OrgNetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.fileDescriptor+xml", :ComplexTypeName=>"FileDescriptorType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml", :ComplexTypeName=>"UploadVAppTemplateParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.licensingReportList+xml", :ComplexTypeName=>"LicensingReportListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwNetworkPool+xml", :ComplexTypeName=>"VMWNetworkPoolType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.taskOperationList+xml", :ComplexTypeName=>"TaskOperationListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vSphereWebClientUrl+xml", :ComplexTypeName=>"VSphereWebClientUrlType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.productSections+xml", :ComplexTypeName=>"ProductSectionListType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.blockingTaskSettings+xml", :ComplexTypeName=>"BlockingTaskSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vAppTemplate+xml", :ComplexTypeName=>"VAppTemplateType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.organizationPasswordPolicySettings+xml", :ComplexTypeName=>"OrgPasswordPolicySettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.vcloud.mediaInsertOrEjectParams+xml", :ComplexTypeName=>"MediaInsertOrEjectParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vmPendingQuestion+xml", :ComplexTypeName=>"VmPendingQuestionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.organization+xml", :ComplexTypeName=>"AdminOrgType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.ldapSettings+xml", :ComplexTypeName=>"LdapSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.snapshotSection+xml", :ComplexTypeName=>"SnapshotSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.vAppTemplateLeaseSettings+xml", :ComplexTypeName=>"OrgVAppTemplateLeaseSettingsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.importMediaParams+xml", :ComplexTypeName=>"ImportMediaParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=> "application/vnd.vmware.admin.resourcePoolSetUpdateParams+xml", :ComplexTypeName=>"UpdateResourcePoolSetParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.licenseSettings+xml", :ComplexTypeName=>"LicenseType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.bundleUploadParams+xml", :ComplexTypeName=>"BundleUploadParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwNetworkPoolReferences+xml", :ComplexTypeName=>"VMWNetworkPoolReferencesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vcloud+xml", :ComplexTypeName=>"VCloudType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.serviceResource+xml", :ComplexTypeName=>"ServiceResourceType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.composeVAppParams+xml", :ComplexTypeName=>"ComposeVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.admin.vmwProviderVdcResourcePool+xml", :ComplexTypeName=>"VMWProviderVdcResourcePoolSetType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vm+xml", :ComplexTypeName=>"VmType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=> "application/vnd.vmware.vcloud.guestCustomizationSection+xml", :ComplexTypeName=>"GuestCustomizationSectionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.session+xml", :ComplexTypeName=>"SessionType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.pvdcStorageProfile+xml", :ComplexTypeName=>"ProviderVdcStorageProfileType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwStorageProfiles+xml", :ComplexTypeName=>"VMWStorageProfilesType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.importVmAsVAppParams+xml", :ComplexTypeName=>"ImportVmAsVAppParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.admin.serviceLink+xml", :ComplexTypeName=>"ServiceLinkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.enableDownloadParams+xml", :ComplexTypeName=>"EnableDownloadParamsType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.rasdItem+xml", :ComplexTypeName=>"RASD_Type", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.startupSection+xml", :ComplexTypeName=>"StartupSection_Type", :SchemaLocation=> "http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.virtualHardwareSection+xml", :ComplexTypeName=>"VirtualHardwareSection_Type", :SchemaLocation=> "http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.operatingSystemSection+xml", :ComplexTypeName=>"OperatingSystemSection_Type", :SchemaLocation=> "http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.networkSection+xml", :ComplexTypeName=>"NetworkSection_Type", :SchemaLocation=> "http://schemas.dmtf.org/ovf/envelope/1/dsp8023_1.1.0.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.vAppNetwork+xml", :ComplexTypeName=>"VAppNetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.network+xml", :ComplexTypeName=>"NetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.vcloud.orgNetwork+xml", :ComplexTypeName=>"OrgNetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/master.xsd"}, {:MediaType=>"application/vnd.vmware.admin.vmwexternalnet+xml", :ComplexTypeName=>"VMWExternalNetworkType", :SchemaLocation=> "http://#{@host}#{@path}/v1.5/schema/vmwextensions.xsd"}]}]} Excon::Response.new( :body => body, :headers => {'Content-Type' => 'text/xml'}, :status => 200 ) end
get_task(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_task.rb, line 98 def get_task(id) unless data[:tasks][id] raise Fog::Compute::VcloudDirector::Forbidden.new( 'This operation is denied.' ) end body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location }.merge(task_body(id)) Excon::Response.new( :status => 200, :headers => {'Type' => "application/#{body[:type]};version=#{api_version}"}, :body => body ) end
get_task_list(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_task_list.rb, line 104 def get_task_list(id) unless id == data[:org][:uuid] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"com.vmware.vcloud.entity.org:#{id}\"." ) end body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location, :href => make_href("tasksList/#{id}"), :type => "application/vnd.vmware.vcloud.tasksList+xml", :name => "Tasks Lists", :Task => data[:tasks].keys.map {|task_id| task_body(task_id)} } Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
get_vcloud()
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_vcloud.rb, line 50 def get_vcloud body = {:href=>make_href('admin/'), :type=>"application/vnd.vmware.admin.vcloud+xml", :name=>'VMware vCloud Director', :Description=>'5.1.2.1377223 Tue Oct 15 20:56:05 GMT 2013', :Tasks=>{:Task=>[]}, :OrganizationReferences=> {:OrganizationReference=> [{:type=>"application/vnd.vmware.admin.organization+xml", :name=>data[:org][:name], :href=>make_href("api/admin/org/#{data[:org][:uuid]}")}]}, :ProviderVdcReferences=>{:ProviderVdcReference=>[]}, :RightReferences=>{:RightReference=>[]}, :RoleReferences=>{:RoleReference=>[]}, :Networks=>{:Network=>[]}} Excon::Response.new( :body => body, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :status => 200 ) end
get_vdc(vdc_id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_vdc.rb, line 31 def get_vdc(vdc_id) response = Excon::Response.new unless vdc = data[:vdcs][vdc_id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"com.vmware.vcloud.entity.vdc:#{vdc_id}\"." ) end body = {:xmlns=>xmlns, :xmlns_xsi=>xmlns_xsi, :status=>"1", :name=>vdc[:name], :id=>"urn:vcloud:vdc:#{vdc_id}", :type=>"application/vnd.vmware.vcloud.vdc+xml", :href=>make_href("vdc/#{vdc_id}"), :xsi_schemaLocation=>xsi_schema_location, :Link=> [{:rel=>"up", :type=>"application/vnd.vmware.vcloud.org+xml", :href=>make_href("org/#{data[:org][:uuid]}")}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.metadata+xml", :href=>make_href("vdc/#{vdc_id}/metadata")}, {:rel=>"add", :type=>"application/vnd.vmware.vcloud.uploadVAppTemplateParams+xml", :href=> make_href("vdc/#{vdc_id}/action/uploadVAppTemplate")}, {:rel=>"add", :type=>"application/vnd.vmware.vcloud.media+xml", :href=>make_href("vdc/#{vdc_id}/media")}, {:rel=>"add", :type=> "application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml", :href=> make_href("vdc/#{vdc_id}/action/instantiateVAppTemplate")}, {:rel=>"add", :type=>"application/vnd.vmware.vcloud.cloneVAppParams+xml", :href=>make_href("vdc/#{vdc_id}/action/cloneVApp")}, {:rel=>"add", :type=>"application/vnd.vmware.vcloud.cloneVAppTemplateParams+xml", :href=> make_href("vdc/#{vdc_id}/action/cloneVAppTemplate")}, {:rel=>"add", :type=>"application/vnd.vmware.vcloud.cloneMediaParams+xml", :href=>make_href("vdc/#{vdc_id}/action/cloneMedia")}, {:rel=>"add", :type=>"application/vnd.vmware.vcloud.captureVAppParams+xml", :href=>make_href("vdc/#{vdc_id}/action/captureVApp")}, {:rel=>"add", :type=>"application/vnd.vmware.vcloud.composeVAppParams+xml", :href=>make_href("vdc/#{vdc_id}/action/composeVApp")}, {:rel=>"add", :type=>"application/vnd.vmware.vcloud.diskCreateParams+xml", :href=>make_href("vdc/#{vdc_id}/disk")}, {:rel=>"edgeGateways", :type=>"application/vnd.vmware.vcloud.query.records+xml", :href=>make_href("admin/vdc/#{vdc_id}/edgeGateways")}, {:rel=>"add", :type=>"application/vnd.vmware.vcloud.orgVdcNetwork+xml", :href=>make_href("admin/vdc/#{vdc_id}/networks")}, {:rel=>"orgVdcNetworks", :type=>"application/vnd.vmware.vcloud.query.records+xml", :href=>make_href("admin/vdc/#{vdc_id}/networks")}], :Description=>vdc[:description]||'', :AllocationModel=>"AllocationVApp", :ComputeCapacity=> {:Cpu=> {:Units=>"MHz", :Allocated=>"0", :Limit=>"0", :Reserved=>"0", :Used=>"0", :Overhead=>"0"}, :Memory=> {:Units=>"MB", :Allocated=>"0", :Limit=>"0", :Reserved=>"0", :Used=>"0", :Overhead=>"0"}}, :ResourceEntities => {}, :AvailableNetworks => {}, :Capabilities=> {:SupportedHardwareVersions=> {:SupportedHardwareVersion=>"vmx-08"}}, :NicQuota=>"0", :NetworkQuota=>"20", :UsedNetworkCount=>"0", :VmQuota=>"100", :IsEnabled=>"true"} body[:ResourceEntities][:ResourceEntity] = data[:catalog_items].map do |id, item| {:type=>"application/vnd.vmware.vcloud.#{item[:type]}+xml", :name=>item[:name], :href=>make_href("#{item[:type]}/#{item[:type]}-#{id}")} end body[:AvailableNetworks][:Network] = data[:networks].map do |id, network| {:type=>"application/vnd.vmware.vcloud.network+xml", :name=>network[:name], :href=>make_href("network/#{id}")} end if api_version.to_f >= 5.1 body[:VdcStorageProfiles] = {} body[:VdcStorageProfiles][:VdcStorageProfile] = data[:vdc_storage_classes].select do |id, storage_class| storage_class[:vdc] == vdc_id end.map do |id, storage_class| {:type => 'application/vnd.vmware.vcloud.vdcStorageProfile+xml', :name => storage_class[:name], :href => make_href("vdcStorageProfile/#{id}")} end end response.status = 200 response.headers = {'Content-Type' => "#{body[:type]};version=#{api_version}"} response.body = body response end
get_vdc_storage_class(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_vdc_storage_class.rb, line 47 def get_vdc_storage_class(id) unless vdc_storage_class = data[:vdc_storage_classes][id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.vdcstorageProfile:#{id})\"." ) end body = {:xmlns=>xmlns, :xmlns_xsi=>xmlns_xsi, :name=>vdc_storage_class[:name], :id=>"urn:vcloud:vdcstorageProfile:#{id}", :type=>"application/vnd.vmware.vcloud.vdcStorageProfile+xml", :href=>make_href("api/vdcStorageProfile/#{id}"), :xsi_schemaLocation=>xsi_schema_location, :Link=> [{:rel=>"up", :type=>"application/vnd.vmware.vcloud.vdc+xml", :href=>make_href("vdc/#{vdc_storage_class[:vdc]}")}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.metadata+xml", :href=>make_href("vdcStorageProfile/#{id}/metadata")}], :Enabled=>vdc_storage_class[:enabled].to_s, :Units=>vdc_storage_class[:units], :Limit=>vdc_storage_class[:limit].to_s, :Default=>vdc_storage_class[:default].to_s} Excon::Response.new( :status => 200, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
get_vms_disk_attached_to(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_vms_disk_attached_to.rb, line 27 def get_vms_disk_attached_to(id) unless data[:disks][id] raise Fog::Compute::VcloudDirector::Forbidden.new( 'No access to entity "com.vmware.vcloud.entity.disk:%s".' % id ) end Fog::Mock.not_implemented end
post_cancel_task(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/post_cancel_task.rb, line 25 def post_cancel_task(id) unless task = data[:tasks][id] raise Fog::Compute::VcloudDirector::Forbidden.new( 'No access to entity "com.vmware.vcloud.entity.task:%s"' % id ) end # @note Tasks don't actually get cancelled (confirmed VCloud Director # bug) so we'll emulate that. Set the flag and we're done! task[:cancel_requested] = true Excon::Response.new( :status => 204 ) end
post_clone_media(vdc_id, source_id, options={})
click to toggle source
# File lib/fog/vcloud_director/requests/compute/post_clone_media.rb, line 53 def post_clone_media(vdc_id, source_id, options={}) # TODO: check this happens. unless source_media = data[:medias][source_id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.media:#{source_id})\"." ) end unless data[:vdcs][vdc_id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.vdc:#{vdc_id})\"." ) end media_id = uuid media_name = "#{source_media[:name]}-copy-#{uuid}" owner = { :href => make_href("media/#{media_id}"), :type => 'application/vnd.vmware.vcloud.media+xml' } task_id = enqueue_task( "Copy Media File #{media_name}(#{media_id})", 'vdcCopyMedia', owner, :on_success => lambda do data[:medias][media_id][:status] = 1 end ) media = source_media.dup.merge( :name => media_name, :status => 0, :tasks => [task_id] ) data[:medias][media_id] = media body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location }.merge(media_body(media_id)) Excon::Response.new( :status => 201, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
post_configure_edge_gateway_services(id, configuration)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/post_configure_edge_gateway_services.rb, line 37 def post_configure_edge_gateway_services(id, configuration) unless data[:edge_gateways][id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.edgegateway:#{id})\"." ) end owner = {:href => '', :name => nil, :type => nil} #known-bug: admin-api does not return owner. task_id = enqueue_task( "Configuring edgegateway(#{id})", 'networkConfigureEdgeGatewayServices', owner, :on_success => lambda do data[:edge_gateways][id][:Configuration][:EdgeGatewayServiceConfiguration] = configuration end ) body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location, }.merge(task_body(task_id)) Excon::Response.new( :status => 202, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
post_create_org_vdc_network(vdc_id, name, options={})
click to toggle source
# File lib/fog/vcloud_director/requests/compute/post_create_org_vdc_network.rb, line 68 def post_create_org_vdc_network(vdc_id, name, options={}) unless data[:vdcs][vdc_id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.vdc:#{vdc_id})\"." ) end type = 'network' id = uuid # Description # Configuration # IpScopes # IpScope # IsInherited # Gateway # Netmask # Dns1 # Dns2 # DnsSuffix # IsEnabled # IpRanges # IpRange # StartAddress # EndAddress # FenceMode # EdgeGateway # IsShared network_body = { :name => name, :vdc => vdc_id, } [:Description, :IsShared].each do |key| network_body[key] = options[key] if options.key?(key) end if options.key?(:EdgeGateway) network_body[:EdgeGateway] = options[:EdgeGateway][:href].split('/').last end if configuration = options[:Configuration] if ip_scopes = configuration[:IpScopes] if ip_scope = ip_scopes[:IpScope] [:IsInherited, :Gateway, :Netmask, :Dns1, :Dns2, :DnsSuffix, :IsEnabled].each do |key| network_body[key] = ip_scope[key] if ip_scope.key?(key) end if ip_ranges = ip_scope[:IpRanges] network_body[:IpRanges] = [] ip_ranges.each do |ipr| network_body[:IpRanges] << { :StartAddress => ipr[:IpRange][:StartAddress], :EndAddress => ipr[:IpRange][:EndAddress] } end end end end network_body[:FenceMode] = configuration[:FenceMode] if ip_scope.key?(:FenceMode) end owner = { :href => make_href("#{type}/#{id}"), :type => "application/vnd.vmware.vcloud.#{type}+xml" } task_id = enqueue_task( "Adding #{type} #{name} (#{id})", 'CreateOrgVdcNetwork', owner, :on_success => lambda do data[:networks][id] = network_body end ) body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location, :href => make_href("admin/network/#{id}"), :name => name, :id => "urn:vcloud:network:#{id}", :type => "application/vnd.vmware.vcloud.orgVdcNetwork+xml", :Link => [ {:rel=>"up", :type=>"application/vnd.vmware.vcloud.vdc+xml", :href=>make_href("vdc/#{vdc_id}")}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.metadata+xml", :href=>make_href("admin/network/#{id}/metadata")}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.allocatedNetworkAddress+xml", :href=>make_href("admin/network/#{id}/allocatedAddresses/")}, ], }.merge(options) body[:Tasks] = { :Task => task_body(task_id) } Excon::Response.new( :status => 201, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
post_upload_disk(id, name, size, options={})
click to toggle source
# File lib/fog/vcloud_director/requests/compute/post_upload_disk.rb, line 82 def post_upload_disk(id, name, size, options={}) unless size.to_s =~ /^\d+$/ raise Fog::Compute::VcloudDirector::BadRequest.new( "validation error on field 'diskSpec.sizeBytes': must be greater than or equal to 0" ) end unless data[:vdcs][id] raise Fog::Compute::VcloudDirector::Forbidden.new( 'No access to entity "(com.vmware.vcloud.entity.vdc:%s)".' % id ) end disk_id = uuid owner = { :href => make_href("disk/#{disk_id}"), :type => 'application/vnd.vmware.vcloud.disk+xml' } task_id = enqueue_task( "Creating Disk #{name}(#{disk_id})", 'vdcCreateDisk', owner, :on_success => lambda do data[:disks][disk_id][:status] = 1 end ) disk = { :description => options[:Description], :name => name, :size => size.to_i, :status => 0, :tasks => [task_id], :vdc_id => id, :vdc_storage_class => data[:vdc_storage_classes].find {|k,v| v[:default]}.first } data[:disks][disk_id] = disk body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location }.merge(disk_body(disk_id)) Excon::Response.new( :status => 201, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
post_upload_media(vdc_id, name, image_type, size, options={})
click to toggle source
# File lib/fog/vcloud_director/requests/compute/post_upload_media.rb, line 56 def post_upload_media(vdc_id, name, image_type, size, options={}) unless ['iso','floppy'].include?(image_type) raise Fog::Compute::VcloudDirector::BadRequest.new( 'The value of parameter imageType is incorrect.' ) end unless size.to_s =~ /^\d+$/ raise Fog::Compute::VcloudDirector::BadRequest.new( 'validation error on field \size\: must be greater than or equal to 0' ) end unless data[:vdcs][vdc_id] raise Fog::Compute::VcloudDirector::Forbidden.new( "No access to entity \"(com.vmware.vcloud.entity.vdc:#{vdc_id})\"." ) end media_id = uuid file_id = uuid owner = { :href => make_href("media/#{media_id}"), :type => 'application/vnd.vmware.vcloud.media+xml' } task_id = enqueue_task( "Importing Media File #{name}(#{file_id})", 'vdcUploadMedia', owner, :on_success => lambda do media = data[:medias][media_id] media[:file][:bytes_transferred] = media[:size] media[:status] = 1 end ) media = { :description => options[:Description], :file => { :bytes_transferred => 0, :uuid => file_id }, :image_type => image_type, :name => name, :size => size.to_i, :status => 0, :tasks => [task_id], :vdc_id => vdc_id, :vdc_storage_class => data[:vdc_storage_classes].find {|k,v| v[:default]}.first } data[:medias][media_id] = media body = { :xmlns => xmlns, :xmlns_xsi => xmlns_xsi, :xsi_schemaLocation => xsi_schema_location }.merge(media_body(media_id)) Excon::Response.new( :status => 201, :headers => {'Content-Type' => "#{body[:type]};version=#{api_version}"}, :body => body ) end
Private Instance Methods
all_types()
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_execute_query.rb, line 225 def all_types {:xmlns=>xmlns, :xmlns_xsi=>xmlns_xsi, :type=>"application/vnd.vmware.vcloud.query.queryList+xml", :href=>make_href('query'), :xsi_schemaLocation=>xsi_schema_location, :Link=> [{:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"organization", :href=>make_href('query?type=organization&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"organization", :href=>make_href('query?type=organization&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"organization", :href=>make_href('query?type=organization&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"orgVdc", :href=>make_href('query?type=orgVdc&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"orgVdc", :href=>make_href('query?type=orgVdc&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"orgVdc", :href=>make_href('query?type=orgVdc&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"media", :href=>make_href('query?type=media&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"media", :href=>make_href('query?type=media&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"media", :href=>make_href('query?type=media&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"vAppTemplate", :href=>make_href('query?type=vAppTemplate&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"vAppTemplate", :href=>make_href('query?type=vAppTemplate&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"vAppTemplate", :href=>make_href('query?type=vAppTemplate&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"vApp", :href=>make_href('query?type=vApp&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"vApp", :href=>make_href('query?type=vApp&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"vApp", :href=>make_href('query?type=vApp&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"vm", :href=>make_href('query?type=vm&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"vm", :href=>make_href('query?type=vm&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"vm", :href=>make_href('query?type=vm&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"orgNetwork", :href=>make_href('query?type=orgNetwork&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"orgNetwork", :href=>make_href('query?type=orgNetwork&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"orgNetwork", :href=>make_href('query?type=orgNetwork&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"vAppNetwork", :href=>make_href('query?type=vAppNetwork&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"vAppNetwork", :href=>make_href('query?type=vAppNetwork&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"vAppNetwork", :href=>make_href('query?type=vAppNetwork&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"catalog", :href=>make_href('query?type=catalog&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"catalog", :href=>make_href('query?type=catalog&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"catalog", :href=>make_href('query?type=catalog&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"group", :href=>make_href('query?type=group&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"group", :href=>make_href('query?type=group&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"group", :href=>make_href('query?type=group&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"user", :href=>make_href('query?type=user&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"user", :href=>make_href('query?type=user&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"user", :href=>make_href('query?type=user&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"strandedUser", :href=>make_href('query?type=strandedUser&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"strandedUser", :href=>make_href('query?type=strandedUser&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"strandedUser", :href=>make_href('query?type=strandedUser&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"role", :href=>make_href('query?type=role&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"role", :href=>make_href('query?type=role&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"role", :href=>make_href('query?type=role&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"allocatedExternalAddress", :href=>make_href('query?type=allocatedExternalAddress&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"allocatedExternalAddress", :href=>make_href('query?type=allocatedExternalAddress&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"event", :href=>make_href('query?type=event&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"event", :href=>make_href('query?type=event&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"right", :href=>make_href('query?type=right&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"right", :href=>make_href('query?type=right&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"right", :href=>make_href('query?type=right&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"vAppOrgNetworkRelation", :href=>make_href('query?type=vAppOrgNetworkRelation&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"vAppOrgNetworkRelation", :href=>make_href('query?type=vAppOrgNetworkRelation&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"vAppOrgNetworkRelation", :href=>make_href('query?type=vAppOrgNetworkRelation&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"catalogItem", :href=>make_href('query?type=catalogItem&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"catalogItem", :href=>make_href('query?type=catalogItem&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"catalogItem", :href=>make_href('query?type=catalogItem&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"task", :href=>make_href('query?type=task&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"task", :href=>make_href('query?type=task&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"task", :href=>make_href('query?type=task&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"disk", :href=>make_href('query?type=disk&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"disk", :href=>make_href('query?type=disk&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"disk", :href=>make_href('query?type=disk&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"vmDiskRelation", :href=>make_href('query?type=vmDiskRelation&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"vmDiskRelation", :href=>make_href('query?type=vmDiskRelation&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"service", :href=>make_href('query?type=service&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"service", :href=>make_href('query?type=service&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"service", :href=>make_href('query?type=service&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"orgVdcStorageProfile", :href=>make_href('query?type=orgVdcStorageProfile&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"orgVdcStorageProfile", :href=>make_href('query?type=orgVdcStorageProfile&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"orgVdcStorageProfile", :href=>make_href('query?type=orgVdcStorageProfile&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"apiDefinition", :href=>make_href('query?type=apiDefinition&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"apiDefinition", :href=>make_href('query?type=apiDefinition&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"apiDefinition", :href=>make_href('query?type=apiDefinition&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"fileDescriptor", :href=>make_href('query?type=fileDescriptor&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"fileDescriptor", :href=>make_href('query?type=fileDescriptor&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"edgeGateway", :href=>make_href('query?type=edgeGateway&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"edgeGateway", :href=>make_href('query?type=edgeGateway&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"edgeGateway", :href=>make_href('query?type=edgeGateway&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"orgVdcNetwork", :href=>make_href('query?type=orgVdcNetwork&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"orgVdcNetwork", :href=>make_href('query?type=orgVdcNetwork&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"orgVdcNetwork", :href=>make_href('query?type=orgVdcNetwork&format=idrecords')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.references+xml", :name=>"vAppOrgVdcNetworkRelation", :href=>make_href('query?type=vAppOrgVdcNetworkRelation&format=references')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.records+xml", :name=>"vAppOrgVdcNetworkRelation", :href=>make_href('query?type=vAppOrgVdcNetworkRelation&format=records')}, {:rel=>"down", :type=>"application/vnd.vmware.vcloud.query.idrecords+xml", :name=>"vAppOrgVdcNetworkRelation", :href=>make_href('query?type=vAppOrgVdcNetworkRelation&format=idrecords')} ] } end
disk_body(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_disk.rb, line 66 def disk_body(id) disk = data[:disks][id] storage_class_id = disk[:vdc_storage_class] body = { :href => make_href("disk/#{id}"), :type => 'application/vnd.vmware.vcloud.disk+xml', :id => "urn:vcloud:disk:#{id}", :name => disk[:name], :status => disk[:status].to_s, :busSubType => disk[:bus_sub_type], :busType => disk[:bus_type], :size => disk[:size].to_s, :Link => [ { :href => make_href("vdc/#{disk[:vdc_id]}"), :rel => 'up', :type => 'application/vnd.vmware.vcloud.vdc+xml' } ], :Description => disk[:description], :Tasks => { # FIXME: there's only one for now :Task => disk[:tasks].map {|task_id| task_body(task_id)}.first }, :Files => { :File => [] }, :StorageProfile => { :href => make_href("vdcStorageProfile/#{storage_class_id}"), :name => data[:vdc_storage_classes][storage_class_id][:name], :type => 'application/vnd.vmware.vcloud.vdcStorageProfile+xml', }, :Owner => { :type => 'application/vnd.vmware.vcloud.owner+xml', :User => { :href => make_href("admin/user/#{user_uuid}"), :name => user_name, :type => 'application/vnd.vmware.admin.user+xml', } } } if api_version.to_f >= 5.1 storage_class_id = disk[:vdc_storage_class] body[:VdcStorageProfile] = { :href => make_href("vdcStorageProfile/#{storage_class_id}"), :name => data[:vdc_storage_classes][storage_class_id][:name], :type => 'application/vnd.vmware.vcloud.vdcStorageProfile+xml', } end body end
fetch_items(type, opts)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_execute_query.rb, line 164 def fetch_items(type, opts) if opts.key?(:filter) && opts[:filter] =~ /^name==([^;,]+)$/ name = $1 elsif opts.key?(:filter) Fog::Mock.not_implemented("Complex filters are not yet implemented in get_execute_query Mock for #{type}: #{opts[:filter]}") end body = { :xmlns=>xmlns, :xmlns_xsi=>xmlns_xsi, :href=>make_href('query'), :name=>type, :type=>"application/vnd.vmware.vcloud.query.records+xml", :xsi_schemaLocation=>xsi_schema_location, } if type == 'orgVdcNetwork' record_type = :OrgVdcNetworkRecords data_type = :networks records = [] data[data_type].each do |id, dr| r = {} if name.nil? || dr[:name] == name vdc_id = dr[:vdc] if data[:vdcs][vdc_id] && data[:vdcs][vdc_id].key?(:name) r[:vdcName] = data[:vdcs][vdc_id][:name] end r[:name] = dr[:name] r[:vdc] = make_href("vdc/#{vdc_id}") if vdc_id r[:href] = make_href("admin/network/#{id}") mapping = { :description => :Description, :netmask => :Netmask, :linkType => :LinkType, :dns1 => :Dns1, :dns2 => :Dns2, :dnsSuffix => :DnsSuffix, :defaultGateway => :Gateway, :isShared => :IsShared, :isBusy => :IsBusy, :isIpScopeInherited => :IsIpScopeInherited, } mapping.each do |k,v| r[k] = dr[v] if dr.key?(v) end records << r end end body[:page] = 1.to_s # TODO: Support pagination body[:pageSize] = records.size.to_s # TODO: Support pagination body[:total] = records.size.to_s body[record_type] = records else Fog::Mock.not_implemented("No 'get by name' get_execute_query Mock for #{type} (#{name})") end body end
media_body(id)
click to toggle source
# File lib/fog/vcloud_director/requests/compute/get_media.rb, line 51 def media_body(id) media = data[:medias][id] body = { :size => media[:size].to_s, :imageType => media[:image_type], :status => media[:status].to_s, :name => media[:name], :id => "urn:vcloud:media:#{id}", :type => 'application/vnd.vmware.vcloud.media+xml', :href => make_href("media/#{id}"), :Link => { :href => make_href("vdc/#{media[:vdc_id]}"), :type => 'application/vnd.vmware.vcloud.vdc+xml', :rel => 'up' }, :Description => media[:description] || '', :Tasks => { # FIXME: there's only one for now :Task => media[:tasks].map {|task_id| task_body(task_id)}.first }, :Files => { :File => [] }, :Owner => { :type => 'application/vnd.vmware.vcloud.owner+xml', :User => { :href => make_href("admin/user/#{user_uuid}"), :name => user_uuid, :type => 'application/vnd.vmware.admin.user+xml', } } } if media[:status] == 0 body[:Files][:File] << { :size => media[:size].to_s, :bytesTransferred => media[:file][:bytes_transferred].to_s, :name => 'file', :Link=> { :href => make_href("transfer/#{media[:file][:uuid]}/file"), :rel => 'upload:default' } } end if api_version.to_f >= 5.1 storage_class_id = media[:vdc_storage_class] body[:VdcStorageProfile] = { :href => make_href("vdcStorageProfile/#{storage_class_id}"), :name => data[:vdc_storage_classes][storage_class_id][:name], :type => 'application/vnd.vmware.vcloud.vdcStorageProfile+xml', } end body end
task_body(id)
click to toggle source
@param [String] id Object identifier of the task. @return [Hash]
# File lib/fog/vcloud_director/requests/compute/get_task.rb, line 122 def task_body(id) task = data[:tasks][id] body = { :href => make_href("tasks/#{id}"), :type => 'application/vnd.vmware.vcloud.task+xml', :id => "urn:vcloud:tasl:#{id}", :name => task[:name], :cancelRequested => task[:cancel_requested].to_s, :expiryTime => task[:expiry_time].strftime('%Y-%m-%dT%H:%M:%S%z'), :operation => task[:operation], :operationName => task[:operation_name], :serviceNamespace => task[:service_namespace], :status => task[:status], :Link => [], :Owner => task[:owner], :User => { # for now, always the current user :href => make_href("admin/user/#{user_uuid}"), :name => user_name, :type => 'application/vnd.vmware.admin.user+xml', }, :Organization => { # for now, always the current org :href => make_href("org/#{data[:org][:uuid]}"), :name => data[:org][:name], :type => 'application/vnd.vmware.vcloud.org+xml', }, :Progress => task[:progress].to_s, :Details => task[:details] || '', } body[:endTime] = task[:end_time].strftime('%Y-%m-%dT%H:%M:%S%z') if task[:end_time] body[:startTime] = task[:start_time].strftime('%Y-%m-%dT%H:%M:%S%z') if task[:start_time] body[:Description] = task[:description] if task[:description] if task[:status] == 'running' body[:Link] << { :href => make_href("task/#{id}/action/cancel"), :type => 'application/vnd.vmware.vcloud.task+xml', :rel => 'cancel', } end body end