Sha256: b785d488a48a006d71940d71d88d044d42e4db6054079f256484481ff9e0106e
Contents?: true
Size: 1.22 KB
Versions: 28
Compression:
Stored size: 1.22 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.4/root_admin/registerTemplate.html] def register_template(*args) options = {} if args[0].is_a? Hash options = args[0] options.merge!('command' => 'registerTemplate') else options.merge!('command' => 'registerTemplate', 'zoneid' => args[0], 'format' => args[1], 'hypervisor' => args[2], 'url' => args[3], 'name' => args[4], 'ostypeid' => args[5], 'displaytext' => args[6]) end 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
28 entries across 26 versions & 4 rubygems