Sha256: a7dc9d74784be897dfeaa21b76b48e803981c516a59d967b604a6dc61d933615

Contents?: true

Size: 1.61 KB

Versions: 35

Compression:

Stored size: 1.61 KB

Contents

module Fog
  module HP
    class Network

      class Real
        # List existing ports
        #
        # ==== Parameters
        # * options<~Hash>:
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #     * ports<~Array>:
        #       * 'id'<~String>: - UUId for the port
        #       * 'name'<~String>: - Name of the port
        #       * 'network_id'<~String>: - UUId of the network
        #       * 'tenant_id'<~String>: - TenantId that owns the port
        #       * 'status'<~String>: - Status of the port i.e. ACTIVE
        #       * 'admin_state_up'<~Boolean>: - true or false
        #       * 'binding:vif_type'<~String>: - "other"
        #       * 'device_owner'<~String>: - Device owner of the port i.e. "network:dhcp"
        #       * 'mac_address'<~String>: - MAC address of the port
        #       * 'fixed_ips'<~Array>:
        #         * 'subnet_id'<~String>: - UUId of the subnet
        #         * 'ip_address'<~String>: - IP address
        #       * 'security_groups'<~Array>: - Security Groups
        #       * 'device_id'<~String>: - Id of the device
        def list_ports(options = {})
          request(
            :expects => 200,
            :method  => 'GET',
            :path    => 'ports',
            :query   => options
          )
        end
      end

      class Mock
        def list_ports(options = {})
          response = Excon::Response.new

          ports = self.data[:ports].values
          response.status = 200
          response.body = { 'ports' => ports }
          response
        end
      end

    end
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
fog-maestrodev-1.20.0.20140305101839 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.20.0.20140305101305 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.19.0.20140212012611 lib/fog/hp/requests/network/list_ports.rb
fog-1.20.0 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.19.0.20140110004459 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.19.0.20140110003812 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.19.0.20140109202555 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.19.0.20140107192102 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.19.0.20140107142106 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.19.0.20131219203941 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.18.0.20131219193542 lib/fog/hp/requests/network/list_ports.rb
fog-1.19.0 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.18.0.20131219033443 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.18.0.20131219032002 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.18.0.20131219030716 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.18.0.20131219022322 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.18.0.20131218202447 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.18.0.20131209091424 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.18.0.20131209090811 lib/fog/hp/requests/network/list_ports.rb
fog-maestrodev-1.18.0.20131206115947 lib/fog/hp/requests/network/list_ports.rb