Sha256: e0a5495a1b2b66f99da4a42d935d6da8e6585be846a632c44e4bbc8ed5f22c07

Contents?: true

Size: 1.89 KB

Versions: 20

Compression:

Stored size: 1.89 KB

Contents

module Fog
  module OpenStack
    class Network
      class Real
        # Get details about a security group rule
        #
        # ==== Parameters
        # * 'security_group_rule_id'<~String> - UUID of the security group rule
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #   * 'security_group_rule'<~Hash>:
        #     * 'id'<~String> - UUID of the security group rule
        #     * 'direction'<~String> - Direction of traffic, must be in ['ingress', 'egress']
        #     * 'port_range_min'<~Integer> - Start port for rule i.e. 22 (or -1 for ICMP wildcard)
        #     * 'port_range_max'<~Integer> - End port for rule i.e. 22 (or -1 for ICMP wildcard)
        #     * 'protocol'<~String> - IP protocol for rule, must be in ['tcp', 'udp', 'icmp']
        #     * 'ethertype'<~String> - Type of ethernet support, must be in ['IPv4', 'IPv6']
        #     * 'security_group_id'<~String> - UUID of the parent security group
        #     * 'remote_group_id'<~String> - UUID of the remote security group
        #     * 'remote_ip_prefix'<~String> - IP cidr range address i.e. '0.0.0.0/0'
        #     * 'tenant_id'<~String> - Tenant id that owns the security group rule
        def get_security_group_rule(security_group_rule_id)
          request(
            :expects => 200,
            :method  => "GET",
            :path    => "security-group-rules/#{security_group_rule_id}"
          )
        end
      end

      class Mock
        def get_security_group_rule(security_group_rule_id)
          response = Excon::Response.new
          if sec_group_rule = data[:security_group_rules][security_group_rule_id]
            response.status = 200
            response.body   = {"security_group_rule" => sec_group_rule}
            response
          else
            raise Fog::OpenStack::Network::NotFound
          end
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
fog-openstack-1.1.3 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.1.2 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-fork-99 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.1.0 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.1.0.pre lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-apibank-1.0.102 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.11 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-apibank-1.0.101 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.10 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.9 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.8 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.7 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.6 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.5 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.4 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.3 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.2 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.1 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-1.0.0 lib/fog/openstack/network/requests/get_security_group_rule.rb
fog-openstack-0.3.1 lib/fog/openstack/network/requests/get_security_group_rule.rb