mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-30 22:50:10 +03:00
parent
697464711b
commit
54e18f7120
@ -333,6 +333,10 @@ module Service
|
||||
end
|
||||
end
|
||||
|
||||
def set_content_type(content_type)
|
||||
@content_type = content_type
|
||||
end
|
||||
|
||||
def get(path)
|
||||
req = Net::HTTP::Proxy(@host, @port)::Get.new(path)
|
||||
|
||||
@ -349,6 +353,11 @@ module Service
|
||||
req = Net::HTTP::Proxy(@host, @port)::Post.new(path)
|
||||
req.body = body
|
||||
|
||||
if path.start_with?('/service_template')
|
||||
unless @content_type.nil?
|
||||
req.content_type = @content_type
|
||||
end
|
||||
end
|
||||
do_request(req)
|
||||
end
|
||||
|
||||
|
@ -127,7 +127,7 @@ end
|
||||
|
||||
post '/service_template/:id/action' do
|
||||
client = af_build_client
|
||||
|
||||
client.set_content_type(content_type)
|
||||
resp = client.post('/service_template/' + params[:id] + '/action', @request_body)
|
||||
|
||||
af_format_response(resp)
|
||||
@ -135,7 +135,7 @@ end
|
||||
|
||||
post '/service_template' do
|
||||
client = af_build_client
|
||||
|
||||
client.set_content_type(content_type)
|
||||
resp = client.post('/service_template', @request_body)
|
||||
|
||||
af_format_response(resp)
|
||||
|
Loading…
x
Reference in New Issue
Block a user