@@ -37,7 +37,7 @@ class AgentClient extends AbstractClient {
3737 * )
3838 */
3939 public function self () {
40- $ r = new Request ('GET ' , 'v1/agent/self ' , $ this ->c );
40+ $ r = new Request ('GET ' , 'v1/agent/self ' , $ this ->config );
4141
4242 /** @var \Psr\Http\Message\ResponseInterface $response */
4343 list ($ duration , $ response , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -62,7 +62,7 @@ public function self() {
6262 * @return \DCarbone\PHPConsulAPI\Error|null
6363 */
6464 public function reload () {
65- $ r = new Request ('PUT ' , 'v1/agent/reload ' , $ this ->c );
65+ $ r = new Request ('PUT ' , 'v1/agent/reload ' , $ this ->config );
6666
6767 return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
6868 }
@@ -95,7 +95,7 @@ public function nodeName() {
9595 * )
9696 */
9797 public function checks () {
98- $ r = new Request ('GET ' , 'v1/agent/checks ' , $ this ->c );
98+ $ r = new Request ('GET ' , 'v1/agent/checks ' , $ this ->config );
9999
100100 /** @var \Psr\Http\Message\ResponseInterface $response */
101101 list ($ _ , $ response , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -125,7 +125,7 @@ public function checks() {
125125 * )
126126 */
127127 public function services () {
128- $ r = new Request ('GET ' , 'v1/agent/services ' , $ this ->c );
128+ $ r = new Request ('GET ' , 'v1/agent/services ' , $ this ->config );
129129
130130 /** @var \Psr\Http\Message\ResponseInterface $response */
131131 list ($ _ , $ response , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -155,7 +155,7 @@ public function services() {
155155 * )
156156 */
157157 public function members () {
158- $ r = new Request ('GET ' , 'v1/agent/members ' , $ this ->c );
158+ $ r = new Request ('GET ' , 'v1/agent/members ' , $ this ->config );
159159
160160 /** @var \Psr\Http\Message\ResponseInterface $response */
161161 list ($ _ , $ response , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -185,7 +185,7 @@ public function members() {
185185 * @return \DCarbone\PHPConsulAPI\Error|null
186186 */
187187 public function serviceRegister (AgentServiceRegistration $ agentServiceRegistration ) {
188- $ r = new Request ('PUT ' , 'v1/agent/service/register ' , $ this ->c , $ agentServiceRegistration );
188+ $ r = new Request ('PUT ' , 'v1/agent/service/register ' , $ this ->config , $ agentServiceRegistration );
189189
190190 return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
191191 }
@@ -197,7 +197,7 @@ public function serviceRegister(AgentServiceRegistration $agentServiceRegistrati
197197 * @return \DCarbone\PHPConsulAPI\Error|null
198198 */
199199 public function serviceDeregister ($ serviceID ) {
200- $ r = new Request ('PUT ' , sprintf ('v1/agent/service/deregister/%s ' , $ serviceID ), $ this ->c );
200+ $ r = new Request ('PUT ' , sprintf ('v1/agent/service/deregister/%s ' , $ serviceID ), $ this ->config );
201201
202202 return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
203203 }
@@ -265,7 +265,7 @@ public function updateTTL($checkID, $output, $status) {
265265
266266 $ r = new Request ('PUT ' ,
267267 sprintf ('v1/agent/check/update/%s ' , $ checkID ),
268- $ this ->c ,
268+ $ this ->config ,
269269 new AgentCheckUpdate (['Output ' => $ output , 'Status ' => $ status ]));
270270
271271 return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
@@ -276,7 +276,7 @@ public function updateTTL($checkID, $output, $status) {
276276 * @return \DCarbone\PHPConsulAPI\Error|null
277277 */
278278 public function checkRegister (AgentCheckRegistration $ agentCheckRegistration ) {
279- $ r = new Request ('PUT ' , 'v1/agent/check/register ' , $ this ->c , $ agentCheckRegistration );
279+ $ r = new Request ('PUT ' , 'v1/agent/check/register ' , $ this ->config , $ agentCheckRegistration );
280280
281281 return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
282282 }
@@ -286,7 +286,7 @@ public function checkRegister(AgentCheckRegistration $agentCheckRegistration) {
286286 * @return \DCarbone\PHPConsulAPI\Error|null
287287 */
288288 public function checkDeregister ($ checkID ) {
289- $ r = new Request ('PUT ' , sprintf ('v1/agent/check/deregister/%s ' , $ checkID ), $ this ->c );
289+ $ r = new Request ('PUT ' , sprintf ('v1/agent/check/deregister/%s ' , $ checkID ), $ this ->config );
290290
291291 return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
292292 }
@@ -297,7 +297,7 @@ public function checkDeregister($checkID) {
297297 * @return \DCarbone\PHPConsulAPI\Error|null
298298 */
299299 public function join ($ addr , $ wan = false ) {
300- $ r = new Request ('PUT ' , sprintf ('v1/agent/join/%s ' , $ addr ), $ this ->c );
300+ $ r = new Request ('PUT ' , sprintf ('v1/agent/join/%s ' , $ addr ), $ this ->config );
301301 if ($ wan ) {
302302 $ r ->params ->set ('wan ' , '1 ' );
303303 }
@@ -312,7 +312,7 @@ public function join($addr, $wan = false) {
312312 * @return \DCarbone\PHPConsulAPI\Error|null
313313 */
314314 public function forceLeave ($ node ) {
315- $ r = new Request ('PUT ' , sprintf ('v1/agent/force-leave/%s ' , $ node ), $ this ->c );
315+ $ r = new Request ('PUT ' , sprintf ('v1/agent/force-leave/%s ' , $ node ), $ this ->config );
316316
317317 list ($ _ , $ _ , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
318318
@@ -325,7 +325,7 @@ public function forceLeave($node) {
325325 * @return \DCarbone\PHPConsulAPI\Error|null
326326 */
327327 public function enableServiceMaintenance ($ serviceID , $ reason = '' ) {
328- $ r = new Request ('PUT ' , sprintf ('v1/agent/service/maintenance/%s ' , $ serviceID ), $ this ->c );
328+ $ r = new Request ('PUT ' , sprintf ('v1/agent/service/maintenance/%s ' , $ serviceID ), $ this ->config );
329329 $ r ->params ->set ('enable ' , 'true ' );
330330 $ r ->params ->set ('reason ' , $ reason );
331331
@@ -339,7 +339,7 @@ public function enableServiceMaintenance($serviceID, $reason = '') {
339339 * @return \DCarbone\PHPConsulAPI\Error|null
340340 */
341341 public function disableServiceMaintenance ($ serviceID ) {
342- $ r = new Request ('PUT ' , sprintf ('v1/agent/service/maintenance/%s ' , $ serviceID ), $ this ->c );
342+ $ r = new Request ('PUT ' , sprintf ('v1/agent/service/maintenance/%s ' , $ serviceID ), $ this ->config );
343343 $ r ->params ->set ('enable ' , 'false ' );
344344
345345 list ($ _ , $ _ , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -352,7 +352,7 @@ public function disableServiceMaintenance($serviceID) {
352352 * @return \DCarbone\PHPConsulAPI\Error|null
353353 */
354354 public function enableNodeMaintenance ($ reason = '' ) {
355- $ r = new Request ('PUT ' , 'v1/agent/maintenance ' , $ this ->c );
355+ $ r = new Request ('PUT ' , 'v1/agent/maintenance ' , $ this ->config );
356356 $ r ->params ->set ('enable ' , 'true ' );
357357 $ r ->params ->set ('reason ' , $ reason );
358358
@@ -365,7 +365,7 @@ public function enableNodeMaintenance($reason = '') {
365365 * @return \DCarbone\PHPConsulAPI\Error|null
366366 */
367367 public function disableNodeMaintenance () {
368- $ r = new Request ('PUT ' , 'v1/agent/maintenance ' , $ this ->c );
368+ $ r = new Request ('PUT ' , 'v1/agent/maintenance ' , $ this ->config );
369369 $ r ->params ->set ('enable ' , 'false ' );
370370
371371 list ($ _ , $ _ , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -377,7 +377,7 @@ public function disableNodeMaintenance() {
377377 * @return \DCarbone\PHPConsulAPI\Error|null
378378 */
379379 public function leave () {
380- $ r = new Request ('PUT ' , 'v1/agent/leave ' , $ this ->c );
380+ $ r = new Request ('PUT ' , 'v1/agent/leave ' , $ this ->config );
381381
382382 list ($ _ , $ _ , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
383383
0 commit comments