Sha256: 8aa32666561ca501e5a4b2839d9c408414ffdcc53a866b2a2a24f0474e33e0d4

Contents?: true

Size: 1.2 KB

Versions: 4

Compression:

Stored size: 1.2 KB

Contents

module Fog
  module Compute
    class Gridscale
      class Real

        def marketplace_template_create(options={})
          create_options = {
          }

          create_options[:labels] = options[:labels] || []

          if options[:name]
            create_options[:name] = options[:name]
          end

          if options[:capacity]
            create_options[:capacity] = options[:capacity]
          end

          if options[:object_storage_path]
            create_options[:object_storage_path] = options[:object_storage_path]
          end

          if options[:object_storage_path]
            create_options[:object_storage_path] = options[:object_storage_path]
          end

          if options[:unique_hash]
            create_options[:unique_hash] = options[:unique_hash]
          end
          encoded_body = Fog::JSON.encode(create_options)

          request(
              :expects => [202],
              :headers => {
                  'Content-Type' => "application/json; charset=UTF-8",
              },
              :method  => 'POST',
              :path    => '/objects/marketplace/templates',
              :body    => encoded_body,
              )
        end

      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-gridscale-0.1.5 lib/fog/compute/gridscale/requests/marketplace_template_create.rb
fog-gridscale-0.1.4 lib/fog/compute/gridscale/requests/marketplace_template_create.rb
fog-gridscale-0.1.3 lib/fog/compute/gridscale/requests/marketplace_template_create.rb
fog-gridscale-0.1.2 lib/fog/compute/gridscale/requests/marketplace_template_create.rb