@@ -37,7 +37,7 @@ class AgentClient extends AbstractClient {
37
37
* )
38
38
*/
39
39
public function self () {
40
- $ r = new Request ('GET ' , 'v1/agent/self ' , $ this ->c );
40
+ $ r = new Request ('GET ' , 'v1/agent/self ' , $ this ->config );
41
41
42
42
/** @var \Psr\Http\Message\ResponseInterface $response */
43
43
list ($ duration , $ response , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -62,7 +62,7 @@ public function self() {
62
62
* @return \DCarbone\PHPConsulAPI\Error|null
63
63
*/
64
64
public function reload () {
65
- $ r = new Request ('PUT ' , 'v1/agent/reload ' , $ this ->c );
65
+ $ r = new Request ('PUT ' , 'v1/agent/reload ' , $ this ->config );
66
66
67
67
return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
68
68
}
@@ -95,7 +95,7 @@ public function nodeName() {
95
95
* )
96
96
*/
97
97
public function checks () {
98
- $ r = new Request ('GET ' , 'v1/agent/checks ' , $ this ->c );
98
+ $ r = new Request ('GET ' , 'v1/agent/checks ' , $ this ->config );
99
99
100
100
/** @var \Psr\Http\Message\ResponseInterface $response */
101
101
list ($ _ , $ response , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -125,7 +125,7 @@ public function checks() {
125
125
* )
126
126
*/
127
127
public function services () {
128
- $ r = new Request ('GET ' , 'v1/agent/services ' , $ this ->c );
128
+ $ r = new Request ('GET ' , 'v1/agent/services ' , $ this ->config );
129
129
130
130
/** @var \Psr\Http\Message\ResponseInterface $response */
131
131
list ($ _ , $ response , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -155,7 +155,7 @@ public function services() {
155
155
* )
156
156
*/
157
157
public function members () {
158
- $ r = new Request ('GET ' , 'v1/agent/members ' , $ this ->c );
158
+ $ r = new Request ('GET ' , 'v1/agent/members ' , $ this ->config );
159
159
160
160
/** @var \Psr\Http\Message\ResponseInterface $response */
161
161
list ($ _ , $ response , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -185,7 +185,7 @@ public function members() {
185
185
* @return \DCarbone\PHPConsulAPI\Error|null
186
186
*/
187
187
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 );
189
189
190
190
return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
191
191
}
@@ -197,7 +197,7 @@ public function serviceRegister(AgentServiceRegistration $agentServiceRegistrati
197
197
* @return \DCarbone\PHPConsulAPI\Error|null
198
198
*/
199
199
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 );
201
201
202
202
return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
203
203
}
@@ -265,7 +265,7 @@ public function updateTTL($checkID, $output, $status) {
265
265
266
266
$ r = new Request ('PUT ' ,
267
267
sprintf ('v1/agent/check/update/%s ' , $ checkID ),
268
- $ this ->c ,
268
+ $ this ->config ,
269
269
new AgentCheckUpdate (['Output ' => $ output , 'Status ' => $ status ]));
270
270
271
271
return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
@@ -276,7 +276,7 @@ public function updateTTL($checkID, $output, $status) {
276
276
* @return \DCarbone\PHPConsulAPI\Error|null
277
277
*/
278
278
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 );
280
280
281
281
return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
282
282
}
@@ -286,7 +286,7 @@ public function checkRegister(AgentCheckRegistration $agentCheckRegistration) {
286
286
* @return \DCarbone\PHPConsulAPI\Error|null
287
287
*/
288
288
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 );
290
290
291
291
return $ this ->requireOK ($ this ->doRequest ($ r ))[2 ];
292
292
}
@@ -297,7 +297,7 @@ public function checkDeregister($checkID) {
297
297
* @return \DCarbone\PHPConsulAPI\Error|null
298
298
*/
299
299
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 );
301
301
if ($ wan ) {
302
302
$ r ->params ->set ('wan ' , '1 ' );
303
303
}
@@ -312,7 +312,7 @@ public function join($addr, $wan = false) {
312
312
* @return \DCarbone\PHPConsulAPI\Error|null
313
313
*/
314
314
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 );
316
316
317
317
list ($ _ , $ _ , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
318
318
@@ -325,7 +325,7 @@ public function forceLeave($node) {
325
325
* @return \DCarbone\PHPConsulAPI\Error|null
326
326
*/
327
327
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 );
329
329
$ r ->params ->set ('enable ' , 'true ' );
330
330
$ r ->params ->set ('reason ' , $ reason );
331
331
@@ -339,7 +339,7 @@ public function enableServiceMaintenance($serviceID, $reason = '') {
339
339
* @return \DCarbone\PHPConsulAPI\Error|null
340
340
*/
341
341
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 );
343
343
$ r ->params ->set ('enable ' , 'false ' );
344
344
345
345
list ($ _ , $ _ , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -352,7 +352,7 @@ public function disableServiceMaintenance($serviceID) {
352
352
* @return \DCarbone\PHPConsulAPI\Error|null
353
353
*/
354
354
public function enableNodeMaintenance ($ reason = '' ) {
355
- $ r = new Request ('PUT ' , 'v1/agent/maintenance ' , $ this ->c );
355
+ $ r = new Request ('PUT ' , 'v1/agent/maintenance ' , $ this ->config );
356
356
$ r ->params ->set ('enable ' , 'true ' );
357
357
$ r ->params ->set ('reason ' , $ reason );
358
358
@@ -365,7 +365,7 @@ public function enableNodeMaintenance($reason = '') {
365
365
* @return \DCarbone\PHPConsulAPI\Error|null
366
366
*/
367
367
public function disableNodeMaintenance () {
368
- $ r = new Request ('PUT ' , 'v1/agent/maintenance ' , $ this ->c );
368
+ $ r = new Request ('PUT ' , 'v1/agent/maintenance ' , $ this ->config );
369
369
$ r ->params ->set ('enable ' , 'false ' );
370
370
371
371
list ($ _ , $ _ , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
@@ -377,7 +377,7 @@ public function disableNodeMaintenance() {
377
377
* @return \DCarbone\PHPConsulAPI\Error|null
378
378
*/
379
379
public function leave () {
380
- $ r = new Request ('PUT ' , 'v1/agent/leave ' , $ this ->c );
380
+ $ r = new Request ('PUT ' , 'v1/agent/leave ' , $ this ->config );
381
381
382
382
list ($ _ , $ _ , $ err ) = $ this ->requireOK ($ this ->doRequest ($ r ));
383
383
0 commit comments