You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
integrationport=(`mysql -h $db --user=$user --password=$password --skip-column-names -U cloud -e "SELECT value FROM configuration WHERE name='integration.api.port'"`)
107
+
if [ $integrationport-le 0 ];then
108
+
echo"Integration port is not enabled!"
109
+
exit
110
+
fi
111
+
105
112
prepare_ids_clause() {
106
113
if [[ !-z"$vmidsclause" ]];then
107
114
return
@@ -243,7 +250,7 @@ stop_start_all() {
243
250
}
244
251
245
252
send_request(){
246
-
jobid=`curl -sS "http://$ms:8096/?command=$1&id=$2&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F: {'print $3'}`
253
+
jobid=`curl -sS "http://$ms:$integrationport/?command=$1&id=$2&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F: {'print $3'}`
247
254
if [ "$jobid"=="" ];then
248
255
echo 2
249
256
return
@@ -259,7 +266,7 @@ send_request(){
259
266
260
267
reboot_router(){
261
268
echo"[$(date "+%Y.%m.%d-%H.%M.%S")] INFO: Restarting router with id $1">>$LOGFILE
262
-
jobid=`curl -sS "http://$ms:8096/?command=rebootRouter&id=$1&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F: {'print $3'}`
269
+
jobid=`curl -sS "http://$ms:$integrationport/?command=rebootRouter&id=$1&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F: {'print $3'}`
263
270
if [ "$jobid"=="" ];then
264
271
echo"[$(date "+%Y.%m.%d-%H.%M.%S")] ERROR: Failed to restart domainRouter with id $1; unable to submit the job">>$LOGFILE
265
272
echo 2
@@ -343,7 +350,7 @@ restart_networks(){
343
350
}
344
351
345
352
restart_network(){
346
-
jobid=`curl -sS "http://$ms:8096/?command=restartNetwork&id=$1&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F: {'print $3'}`
353
+
jobid=`curl -sS "http://$ms:$integrationport/?command=restartNetwork&id=$1&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F: {'print $3'}`
347
354
if [ "$jobid"=="" ];then
348
355
echo"[$(date "+%Y.%m.%d-%H.%M.%S")] ERROR: Failed to restart network with id $1; unable to submit the job">>$LOGFILE
349
356
echo 2
@@ -364,7 +371,7 @@ restart_network(){
364
371
restart_vpc(){
365
372
echo -e "INFO: Restarting vpc with id $1"
366
373
echo"[$(date "+%Y.%m.%d-%H.%M.%S")] INFO: Restarting vpc with id $1">>$LOGFILE
367
-
jobid=`curl -sS "http://$ms:8096/?command=restartVPC&id=$1&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F: {'print $3'}`
374
+
jobid=`curl -sS "http://$ms:$integrationport/?command=restartVPC&id=$1&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F: {'print $3'}`
368
375
if [ "$jobid"=="" ];then
369
376
echo"[$(date "+%Y.%m.%d-%H.%M.%S")] ERROR: Failed to restart vpc with id $1; unable to submit the job">>$LOGFILE
370
377
echo 2
@@ -449,7 +456,7 @@ restart_vpcs(){
449
456
query_async_job_result() {
450
457
while [ 1 ]
451
458
do
452
-
jobstatus=`curl -sS "http://$ms:8096/?command=queryAsyncJobResult&jobId=$1&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F, {'print $4'} | awk -F: {'print $2'}`
459
+
jobstatus=`curl -sS "http://$ms:$integrationport/?command=queryAsyncJobResult&jobId=$1&response=json"| sed 's/\"//g'| sed 's/ //g'| sed 's/{//g'| sed 's/}//g'| awk -F, {'print $4'} | awk -F: {'print $2'}`
0 commit comments