@@ -24,7 +24,11 @@ public function all()
2424 {
2525 $ containers = [];
2626
27- foreach ($ this ->get ($ this ->getEndpoint ()) as $ container ) {
27+ $ config = [
28+ "project " =>$ this ->client ->getProject ()
29+ ];
30+
31+ foreach ($ this ->get ($ this ->getEndpoint (), $ config ) as $ container ) {
2832 $ containers [] = str_replace ('/ ' .$ this ->client ->getApiVersion ().$ this ->getEndpoint (), '' , $ container );
2933 }
3034
@@ -39,7 +43,11 @@ public function all()
3943 */
4044 public function info ($ name )
4145 {
42- return $ this ->get ($ this ->getEndpoint ().$ name );
46+ $ config = [
47+ "project " =>$ this ->client ->getProject ()
48+ ];
49+
50+ return $ this ->get ($ this ->getEndpoint ().$ name , $ config );
4351 }
4452
4553 /**
@@ -50,7 +58,11 @@ public function info($name)
5058 */
5159 public function state ($ name )
5260 {
53- return $ this ->get ($ this ->getEndpoint ().$ name .'/state ' );
61+ $ config = [
62+ "project " =>$ this ->client ->getProject ()
63+ ];
64+
65+ return $ this ->get ($ this ->getEndpoint ().$ name .'/state ' , $ config );
5466 }
5567
5668 /**
@@ -71,7 +83,11 @@ public function setState($name, $state, $timeout = 30, $force = true, $stateful
7183 $ opts ['force ' ] = $ force ;
7284 $ opts ['stateful ' ] = $ stateful ;
7385
74- $ response = $ this ->put ($ this ->getEndpoint ().$ name .'/state ' , $ opts );
86+ $ config = [
87+ "project " =>$ this ->client ->getProject ()
88+ ];
89+
90+ $ response = $ this ->put ($ this ->getEndpoint ().$ name .'/state ' , $ opts , $ config );
7591
7692 if ($ wait ) {
7793 $ response = $ this ->client ->operations ->wait ($ response ['id ' ]);
@@ -262,7 +278,11 @@ public function create($name, array $options, $wait = false)
262278 $ opts = $ this ->getLocalImageOptions ($ name , $ source , $ options );
263279 }
264280
265- $ response = $ this ->post ($ this ->getEndpoint (), $ opts );
281+ $ config = [
282+ "project " =>$ this ->client ->getProject ()
283+ ];
284+
285+ $ response = $ this ->post ($ this ->getEndpoint (), $ opts , $ config );
266286
267287 if ($ wait ) {
268288 $ response = $ this ->client ->operations ->wait ($ response ['id ' ]);
@@ -297,7 +317,11 @@ public function copy($name, $copyName, array $options = [], $wait = false)
297317 $ opts ['source ' ]['type ' ] = 'copy ' ;
298318 $ opts ['source ' ]['source ' ] = $ name ;
299319
300- $ response = $ this ->post ($ this ->getEndpoint (), $ opts );
320+ $ config = [
321+ "project " =>$ this ->client ->getProject ()
322+ ];
323+
324+ $ response = $ this ->post ($ this ->getEndpoint (), $ opts , $ config );
301325
302326 if ($ wait ) {
303327 $ response = $ this ->client ->operations ->wait ($ response ['id ' ]);
@@ -381,7 +405,11 @@ public function initMigration($name)
381405 */
382406 public function replace ($ name , $ container , $ wait = false )
383407 {
384- $ response = $ this ->put ($ this ->getEndpoint ().$ name , $ container );
408+ $ config = [
409+ "project " =>$ this ->client ->getProject ()
410+ ];
411+
412+ $ response = $ this ->put ($ this ->getEndpoint ().$ name , $ container , $ config );
385413
386414 if ($ wait ) {
387415 $ response = $ this ->client ->operations ->wait ($ response ['id ' ]);
@@ -413,7 +441,11 @@ public function replace($name, $container, $wait = false)
413441 */
414442 public function update ($ name , $ config , $ wait = false )
415443 {
416- $ response = $ this ->patch ($ this ->getEndpoint ().$ name , $ config );
444+ $ options = [
445+ "project " =>$ this ->client ->getProject ()
446+ ];
447+
448+ $ response = $ this ->patch ($ this ->getEndpoint ().$ name , $ config , $ options );
417449
418450 if ($ wait ) {
419451 $ response = $ this ->client ->operations ->wait ($ response ['id ' ]);
@@ -433,7 +465,12 @@ public function update($name, $config, $wait = false)
433465 public function rename ($ name , $ newName , $ wait = false )
434466 {
435467 $ opts ['name ' ] = $ newName ;
436- $ response = $ this ->post ($ this ->getEndpoint ().$ name , $ opts );
468+
469+ $ config = [
470+ "project " =>$ this ->client ->getProject ()
471+ ];
472+
473+ $ response = $ this ->post ($ this ->getEndpoint ().$ name , $ opts , $ config );
437474
438475 if ($ wait ) {
439476 $ response = $ this ->client ->operations ->wait ($ response ['id ' ]);
@@ -451,7 +488,11 @@ public function rename($name, $newName, $wait = false)
451488 */
452489 public function remove ($ name , $ wait = false )
453490 {
454- $ response = $ this ->delete ($ this ->getEndpoint ().$ name );
491+ $ config = [
492+ "project " =>$ this ->client ->getProject ()
493+ ];
494+
495+ $ response = $ this ->delete ($ this ->getEndpoint ().$ name , $ config );
455496
456497 if ($ wait ) {
457498 $ response = $ this ->client ->operations ->wait ($ response ['id ' ]);
@@ -489,11 +530,14 @@ public function execute($name, $command, $record = false, array $environment = [
489530 $ opts ['wait-for-websocket ' ] = false ;
490531 $ opts ['interactive ' ] = false ;
491532
492- $ response = $ this ->post ($ this ->getEndpoint ().$ name .'/exec ' , $ opts );
533+ $ config = [
534+ "project " =>$ this ->client ->getProject ()
535+ ];
536+
537+ $ response = $ this ->post ($ this ->getEndpoint ().$ name .'/exec ' , $ opts , $ config );
493538
494539 if ($ wait ) {
495540 $ response = $ this ->client ->operations ->wait ($ response ['id ' ]);
496-
497541 $ logs = [];
498542 $ output = $ response ['metadata ' ]['output ' ];
499543 $ return = $ response ['metadata ' ]['return ' ];
0 commit comments