1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #5313 onegate server to send post to oneflow for scaling

Signed-off-by: Rafael Campuzano <rcampuz.telecom@gmail.com>
(cherry picked from commit c4bb5edf691e4b0d6114f1c5db51cfbae7391779)
This commit is contained in:
Rafael Campuzano 2021-03-28 12:29:19 +03:00 committed by Ruben S. Montero
parent 7b8857f219
commit 3269e2c69e
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -981,9 +981,16 @@ put '/service/role/:role' do
check_vm_in_service(source_vm['ID'], service_id, client)
action_response = flow_client(client).put(
"/service/" + service_id + "/role/" + params[:role],
request.body.read)
cardinality = JSON.parse(request.body.read)["cardinality"]
body_json = {
:cardinality => cardinality,
:role_name => params[:role],
:force => false
}.to_json
action_response = flow_client(client).post(
"/service/" + service_id + "/scale",
body_json)
if CloudClient::is_error?(action_response)
error_msg = "Error performing action on service #{service_id} role #{params[:role]}"