Sha256: 5103dba8f11d914654ba1a3f642052de82da4070d231c1fa431e5ee9654c580b

Contents?: true

Size: 1.7 KB

Versions: 41

Compression:

Stored size: 1.7 KB

Contents

module Fog
  module Compute
    class VcloudDirector
      class Real
        # Upload an OVF package to create a vApp template
        #
        # The response includes an upload link for the OVF descriptor.
        #
        # @param [String] vdc_id Object identifier of the vDC.
        # @param [String] name The name of the vApp template.
        # @param [Hash] options
        # @option options [Boolean] :manifestRequired True if an OVF manifest
        #   is included in the upload. Default value is false.
        # @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-UploadVAppTemplate.html
        # @since vCloud API version 0.9
        def post_upload_vapp_template(vdc_id, name, options={})
          body = Nokogiri::XML::Builder.new do
            attrs = {
              :xmlns => 'http://www.vmware.com/vcloud/v1.5',
              :name => name
            }
            attrs[:manifestRequired] = options[:manifestRequired] if options.key?(:manifestRequired)
            UploadVAppTemplateParams(attrs) {
              if options.key?(:Description)
                Description options[:Description]
              end
            }
          end.to_xml

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

Version data entries

41 entries across 41 versions & 3 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-1.22.1 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-1.22.0 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-1.21.0 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-1.20.0 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-1.19.0 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/vcloud_director/requests/compute/post_upload_vapp_template.rb