2013-01-02 08:34:32 -06:00
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class RackspaceV2
|
|
|
|
class Real
|
2013-01-07 11:25:49 -06:00
|
|
|
def update_metadata(collection, obj_id, metadata = {})
|
2013-01-02 08:34:32 -06:00
|
|
|
request(
|
|
|
|
:expects => [200, 203],
|
|
|
|
:method => 'POST',
|
2013-01-07 11:25:49 -06:00
|
|
|
:path => "/#{collection}/#{obj_id}/metadata",
|
2013-01-02 08:34:32 -06:00
|
|
|
:body => Fog::JSON.encode('metadata' => metadata)
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Mock
|
2013-01-07 11:25:49 -06:00
|
|
|
def update_metadata(collection, obj_id, metadata = {})
|
|
|
|
raise Fog::Compute::RackspaceV2::NotFound if obj_id == 0
|
2013-01-02 08:34:32 -06:00
|
|
|
|
|
|
|
response = Excon::Response.new
|
|
|
|
response.status = 202
|
|
|
|
response.body = {"metadata" => {"environment" => "dev", "Tag" => "Database"}}
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|