Sha256: dd7b2b8c1e566c33c35cac06403c4383e94a494ad75ce859fdf7f156690c79bf

Contents?: true

Size: 1.63 KB

Versions: 39

Compression:

Stored size: 1.63 KB

Contents

module Fog
  module Compute
    class VcloudDirector
      class Real
        # Create a vApp template from a vApp.
        #
        # The response includes a Task element. You can monitor the task to to
        # track the creation of the vApp template.
        #
        # @param [String] vdc_id Object identifier of the vDC.
        # @param [String] name Name of the vApp template.
        # @param [String] source_id Object identifier of the vApp to capture.
        # @param [Hash] options
        # @option options [String] :Description Optional description.
        # @return [Excon::Response]
        #   * body<~Hash>:
        #
        # @see http://pubs.vmware.com/vcd-51/topic/com.vmware.vcloud.api.reference.doc_51/doc/operations/POST-CaptureVApp.html
        # @since vCloud API version 0.9
        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',
              :name => name
            }
            CaptureVAppParams(attrs) {
              if options.key?(:Description)
                Description options[:Description]
              end
              Source(:href => "#{end_point}vApp/#{source_id}")
            }
          end.to_xml

          request(
            :body    => body,
            :expects => 201,
            :headers => {'Content-Type' => 'application/vnd.vmware.vcloud.captureVAppParams+xml'},
            :method  => 'POST',
            :parser  => Fog::ToHashDocument.new,
            :path    => "vdc/#{vdc_id}/action/captureVApp"
          )
        end
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
fog-1.22.0 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-1.21.0 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-1.20.0 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-1.19.0 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/vcloud_director/requests/compute/post_capture_vapp.rb