Sha256: 281564f844251ca645e14e2c886def2c7622c823b8b47bac0b61d02a27370ba1

Contents?: true

Size: 1.67 KB

Versions: 29

Compression:

Stored size: 1.67 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

29 entries across 29 versions & 4 rubygems

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