File tree 1 file changed +7
-4
lines changed
lib/OpenCloud/LoadBalancer/Resource
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -255,17 +255,20 @@ public function addNodes()
255
255
);
256
256
}
257
257
258
- $ requests = array ();
258
+ $ requestData = array (' nodes ' => array () );
259
259
260
+ /** @var Node $node */
260
261
foreach ($ this ->nodes as $ node ) {
261
262
// Only add the node if it is new
262
263
if (null === $ node ->getId ()) {
263
- $ json = json_encode ( $ node ->createJson () );
264
- $ requests [] = $ this -> getClient ()-> post ( $ node -> getUrl (), self :: getJsonHeader (), $ json ) ;
264
+ $ nodeJson = $ node ->createJson ();
265
+ $ requestData [ ' nodes ' ][] = $ nodeJson [ ' nodes ' ][ 0 ] ;
265
266
}
266
267
}
267
268
268
- return $ this ->getClient ()->send ($ requests );
269
+ $ request = $ this ->getClient ()->post ($ node ->getUrl (), self ::getJsonHeader (), json_encode ($ requestData ));
270
+
271
+ return $ this ->getClient ()->send ($ request );
269
272
}
270
273
271
274
/**
You can’t perform that action at this time.
0 commit comments