Sha256: d074aab6612d1ab570ded583855be2a300479344c99d0e65ae8f3bbd37a76799

Contents?: true

Size: 1.75 KB

Versions: 79

Compression:

Stored size: 1.75 KB

Contents

module Fog
  module Compute
    class HP
      class Real

        # List all security groups
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #   * 'security_groups'<~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 list_security_groups
          request(
            :expects  => [200],
            :method   => 'GET',
            :path     => 'os-security-groups.json'
          )
        end

      end

      class Mock

        def list_security_groups
          response = Excon::Response.new

          sec_groups = []
          sec_groups = self.data[:security_groups].values unless self.data[:security_groups].nil?

          response.status = 200
          response.body = { 'security_groups' => sec_groups }
          response
        end

      end
    end
  end
end

Version data entries

79 entries across 79 versions & 12 rubygems

Version Path
fog-1.22.0 lib/fog/hp/requests/compute/list_security_groups.rb
fog-1.21.0 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.20.0.20140305101839 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/hp/requests/compute/list_security_groups.rb
fog-1.20.0 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/hp/requests/compute/list_security_groups.rb
fog-1.19.0 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/hp/requests/compute/list_security_groups.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/hp/requests/compute/list_security_groups.rb