Sha256: 0a874459d01371c0203bd7ca5d3c50acb9f0ec319407343e52210895141b08a2

Contents?: true

Size: 1.18 KB

Versions: 9

Compression:

Stored size: 1.18 KB

Contents

class Ey::Core::Client
  class Real
    def update_auto_scaling_group(params = {})
      id = params.delete("id")

      request(
        :method => :put,
        :path   => "/auto_scaling_groups/#{id}",
        :body   => { "auto_scaling_group" => params.fetch("auto_scaling_group") },
      )
    end
  end

  class Mock
    def update_auto_scaling_group(params = {})
      url = params.delete("url")

      resource_id = params.delete("id")
      resource = find(:auto_scaling_groups, resource_id).merge(params["auto_scaling_group"])

      now = Time.now

      request = {
        "id"           => self.uuid,
        "type"         => "update_auto_scaling_group",
        "successful"   => true,
        "created_at"   => now - 5,
        "updated_at"   => now,
        "started_at"   => now - 3,
        "finished_at"  => now,
        "message"      => nil,
        "read_channel" => nil,
        "resource"     => [:auto_scaling_groups, resource_id, resource],
        "resource_url" => url_for("/auto_scaling_groups/#{resource_id}")
      }

      self.data[:requests][request["id"]] = request

      response(
        :body   => {"request" => request},
        :status => 200
      )
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
ey-core-3.6.0.autoscaling1 lib/ey-core/requests/update_auto_scaling_group.rb
ey-core-3.6.4 lib/ey-core/requests/update_auto_scaling_group.rb
ey-core-3.6.3 lib/ey-core/requests/update_auto_scaling_group.rb
ey-core-3.6.1 lib/ey-core/requests/update_auto_scaling_group.rb
groove-ey-core-3.6.3 lib/ey-core/requests/update_auto_scaling_group.rb
groove-ey-core-3.6.2 lib/ey-core/requests/update_auto_scaling_group.rb
groove-ey-core-3.6.1 lib/ey-core/requests/update_auto_scaling_group.rb
ey-core-3.5.0 lib/ey-core/requests/update_auto_scaling_group.rb
ey-core-3.4.4 lib/ey-core/requests/update_auto_scaling_group.rb