def put(request)
org = FFI_Yajl::Parser.parse(get_data(request, request.rest_path + [ 'org' ]), :create_additions => false)
new_org = FFI_Yajl::Parser.parse(request.body, :create_additions => false)
new_org.each do |key, value|
org[key] = value
end
save_org = FFI_Yajl::Encoder.encode(org, :pretty => true)
if new_org['name'] != request.rest_path[-1]
return error(400, "Cannot rename org #{request.rest_path[-1]} to #{new_org['name']}: rename not supported for orgs")
end
set_data(request, request.rest_path + [ 'org' ], save_org)
json_response(200, {
"uri" => "#{build_uri(request.base_uri, request.rest_path)}",
"name" => org['name'],
"org_type" => org['org_type'],
"full_name" => org['full_name']
})
end