Sha256: 22207ac4e78fa8d034e7e5c239f8f406f7c631e931a87a02029ca650cdbe6980

Contents?: true

Size: 858 Bytes

Versions: 6

Compression:

Stored size: 858 Bytes

Contents

require File.expand_path("../row", __FILE__)

module Fog
  module Compute
    class Ecloud
      class Rows < Fog::Ecloud::Collection
        identity :href

        model Fog::Compute::Ecloud::Row

        def all
          data = service.get_layout(href).body[:Rows][:Row]
          load(data)
        end

        def get(uri)
          data = service.get_row(uri).body
          if data == ""
            nil
          else
            new(data)
          end
        rescue Excon::Errors::NotFound
          nil
        end

        def create(options = {})
          options[:uri] = "#{service.base_path}/layoutRows/environments/#{environment_id}/action/createLayoutRow"
          data = service.rows_create(options).body
          new(data)
        end

        def environment_id
          href.scan(/\d+/)[0]
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-ecloud-0.1.1/lib/fog/compute/ecloud/models/rows.rb
fog-ecloud-0.2.0 lib/fog/compute/ecloud/models/rows.rb
fog-ecloud-0.1.3 lib/fog/compute/ecloud/models/rows.rb
fog-ecloud-0.1.2 lib/fog/compute/ecloud/models/rows.rb
fog-ecloud-0.1.1 lib/fog/compute/ecloud/models/rows.rb
fog-ecloud-0.1.0 lib/fog/compute/ecloud/models/rows.rb