Sha256: 843027bd915271bfc3d86a59ef8c528ff216b9f24e693dcb675249f22f91669d

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

module Fog
  module Compute
    class HuaweiCloud
      class Real
        def get_server_group(group_id)
          request(
            :expects => 200,
            :method  => 'GET',
            :path    => "/os-server-groups/#{group_id}"
          )
        end
      end

      class Mock
        def get_server_group(group_id)
          grp = data[:server_groups][group_id]
          response = Excon::Response.new
          response.status = 200
          response.headers = {
            "Content-Type"   => "text/html; charset=UTF-8",
            "Content-Length" => "0",
            "Date"           => Date.new
          }
          response.body = {'server_group' => {
            'id'         => group_id,
            'name'       => grp[:name],
            'policies'   => grp[:policies],
            'members'    => grp[:members],
            'metadata'   => {},
            'project_id' => 'test-project',
            'user_id'    => 'test-user'
          }}
          response
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fog-huaweicloud-0.0.3 lib/fog/compute/huaweicloud/requests/get_server_group.rb
fog-huaweicloud-0.0.2 lib/fog/compute/huaweicloud/requests/get_server_group.rb
fog-huaweicloud-0.1.3 lib/fog/compute/huaweicloud/requests/get_server_group.rb
fog-huaweicloud-0.1.2 lib/fog/compute/huaweicloud/requests/get_server_group.rb