Sha256: df2631ce94745c5597cf0b54051a550f9f2b37a164dafa0aa2c1f543659637ee

Contents?: true

Size: 992 Bytes

Versions: 53

Compression:

Stored size: 992 Bytes

Contents

class Ey::Core::Client
  class Real
    def destroy_firewall_rule(params={})
      id  = params["id"]
      url = params.delete("url")

      request(
        :path   => "/firewall-rules/#{id}",
        :url    => url,
        :method => :delete,
      )
    end
  end

  class Mock
    def destroy_firewall_rule(params={})
      extract_url_params!(params)
      request_id = self.uuid

      firewall_rule_id = params["id"] || params["firewall_rule"]

      firewall_rule = self.find(:firewall_rules, firewall_rule_id)

      request = {
        "type"        => "deprovision_firewall_rule",
        "started_at"  => Time.now,
        "finished_at" => nil,
        "successful"  => "true",
        "id"          => request_id,
      }

      self.data[:requests][request_id] = request.merge(
        "resource" => [:firewall_rules, firewall_rule_id, firewall_rule.merge("deleted_at" => Time.now)],
      )

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

Version data entries

53 entries across 53 versions & 3 rubygems

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