1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-30 22:50:10 +03:00

B #1560: Saving a relatively big Service Template (#1730)

This commit is contained in:
denys152 2018-03-01 04:22:10 -05:00 committed by Ruben S. Montero
parent 697464711b
commit 54e18f7120
2 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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)