| @@ 269-283 (lines=15) @@ | ||
| 266 | * |
|
| 267 | * @return \Psr\Http\Message\ResponseInterface |
|
| 268 | */ |
|
| 269 | public function resize($id, $parameters = [], $fetch = self::FETCH_OBJECT) |
|
| 270 | { |
|
| 271 | $queryParam = new QueryParam(); |
|
| 272 | $queryParam->setDefault('h', null); |
|
| 273 | $queryParam->setDefault('w', null); |
|
| 274 | $url = '/containers/{id}/resize'; |
|
| 275 | $url = str_replace('{id}', $id, $url); |
|
| 276 | $url = $url . ('?' . $queryParam->buildQueryString($parameters)); |
|
| 277 | $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); |
|
| 278 | $body = $queryParam->buildFormDataString($parameters); |
|
| 279 | $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); |
|
| 280 | $response = $this->httpClient->sendRequest($request); |
|
| 281 | ||
| 282 | return $response; |
|
| 283 | } |
|
| 284 | ||
| 285 | /** |
|
| 286 | * Start the container id. |
|
| @@ 529-543 (lines=15) @@ | ||
| 526 | * |
|
| 527 | * @return \Psr\Http\Message\ResponseInterface |
|
| 528 | */ |
|
| 529 | public function remove($id, $parameters = [], $fetch = self::FETCH_OBJECT) |
|
| 530 | { |
|
| 531 | $queryParam = new QueryParam(); |
|
| 532 | $queryParam->setDefault('v', null); |
|
| 533 | $queryParam->setDefault('force', null); |
|
| 534 | $url = '/containers/{id}'; |
|
| 535 | $url = str_replace('{id}', $id, $url); |
|
| 536 | $url = $url . ('?' . $queryParam->buildQueryString($parameters)); |
|
| 537 | $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); |
|
| 538 | $body = $queryParam->buildFormDataString($parameters); |
|
| 539 | $request = $this->messageFactory->createRequest('DELETE', $url, $headers, $body); |
|
| 540 | $response = $this->httpClient->sendRequest($request); |
|
| 541 | ||
| 542 | return $response; |
|
| 543 | } |
|
| 544 | ||
| 545 | /** |
|
| 546 | * Get an tar archive of a resource in the filesystem of container id. |
|
| @@ 201-216 (lines=16) @@ | ||
| 198 | * |
|
| 199 | * @return \Psr\Http\Message\ResponseInterface |
|
| 200 | */ |
|
| 201 | public function push($name, $parameters = [], $fetch = self::FETCH_OBJECT) |
|
| 202 | { |
|
| 203 | $queryParam = new QueryParam(); |
|
| 204 | $queryParam->setDefault('tag', null); |
|
| 205 | $queryParam->setRequired('X-Registry-Auth'); |
|
| 206 | $queryParam->setHeaderParameters(['X-Registry-Auth']); |
|
| 207 | $url = '/images/{name}/push'; |
|
| 208 | $url = str_replace('{name}', $name, $url); |
|
| 209 | $url = $url . ('?' . $queryParam->buildQueryString($parameters)); |
|
| 210 | $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters)); |
|
| 211 | $body = $queryParam->buildFormDataString($parameters); |
|
| 212 | $request = $this->messageFactory->createRequest('POST', $url, $headers, $body); |
|
| 213 | $response = $this->httpClient->sendRequest($request); |
|
| 214 | ||
| 215 | return $response; |
|
| 216 | } |
|
| 217 | ||
| 218 | /** |
|
| 219 | * Tag the image name into a repository. |
|