Sha256: 585fa859e6957ce108c72528403458edd9e92516194f792c55af29b17997c549

Contents?: true

Size: 1.34 KB

Versions: 66

Compression:

Stored size: 1.34 KB

Contents

module Fog
  module Compute
    class OpenStack
      class Real

        def get_security_group(security_group_id)
          request(
            :expects  => [200],
            :method   => 'GET',
            :path     => "os-security-groups/#{security_group_id}"
          )
        end

      end

      class Mock
        def get_security_group(security_group_id)
          response = Excon::Response.new
          response.status = 200
          response.headers = {
            "X-Compute-Request-Id" => "req-63a90344-7c4d-42e2-936c-fd748bced1b3",
            "Content-Type" => "application/json",
            "Content-Length" => "167",
            "Date" => Date.new
          }
          response.body = {
            "security_group" => {
              "rules" => [{
                "from_port" => 44,
                "group" => {},
                "ip_protocol" => "tcp",
                "to_port" => 55,
                "parent_group_id" => 1,
                "ip_range" => {
                  "cidr" => "10.10.10.10/24"
                }, "id"=>1
              }],
              "tenant_id" => "d5183375ab0343f3a0b4b05f547aefc2",
              "id"=>security_group_id,
              "name"=>"default",
              "description"=>"default"
            }
          }
          response
        end
      end # mock
    end # openstack
  end #compute
end #fog

Version data entries

66 entries across 66 versions & 13 rubygems

Version Path
cifrado-0.2.1 vendor/fog/lib/fog/openstack/requests/compute/get_security_group.rb
cifrado-0.2.0 vendor/fog/lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131205181604 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131127194823 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131126183714 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131126122111 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131125111730 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131125083406 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131123105121 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131122203507 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131121075022 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131118164830 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131115184302 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131114200144 lib/fog/openstack/requests/compute/get_security_group.rb
gapinc-fog-1.12.1.2.1 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131112185232 lib/fog/openstack/requests/compute/get_security_group.rb
fog-maestrodev-1.18.0.20131111203459 lib/fog/openstack/requests/compute/get_security_group.rb