Skip to content

Commit

Permalink
Merge 0129309 into 4d8d0b0
Browse files Browse the repository at this point in the history
  • Loading branch information
nosborn committed Dec 31, 2013
2 parents 4d8d0b0 + 0129309 commit bd28750
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
Expand Up @@ -12,6 +12,13 @@ class Real
# @param [String] source_id Object identifier of the vApp to capture.
# @param [Hash] options
# @option options [String] :Description Optional description.
# @option options [Hash] :LeaseSettingsSection
# * :StorageLeaseInSeconds<~Integer> - Storage lease in seconds.
# @option options [Hash] :CustomizationSection
# * :goldMaster<~Boolean> - True if this template is a gold master.
# * :CustomizeOnInstantiate<~Boolean> - True if instantiating this
# template applies customization settings. Otherwise, instantiation
# creates an identical copy.
# @return [Excon::Response]
# * body<~Hash>:
#
Expand All @@ -21,13 +28,30 @@ def post_capture_vapp(vdc_id, name, source_id, options={})
body = Nokogiri::XML::Builder.new do
attrs = {
:xmlns => 'http://www.vmware.com/vcloud/v1.5',
'xmlns:ovf' => 'http://schemas.dmtf.org/ovf/envelope/1',
:name => name
}
CaptureVAppParams(attrs) {
if options.key?(:Description)
Description options[:Description]
end
Source(:href => "#{end_point}vApp/#{source_id}")
if section = options[:LeaseSettingsSection]
LeaseSettingsSection {
self['ovf'].Info 'Lease settings section'
if section.key?(:StorageLeaseInSeconds)
StorageLeaseInSeconds section[:StorageLeaseInSeconds]
end
}
end
if section = options[:CustomizationSection]
attrs = {}
attrs[:goldMaster] = section[:goldMaster] if section.key?(:goldMaster)
CustomizationSection(attrs) {
self['ovf'].Info 'VApp template customization section'
CustomizeOnInstantiate section[:CustomizeOnInstantiate]
}
end
}
end.to_xml

Expand Down

0 comments on commit bd28750

Please sign in to comment.