Sha256: 8f3f306f309c64a7228ca304a44345a81d6ac322e916fe4d34f3de286d1167a4

Contents?: true

Size: 1.08 KB

Versions: 14

Compression:

Stored size: 1.08 KB

Contents

module Fog
  module Image
    class OpenStack
      class V2
        class Real
          def update_image_member(image_id, member)
            request( # 'status' is the only property we can update
              :body    => Fog::JSON.encode(member.select { |key, _value| key == 'status' }),
              :expects => [200],
              :method  => 'PUT',
              :path    => "images/#{image_id}/members/#{member['member_id']}"
            )
          end
        end # class Real

        class Mock
          def update_image_members(image_id, member)
            response = Excon::Response.new
            response.status = 204
            response.body = {
              :status     => "accepted",
              :created_at => "2013-11-26T07:21:21Z",
              :updated_at => "2013-11-26T07:21:21Z",
              :image_id   => image_id,
              :member_id  => member['member_id'],
              :schema     => "/v2/schemas/member"
            }
            response
          end
        end # class Mock
      end # class OpenStack
    end
  end # module Identity
end # module Fog

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fog-openstack-0.1.25 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.24 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.23 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.22 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.21 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.20 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.19 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.18 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.17 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.15 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.14 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.13 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.12 lib/fog/image/openstack/v2/requests/update_image_member.rb
fog-openstack-0.1.11 lib/fog/image/openstack/v2/requests/update_image_member.rb