Sha256: 46ba95af9257333e8a0fc8f8ce51c4689d8854bd243c7b4116d2706dc62ff960

Contents?: true

Size: 1.68 KB

Versions: 37

Compression:

Stored size: 1.68 KB

Contents

module Fog
  module Compute
    class HPV2
      class Real

        # List all servers (IDs and names only)
        #
        # ==== Parameters
        # * options<~Hash>: filter options
        #   * 'name'<~String> - Filters by the name of the server
        #   * 'image'<~String> - Filters by the UUId of the image
        #   * 'flavor'<~String> - Filters by the UUId of the flavor
        #   * 'status'<~String> - Filters by the status of the server
        #   * 'marker'<~String> - The ID of the last item in the previous list
        #   * 'limit'<~Integer> - Sets the page size
        #   * 'changes-since'<~DateTime> - Filters by the changes-since time. The list contains servers that have been deleted since the changes-since time.
        #
        # ==== Returns
        # * response<~Excon::Response>:
        #   * body<~Hash>:
        #   * 'servers'<~Array>:
        #     * 'id'<~Integer> - UUId of server
        #     * 'name'<~String> - Name of server
        #     * 'links'<~Array> - array of server links
        def list_servers(options = {})
          request(
            :expects  => [200, 203],
            :method   => 'GET',
            :path     => 'servers',
            :query    => options
          )
        end

      end

      class Mock

        def list_servers(options = {})
          response = Excon::Response.new
          data = list_servers_detail.body['servers']
          servers = []
          for server in data
            servers << server.reject { |key, value| !['id', 'name', 'links'].include?(key) }
          end
          response.status = 200
          response.body = { 'servers' => servers }
          response
        end

      end
    end
  end
end

Version data entries

37 entries across 37 versions & 2 rubygems

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