Sha256: be0acf66469b8611fb1315fe89263584beef7048718a26d88b996b77d7236e31

Contents?: true

Size: 1.75 KB

Versions: 29

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

29 entries across 29 versions & 4 rubygems

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