Sha256: d8aabc2c0a18ef34465d649822bc07c3d883996e16345f9f9eeea4a96b8c4b32

Contents?: true

Size: 1.95 KB

Versions: 29

Compression:

Stored size: 1.95 KB

Contents

module Fog
  module Compute
    class HP
      class Real
        # Get details about a security group
        #
        # ==== Parameters
        # * 'security_group_id'<~Integer> - Id of security group to get details for
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #   * 'security_group'<~Array>:
        #     * 'rules'<~Array>: - array of security group rules
        #       * 'id'<~Integer> - id of the security group rule
        #       * 'from_port'<~Integer> - start port for rule i.e. 22 (or -1 for ICMP wildcard)
        #       * 'to_port'<~Integer> - end port for rule i.e. 22 (or -1 for ICMP wildcard)
        #       * 'ip_protocol'<~String> - ip protocol for rule, must be in ['tcp', 'udp', 'icmp']
        #       * 'group'<~Hash>:
        #          * Undefined
        #       * 'parent_group_id'<~Integer> - parent group id
        #       * 'ip_range'<~Hash>:
        #         * 'cidr'<~String> - ip range address i.e. '0.0.0.0/0'
        #     * 'id'<~Integer> - id of the security group
        #     * 'name'<~String> - name of the security group
        #     * 'description'<~String> - description of the security group
        #     * 'tenant_id'<~String> - tenant id of the user
        #
        # {Openstack API Reference}[http://docs.openstack.org]
        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
          if sec_group = self.data[:security_groups][security_group_id]
            response.status = 200
            response.body = { 'security_group' => sec_group }
            response
          else
            raise Fog::Compute::HP::NotFound
          end
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 4 rubygems

Version Path
fog-1.37.0 lib/fog/hp/requests/compute/get_security_group.rb
fog-1.36.0 lib/fog/hp/requests/compute/get_security_group.rb
fog-1.35.0 lib/fog/hp/requests/compute/get_security_group.rb
fog-2.0.0.pre.0 lib/fog/hp/requests/compute/get_security_group.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/hp/requests/compute/get_security_group.rb
fog-1.34.0 lib/fog/hp/requests/compute/get_security_group.rb
fog-1.33.0 lib/fog/hp/requests/compute/get_security_group.rb
fog-1.32.0 lib/fog/hp/requests/compute/get_security_group.rb
fog-1.31.0 lib/fog/hp/requests/compute/get_security_group.rb
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/hp/requests/compute/get_security_group.rb
fog-1.30.0 lib/fog/hp/requests/compute/get_security_group.rb
fog-1.29.0 lib/fog/hp/requests/compute/get_security_group.rb
fog-1.28.0 lib/fog/hp/requests/compute/get_security_group.rb
fog-1.27.0 lib/fog/hp/requests/compute/get_security_group.rb
fog-1.26.0 lib/fog/hp/requests/compute/get_security_group.rb
fog-1.25.0 lib/fog/hp/requests/compute/get_security_group.rb
nsidc-fog-1.24.1 lib/fog/hp/requests/compute/get_security_group.rb
fog-1.24.0 lib/fog/hp/requests/compute/get_security_group.rb
ns-fog-1.22.11 lib/fog/hp/requests/compute/get_security_group.rb
ns-fog-1.22.10 lib/fog/hp/requests/compute/get_security_group.rb