@@ 31-40 (lines=10) @@ | ||
28 | * |
|
29 | * @return \Psr\Http\Message\ResponseInterface |
|
30 | */ |
|
31 | public function addApi(array $params) |
|
32 | { |
|
33 | $headers = [ |
|
34 | 'Content-Type' => 'application/json', |
|
35 | ]; |
|
36 | ||
37 | $body = json_encode($params); |
|
38 | ||
39 | return $this->post('/apis/', $headers, $body); |
|
40 | } |
|
41 | ||
42 | /** |
|
43 | * retrieve api |
|
@@ 72-81 (lines=10) @@ | ||
69 | * |
|
70 | * @return \Psr\Http\Message\ResponseInterface |
|
71 | */ |
|
72 | public function updateApi($nameOrId, array $params) |
|
73 | { |
|
74 | $headers = [ |
|
75 | 'Content-Type' => 'application/json', |
|
76 | ]; |
|
77 | ||
78 | $body = json_encode($params); |
|
79 | ||
80 | return $this->patch(sprintf('/apis/%1$s', $nameOrId), $headers, $body); |
|
81 | } |
|
82 | ||
83 | /** |
|
84 | * update or create api |
|
@@ 90-99 (lines=10) @@ | ||
87 | * |
|
88 | * @return \Psr\Http\Message\ResponseInterface |
|
89 | */ |
|
90 | public function updateOrCreateApi(array $params) |
|
91 | { |
|
92 | $headers = [ |
|
93 | 'Content-Type' => 'application/json', |
|
94 | ]; |
|
95 | ||
96 | $body = json_encode($params); |
|
97 | ||
98 | return $this->put('/apis/', $headers, $body); |
|
99 | } |
|
100 | ||
101 | /** |
|
102 | * delete api |
@@ 40-51 (lines=12) @@ | ||
37 | * |
|
38 | * @return \Psr\Http\Message\ResponseInterface |
|
39 | */ |
|
40 | public function forciblyRemoveANode($name) |
|
41 | { |
|
42 | $headers = [ |
|
43 | 'Content-Type' => 'application/json', |
|
44 | ]; |
|
45 | ||
46 | $body = json_encode([ |
|
47 | 'name' => $name, |
|
48 | ]); |
|
49 | ||
50 | return $this->delete('/cluster', $headers, $body); |
|
51 | } |
|
52 | } |
|
53 |