Sha256: 3f0c34490424fe4d50c104128856fd05092e2ea207406a209eb0560c79bedc9b

Contents?: true

Size: 1.21 KB

Versions: 21

Compression:

Stored size: 1.21 KB

Contents

class Ey::Core::Client
  class Real
    def get_alerting_environments(params={})
      query = Ey::Core.paging_parameters(params)
      url   = params.delete("url")

      request(
        :params => params,
        :query  => query,
        :path   => "/environments/alerting",
        :url    => url,
      )
    end
  end # Real

  class Mock
    def get_alerting_environments(params={})
      extract_url_params!(params)

      resources = self.data[:legacy_alerts].map do |id, alert|
        server_id = resource_identity(alert["server"])
        self.data[:servers][server_id]
      end.compact.map do |server|
        environment_id = resource_identity(server["environment"])
        self.data[:environments][environment_id]
      end.compact.uniq.inject({}) {|hash, env| hash[env["id"]] = env; hash}

      if params.delete("exclude_ignored")
        resources.reject! { |id,hash| hash["permanently_ignored"] }
      end

      headers, environments_page = search_and_page(params, :environments, search_keys: %w[account project name assignee_id], resources: resources)

      response(
        :body    => {"environments" => environments_page},
        :status  => 200,
        :headers => headers
      )
    end
  end # Mock
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
ey-core-3.6.0.autoscaling1 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.6.4 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.6.3 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.6.1 lib/ey-core/requests/get_alerting_environments.rb
groove-ey-core-3.6.3 lib/ey-core/requests/get_alerting_environments.rb
groove-ey-core-3.6.2 lib/ey-core/requests/get_alerting_environments.rb
groove-ey-core-3.6.1 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.5.0 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.4.4 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.4.2 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.4.1 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.4.0 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.3.1 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.3.0 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.2.6 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.2.5 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.2.4 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.2.3 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.2.2 lib/ey-core/requests/get_alerting_environments.rb
ey-core-3.2.1 lib/ey-core/requests/get_alerting_environments.rb