Sha256: 53c0cef62634d79ef11ebbd34dc7eaf5afcfacdcbe8d11c66a8db9fa30441547

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

module Fog
  module Compute
    class Cloudstack

      class Real
        # Registers an existing template into the CloudStack cloud. 
        #
        # {CloudStack API Reference}[http://cloudstack.apache.org/docs/api/apidocs-4.3/root_admin/registerTemplate.html]
        def register_template(ostypeid, hypervisor, name, format, zoneid, displaytext, url, options={})
          options.merge!(
            'command' => 'registerTemplate', 
            'ostypeid' => ostypeid, 
            'hypervisor' => hypervisor, 
            'name' => name, 
            'format' => format, 
            'zoneid' => zoneid, 
            'displaytext' => displaytext, 
            'url' => url  
          )
          request(options)
        end
      end
 
      class Mock
        def register_template(options={})
          mock_template_id = self.data[:images].keys.first
          registered_template = self.data[:images][mock_template_id]

          {
              'registertemplateresponse' =>
              {
                  'count' => 1,
                  'template' => [registered_template]
              }
          }
        end
      end 
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-1.23.0 lib/fog/cloudstack/requests/compute/register_template.rb